diff --git a/cypress.config.js b/cypress.config.js index 9ff4c4b2bf..11859bb4df 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -7,6 +7,10 @@ const fs = require('fs'); const allureWriter = require('@shelex/cypress-allure-plugin/writer'); module.exports = defineConfig({ + retries: { + runMode: 0, + openMode: 0, + }, viewportWidth: 1920, viewportHeight: 1080, video: false, diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js index b074814e39..7955114d79 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js @@ -8,13 +8,11 @@ import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-s import Users from '../../../support/fragments/users/users'; import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; import DateTools from '../../../support/utils/dateTools'; -import BulkEditFiles from '../../../support/fragments/bulk-edit/bulk-edit-files'; let user; const userBarcodesFileName = `userBarcodes_${getRandomPostfix()}.csv`; const matchedRecordsFileName = `*Matched-Records-${userBarcodesFileName}`; const editedFileName = `edited-records-${getRandomPostfix()}.csv`; -const errorsInChangedRecordsFileName = `*-Errors-${editedFileName}`; describe('bulk-edit', () => { describe('csv approach', () => { @@ -37,10 +35,10 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); FileManager.deleteFile(`cypress/fixtures/${editedFileName}`); - FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName, errorsInChangedRecordsFileName); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); }); - it('C388498 Negative: Verify CSV updating records with invalid date (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { + it('C388498 Negative: Verify Local updating records with invalid date (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); BulkEditSearchPane.uploadFile(userBarcodesFileName); @@ -60,8 +58,6 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyErrorLabelAfterChanges(editedFileName, 0, 1); BulkEditSearchPane.verifyReasonForError('Field "createdDate"'); BulkEditActions.openActions(); - BulkEditActions.downloadErrors(); - BulkEditFiles.verifyMatchedResultFileContent(errorsInChangedRecordsFileName, [user.barcode], 'firstElement', false); }); }); }); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js index 34ee144f98..32e8d8bbf9 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js @@ -31,7 +31,7 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - it('C350928 Verify error accordion during matching (CSV approach) (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C350928 Verify error accordion during matching (Local approach) (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js index 21e3331fe5..3af3a48100 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js @@ -39,7 +39,7 @@ describe('bulk-edit', () => { cy.visit(TopMenu.bulkEditPath); }); - it('C356817 Verify Matched records label cleanup -- CSV approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C356817 Verify Matched records label cleanup -- Local approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js new file mode 100644 index 0000000000..66b4dcc0e1 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js @@ -0,0 +1,98 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import TopMenu from '../../../support/fragments/topMenu'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import Users from '../../../support/fragments/users/users'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; +import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; + +let user; +const holdingHRIDsFileName = `holdingHRIDs_${getRandomPostfix()}.csv`; +const barcode = getRandomPostfix(); +const inventoryEntity = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + barcode, + secondBarcode: `secondBarcode_${barcode}`, +}; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + + inventoryEntity.instanceId = InventoryInstances.createInstanceViaApi(inventoryEntity.instanceName, inventoryEntity.barcode); + cy.getHoldings({ query: `"instanceId"="${inventoryEntity.instanceId}"` }).then(holdings => { + inventoryEntity.holdingHRID = holdings[0].hrid; + FileManager.createFile(`cypress/fixtures/${holdingHRIDsFileName}`, inventoryEntity.holdingHRID); + }); + + cy.getItems({ query: `"barcode"=="${inventoryEntity.barcode}"` }).then(inventoryItem => { + inventoryItem.discoverySuppress = true; + ItemActions.editItemViaApi(inventoryItem); + }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(inventoryEntity.barcode); + FileManager.deleteFile(`cypress/fixtures/${holdingHRIDsFileName}`); + }); + + it('C399061 Verify "Suppress from discovery" (Set false) option in Bulk Editing Holdings (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings HRIDs'); + BulkEditSearchPane.uploadFile(holdingHRIDsFileName); + BulkEditSearchPane.waitFileUploading(); + + const suppressFromDiscovery = false; + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', inventoryEntity.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.checkMarkAsSuppressedFromDiscoveryAbsent(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', inventoryEntity.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsPresent(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', inventoryEntity.secondBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsAbsent(); + }); + }); +}); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-true.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-true.cy.js new file mode 100644 index 0000000000..1641985556 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-true.cy.js @@ -0,0 +1,82 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import TopMenu from '../../../support/fragments/topMenu'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import Users from '../../../support/fragments/users/users'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; + +let user; +const holdingUUIDsFileName = `holdingUUIDs_${getRandomPostfix()}.csv`; +const item = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + + const instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getHoldings({ query: `"instanceId"="${instanceId}"` }).then(holdings => { + FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, holdings[0].id); + }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); + }); + + it('C398010 Verify "Suppress from discovery" (Set true) option in Bulk Editing Holdings (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); + BulkEditSearchPane.uploadFile(holdingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + + const suppressFromDiscovery = true; + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.checkMarkAsSuppressedFromDiscovery(); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsPresent(); + }); + }); +}); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js index 32df25059a..21dd728ea6 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js @@ -58,7 +58,7 @@ describe('bulk-edit', () => { BulkEditActions.downloadMatchedResults(); BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.editSuppressFromDiscovery('Set true'); + BulkEditActions.editItemsSuppressFromDiscovery(true); BulkEditActions.confirmChanges(); BulkEditActions.downloadPreview(); BulkEditActions.commitChanges(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js index 53bac517ca..1bb662eb6b 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js @@ -21,7 +21,7 @@ describe('bulk-edit', () => { permissions.bulkEditUpdateRecords.gui, permissions.uiUsersView.gui, permissions.uiUserEdit.gui, - ]) + ], 'staff') .then(userProperties => { user = userProperties; FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-true-items-not.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-true-items-not.cy.js new file mode 100644 index 0000000000..b567b15e23 --- /dev/null +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-true-items-not.cy.js @@ -0,0 +1,126 @@ +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; +import permissions from '../../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files'; +import TopMenu from '../../../../support/fragments/topMenu'; +import FileManager from '../../../../support/utils/fileManager'; +import getRandomPostfix from '../../../../support/utils/stringTools'; +import Users from '../../../../support/fragments/users/users'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; +import HoldingsRecordView from '../../../../support/fragments/inventory/holdingsRecordView'; +import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../../support/fragments/inventory/item/itemRecordView'; +import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; +import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation'; + +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + +let user; +const instanceHRIDFileName = `instanceHRID_${getRandomPostfix()}.csv`; +const item = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; +const matchedRecordsFileName = `Matched-Records-${instanceHRIDFileName}`; +const previewOfProposedChangesFileName = `*-Updates-Preview-${instanceHRIDFileName}`; +const updatedRecordsFileName = `*-Changed-Records*-${instanceHRIDFileName}`; + +describe('Bulk Edit - Logs', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.bulkEditLogsView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getHoldings({ limit: 1, expandAll: true, query: `"instanceId"="${item.instanceId}"` }).then(holdings => { + item.holdingsHRID = holdings[0].hrid; + cy.updateHoldingRecord(holdings[0].id, { + ...holdings[0], + discoverySuppress: true, + permanentLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87', + temporaryLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87' + }); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"id"=="${item.instanceId}"` }) + .then(instance => { + item.instanceHRID = instance.hrid; + FileManager.createFile(`cypress/fixtures/${instanceHRIDFileName}`, item.instanceHRID); + }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${instanceHRIDFileName}`); + FileManager.deleteFileFromDownloadsByMask(instanceHRIDFileName, `*${matchedRecordsFileName}`, previewOfProposedChangesFileName, updatedRecordsFileName); + }); + + it('C402321 Verify "Suppress from discovery" option is set True in when Holdings are suppressed and associated Items are not (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Instance HRIDs'); + BulkEditSearchPane.uploadFile(instanceHRIDFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(item.holdingsHRID); + + const suppressFromDiscovery = true; + const newLocation = 'Main Library'; + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.replacePermanentLocation(newLocation, 'holdings', 1); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.replaceTemporaryLocation(newLocation, 'holdings', 2); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + + BulkEditSearchPane.openLogsSearch(); + BulkEditSearchPane.checkHoldingsCheckbox(); + BulkEditSearchPane.clickActionsRunBy(user.username); + + BulkEditSearchPane.downloadFileUsedToTrigger(); + BulkEditFiles.verifyCSVFileRows(instanceHRIDFileName, [item.instanceHRID]); + + BulkEditSearchPane.downloadFileWithMatchingRecords(); + BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileName}`, [item.instanceHRID], 'instanceHrid', true); + + BulkEditSearchPane.downloadFileWithProposedChanges(); + BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName, [item.instanceHRID], 'instanceHrid', true); + + BulkEditSearchPane.downloadFileWithUpdatedRecords(); + BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, [item.instanceHRID], 'instanceHrid', true); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.selectViewHoldings(); + InventoryInstance.verifyHoldingsPermanentLocation(newLocation); + InventoryInstance.verifyHoldingsTemporaryLocation(newLocation); + HoldingsRecordView.checkMarkAsSuppressedFromDiscovery(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsPresent(); + }); +}); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js index 79d40d7f05..b71466c45d 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js @@ -62,15 +62,10 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.uploadFile(validItemBarcodesFileName); BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditActions.clickSuppressedFromDiscoveryCheckbox(); - BulkEditSearchPane.verifyResultColumTitles('Suppressed from discovery'); - BulkEditSearchPane.verifyResultColumnValue('true'); - BulkEditActions.openActions(); BulkEditActions.downloadMatchedResults(); BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.editSuppressFromDiscovery('Set false'); + BulkEditActions.editItemsSuppressFromDiscovery(false); BulkEditActions.addNewBulkEditFilterString(); BulkEditActions.fillPermanentLoanType('Selected', 1); BulkEditActions.confirmChanges(); @@ -78,6 +73,8 @@ describe('Bulk Edit - Logs', () => { BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', false); BulkEditActions.downloadChangedCSV(); BulkEditSearchPane.openLogsSearch(); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js index d8c9029afb..5f1b590cfd 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js @@ -47,7 +47,7 @@ describe('Permissions Bulk Edit', () => { FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); }); - it('C353969 Export manager -- Verify that user can view data in Export Manager based on permissions (CSV approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C353969 Export manager -- Verify that user can view data in Export Manager based on permissions (Local approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { ExportManagerSearchPane.waitLoading(); ExportManagerSearchPane.searchByBulkEdit(); ExportManagerSearchPane.selectJob(user.username); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js index 26f5a34f4b..4456bc85c1 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js @@ -37,7 +37,7 @@ describe('bulk-edit', () => { }); // TODO: think about dragging file without dropping - it('C353537 Verify label to the Drag and drop area -- CSV approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C353537 Verify label to the Drag and drop area -- Local approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { cy.login(userWithCsvPermissions.username, userWithCsvPermissions.password); cy.visit(TopMenu.bulkEditPath); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js index da38c16c59..8257bd39a7 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js @@ -10,6 +10,9 @@ import FileManager from '../../../support/utils/fileManager'; import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; import UserEdit from '../../../support/fragments/users/userEdit'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + let user; const userUUIDsFileName = `userUUIDs_${getRandomPostfix()}.csv`; diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js index 3118cf12a8..561f00b6a8 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js @@ -7,6 +7,9 @@ import UsersCard from '../../../support/fragments/users/usersCard'; import devTeams from '../../../support/dictionary/devTeams'; import users from '../../../support/fragments/users/users'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + let userWthViewEditPermissions; describe('bulk-edit', () => { diff --git a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js index 86b5e6ad2b..0c7526ccdc 100644 --- a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js @@ -256,72 +256,72 @@ describe('ui-data-import', () => { }); FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); FileDetails.checkInstanceQuantityInSummaryTable('1', 0); - - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - DataImport.editMarcFile(fileForEditRev1, editedFileNameRev1, [instanceHridFromFile], [instanceHrid]); - DataImport.editMarcFile(fileForEditRev2, editedFileNameRev2, [instanceHridFromFile], [instanceHrid]); - - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedFileNameRev1, fileNameForProtect); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForProtect); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForProtect); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); - FileDetails.checkInstanceQuantityInSummaryTable('1', 1); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyAdministrativeNote(administrativeNote); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 2); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 1); - InstanceRecordView.verifyInstanceNote(instanceNote); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - resourceIdentifiers.forEach(element => { - InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.firstField, element.value); - }); - InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, instanceNote); - - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedFileNameRev2, fileNameForOverride); - JobProfiles.searchJobProfileForImport(jobProfileForOverride.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForOverride); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForOverride); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); - FileDetails.checkInstanceQuantityInSummaryTable('1', 1); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyAdministrativeNote(administrativeNote); - InstanceRecordView.verifyAdministrativeNote(updatedAdministativeNote); - resourceIdentifiers.forEach(element => { - InventoryInstance.verifyResourceIdentifierAbsent(element.value); - }); - InstanceRecordView.verifyInstanceNote(updatedInstanceNote); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - InventoryViewSource.notContains(`${protectedFields.firstField}\t`); - InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, updatedInstanceNote); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + DataImport.editMarcFile(fileForEditRev1, editedFileNameRev1, [instanceHridFromFile], [instanceHrid]); + DataImport.editMarcFile(fileForEditRev2, editedFileNameRev2, [instanceHridFromFile], [instanceHrid]); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedFileNameRev1, fileNameForProtect); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForProtect); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForProtect); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); + FileDetails.checkInstanceQuantityInSummaryTable('1', 1); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyAdministrativeNote(administrativeNote); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 2); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 1); + InstanceRecordView.verifyInstanceNote(instanceNote); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + resourceIdentifiers.forEach(element => { + InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.firstField, element.value); + }); + InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, instanceNote); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedFileNameRev2, fileNameForOverride); + JobProfiles.searchJobProfileForImport(jobProfileForOverride.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForOverride); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForOverride); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); + FileDetails.checkInstanceQuantityInSummaryTable('1', 1); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyAdministrativeNote(administrativeNote); + InstanceRecordView.verifyAdministrativeNote(updatedAdministativeNote); + resourceIdentifiers.forEach(element => { + InventoryInstance.verifyResourceIdentifierAbsent(element.value); + }); + InstanceRecordView.verifyInstanceNote(updatedInstanceNote); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + InventoryViewSource.notContains(`${protectedFields.firstField}\t`); + InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, updatedInstanceNote); + }); }); }); diff --git a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js index ff84ef8ef3..bbe2e104e8 100644 --- a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js @@ -17,7 +17,6 @@ import Logs from '../../../support/fragments/data_import/logs/logs'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import MarcFieldProtection from '../../../support/fragments/settings/dataImport/marcFieldProtection'; -import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; @@ -167,24 +166,23 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); Logs.clickOnHotLink(0, 3, 'Created'); - InstanceRecordView.viewSource(); - InstanceRecordView.verifySrsMarcRecord(); - InventoryViewSource.verifyFieldInMARCBibSource('500', dataForField500); - InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[0], dataForField507); - InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[1], dataForField920); - - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - // change file using order number - DataImport.editMarcFile( - 'marcFileForC17017.mrc', - editedMarcFileName, - [dataFromField001, dataForField500, dataForField507, dataForField920], - [instanceHrid, updateDataForField500, updateDataForField507, updateDataForField920] - ); - }); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + InstanceRecordView.viewSource(); + InstanceRecordView.verifySrsMarcRecord(); + InventoryViewSource.verifyFieldInMARCBibSource('500', dataForField500); + InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[0], dataForField507); + InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[1], dataForField920); + + + // change file using order number + DataImport.editMarcFile( + 'marcFileForC17017.mrc', + editedMarcFileName, + [dataFromField001, dataForField500, dataForField507, dataForField920], + [instanceHrid, updateDataForField500, updateDataForField507, updateDataForField920] + ); + }); // create mapping profile for update cy.visit(SettingsMenu.mappingProfilePath); diff --git a/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js b/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js index af3b47aa0d..c77b831aa1 100644 --- a/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js +++ b/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js @@ -11,7 +11,6 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import DevTeams from '../../../support/dictionary/devTeams'; import Logs from '../../../support/fragments/data_import/logs/logs'; import TestTypes from '../../../support/dictionary/testTypes'; -import Helper from '../../../support/fragments/finance/financeHelper'; import { JOB_STATUS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { @@ -39,7 +38,7 @@ describe('ui-data-import', () => { }); // Log list should contain at least 30-35 import jobs, run by different users, and using different import profiles for (let i = 0; i < 25; i++) { - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); } diff --git a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js index bfd4a468a3..eabbc625dc 100644 --- a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js @@ -105,7 +105,7 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(profile); NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); - NewFieldMappingProfile.addElectronicAccess('Resource', '856$u', '856$z'); + NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u', '856$z'); FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); }; diff --git a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js index c8dd6c360f..a56bc2d8ec 100644 --- a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js @@ -1,3 +1,5 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import TopMenu from '../../../support/fragments/topMenu'; @@ -6,7 +8,6 @@ import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -import getRandomPostfix from '../../../support/utils/stringTools'; import DataImport from '../../../support/fragments/data_import/dataImport'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../../support/fragments/data_import/logs/logs'; @@ -19,7 +20,6 @@ import ActionProfiles from '../../../support/fragments/data_import/action_profil import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; -import permissions from '../../../support/dictionary/permissions'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; diff --git a/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js b/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js index e3de64c647..dd26d636b4 100644 --- a/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js @@ -21,7 +21,6 @@ import NewFieldMappingProfile from '../../../support/fragments/data_import/mappi import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; @@ -51,31 +50,31 @@ describe('ui-data-import', () => { const collectionOfProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350944 Update Instance by POL match ${Helper.getRandomBarcode()}` }, + name: `C350944 Update Instance by POL match ${getRandomPostfix()}` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350944 Update Instance by POL match ${Helper.getRandomBarcode()}`, + name: `C350944 Update Instance by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350944 Create Holdings by POL match ${Helper.getRandomBarcode()}`, + name: `C350944 Create Holdings by POL match ${getRandomPostfix()}`, callNumberType: `"${CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350944 Create Holdings by POL match ${Helper.getRandomBarcode()}` } + name: `C350944 Create Holdings by POL match ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350944 Create Item by POL match ${Helper.getRandomBarcode()}`, + name: `C350944 Create Item by POL match ${getRandomPostfix()}`, status: ITEM_STATUS_NAMES.AVAILABLE, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350944 Create Item by POL match ${Helper.getRandomBarcode()}` } + name: `C350944 Create Item by POL match ${getRandomPostfix()}` } } ]; const matchProfile = { - profileName: `C350944 935 $a POL to Instance POL ${Helper.getRandomBarcode()}`, + profileName: `C350944 935 $a POL to Instance POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield:'a' @@ -86,7 +85,7 @@ describe('ui-data-import', () => { }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350944 Update Instance, and create Holdings, Item based on POL match ${Helper.getRandomBarcode()}`, + profileName: `C350944 Update Instance, and create Holdings, Item based on POL match ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; const order = { ...NewOrder.defaultOneTimeOrder, diff --git a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js index 311b592f75..5509cb0abd 100644 --- a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js @@ -1,5 +1,6 @@ import uuid from 'uuid'; import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import { FOLIO_RECORD_TYPE, LOCATION_NAMES, @@ -65,37 +66,37 @@ describe('ui-data-import', () => { quantity: '1', price: '20' }; - const editedMarcFileName = `C350590 marcFileForMatchOnPol.${Helper.getRandomBarcode()}.mrc`; + const editedMarcFileName = `C350590 marcFileForMatchOnPol.${getRandomPostfix()}.mrc`; const collectionOfProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350590 Update Instance by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Instance by POL match ${getRandomPostfix()}`, update: true }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350590 Update Instance by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Instance by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350590 Update Holdings by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Holdings by POL match ${getRandomPostfix()}`, update: true }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350590 Update Holdings by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Holdings by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350590 Update Item by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Item by POL match ${getRandomPostfix()}`, update: true }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350590 Update Item by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Item by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } ]; const collectionOfMatchProfiles = [ { - matchProfile: { profileName: `C350590 935 $a POL to Instance POL ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C350590 935 $a POL to Instance POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield:'a' @@ -105,7 +106,7 @@ describe('ui-data-import', () => { instanceOption: NewMatchProfile.optionsList.pol } }, { - matchProfile: { profileName: `C350590 935 $a POL to Holdings POL ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C350590 935 $a POL to Holdings POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield: 'a' @@ -116,7 +117,7 @@ describe('ui-data-import', () => { }, { matchProfile: { - profileName: `C350590 935 $a POL to Item POL ${Helper.getRandomBarcode()}`, + profileName: `C350590 935 $a POL to Item POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield: 'a' @@ -129,7 +130,7 @@ describe('ui-data-import', () => { ]; const specialJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350590 autotestJobProf${Helper.getRandomBarcode()}`, + profileName: `C350590 autotestJobProf${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; before('create test data', () => { @@ -247,7 +248,7 @@ describe('ui-data-import', () => { const checkReceivedPiece = (number, title) => { cy.visit(TopMenu.ordersPath); Orders.resetFilters(); - Orders.searchByParameter('PO number', number); + Orders.searchByParameter('PO number', `${number}-1`); Orders.selectFromResultsList(number); OrderView.openPolDetails(title); OrderLines.openReceiving(); @@ -334,9 +335,9 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(specialJobProfile); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfProfiles[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfProfiles[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfProfiles[1].actionProfile.name, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfProfiles[2].actionProfile.name, 4); NewJobProfile.saveAndClose(); // upload .mrc file diff --git a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js index 8db4555e7f..6ece082cfa 100644 --- a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js @@ -2,7 +2,6 @@ import uuid from 'uuid'; import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; -import Helper from '../../../support/fragments/finance/financeHelper'; import TopMenu from '../../../support/fragments/topMenu'; import Logs from '../../../support/fragments/data_import/logs/logs'; import MatchOnVRN from '../../../support/fragments/data_import/matchOnVRN'; @@ -53,15 +52,15 @@ describe('ui-data-import', () => { let user = null; let orderNumber; - const instanceMappingProfileName = `C350591 Update Instance by VRN match ${Helper.getRandomBarcode()}`; - const holdingsMappingProfileName = `C350591 Update Holdings by VRN match ${Helper.getRandomBarcode()}`; - const itemMappingProfileName = `C350591 Update Item by VRN match ${Helper.getRandomBarcode()}`; - const instanceActionProfileName = `C350591 Action for Instance ${Helper.getRandomBarcode()}`; - const holdingsActionProfileName = `C350591 Action for Holdings ${Helper.getRandomBarcode()}`; - const itemActionProfileName = `C350591 Action for Item ${Helper.getRandomBarcode()}`; - const instanceMatchProfileName = `C350591 Match for Instance ${Helper.getRandomBarcode()}`; - const holdingsMatchProfileName = `C350591 Match for Holdings ${Helper.getRandomBarcode()}`; - const itemMatchProfileName = `C350591 Match for Item ${Helper.getRandomBarcode()}`; + const instanceMappingProfileName = `C350591 Update Instance by VRN match ${getRandomPostfix()}`; + const holdingsMappingProfileName = `C350591 Update Holdings by VRN match ${getRandomPostfix()}`; + const itemMappingProfileName = `C350591 Update Item by VRN match ${getRandomPostfix()}`; + const instanceActionProfileName = `C350591 Action for Instance ${getRandomPostfix()}`; + const holdingsActionProfileName = `C350591 Action for Holdings ${getRandomPostfix()}`; + const itemActionProfileName = `C350591 Action for Item ${getRandomPostfix()}`; + const instanceMatchProfileName = `C350591 Match for Instance ${getRandomPostfix()}`; + const holdingsMatchProfileName = `C350591 Match for Holdings ${getRandomPostfix()}`; + const itemMatchProfileName = `C350591 Match for Item ${getRandomPostfix()}`; const editedMarcFileName = `marcFileForC350591.${getRandomPostfix()}.mrc`; const matchProfiles = [ @@ -80,7 +79,7 @@ describe('ui-data-import', () => { ]; const jobProfilesData = { - name: `C350591 Job profile ${Helper.getRandomBarcode()}`, + name: `C350591 Job profile ${getRandomPostfix()}`, dataType: ACCEPTED_DATA_TYPE_NAMES.MARC, matches: [ { diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js index 1e92cfb489..7c9f549675 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js @@ -29,11 +29,20 @@ describe('ui-data-import', () => { const nameForCSVFile = `C345423autotestFile${getRandomPostfix()}.csv`; const nameMarcFileForUpload = `C345423autotestFile.${getRandomPostfix()}.mrc`; const mappingProfileFieldsForModify = { name: `autoTestMappingProf.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + modifications: { action: 'Add', + field: '947', + ind1: '', + ind2: '', + subfield: 'a', + data: `Test.${getRandomPostfix()}`, + subaction: 'Add subfield', + subfieldInd1: 'b', + subfieldData: `Addition.${getRandomPostfix()}` } }; const actionProfile = { name: `autoTestActionProf.${getRandomPostfix()}`, action: 'Modify (MARC Bibliographic record type only)', - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; const matchProfile = { profileName: `autoTestMatchProf.${getRandomPostfix()}`, @@ -75,8 +84,7 @@ describe('ui-data-import', () => { MatchProfiles.deleteMatchProfile(matchProfile.profileName); ActionProfiles.deleteActionProfile(actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileFieldsForModify.name); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); Users.deleteViaApi(user.userId); @@ -101,18 +109,18 @@ describe('ui-data-import', () => { FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); }); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHRID = hrId[0]; + // open Instance to get hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - }); + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + }); // download exported marc file cy.visit(TopMenu.dataExportPath); ExportFile.uploadFile(nameForCSVFile); @@ -125,11 +133,10 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfileFieldsForModify); NewFieldMappingProfile.addFieldMappingsForMarc(); - NewFieldMappingProfile.fillModificationSectionWithAdd('Add', '947', 'a', 'Add subfield', 'Test', 'b', 'Addition'); + NewFieldMappingProfile.fillModificationSectionWithAdd(mappingProfileFieldsForModify.modifications); FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfileFieldsForModify.name); FieldMappingProfiles.checkMappingProfilePresented(mappingProfileFieldsForModify.name); - // create Action profile and link it to Field mapping profile cy.visit(SettingsMenu.actionProfilePath); ActionProfiles.create(actionProfile, mappingProfileFieldsForModify.name); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js index 700d25c97a..da4aa297a1 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js @@ -338,8 +338,7 @@ describe('ui-data-import', () => { FieldMappingProfiles.deleteFieldMappingProfile(nameInstanceMappingProfile); FieldMappingProfiles.deleteFieldMappingProfile(nameHoldingsMappingProfile); FieldMappingProfiles.deleteFieldMappingProfile(nameItemMappingProfile); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForImportUpdate}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) @@ -366,7 +365,7 @@ describe('ui-data-import', () => { NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); NewFieldMappingProfile.fillCallNumber('050$a " " 050$b'); - NewFieldMappingProfile.addElectronicAccess('Resource', '856$u'); + NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u'); FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); }; @@ -400,17 +399,18 @@ describe('ui-data-import', () => { FileDetails.checkItemsQuantityInSummaryTable(0, '1'); FileDetails.checkItemsQuantityInSummaryTable(1, '0'); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHRID = hrId[0]; - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + }); cy.visit(SettingsMenu.exportMappingProfilePath); ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); @@ -449,9 +449,9 @@ describe('ui-data-import', () => { // create Job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfMappingAndActionProfiles[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfiles[1].actionProfile.name, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfMappingAndActionProfiles[2].actionProfile.name, 4); NewJobProfile.saveAndClose(); // upload the exported marc file diff --git a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js index 29b1ca07a7..352ed81879 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js @@ -17,6 +17,7 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import permissions from '../../../support/dictionary/permissions'; import Users from '../../../support/fragments/users/users'; import DevTeams from '../../../support/dictionary/devTeams'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; describe('ui-data-import', () => { let user = {}; @@ -90,57 +91,59 @@ describe('ui-data-import', () => { Logs.openFileDetails(nameForMarcFile); FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - cy.visit(TopMenu.dataExportPath); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + const instanceHRID = initialInstanceHrId; - // download exported marc file - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithDefaultJobProfile(nameForCSVFile); - ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + cy.visit(TopMenu.dataExportPath); - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); + // download exported marc file + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithDefaultJobProfile(nameForCSVFile); + ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfile(mappingProfile); + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); - // create Action profile and link it to Field mapping profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfile(mappingProfile); - // create Job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Action profile and link it to Field mapping profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - // upload the exported marc file with 001 field - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(nameForExportedMarcFile); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForExportedMarcFile); - Logs.openFileDetails(nameForExportedMarcFile); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); + // upload the exported marc file with 001 field + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(nameForExportedMarcFile); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForExportedMarcFile); + Logs.openFileDetails(nameForExportedMarcFile); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - // ensure the fields created in Field mapping profile exists in inventory - InventorySearchAndFilter.checkInstanceDetails(); - }); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + + // ensure the fields created in Field mapping profile exists in inventory + InventorySearchAndFilter.checkInstanceDetails(); + }); }); }); diff --git a/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js b/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js index ee356f2525..5316328753 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js @@ -14,6 +14,7 @@ import SettingsMenu from '../../../support/fragments/settingsMenu'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import TopMenu from '../../../support/fragments/topMenu'; import DevTeams from '../../../support/dictionary/devTeams'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { @@ -115,64 +116,62 @@ describe('ui-data-import', () => { Logs.openFileDetails(nameForMarcFile); FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - cy.visit(TopMenu.dataExportPath); - - // download exported marc file - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithDefaultJobProfile(nameForCSVFile); - ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - - cy.log('#####End Of Export#####'); - - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - - // create Action profile and link it to Field mapping profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); - - // create Job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - - // upload the exported marc file with 999.f.f.s fields - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(nameForExportedMarcFile); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForExportedMarcFile); - Logs.openFileDetails(nameForExportedMarcFile); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(id => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(id[0]); - - // ensure the fields created in Field mapping profile exists in inventory - InventorySearchAndFilter.checkInstanceDetails(); - }); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + const instanceHRID = initialInstanceHrId; + + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + cy.visit(TopMenu.dataExportPath); + + // download exported marc file + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithDefaultJobProfile(nameForCSVFile); + ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + + cy.log('#####End Of Export#####'); + + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create Action profile and link it to Field mapping profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload the exported marc file with 999.f.f.s fields + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(nameForExportedMarcFile); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForExportedMarcFile); + Logs.openFileDetails(nameForExportedMarcFile); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + + // ensure the fields created in Field mapping profile exists in inventory + InventorySearchAndFilter.checkInstanceDetails(); + }); }); }); diff --git a/cypress/e2e/data-import/e2e/view-all-filter.cy.js b/cypress/e2e/data-import/e2e/view-all-filter.cy.js index cacc592add..a6d2cc99bc 100644 --- a/cypress/e2e/data-import/e2e/view-all-filter.cy.js +++ b/cypress/e2e/data-import/e2e/view-all-filter.cy.js @@ -37,7 +37,6 @@ describe('ui-data-import', () => { // Upload files // runs with errors cy.uploadFileWithDefaultJobProfile(fileNameForFailedImport); - cy.reload(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); // runs successfully diff --git a/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js index 77162b544b..e989da9eeb 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js @@ -34,7 +34,7 @@ describe('ui-data-import', () => { it('C359207 Checking the import to Create MARC Authority records, when incoming records do and do not have 999 ff field (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete reload after fix https://issues.folio.org/browse/MODDATAIMP-691 - cy.reload(); + DataImport.verifyUploadState(); // upload the first .mrc file DataImport.uploadFile('marcAuthFileC359207.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js index 9da4eaf056..23e8b64eb5 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js @@ -13,7 +13,6 @@ import Logs from '../../../support/fragments/data_import/logs/logs'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; @@ -43,7 +42,7 @@ describe('ui-data-import', () => { const fileNameAfterUpload = `C17039 uploadedFile.${getRandomPostfix()}.mrc`; const matchProfile = { - profileName: `C17039 match profile ${Helper.getRandomBarcode()}`, + profileName: `C17039 match profile ${getRandomPostfix()}`, incomingRecordFields: { field: '999', in1: 'f', @@ -56,18 +55,18 @@ describe('ui-data-import', () => { }; const mappingProfile = { - name: `C17039 mapping profile ${Helper.getRandomBarcode()}`, + name: `C17039 mapping profile ${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17039 action profile ${Helper.getRandomBarcode()}`, + name: `C17039 action profile ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const jobProfile = { - profileName: `C17039 job profile ${Helper.getRandomBarcode()}`, + profileName: `C17039 job profile ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -86,11 +85,11 @@ describe('ui-data-import', () => { JobProfiles.waitFileIsImported(fileName); Logs.openFileDetails(fileName); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHridForReimport = hrId[0]; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHridForReimport = initialInstanceHrId; + }); }); }); @@ -99,8 +98,7 @@ describe('ui-data-import', () => { MatchProfiles.deleteMatchProfile(matchProfile.profileName); ActionProfiles.deleteActionProfile(actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) @@ -131,82 +129,82 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - // check fields are absent in the view source - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 1); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); - InventoryViewSource.notContains('003\t'); - InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); - - InventoryViewSource.extructDataFrom999Field() - .then(uuid => { - // change file using uuid for 999 field - DataImport.editMarcFile( - 'marcFilrForC17039With999Field.mrc', - editedMarcFileName, - ['srsUuid', 'instanceUuid'], - [uuid[0], uuid[1]] - ); - }); - - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithExistingPart(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(instanceStatusTerm); - NewFieldMappingProfile.fillCatalogedDate(catalogedDate); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); - - // create job profile for update - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - - // upload a marc file for updating already created instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, fileNameAfterUpload); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameAfterUpload); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameAfterUpload); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); - FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + // check fields are absent in the view source + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 1); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); + InventoryViewSource.notContains('003\t'); + InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); + + InventoryViewSource.extructDataFrom999Field() + .then(uuid => { + // change file using uuid for 999 field + DataImport.editMarcFile( + 'marcFilrForC17039With999Field.mrc', + editedMarcFileName, + ['srsUuid', 'instanceUuid'], + [uuid[0], uuid[1]] + ); + }); - // check instance is updated - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventoryInstance.checkIsInstanceUpdated(); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); - InventoryViewSource.notContains('003\t'); - InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); - }); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithExistingPart(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(instanceStatusTerm); + NewFieldMappingProfile.fillCatalogedDate(catalogedDate); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + // create job profile for update + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file for updating already created instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, fileNameAfterUpload); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameAfterUpload); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameAfterUpload); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + + // check instance is updated + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventoryInstance.checkIsInstanceUpdated(); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); + InventoryViewSource.notContains('003\t'); + InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); + }); // export instance cy.visit(TopMenu.inventoryPath); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js new file mode 100644 index 0000000000..166b346836 --- /dev/null +++ b/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js @@ -0,0 +1,270 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import { + LOCATION_NAMES, + FOLIO_RECORD_TYPE, + ACCEPTED_DATA_TYPE_NAMES, + EXISTING_RECORDS_NAMES, + JOB_STATUS_NAMES, + HOLDINGS_TYPE_NAMES +} from '../../../support/constants'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import Users from '../../../support/fragments/users/users'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import FileManager from '../../../support/utils/fileManager'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; + +describe('ui-data-import', () => { + let user; + let instanceHrid; + const holdingsElectronicAccessData = { + urlRelationship: 'Resource', + uri: 'http://silk.library.umass.edu/login?url=https://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=10241', + linkTextUMass: 'UMass: Link to resource', + urlPublicNote: 'EBSCO' + }; + const callNumberData = { + callNumberType: 'LC Modified', + callNumberPrefix: 'TestPref', + callNumber: '322', + callNumberSuffix: 'TestSuf' + }; + const filePathForCreate = 'marcFileForC401727.mrc'; + const marcFileNameForCreate = `C401727 autotestFileName ${getRandomPostfix()}`; + const marcFileNameForUpdate = `C401727 autotestFileName ${getRandomPostfix()}`; + const editedMarcFileName = `C401727 editedAutotestFileName ${getRandomPostfix()}`; + const holdingsMappingProfile = { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Create simple Holdings ${getRandomPostfix()}}`, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }; + const holdingsActionProfile = { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Create simple Holdings ${getRandomPostfix()}` }; + const jobProfile = { + profileName: `C401727 Create simple Instance and Holdings ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C401727 Update ER holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Update ER holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C401727 Update Call number holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + callNumberType: '852$t', + callNumberPrefix: '852$p', + callNumber: '852$h', + callNumberSuffix: '852$s' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Update Call number holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C401727 Update Electronic access holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + relationship: '856$f', + uri: '856$u', + linkText: '856$y', + materialsSpecified: '856$3', + urlPublicNote: '856$z' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Update Electronic access holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const matchProfile = { profileName: `C401727 901 to Holdings HRID match ${getRandomPostfix()}`, + incomingRecordFields: { + field: '901', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid }; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C401727 Update holdings with 901 match ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('create test data', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + ActionProfiles.deleteActionProfile(holdingsActionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfile.name); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C401727 Verify that 3 successive update actions for Holdings proceed without errors (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create field mapping profile + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); + NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); + + // create action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(holdingsActionProfile, holdingsMappingProfile.name); + ActionProfiles.checkActionProfilePresented(holdingsActionProfile.name); + + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfileByName(holdingsActionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file for creating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreate, marcFileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + // get Instance hrid for deleting + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(hrId => { instanceHrid = hrId; }); + cy.go('back'); + FileDetails.openHoldingsInInventory('Created'); + HoldingsRecordView.getHoldingsHrId().then(initialHrId => { + const holdingsHrId = initialHrId; + + // edit file with the copied value in the 901 field + DataImport.editMarcFile(filePathForCreate, editedMarcFileName, ['ho00004554073'], [holdingsHrId]); + }); + + // create field mapping profiles for updating + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.holdingsType); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile); + NewFieldMappingProfile.fillCallNumberType(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumberType); + NewFieldMappingProfile.fillCallNumberPrefix(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumberPrefix); + NewFieldMappingProfile.fillCallNumber(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumber); + NewFieldMappingProfile.fillcallNumberSuffix(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumberSuffix); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile); + NewFieldMappingProfile.addElectronicAccess( + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.relationship, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.uri, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.linkText, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.materialsSpecified, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.urlPublicNote + ); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.name); + + // create action profiles for updating + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create job profile for creating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchAndThreeActionProfiles( + matchProfile.profileName, + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, + collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, + collectionOfMappingAndActionProfilesForUpdate[2].actionProfile.name + ); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + + // upload a marc file for creating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, marcFileNameForUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); + FileDetails.openHoldingsInInventory('Updated'); + + HoldingsRecordView.checkHoldingsType(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.holdingsType); + HoldingsRecordView.checkCallNumberType(callNumberData.callNumberType); + HoldingsRecordView.checkCallNumberPrefix(callNumberData.callNumberPrefix); + HoldingsRecordView.checkCallNumber(callNumberData.callNumber); + HoldingsRecordView.checkCallNumberSuffix(callNumberData.callNumberSuffix); + HoldingsRecordView.checkElectronicAccess( + holdingsElectronicAccessData.urlRelationship, + holdingsElectronicAccessData.uri, + holdingsElectronicAccessData.linkTextUMass, + holdingsElectronicAccessData.urlPublicNote + ); + }); +}); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js index 3992ccc7de..9e7b9f3a34 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js @@ -104,18 +104,18 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); - InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); - InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); - InstanceRecordView.verifyNatureOfContent(mappingProfile.natureOfContent); - }); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); + InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); + InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); + InstanceRecordView.verifyNatureOfContent(mappingProfile.natureOfContent); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js index fcc2c2cacc..e60933bafc 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { @@ -13,7 +14,6 @@ import { } from '../../../support/constants'; import TopMenu from '../../../support/fragments/topMenu'; import DataImport from '../../../support/fragments/data_import/dataImport'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; @@ -37,27 +37,27 @@ describe('ui-data-import', () => { let instanceHrid; let exportedFileName; const quantityOfItems = '1'; - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368009 Testing item for SRS MARC bib ${Helper.getRandomBarcode()}`, + name: `C368009 Testing item for SRS MARC bib ${getRandomPostfix()}`, materialType: `"${MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE}"`, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368009 Testing holding for SRS MARC bib ${Helper.getRandomBarcode()}` } + name: `C368009 Testing holding for SRS MARC bib ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368009 Testing holding for SRS MARC bib ${Helper.getRandomBarcode()}`, + name: `C368009 Testing holding for SRS MARC bib ${getRandomPostfix()}`, permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368009 Testing holding for SRS MARC bib ${Helper.getRandomBarcode()}` } + name: `C368009 Testing holding for SRS MARC bib ${getRandomPostfix()}` } } ]; const matchProfile = { - profileName: `C368009 001 to Instance HRID ${Helper.getRandomBarcode()}`, + profileName: `C368009 001 to Instance HRID ${getRandomPostfix()}`, incomingRecordFields: { field: '001' }, @@ -66,7 +66,7 @@ describe('ui-data-import', () => { instanceOption: NewMatchProfile.optionsList.instanceHrid }; const jobProfile = { - profileName: `C368009 Testing SRS MARC bib ${Helper.getRandomBarcode()}`, + profileName: `C368009 Testing SRS MARC bib ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -104,8 +104,7 @@ describe('ui-data-import', () => { FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); Users.deleteViaApi(user.userId); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) .then((instance) => { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js index e4ec0aaf79..3d78201830 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import DevTeams from '../../../support/dictionary/devTeams'; import TestTypes from '../../../support/dictionary/testTypes'; import DataImport from '../../../support/fragments/data_import/dataImport'; @@ -6,7 +7,6 @@ import TopMenu from '../../../support/fragments/topMenu'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../../support/fragments/data_import/logs/logs'; import Users from '../../../support/fragments/users/users'; -import Helper from '../../../support/fragments/finance/financeHelper'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import { JOB_STATUS_NAMES } from '../../../support/constants'; @@ -14,7 +14,7 @@ describe('ui-data-import', () => { let user; // eslint-disable-next-line const error = '{\"errors\":[{\"name\":\"io.vertx.core.json.DecodeException\",\"message\":\"Failed to decode:Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in name\\n at [Source: (String)\\\"{\\\"leader\\\":\\\"01621cas a2200445 a 4500\\\",\\\"fields\\\":[{\\\"001\\\":\\\"in00000012507\\\"},{\\\"003\\\":\\\"OCoLC\\\"},{\\\"008\\\":\\\"06d0504c20069999txufr pso 0 a0eng c\\\"},{\\\"015\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\";\\\",\\\"ind2\\\":\\\"A\\\"}},{\\\"00\\\\u0009\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\" \\\",\\\"ind2\\\":\\\" \\\"}},{\\\"0==\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\"d\\\",\\\"ind2\\\":\\\"s\\\"}},{\\\"\\\\u0009\\\\A\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\"5\\\",\\\"ind2\\\":\\\"8\\\"}},{\\\"022\\\":{\\\"subfields\\\":[{\\\"a\\\":\\\"1 931-7603\\\"},{\\\"l\\\":\\\"1931-7603\\\"},{\\\"2\\\":\\\"1\\\"}],\\\"ind1\\\":\\\"0\\\",\\\"ind2\\\":\\\" \\\"}},{\\\"035\\\":{\\\"subfields\\\":[{\\\"a\\\":\\\"(OCoLC)68188263\\\"},{\\\"z\\\":\\\"(OCoLC)1058285745\\\"}],\\\"ind1\\\":\\\"\\\"[truncated 2505 chars]; line: 1, column: 192]\"}]}'; - const nameMarcFileForImportCreate = `C350750autotestFile.${Helper.getRandomBarcode()}.mrc`; + const nameMarcFileForImportCreate = `C350750autotestFile.${getRandomPostfix()}.mrc`; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; before('login', () => { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js index 5572cbf7b8..119a6ef972 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js @@ -243,7 +243,6 @@ describe('ui-data-import', () => { }); after('delete test data', () => { - FileManager.deleteFolder(Cypress.config('downloadsFolder')); FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js index 4a04071698..93a8d99502 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js @@ -1,8 +1,8 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import MarcFieldProtection from '../../../support/fragments/settings/dataImport/marcFieldProtection'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; @@ -25,20 +25,20 @@ describe('ui-data-import', () => { const fieldsForDelete = ['977', '978', '979']; const fieldsForDeleteIds = []; // unique file name to upload - const fileName = `C350678autotestFileProtection.${Helper.getRandomBarcode()}.mrc`; + const fileName = `C350678autotestFileProtection.${getRandomPostfix}.mrc`; - const mappingProfile = { name: `C350678 Remove extraneous MARC fields ${Helper.getRandomBarcode()}`, + const mappingProfile = { name: `C350678 Remove extraneous MARC fields ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C350678 Remove extraneous MARC fields ${Helper.getRandomBarcode()}`, + name: `C350678 Remove extraneous MARC fields ${getRandomPostfix}`, action: 'Modify (MARC Bibliographic record type only)' }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350678 Create bib and instance, but remove some MARC fields first ${Helper.getRandomBarcode()}`, + profileName: `C350678 Create bib and instance, but remove some MARC fields first ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -139,18 +139,19 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); FileDetails.checkInstanceQuantityInSummaryTable('1', 0); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - // check fields are absent in the view source - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - fieldsForDelete.forEach(fieldNumber => { - InventoryViewSource.notContains(`${fieldNumber}\t`); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + // check fields are absent in the view source + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + fieldsForDelete.forEach(fieldNumber => { + InventoryViewSource.notContains(`${fieldNumber}\t`); }); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js index 06fe84bc34..71a94bc550 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js @@ -35,8 +35,7 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); DataImport.uploadBunchOfFiles(filePathForUpload, upload.quantityOfFiles, upload.fileName); - // TODO wait until the file will be uploaded - cy.wait(8000); + DataImport.waitFileIsUploaded(); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(upload.fileName); @@ -45,6 +44,8 @@ describe('ui-data-import', () => { LogsViewAll.viewAllIsOpened(); LogsViewAll.selectOption('Keyword (ID, File name)'); LogsViewAll.searchWithTerm(upload.fileName); + // TODO need to wait until files are filtered + cy.wait(2000); LogsViewAll.verifyQuantityOfLogs(upload.quantityOfFiles); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js index 970e486b5b..14e04424d7 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js @@ -1,4 +1,5 @@ /* eslint-disable cypress/no-unnecessary-waiting */ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import permissions from '../../../support/dictionary/permissions'; @@ -10,7 +11,6 @@ import { MATERIAL_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -46,42 +46,42 @@ describe('ui-data-import', () => { 'Language, borders and identity / edited by Dominic Watt and Carmen Llamas.' ]; const itemNote = 'THIS WAS UPDATED!'; - const jobProfileNameForExport = `C357552 Bibs with Item HRIDs ${Helper.getRandomBarcode()}`; + const jobProfileNameForExport = `C357552 Bibs with Item HRIDs ${getRandomPostfix}`; // file names - const nameMarcFileForImportCreate = `C357552autotestFile.${Helper.getRandomBarcode()}.mrc`; - const nameForCSVFile = `C357552autotestFile${Helper.getRandomBarcode()}.csv`; - const nameMarcFileForUpdate = `C357552autotestFile${Helper.getRandomBarcode()}.mrc`; + const nameMarcFileForImportCreate = `C357552autotestFile.${getRandomPostfix}.mrc`; + const nameForCSVFile = `C357552autotestFile${getRandomPostfix}.csv`; + const nameMarcFileForUpdate = `C357552autotestFile${getRandomPostfix}.mrc`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C357552 Create simple holdings ${Helper.getRandomBarcode()}`, + name: `C357552 Create simple holdings ${getRandomPostfix}`, permanentLocation: LOCATION_NAMES.ONLINE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C357552 Create simple holdings ${Helper.getRandomBarcode()}` } + name: `C357552 Create simple holdings ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Create simple items ${Helper.getRandomBarcode()}`, + name: `C357552 Create simple items ${getRandomPostfix}`, status: ITEM_STATUS_NAMES.AVAILABLE, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Create simple items ${Helper.getRandomBarcode()}` } + name: `C357552 Create simple items ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Update Item by POL match ${Helper.getRandomBarcode()}`, + name: `C357552 Update Item by POL match ${getRandomPostfix}`, status: ITEM_STATUS_NAMES.AVAILABLE, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Update simple items ${Helper.getRandomBarcode()}`, + name: `C357552 Update simple items ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } ]; const matchProfileItemHrid = { - profileName: `C357552 Match 902$a to Item HRID ${Helper.getRandomBarcode()}`, + profileName: `C357552 Match 902$a to Item HRID ${getRandomPostfix}`, incomingRecordFields: { field: '902', in1: '*', @@ -94,7 +94,7 @@ describe('ui-data-import', () => { }; const matchProfileItemStatus = { - profileName: `C357552 Item status = Available ${Helper.getRandomBarcode()}`, + profileName: `C357552 Item status = Available ${getRandomPostfix}`, incomingStaticValue: 'Available', matchCriterion: 'Exactly matches', existingRecordType: EXISTING_RECORDS_NAMES.ITEM, @@ -103,16 +103,16 @@ describe('ui-data-import', () => { const createJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C357552 Create simple instance, holdings, items ${Helper.getRandomBarcode()}`, + profileName: `C357552 Create simple instance, holdings, items ${getRandomPostfix}`, }; const updateJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C357552 Update item based on HRID and Status ${Helper.getRandomBarcode()}`, + profileName: `C357552 Update item based on HRID and Status ${getRandomPostfix}`, }; const exportMappingProfile = { - name: `C357552 Item HRID ${Helper.getRandomBarcode()}`, + name: `C357552 Item HRID ${getRandomPostfix}`, }; before('create test data', () => { @@ -153,8 +153,7 @@ describe('ui-data-import', () => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpdate}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js index 1f476a2350..8e988e9935 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { @@ -10,7 +11,6 @@ import { ACCEPTED_DATA_TYPE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import SettingsMenu from '../../../support/fragments/settingsMenu'; @@ -29,7 +29,7 @@ describe('ui-data-import', () => { let user; const rowNumbers = [0, 1]; const instanceHrids = []; - const marcFileName = `C368005 autotestFile.${Helper.getRandomBarcode()}.mrc`; + const marcFileName = `C368005 autotestFile.${getRandomPostfix}.mrc`; const itemNotes = { note: 'This is a plain note', checkInNoteForFirstItem: 'This is a check in note', @@ -42,21 +42,21 @@ describe('ui-data-import', () => { const collectionOfProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C368005 Create instance for mapping notes ${Helper.getRandomBarcode()}`, + name: `C368005 Create instance for mapping notes ${getRandomPostfix}`, catalogingDate: '###TODAY###' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C368005 Create instance for mapping notes ${Helper.getRandomBarcode()}` } + name: `C368005 Create instance for mapping notes ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368005 Create holdings for mapping notes ${Helper.getRandomBarcode()}`, + name: `C368005 Create holdings for mapping notes ${getRandomPostfix}`, permanetLocation: `"${LOCATION_NAMES.ANNEX}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368005 Create holdings for mapping notes ${Helper.getRandomBarcode()}` } + name: `C368005 Create holdings for mapping notes ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368005 Create item for mapping notes ${Helper.getRandomBarcode()}`, + name: `C368005 Create item for mapping notes ${getRandomPostfix}`, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, noteType: '876$t', note: '876$n', @@ -67,11 +67,11 @@ describe('ui-data-import', () => { permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368005 Create items for mapping notes ${Helper.getRandomBarcode()}` } + name: `C368005 Create items for mapping notes ${getRandomPostfix}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C368005 Create mappings for item notes ${Helper.getRandomBarcode()}`, + profileName: `C368005 Create mappings for item notes ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; before('create test data', () => { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-the-856-field-maintains-relationship-between-url-and-link-test.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-the-856-field-maintains-relationship-between-url-and-link-test.cy.js new file mode 100644 index 0000000000..bfa3a15b16 --- /dev/null +++ b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-the-856-field-maintains-relationship-between-url-and-link-test.cy.js @@ -0,0 +1,181 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import { INSTANCE_STATUS_TERM_NAMES, + HOLDINGS_TYPE_NAMES, + LOCATION_NAMES, + FOLIO_RECORD_TYPE, + ACCEPTED_DATA_TYPE_NAMES, + JOB_STATUS_NAMES } from '../../../support/constants'; +import NewInstanceStatusType from '../../../support/fragments/settings/inventory/instances/instanceStatusTypes/newInstanceStatusType'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import Users from '../../../support/fragments/users/users'; +import InstanceStatusTypes from '../../../support/fragments/settings/inventory/instances/instanceStatusTypes/instanceStatusTypes'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; + +describe('ui-data-import', () => { + let user; + let instanceHrid; + const testData = { + protectedFieldId: null, + filePath: 'marcFileForC400649.mrc', + fileName: `C400649 autotestFile_${getRandomPostfix()}` + }; + const firstField = { + fieldNimberInFile: 0, + url: 'https://muse.jhu.edu/book/67428', + linkText: 'Project Muse' + }; + const secondField = { + fieldNimberInFile: 1, + url: 'https://muse.jhu.edu/book/74528', + linkText: 'Project Muse' + }; + const thirdField = { + fieldNimberInFile: 2, + url: 'https://www.jstor.org/stable/10.2307/j.ctv26d9pv', + linkText: 'JSTOR' + }; + const forthField = { + fieldNimberInFile: 3, + url: 'https://www.jstor.org/stable/10.2307/j.ctvcwp01n', + linkText: 'JSTOR' + }; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C400649 Create ER Instance ${getRandomPostfix()}`, + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C400649 Create ER Instance ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C400649 Create ER Holdings ${getRandomPostfix()}`, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, + relationship: 'Resource', + uri: '856$u', + linkText: '856$y', + materialsSpecified: '856$3', + urlPublicNote: '856$z' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C400649 Create ER Holdings ${getRandomPostfix()}` } + } + ]; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C400649 Create ER Instance and Holdings ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + + NewInstanceStatusType.createViaApi() + .then((initialInstanceStatusType) => { + testData.instanceStatusTypeId = initialInstanceStatusType.body.id; + }); + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + InstanceStatusTypes.deleteViaApi(testData.instanceStatusTypeId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C400649 Verify that mapping for the 856 field maintains relationship between URL and link text (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create Field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfiles[0].mappingProfile.instanceStatusTerm); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfiles[1].mappingProfile.holdingsType); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); + NewFieldMappingProfile.addElectronicAccess( + collectionOfMappingAndActionProfiles[1].mappingProfile.relationship, + collectionOfMappingAndActionProfiles[1].mappingProfile.uri, + collectionOfMappingAndActionProfiles[1].mappingProfile.linkText, + collectionOfMappingAndActionProfiles[1].mappingProfile.materialsSpecified, + collectionOfMappingAndActionProfiles[1].mappingProfile.urlPublicNote + ); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + + // create action profiles + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(testData.filePath, testData.fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(testData.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(testData.fileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(hrId => { instanceHrid = hrId; }); + [firstField, secondField, thirdField, forthField].forEach(field => { + InstanceRecordView.verifyElectronicAccess(field.url, field.linkText, field.fieldNimberInFile); + }); + InstanceRecordView.viewSource(); + [firstField, secondField, thirdField, forthField].forEach(field => { + InventoryViewSource.verifyFieldInMARCBibSource('856', field.url); + InventoryViewSource.contains(field.linkText); + }); + }); +}); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js index 5381bf3f6c..86dd69419c 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE, @@ -5,7 +6,6 @@ import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import TopMenu from '../../../support/fragments/topMenu'; import DataImport from '../../../support/fragments/data_import/dataImport'; import Logs from '../../../support/fragments/data_import/logs/logs'; @@ -26,33 +26,33 @@ describe('ui-data-import', () => { let instanceHrid; const quantityOfItems = '1'; // unique file names - const marcFileForCreate = `C17019 oneMarcBib.mrc${Helper.getRandomBarcode()}`; - const editedMarcFileName = `C17019 editedMarcFile.${Helper.getRandomBarcode()}.mrc`; - const fileNameForUpdate = `C17019 marcFileForUpdate.${Helper.getRandomBarcode()}.mrc`; + const marcFileForCreate = `C17019 oneMarcBib.mrc${getRandomPostfix}`; + const editedMarcFileName = `C17019 editedMarcFile.${getRandomPostfix}.mrc`; + const fileNameForUpdate = `C17019 marcFileForUpdate.${getRandomPostfix}.mrc`; // profiles for updating instance const instanceMappingProfile = { - name: `C17019 autotest instance mapping profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest instance mapping profile.${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE, statisticalCode: 'ARL (Collection stats): books - Book, print (books)', statisticalCodeUI: 'Book, print (books)', instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED }; const marcBibMappingProfile = { - name: `C17019 autotest marc bib mapping profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest marc bib mapping profile.${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; const instanceActionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17019 autotest instance action profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest instance action profile.${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const marcBibActionProfile = { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C17019 autotest marc bib action profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest marc bib action profile.${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const matchProfile = { - profileName: `C17019 autotest match profile.${Helper.getRandomBarcode()}`, + profileName: `C17019 autotest match profile.${getRandomPostfix}`, incomingRecordFields: { field: '001' }, @@ -64,7 +64,7 @@ describe('ui-data-import', () => { }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C17019 autotest job profile.${Helper.getRandomBarcode()}`, + profileName: `C17019 autotest job profile.${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js index be84221ffc..64648c6348 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js @@ -158,67 +158,67 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyCatalogedDate(itemsForCreateInstance.catalogedDateUi); - InstanceRecordView.verifyInstanceStatusTerm(itemsForCreateInstance.statusTerm); - InstanceRecordView.verifyStatisticalCode(itemsForCreateInstance.statisticalCodeUI); - InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); - - // create mapping profile for updating instance - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(itemsForUpdateInstance.statusTerm); - NewFieldMappingProfile.addStatisticalCode(itemsForUpdateInstance.statisticalCode, 8); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - - // create action profile for updating instance - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(collectionOfMappingAndActionProfiles[1].actionProfile, collectionOfMappingAndActionProfiles[1].mappingProfile.name); - ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfiles[1].actionProfile.name); - - // craete match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create job profile for updating instance - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(collectionOfJobProfiles[1].jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(collectionOfJobProfiles[1].jobProfile.profileName); - - // upload a marc file for updating instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForUpdate); - JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[1].jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForUpdate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForUpdate); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); - InstanceRecordView.verifyInstanceStatusTerm(itemsForUpdateInstance.statusTerm); - InstanceRecordView.verifyStatisticalCode(itemsForUpdateInstance.statisticalCodeUI); - InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyCatalogedDate(itemsForCreateInstance.catalogedDateUi); + InstanceRecordView.verifyInstanceStatusTerm(itemsForCreateInstance.statusTerm); + InstanceRecordView.verifyStatisticalCode(itemsForCreateInstance.statisticalCodeUI); + InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); + + // create mapping profile for updating instance + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(itemsForUpdateInstance.statusTerm); + NewFieldMappingProfile.addStatisticalCode(itemsForUpdateInstance.statisticalCode, 8); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + + // create action profile for updating instance + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(collectionOfMappingAndActionProfiles[1].actionProfile, collectionOfMappingAndActionProfiles[1].mappingProfile.name); + ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfiles[1].actionProfile.name); + + // craete match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create job profile for updating instance + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(collectionOfJobProfiles[1].jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(collectionOfJobProfiles[1].jobProfile.profileName); + + // upload a marc file for updating instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForUpdate); + JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[1].jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFileForUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); + InstanceRecordView.verifyInstanceStatusTerm(itemsForUpdateInstance.statusTerm); + InstanceRecordView.verifyStatisticalCode(itemsForUpdateInstance.statisticalCodeUI); + InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js index 80fee8693b..2335dc8ac9 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js @@ -1,5 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE, @@ -32,13 +32,13 @@ describe('ui-data-import', () => { let firstInstanceHrid; let secondInstanceHrid; // unique file names - const fileForCreateFirstName = `C358138 firstAutotestFileForCreate.${Helper.getRandomBarcode()}.mrc`; - const fileForCreateSecondName = `C358138 secondAutotestFileForCreate.${Helper.getRandomBarcode()}.mrc`; - const fileForUpdateFirstName = `C358138 firstAutotestFileForUpdate.${Helper.getRandomBarcode()}.mrc`; - const fileForUpdateSecondName = `C358138 secondAutotestFileForUpdate.${Helper.getRandomBarcode()}.mrc`; + const fileForCreateFirstName = `C358138 firstAutotestFileForCreate.${getRandomPostfix}.mrc`; + const fileForCreateSecondName = `C358138 secondAutotestFileForCreate.${getRandomPostfix}.mrc`; + const fileForUpdateFirstName = `C358138 firstAutotestFileForUpdate.${getRandomPostfix}.mrc`; + const fileForUpdateSecondName = `C358138 secondAutotestFileForUpdate.${getRandomPostfix}.mrc`; const matchProfile = { - profileName: `C358138 Match on newly-created 035 ${Helper.getRandomBarcode()}`, + profileName: `C358138 Match on newly-created 035 ${getRandomPostfix}`, incomingRecordFields: { field: '035', in1: '*', @@ -51,18 +51,18 @@ describe('ui-data-import', () => { }; const mappingProfile = { - name: `C358138 Update instance via 035 ${Helper.getRandomBarcode()}`, + name: `C358138 Update instance via 035 ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C358138 Update instance via 035 ${Helper.getRandomBarcode()}`, + name: `C358138 Update instance via 035 ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const jobProfile = { - profileName: `C358138 Update instance via 035 ${Helper.getRandomBarcode()}`, + profileName: `C358138 Update instance via 035 ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -135,11 +135,11 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API for delete instance - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - firstInstanceHrid = hrId[0]; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + firstInstanceHrid = initialInstanceHrId; + }); FileDetails.openInstanceInInventory('Created'); InventoryInstance.verifyResourceIdentifier(resourceIdentifierForFirstInstance.type, resourceIdentifierForFirstInstance.value, 2); @@ -211,11 +211,11 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API for delete instance - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - secondInstanceHrid = hrId[0]; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + secondInstanceHrid = initialInstanceHrId; + }); FileDetails.openInstanceInInventory('Created'); InventoryInstance.verifyResourceIdentifier(resourceIdentifierForSecondInstance.type, resourceIdentifierForSecondInstance.value, 3); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js index 991b9f27f9..df767a4aaf 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js @@ -198,8 +198,7 @@ describe('ui-data-import', () => { }); after('delete test data', () => { - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js index efa037f156..dfeaf42d37 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js @@ -63,7 +63,6 @@ describe('ui-data-import', () => { InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; - cy.reload(); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); InventoryInstance.startOverlaySourceBibRecord(); InventoryInstance.importWithOclc(oclcNumber); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js index d52a285bfe..1f1f2b11f4 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js @@ -62,11 +62,11 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); }); }); 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 6614f2bc86..6a3933ffaa 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 @@ -279,8 +279,8 @@ describe('ui-data-import', () => { // create Job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, 2); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); diff --git a/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js b/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js index 3a56dc7a49..064f01f279 100644 --- a/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js @@ -1,8 +1,8 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import TopMenu from '../../../support/fragments/topMenu'; -import Helper from '../../../support/fragments/finance/financeHelper'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import DataImport from '../../../support/fragments/data_import/dataImport'; import Logs from '../../../support/fragments/data_import/logs/logs'; @@ -14,8 +14,8 @@ import FileManager from '../../../support/utils/fileManager'; describe('ui-data-import', () => { let user; let instanceHrid; - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; - const editedMarcFileName = `C359209 editedMarcFile.${Helper.getRandomBarcode()}.mrc`; + const fileName = `oneMarcBib.mrc${getRandomPostfix}`; + const editedMarcFileName = `C359209 editedMarcFile.${getRandomPostfix}.mrc`; const error = '{"error":"A new MARC-Holding was not created because the incoming record already contained a 999ff$s or 999ff$i field"}'; before('create test data', () => { diff --git a/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js b/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js index b434f78ed6..66fe9b4eaf 100644 --- a/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js +++ b/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import DevTeams from '../../../support/dictionary/devTeams'; import TestTypes from '../../../support/dictionary/testTypes'; import DataImport from '../../../support/fragments/data_import/dataImport'; @@ -7,7 +8,6 @@ import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll import DeleteDataImportLogsModal from '../../../support/fragments/data_import/logs/deleteDataImportLogsModal'; import Logs from '../../../support/fragments/data_import/logs/logs'; import Users from '../../../support/fragments/users/users'; -import Helper from '../../../support/fragments/finance/financeHelper'; let user; const maxLogsQuantityOnPage = 100; @@ -21,7 +21,7 @@ describe('ui-data-import', () => { user = userProperties; for (let i = 0; i < 101; i++) { - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix}`; DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); } diff --git a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js index e9c799ee8a..be7609030e 100644 --- a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js +++ b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js @@ -30,6 +30,7 @@ import FileManager from '../../../support/utils/fileManager'; import Users from '../../../support/fragments/users/users'; import InstanceStatusTypes from '../../../support/fragments/settings/inventory/instances/instanceStatusTypes/instanceStatusTypes'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; describe('ui-data-import', () => { const testData = { @@ -40,6 +41,34 @@ describe('ui-data-import', () => { }; let user; const instanceHrids = []; + // profiles for create + const collectionOfMappingAndActionProfilesForCreate = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `Create ER Instance ${getRandomPostfix()}`, + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `Create ER Instance ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `Create ER Holdings ${getRandomPostfix()}`, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, + relationship: '"Resource"', + uri: '856$u', + linkText: '856$y', + materialsSpecified: '856$3', + urlPublicNote: '856$z' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `Create ER Holdings ${getRandomPostfix()}` } + } + ]; + const jobProfileForCreate = { + ...NewJobProfile.defaultJobProfile, + profileName: `Create ER Instance and Holdings ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; before('create test data and login', () => { cy.createTempUser([ @@ -66,13 +95,54 @@ describe('ui-data-import', () => { .then((initialInstanceStatusType) => { testData.instanceStatusTypeId = initialInstanceStatusType.body.id; }); - cy.login(user.username, user.password); + cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + + // create Field mapping profiles for creating + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.instanceStatusTerm); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.holdingsType); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); + NewFieldMappingProfile.addElectronicAccess( + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.relationship, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.uri, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.linkText, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.materialsSpecified, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.urlPublicNote + ); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); + + // create action profiles for creating + collectionOfMappingAndActionProfilesForCreate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create job profile for creating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForCreate); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[0].actionProfile.name); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[1].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); }); }); after('delete test data', () => { MarcFieldProtection.deleteMarcFieldProtectionViaApi(testData.protectedFieldId); InstanceStatusTypes.deleteViaApi(testData.instanceStatusTypeId); + JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); + collectionOfMappingAndActionProfilesForCreate.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); Users.deleteViaApi(user.userId); instanceHrids.forEach(hrid => { cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) @@ -81,18 +151,6 @@ describe('ui-data-import', () => { InventoryInstance.deleteInstanceViaApi(instance.id); }); }); - - // // delete profiles - // MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); - // MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); - // collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - // ActionProfiles.deleteActionProfile(profile.actionProfile.name); - // FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - // }); - // collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { - // ActionProfiles.deleteActionProfile(profile.actionProfile.name); - // FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - // }); }); it('C397983 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 2 matches (folijet)', @@ -103,34 +161,6 @@ describe('ui-data-import', () => { const editedMarcFileNameForUpdate = `C397983 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; const uniq001Field = Helper.getRandomBarcode(); const newUri = 'http://jbjjhhjj:3000/Test2'; - // profiles for create - const collectionOfMappingAndActionProfilesForCreate = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397983 Create ER Instance ${getRandomPostfix()}`, - instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397983 Create ER Instance ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397983 Create ER Holdings ${getRandomPostfix()}`, - holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - relationship: 'Resource', - uri: '856$u', - linkText: '856$y', - materialsSpecified: '856$3', - urlPublicNote: '856$z' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397983 Create ER Holdings ${getRandomPostfix()}` } - } - ]; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C397983 Create ER Instance and Holdings ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; // profiles for update const collectionOfMappingAndActionProfilesForUpdate = [ { @@ -172,43 +202,6 @@ describe('ui-data-import', () => { // change file for creating uniq 035 field DataImport.editMarcFile(testData.fileName, editedMarcFileNameForCreate, ['9000098'], [uniq001Field]); - // create Field mapping profiles for creating - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.instanceStatusTerm); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); - - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); - NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.holdingsType); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); - NewFieldMappingProfile.addElectronicAccess( - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.relationship, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.uri, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.linkText, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.materialsSpecified, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.urlPublicNote - ); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); - - // create action profiles for creating - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); - - // create job profile for creating - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForCreate); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[0].actionProfile.name); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[1].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); @@ -280,18 +273,14 @@ describe('ui-data-import', () => { instanceHrids.push(hrId); }); InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); InstanceRecordView.viewSource(); InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); // delete profiles JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); @@ -309,34 +298,6 @@ describe('ui-data-import', () => { const editedMarcFileNameForUpdate = `C397984 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; const uniq001Field = Helper.getRandomBarcode(); const newUri = 'http://jbjjhhjj:3000/Test'; - // profiles for create - const collectionOfMappingAndActionProfilesForCreate = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397984 Create ER Instance ${getRandomPostfix()}`, - instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397984 Create ER Instance ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397984 Create ER Holdings ${getRandomPostfix()}`, - holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - relationship: 'Resource', - uri: '856$u', - linkText: '856$y', - materialsSpecified: '856$3', - urlPublicNote: '856$z' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397984 Create ER Holdings ${getRandomPostfix()}` } - } - ]; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C397984 Create ER Instance and Holdings ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; // profiles for update const collectionOfMappingAndActionProfilesForUpdate = [ { @@ -369,43 +330,6 @@ describe('ui-data-import', () => { // change file for creating uniq 035 field DataImport.editMarcFile(testData.fileName, editedMarcFileNameForCreate, ['9000098'], [uniq001Field]); - // create Field mapping profiles for creating - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.instanceStatusTerm); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); - - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); - NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.holdingsType); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); - NewFieldMappingProfile.addElectronicAccess( - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.relationship, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.uri, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.linkText, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.materialsSpecified, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.urlPublicNote - ); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); - - // create action profiles for creating - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); - - // create job profile for creating - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForCreate); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[0].actionProfile.name); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[1].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); @@ -430,7 +354,6 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillMappingProfileForUpdatesMarc(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); NewFieldMappingProfile.markFieldForProtection(testData.protectedField); - FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); @@ -475,17 +398,186 @@ describe('ui-data-import', () => { instanceHrids.push(hrId); }); InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); InstanceRecordView.viewSource(); InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); // delete profiles JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForCreate}`); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForUpdate}`); + }); + + it('C397383 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 3 matches (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + const fileNameForCreate = `C397383 autotestFileForCreate.${getRandomPostfix()}.mrc`; + const fileNameForUpdate = `C397383 autotestFileForUpdate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForCreate = `C397383 editedAutotestFileForCreate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForUpdate = `C397383 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; + const uniq001Field = Helper.getRandomBarcode(); + const newUri = 'http://jbjjhhjj:3000/Test3'; + // profiles for update + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C397383 Override 856 protection ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C397383 Update srs override 856 protection ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C397383 Update ER holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, + permanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C397383 Update ER Holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C397383 035$a to 035$a match ${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + subfield: 'a' + }, + existingRecordFields: { + field: '035', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } + }, + { + matchProfile: { profileName: `C397383 Instance status submatch - Electronic Resource ${getRandomPostfix()}`, + incomingStaticValue: 'Electronic Resource', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.instanceStatusTerm } + }, + { + matchProfile: { profileName: `C397383 Holdings type electronic ${getRandomPostfix()}`, + incomingStaticValue: 'Electronic', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + existingRecordOption: NewMatchProfile.optionsList.holdingsType } + } + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C397383 035$a to 035$a match with instance status and holdings type submatch ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + // change file for creating uniq 035 field + DataImport.editMarcFile(testData.fileName, editedMarcFileNameForCreate, ['9000098'], [uniq001Field]); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + + // change file for changing content of 856 field + DataImport.editMarcFile(testData.fileName, editedMarcFileNameForUpdate, ['9000098', 'http://jbjjhhjj:3000/'], + [uniq001Field, newUri]); + + // create Field mapping profiles for updating + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillMappingProfileForUpdatesMarc(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.markFieldForProtection(testData.protectedField); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.holdingsType); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + + // create action profiles for updating + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[2].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[2].matchProfile.profileName); + MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[1].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[1].matchProfile.profileName); + MatchProfiles.createMatchProfile(collectionOfMatchProfiles[0].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[0].matchProfile.profileName); + + // create job profile for updating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[1].matchProfile.profileName); + NewJobProfile.linkMatchAndTwoActionProfilesForSubMatches( + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, + collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name + ); + NewJobProfile.saveAndClose(); + JobProfiles.waitLoadingList(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.openInstanceInInventory('Updated'); + InventoryInstance.getAssignedHRID() + .then(hrId => { + instanceHrids.push(hrId); + }); + InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); + InstanceRecordView.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); + InventoryViewSource.close(); + InstanceRecordView.openHoldingView(); + HoldingsRecordView.checkPermanentLocation(LOCATION_NAMES.ONLINE_UI); + + // delete profiles + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); + }); collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); diff --git a/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js index b6e957fc73..7334c3f077 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js @@ -1,9 +1,9 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; @@ -26,44 +26,35 @@ describe('ui-data-import', () => { let instanceHrid; const quantityOfItems = '1'; const instanceTitle = 'Anglo-Saxon manuscripts in microfiche facsimile Volume 25 Corpus Christi College, Cambridge II, MSS 12, 144, 162, 178, 188, 198, 265, 285, 322, 326, 449 microform A. N. Doane (editor and director), Matthew T. Hussey (associate editor), Phillip Pulsiano (founding editor)'; - const nameMarcFile = `C356801autotestFile.${Helper.getRandomBarcode()}.mrc`; - // unique profile names - const instanceMappingProfileName = `C356801 instance mapping profile ${Helper.getRandomBarcode()}`; - const holdingsMappingProfileName = `C356801 holdings mapping profile ${Helper.getRandomBarcode()}`; - const itemMappingProfileName = `C356801 item mapping profile ${Helper.getRandomBarcode()}`; - const instanceActionProfileName = `C356801 instance action profile ${Helper.getRandomBarcode()}`; - const holdingsActionProfileName = `C356801 holdings action profile ${Helper.getRandomBarcode()}`; - const itemActionProfileName = `C356801 item action profile ${Helper.getRandomBarcode()}`; - const jobProfileName = `C356801 job profile ${Helper.getRandomBarcode()}`; - + const nameMarcFile = `C356801autotestFile.${getRandomPostfix}.mrc`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: instanceMappingProfileName }, + name: `C356801 instance mapping profile ${getRandomPostfix}` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: instanceActionProfileName } + name: `C356801 instance action profile ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: holdingsMappingProfileName, + name: `C356801 holdings mapping profile ${getRandomPostfix}`, pernanentLocation: `"${LOCATION_NAMES.ONLINE}"`, pernanentLocationUI: LOCATION_NAMES.ONLINE_UI }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: holdingsActionProfileName } + name: `C356801 holdings action profile ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: itemMappingProfileName, + name: `C356801 item mapping profile ${getRandomPostfix}`, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: itemActionProfileName } + name: `C356801 item action profile ${getRandomPostfix}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: jobProfileName + profileName: `C356801 job profile ${getRandomPostfix}` }; before('create test data', () => { @@ -80,7 +71,7 @@ describe('ui-data-import', () => { }); after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfileName); + JobProfiles.deleteJobProfile(jobProfile.profileName); collectionOfMappingAndActionProfiles.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); @@ -100,13 +91,13 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfileName); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.pernanentLocation); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileName); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); @@ -114,7 +105,7 @@ describe('ui-data-import', () => { NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfileName); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); // create action profiles collectionOfMappingAndActionProfiles.forEach(profile => { @@ -130,14 +121,14 @@ describe('ui-data-import', () => { NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); // upload a marc file for creating of the new instance, holding and item cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); DataImport.uploadFile('oneMarcBib.mrc', nameMarcFile); - JobProfiles.searchJobProfileForImport(jobProfileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(nameMarcFile); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); diff --git a/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js index cd48f194de..a423f65246 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js @@ -310,7 +310,6 @@ describe('ui-data-import', () => { ExportFile.uploadFile(nameForCSVFile); ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); ExportFile.downloadExportedMarcFile(exportedFileName); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); // edit marc file to add one record DataImport.editMarcFileAddNewRecords(exportedFileName, fileNameWithUpdatedContent, filePathWithUpdatedContent); @@ -362,11 +361,11 @@ describe('ui-data-import', () => { // create job profile for updating cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfProfilesForUpdate[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfProfilesForUpdate[0].actionProfile.name); NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[1].actionProfile.name); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfProfilesForUpdate[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfProfilesForUpdate[1].actionProfile.name, 2); NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[2].actionProfile.name, 3); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfProfilesForUpdate[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfProfilesForUpdate[2].actionProfile.name, 4); NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[3].actionProfile.name, 5); NewJobProfile.saveAndClose(); diff --git a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js index 40ae7e5568..13c0923510 100644 --- a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { LOAN_TYPE_NAMES, @@ -16,7 +17,6 @@ import { LOAN_TYPE_NAMES, import DateTools from '../../../support/utils/dateTools'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsJobProfiles from '../../../support/fragments/settings/dataImport/settingsJobProfiles'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import TopMenu from '../../../support/fragments/topMenu'; @@ -46,15 +46,15 @@ describe('ui-data-import', () => { const quantityOfItems = '1'; const instanceTitle = 'Anglo-Saxon manuscripts in microfiche facsimile Volume 25 Corpus Christi College, Cambridge II, MSS 12, 144, 162, 178, 188, 198, 265, 285, 322, 326, 449 microform A. N. Doane (editor and director), Matthew T. Hussey (associate editor), Phillip Pulsiano (founding editor)'; // file names - const nameMarcFileForImportCreate = `C356802autotestFile.${Helper.getRandomBarcode()}.mrc`; - const nameForCSVFile = `C356802autotestFile${Helper.getRandomBarcode()}.csv`; - const nameMarcFileForImportUpdate = `C356802autotestFile${Helper.getRandomBarcode()}.mrc`; - const jobProfileNameForExport = `C356802 job profile.${Helper.getRandomBarcode()}`; + const nameMarcFileForImportCreate = `C356802autotestFile.${getRandomPostfix}.mrc`; + const nameForCSVFile = `C356802autotestFile${getRandomPostfix}.csv`; + const nameMarcFileForImportUpdate = `C356802autotestFile${getRandomPostfix}.mrc`; + const jobProfileNameForExport = `C356802 job profile.${getRandomPostfix}`; // profiles for creating instance, holdings, item const marcBibMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create marcBib mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create marcBib mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC, mappingDetails: { name: 'holdings', @@ -79,7 +79,7 @@ describe('ui-data-import', () => { const instanceMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create instance mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create instance mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, } @@ -87,7 +87,7 @@ describe('ui-data-import', () => { const holdingsMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create holdings mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create holdings mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, mappingDetails: { name: 'holdings', @@ -102,7 +102,7 @@ describe('ui-data-import', () => { const itemMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create item mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create item mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.ITEM, mappingDetails: { name: 'item', @@ -127,7 +127,7 @@ describe('ui-data-import', () => { const marcBibActionProfileForCreate = { profile: { id: '', - name: `C356802 create marcBib action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create marcBib action profile ${getRandomPostfix}`, action: 'MODIFY', folioRecord: recordType }, @@ -143,7 +143,7 @@ describe('ui-data-import', () => { const instanceActionProfileForCreate = { profile: { id: '', - name: `C356802 create instance action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create instance action profile ${getRandomPostfix}`, action: 'CREATE', folioRecord: 'INSTANCE' }, @@ -160,7 +160,7 @@ describe('ui-data-import', () => { const holdingsActionProfileForCreate = { profile: { id: '', - name: `C356802 create holdings action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create holdings action profile ${getRandomPostfix}`, action: 'CREATE', folioRecord: 'HOLDINGS' }, @@ -177,7 +177,7 @@ describe('ui-data-import', () => { const itemActionProfileForCreate = { profile: { id: '', - name: `C356802 create item action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create item action profile ${getRandomPostfix}`, action: 'CREATE', folioRecord: 'ITEM' }, @@ -193,7 +193,7 @@ describe('ui-data-import', () => { }; const jobProfileForCreate = { profile: { - name: `C356802 create job profile ${Helper.getRandomBarcode()}`, + name: `C356802 create job profile ${getRandomPostfix}`, dataType: ACCEPTED_DATA_TYPE_NAMES.MARC }, addedRelations: [], @@ -212,7 +212,7 @@ describe('ui-data-import', () => { ]; // create Field mapping profile for export const exportMappingProfile = { - name: `C356802 mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 mapping profile ${getRandomPostfix}`, holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, holdingsMarcField: '901', subfieldForHoldings:'$h', @@ -224,33 +224,33 @@ describe('ui-data-import', () => { const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356802 update instance mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 update instance mapping profile ${getRandomPostfix}`, catalogedDate: '###TODAY###', catalogedDateUi: DateTools.getFormattedDate({ date: new Date() }), instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, statisticalCode: 'ARL (Collection stats): books - Book, print (books)', statisticalCodeUI: 'Book, print (books)' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356802 update instance action profile ${Helper.getRandomBarcode()}`, + name: `C356802 update instance action profile ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356802 update holdings mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 update holdings mapping profile ${getRandomPostfix}`, holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, permanentLocation: `"${LOCATION_NAMES.ONLINE}"`, permanentLocationUI: LOCATION_NAMES.ONLINE_UI, callNumberType: CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS, callNumber: '050$a " " 050$b', - relationship: 'Resource', + relationship: '"Resource"', uri: '856$u' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356802 update holdings action profile ${Helper.getRandomBarcode()}`, + name: `C356802 update holdings action profile ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356802 update item mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 update item mapping profile ${getRandomPostfix}`, materialType: MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE, noteType: '"Electronic bookplate"', note: '"Smith Family Foundation"', @@ -259,13 +259,13 @@ describe('ui-data-import', () => { permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356802 update item action profile ${Helper.getRandomBarcode()}`, + name: `C356802 update item action profile ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } ]; const collectionOfMatchProfiles = [ { - matchProfile: { profileName: `C356802 MARC-to-MARC 001 to 001 match profile ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C356802 MARC-to-MARC 001 to 001 match profile ${getRandomPostfix}`, incomingRecordFields: { field: '001' }, @@ -276,7 +276,7 @@ describe('ui-data-import', () => { existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } }, { - matchProfile: { profileName: `C356802 MARC-to-Holdings 901h to Holdings HRID match profile ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C356802 MARC-to-Holdings 901h to Holdings HRID match profile ${getRandomPostfix}`, incomingRecordFields: { field: '901', subfield: 'h' @@ -287,7 +287,7 @@ describe('ui-data-import', () => { }, { matchProfile: { - profileName: `C356802 MARC-to-Item 902i to Item HRID match profile ${Helper.getRandomBarcode()}`, + profileName: `C356802 MARC-to-Item 902i to Item HRID match profile ${getRandomPostfix}`, incomingRecordFields: { field: '902', subfield: 'i' @@ -300,7 +300,7 @@ describe('ui-data-import', () => { ]; const jobProfileForUpdate = { ...NewJobProfile.defaultJobProfile, - profileName: `C356802 update job profile ${Helper.getRandomBarcode()}`, + profileName: `C356802 update job profile ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -390,7 +390,6 @@ describe('ui-data-import', () => { ExportFile.uploadFile(nameForCSVFile); ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); ExportFile.downloadExportedMarcFile(nameMarcFileForImportUpdate); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); // create mapping profiles cy.visit(SettingsMenu.mappingProfilePath); @@ -442,9 +441,9 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfMappingAndActionProfiles[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfiles[1].actionProfile.name, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfMappingAndActionProfiles[2].actionProfile.name, 4); NewJobProfile.saveAndClose(); // upload the exported marc file diff --git a/cypress/e2e/data-import/log-details/instance-srs-have-status-created-with-job-profile-has-modify-after-instance-create.cy.js b/cypress/e2e/data-import/log-details/instance-srs-have-status-created-with-job-profile-has-modify-after-instance-create.cy.js new file mode 100644 index 0000000000..eb5ce6b065 --- /dev/null +++ b/cypress/e2e/data-import/log-details/instance-srs-have-status-created-with-job-profile-has-modify-after-instance-create.cy.js @@ -0,0 +1,107 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import { + FOLIO_RECORD_TYPE, + ACCEPTED_DATA_TYPE_NAMES +} from '../../../support/constants'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import Users from '../../../support/fragments/users/users'; + +describe('ui-data-import', () => { + let user; + const filePathForUpload = 'marcFileForC386867.mrc'; + const fileName = `C386867 autotestFileName${getRandomPostfix()}`; + const mappingProfile = { + name: `C386867 Modify MARC_BIB ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + modifications: { action: 'Add', + field: '900', + ind1: '', + ind2: '', + subfield: 'a', + data: `Added field.${getRandomPostfix()}` } + }; + const actionProfile = { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C386867 Modify MARC_BIB ${getRandomPostfix()}`, + action: 'Modify (MARC Bibliographic record type only)' }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C386867 Multiple status for instance ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); + + it('C386867 Verify that Instance and SRS MARC have status "Created" with job profile that has MARC modify after Instance create (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create Field mapping profile + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addFieldMappingsForMarc(); + NewFieldMappingProfile.fillModificationSectionWithAdd(mappingProfile.modifications); + NewFieldMappingProfile.addNewFieldInModificationSection(); + NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', '500', 1); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create Action profile and link it to Field mapping profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfileByName(actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.uploadFile(filePathForUpload, fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.openFileDetails(fileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); + FileDetails.checkInstanceQuantityInSummaryTable('1', 0); + FileDetails.checkSrsRecordQuantityInSummaryTable('0', 1); + FileDetails.checkInstanceQuantityInSummaryTable('0', 1); + }); +}); diff --git a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js index 30967fb84b..62a7431bc1 100644 --- a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js +++ b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js @@ -50,7 +50,7 @@ describe('ui-data-import', () => { permanentLocationUI: LOCATION_NAMES.ONLINE_UI, callNumberType: '852$t', callNumber: '852$h', - relationship: 'Resource', + relationship: '"Resource"', uri: '856$u', link: '856$y' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, diff --git a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js index 80cc489395..30ac9ec386 100644 --- a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js +++ b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js @@ -393,7 +393,6 @@ describe.skip('ui-data-import', () => { InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[0]); InventorySearchAndFilter.saveUUIDs(); ExportFile.downloadCSVFile(csvFileNameForFirstRecord, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); // download exported marc file cy.visit(TopMenu.dataExportPath); diff --git a/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js b/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js index b9f95697e6..c3e0fb7d53 100644 --- a/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js +++ b/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; @@ -9,12 +10,11 @@ import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Users from '../../../support/fragments/users/users'; -import Helper from '../../../support/fragments/finance/financeHelper'; describe('ui-data-import', () => { let user; let instanceHrid; - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix}`; before('create test data', () => { cy.getAdminToken() diff --git a/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js b/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js index f3d2ad72db..b54ff47eb8 100644 --- a/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js +++ b/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js @@ -1,12 +1,12 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import TopMenu from '../../../support/fragments/topMenu'; -import Helper from '../../../support/fragments/finance/financeHelper'; import DataImport from '../../../support/fragments/data_import/dataImport'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../../support/fragments/data_import/logs/logs'; -import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Users from '../../../support/fragments/users/users'; @@ -16,7 +16,7 @@ describe('ui-data-import', () => { let user; let instanceHrid; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const fileName = `C353641 autotestFile.${Helper.getRandomBarcode()}.mrc`; + const fileName = `C353641 autotestFile.${getRandomPostfix}.mrc`; before('create test data', () => { cy.createTempUser([ @@ -45,8 +45,14 @@ describe('ui-data-import', () => { JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileName); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - // get Instance HRID through API for delete instance - InventorySearchAndFilter.getInstanceHRID().then(hrId => { instanceHrid = hrId[0]; }); + Logs.openFileDetails(fileName); + // open Instance to get hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); + cy.go('back'); + Logs.verifyCheckboxForMarkingLogsAbsent(); Logs.actionsButtonClick(); Logs.verifyDeleteSelectedLogsButtonAbsent(); diff --git a/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js b/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js index b6d309839b..b1b3a83433 100644 --- a/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js +++ b/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; @@ -9,7 +10,6 @@ import { LOAN_TYPE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; @@ -21,36 +21,33 @@ import DataImport from '../../../support/fragments/data_import/dataImport'; import Logs from '../../../support/fragments/data_import/logs/logs'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; -import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; -import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; describe('ui-data-import', () => { let firstUser; let secondUser; - let instanceHrid; const quantityOfItems = '1'; - const nameMarcFile = `C356841autotestFile.${Helper.getRandomBarcode()}.mrc`; + const nameMarcFile = `C356841autotestFile.${getRandomPostfix()}.mrc`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356841 holdings mapping profile ${Helper.getRandomBarcode()}`, + name: `C356841 holdings mapping profile ${getRandomPostfix()}}`, pernanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356841 holdings action profile ${Helper.getRandomBarcode()}` } + name: `C356841 holdings action profile ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356841 item mapping profile ${Helper.getRandomBarcode()}`, + name: `C356841 item mapping profile ${getRandomPostfix()}`, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356841 item action profile ${Helper.getRandomBarcode()}` } + name: `C356841 item action profile ${getRandomPostfix()}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C356841 job profile ${Helper.getRandomBarcode()}` + profileName: `C356841 job profile ${getRandomPostfix()}}` }; before('create test data', () => { @@ -81,12 +78,6 @@ describe('ui-data-import', () => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); - }); }); it('C356841 Confirm a user with limited Data Import permissions can import a file (folijet)', @@ -157,11 +148,5 @@ describe('ui-data-import', () => { FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); }); FileDetails.checkItemQuantityInSummaryTable(quantityOfItems); - - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - }); }); }); diff --git a/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js b/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js index c3b88b520c..ae920cab56 100644 --- a/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js +++ b/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js @@ -1,7 +1,7 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -13,12 +13,12 @@ import ConfirmRemoval from '../../../support/fragments/data_import/action_profil describe('ui-data-import', () => { const mappingProfile = { - name: `C11115 autotest mapping profile ${Helper.getRandomBarcode()}`, + name: `C11115 autotest mapping profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { - name: `C11115 autotest action profile ${Helper.getRandomBarcode()}`, + name: `C11115 autotest action profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; diff --git a/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js index a25936dfcd..1aa657646c 100644 --- a/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js @@ -1,8 +1,8 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; -import permissions from '../../../support/dictionary/permissions'; import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -17,15 +17,15 @@ import ConfirmChanges from '../../../support/fragments/data_import/action_profil describe('ui-data-import', () => { let user; const mappingProfile = { - name: `C367994 autotest mapping profile ${Helper.getRandomBarcode()}`, + name: `C367994 autotest mapping profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C367994 autotest action profile ${Helper.getRandomBarcode()}` + name: `C367994 autotest action profile ${getRandomPostfix}` }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C367994 autotest job profile${Helper.getRandomBarcode()}`, + profileName: `C367994 autotest job profile${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; before('create user', () => { diff --git a/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js index 5d868ea9ed..5f14543a54 100644 --- a/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js @@ -1,8 +1,8 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE } from '../../../support/constants'; -import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import InteractorsTools from '../../../support/utils/interactorsTools'; @@ -14,7 +14,7 @@ describe('ui-data-import', () => { let user; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C2348 autotest action profile ${Helper.getRandomBarcode()}` + name: `C2348 autotest action profile ${getRandomPostfix}` }; before('create user', () => { diff --git a/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js index bc5fca802b..7644d62c9f 100644 --- a/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js @@ -1,8 +1,8 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE } from '../../../support/constants'; -import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -14,7 +14,7 @@ import Users from '../../../support/fragments/users/users'; describe('ui-data-import', () => { let user; const mappingProfile = { - name: `C2351 autotest mapping profile ${Helper.getRandomBarcode()}`, + name: `C2351 autotest mapping profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const instanceStatusTerm = '"Batch Loaded"'; diff --git a/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js index b88062d56d..be065f21b8 100644 --- a/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js @@ -1,7 +1,7 @@ +import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; -import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; @@ -14,7 +14,7 @@ import { EXISTING_RECORDS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { let user; const matchProfile = { - profileName: `C2339 autotest MatchProf${Helper.getRandomBarcode()}`, + profileName: `C2339 autotest MatchProf${getRandomPostfix}`, incomingRecordFields: { field: '001' }, diff --git a/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js b/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js index 2b107e236d..1084e55b2f 100644 --- a/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js +++ b/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js @@ -1,16 +1,16 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; -import Helper from '../../../support/fragments/finance/financeHelper'; import Users from '../../../support/fragments/users/users'; import FieldMappingProfileView from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfileView'; import SettingsMenu from '../../../support/fragments/settingsMenu'; describe('ui-data-import', () => { let user = null; - const mappingProfileName = `C343284 invoice mapping profile ${Helper.getRandomBarcode()}`; + const mappingProfileName = `C343284 invoice mapping profile ${getRandomPostfix}`; before('login', () => { cy.createTempUser([ diff --git a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js index db64fc4292..837bb139fd 100644 --- a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js +++ b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js @@ -160,7 +160,7 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndActionProfilesForInstance(actionProfile.name, matchProfile.profileName); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); diff --git a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js index c00cd91fc2..1221e18014 100644 --- a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js +++ b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js @@ -148,7 +148,7 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndActionProfilesForInstance(actionProfile.name, matchProfile.profileName); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); diff --git a/cypress/e2e/eholdings/eholdings-titles.cy.js b/cypress/e2e/eholdings/eholdings-titles.cy.js index 4451e08672..c4540e2467 100644 --- a/cypress/e2e/eholdings/eholdings-titles.cy.js +++ b/cypress/e2e/eholdings/eholdings-titles.cy.js @@ -17,6 +17,9 @@ import permissions from '../../support/dictionary/permissions'; import users from '../../support/fragments/users/users'; import devTeams from '../../support/dictionary/devTeams'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('eHoldings titles management', () => { let userId; diff --git a/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js b/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js index 940d599e92..fa49d8b8b1 100644 --- a/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js +++ b/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js @@ -43,6 +43,7 @@ describe('Overdue fine', () => { category: noticeCategory, subject: `${noticeName}_${getRandomPostfix()}`, body: '{{item.title}}', + previewText: 'The Wines of Italy', }; }; const noticeTemplates = { @@ -184,11 +185,13 @@ describe('Overdue fine', () => { }; NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.manualFeeFineCharge); + delete noticeTemplates.manualFeeFineCharge.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.manualFeeFineCharge, category: 'FeeFineCharge', }); NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.manualFeeFineAction); + delete noticeTemplates.manualFeeFineAction.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.manualFeeFineAction, category: 'FeeFineAction', diff --git a/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js b/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js index 42314665f0..729c6ed149 100644 --- a/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js +++ b/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js @@ -1,4 +1,5 @@ import uuid from 'uuid'; +import moment from 'moment'; import TestTypes from '../../support/dictionary/testTypes'; import devTeams from '../../support/dictionary/devTeams'; import permissions from '../../support/dictionary/permissions'; @@ -36,7 +37,6 @@ import LoanDetails from '../../support/fragments/users/userDefaultObjects/loanDe import NewFeeFine from '../../support/fragments/users/newFeeFine'; import { ITEM_STATUS_NAMES } from '../../support/constants'; - describe('Overdue fine', () => { let addedCirculationRule; const patronGroup = { @@ -62,6 +62,7 @@ describe('Overdue fine', () => { category: 'Automated fee/fine charge', subject: `Autotest_${getRandomPostfix()}_${noticeName}`, body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -322,16 +323,19 @@ describe('Overdue fine', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.returnedUponAt); + delete noticeTemplates.returnedUponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedUponAt, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterOnce); + delete noticeTemplates.returnedAfterOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterOnce, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterRecurring); + delete noticeTemplates.returnedAfterRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterRecurring, category: 'AutomatedFeeFineCharge', diff --git a/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js b/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js index 9d0908ca0f..e831d977fd 100644 --- a/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js +++ b/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js @@ -1,4 +1,5 @@ import uuid from 'uuid'; +import moment from 'moment'; import TestTypes from '../../support/dictionary/testTypes'; import devTeams from '../../support/dictionary/devTeams'; import permissions from '../../support/dictionary/permissions'; @@ -59,6 +60,7 @@ describe('Overdue fine', () => { category: 'Automated fee/fine charge', subject: `Autotest_${getRandomPostfix()}_${noticeName}`, body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -302,16 +304,19 @@ describe('Overdue fine', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.returnedUponAt); + delete noticeTemplates.returnedUponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedUponAt, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterOnce); + delete noticeTemplates.returnedAfterOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterOnce, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterRecurring); + delete noticeTemplates.returnedAfterRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterRecurring, category: 'AutomatedFeeFineCharge', diff --git a/cypress/e2e/finance/funds/filter-transer-from-in-fund.cy.js b/cypress/e2e/finance/funds/filter-transer-from-in-fund.cy.js new file mode 100644 index 0000000000..298f8451c4 --- /dev/null +++ b/cypress/e2e/finance/funds/filter-transer-from-in-fund.cy.js @@ -0,0 +1,95 @@ +import permissions from '../../../support/dictionary/permissions'; +import testType from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import FiscalYears from '../../../support/fragments/finance/fiscalYears/fiscalYears'; +import TopMenu from '../../../support/fragments/topMenu'; +import Ledgers from '../../../support/fragments/finance/ledgers/ledgers'; +import Users from '../../../support/fragments/users/users'; +import Funds from '../../../support/fragments/finance/funds/funds'; +import FinanceHelp from '../../../support/fragments/finance/financeHelper'; + +describe('ui-finance: Funds', () => { + const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const firstFund = { ...Funds.defaultUiFund }; + const secondFund = { + name: `autotest_fund2_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: `2${getRandomPostfix()}`, + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + const thirdFund = { + name: `autotest_fund3_${getRandomPostfix()}`, + code: `3${getRandomPostfix()}`, + externalAccountNo: `32${getRandomPostfix()}`, + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + + const allocatedQuantity = '1000'; + let user; + + before(() => { + cy.getAdminToken(); + // create first Fiscal Year and prepere 2 Funds for Rollover + FiscalYears.createViaApi(firstFiscalYear) + .then(firstFiscalYearResponse => { + firstFiscalYear.id = firstFiscalYearResponse.id; + defaultLedger.fiscalYearOneId = firstFiscalYear.id; + Ledgers.createViaApi(defaultLedger) + .then(ledgerResponse => { + defaultLedger.id = ledgerResponse.id; + firstFund.ledgerId = defaultLedger.id; + secondFund.ledgerId = defaultLedger.id; + + Funds.createViaApi(firstFund) + .then(fundResponse => { + firstFund.id = fundResponse.fund.id; + + cy.loginAsAdmin({ path:TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(firstFund.name); + Funds.selectFund(firstFund.name); + Funds.addBudget(allocatedQuantity); + }); + + Funds.createViaApi(secondFund) + .then(secondFundResponse => { + secondFund.id = secondFundResponse.fund.id; + }); + }); + }); + + cy.createTempUser([ + permissions.uiFinanceViewEditCreateFundAndBudget.gui, + permissions.uiFinanceViewLedger.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.fundPath, waiter: Funds.waitLoading }); + }); + }); + + after(() => { + cy.loginAsAdmin({ path:TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(firstFund.name); + Funds.selectFund(firstFund.name); + Funds.selectBudgetDetails(); + Funds.deleteBudgetViaActions(); + Funds.checkIsBudgetDeleted(); + + Funds.deleteFundViaApi(firstFund.id); + Funds.deleteFundViaApi(secondFund.id); + + Ledgers.deleteledgerViaApi(defaultLedger.id); + + FiscalYears.deleteFiscalYearViaApi(firstFiscalYear.id); + + Users.deleteViaApi(user.userId); + }); + + it('C380708 Filter in "Transfer from" and "Transfer to" fields works correctly when creating a new fund (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + Funds.cancelCreatingFundWithTransfers(thirdFund, defaultLedger.name, firstFund, secondFund); + }); +}); diff --git a/cypress/e2e/finance/groups/add-funds-to-group.cy.js b/cypress/e2e/finance/groups/add-funds-to-group.cy.js index d243fb9597..467e01d856 100644 --- a/cypress/e2e/finance/groups/add-funds-to-group.cy.js +++ b/cypress/e2e/finance/groups/add-funds-to-group.cy.js @@ -11,6 +11,8 @@ import FinanceHelp from '../../../support/fragments/finance/financeHelper'; import InteractorsTools from '../../../support/utils/interactorsTools'; import Groups from '../../../support/fragments/finance/groups/groups'; +Cypress.on('uncaught:exception', () => false); + describe('ui-finance: Groups', () => { const firstFund = { ...Funds.defaultUiFund }; const secondFund = { diff --git a/cypress/e2e/finance/transactions/moving-allocation.cy.js b/cypress/e2e/finance/transactions/moving-allocation.cy.js index 15bf2dc248..aa160ed905 100644 --- a/cypress/e2e/finance/transactions/moving-allocation.cy.js +++ b/cypress/e2e/finance/transactions/moving-allocation.cy.js @@ -9,6 +9,8 @@ import Users from '../../../support/fragments/users/users'; import Funds from '../../../support/fragments/finance/funds/funds'; import FinanceHelp from '../../../support/fragments/finance/financeHelper'; +Cypress.on('uncaught:exception', () => false); + describe('ui-finance: Transactions', () => { const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; const defaultLedger = { ...Ledgers.defaultUiLedger }; @@ -19,17 +21,14 @@ describe('ui-finance: Transactions', () => { externalAccountNo: getRandomPostfix(), fundStatus: 'Active', description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, - allocatedToIds: [{ - 0: firstFund.id, - }], + }; - const allocatedQuantity = '1000'; + const allocatedQuantity = '500'; let user; before(() => { cy.getAdminToken(); - // create first Fiscal Year and prepere 2 Funds for Rollover FiscalYears.createViaApi(firstFiscalYear) .then(firstFiscalYearResponse => { firstFiscalYear.id = firstFiscalYearResponse.id; @@ -53,6 +52,10 @@ describe('ui-finance: Transactions', () => { Funds.createViaApi(secondFund) .then(secondFundResponse => { secondFund.id = secondFundResponse.fund.id; + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.addTrunsferTo(firstFund.name); }); }); }); @@ -63,7 +66,7 @@ describe('ui-finance: Transactions', () => { ]) .then(userProperties => { user = userProperties; - cy.login(userProperties.username, userProperties.password, { path:TopMenu.ledgerPath, waiter: Ledgers.waitForLedgerDetailsLoading }); + cy.login(userProperties.username, userProperties.password, { path:TopMenu.fundPath, waiter: Funds.waitLoading }); }); }); @@ -89,6 +92,6 @@ describe('ui-finance: Transactions', () => { FinanceHelp.searchByName(firstFund.name); Funds.selectFund(firstFund.name); Funds.selectBudgetDetails(); - Funds.moveAllocationWithError(firstFund, secondFund, '100'); + Funds.moveAllocationWithError(secondFund, '100'); }); }); diff --git a/cypress/e2e/ideyalabs/agreements/agreements.cy.js b/cypress/e2e/ideyalabs/agreements/agreements.cy.js new file mode 100644 index 0000000000..260cf8466f --- /dev/null +++ b/cypress/e2e/ideyalabs/agreements/agreements.cy.js @@ -0,0 +1,43 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import agreementsDetails from '../../../support/fragments/agreements/agreementsDetails'; +import newAgreement from '../../../support/fragments/agreements/newAgreement'; +import eHoldingsPackages from '../../../support/fragments/eholdings/eHoldingsPackages'; +import topMenu from '../../../support/fragments/topMenu'; +import dateTools from '../../../support/utils/dateTools'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const defaultAgreement = { + name: `autotest_agreement_${getRandomPostfix()}`, + status: 'Active', + startDate: dateTools.getCurrentDate() +}; +describe('Agreement', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Delete test data', () => { + newAgreement.findAgreement(defaultAgreement); + newAgreement.deleteAgreement(); + newAgreement.searchAgreement(); + agreementsDetails.remove(); + }); + + it('C757 Create an Agreement (ERM)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.agreementsPath); + newAgreement.newButtonClick(); + newAgreement.fill(); + newAgreement.save(); + newAgreement.validateDateAndTime(); + }); + + it('C1295 Create a new Agreement and attach a package (spitfire)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsPackages.packageSearch(); + eHoldingsPackages.openPackage(); + newAgreement.newButton(); + newAgreement.fill(defaultAgreement); + newAgreement.save(); + newAgreement.agreementLine(); + }); +}); diff --git a/cypress/e2e/ideyalabs/circulationLog.cy.js b/cypress/e2e/ideyalabs/circulationLog.cy.js new file mode 100644 index 0000000000..8cc1c6265b --- /dev/null +++ b/cypress/e2e/ideyalabs/circulationLog.cy.js @@ -0,0 +1,63 @@ +import devTeams from '../../support/dictionary/devTeams'; +import testTypes from '../../support/dictionary/testTypes'; +import searchPane from '../../support/fragments/circulation-log/searchPane'; +import marcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import topMenu from '../../support/fragments/topMenu'; +import usersSearchPane from '../../support/fragments/users/usersSearchPane'; +import circulationlog from '../../support/ideyalabs/circulationlog'; + +const testData = { + itemA: '4502015', + barcode: '43505853', + accordion: 'notice', + checkboxOption: 'Send', + resultsPaneHeadings: { + userBarcode: 'User barcode', + itemBarcode: 'Item barcode', + object: 'Object', + circAction: 'Circ action', + date: 'Date', + servicePoint: 'Service point', + source: 'Source', + description: 'Description' + }, +}; + +describe('CirculationLog App', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C17092 Filter circulation log by (notice) send (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + cy.visit(topMenu.circulationLogPath); + searchPane.setFilterOptionFromAccordion( + testData.accordion, + testData.checkboxOption + ); + searchPane.verifyResult(testData.checkboxOption); + searchPane.resetFilters(); + searchPane.searchByItemBarcode(testData.barcode); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.userBarcode); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.itemBarcode); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.object); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.circAction); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.date); + marcAuthorities.checkColumnExists( + testData.resultsPaneHeadings.servicePoint + ); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.source); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.description); + searchPane.verifyResult(testData.checkboxOption); + }); + + it('C16999 Filter circulation log by Closed loan', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.usersPath); + usersSearchPane.searchByStatus('Active'); + circulationlog.clickOnStatus(); + cy.visit(topMenu.checkInPath); + circulationlog.checkIn(testData.itemA); + cy.visit(topMenu.circulationLogPath); + searchPane.searchByCheckedOut(); + searchPane.verifyClosedloanlist(); + }); +}); diff --git a/cypress/e2e/ideyalabs/custom-fields/create-text-field-custom-field.cy.js b/cypress/e2e/ideyalabs/custom-fields/create-text-field-custom-field.cy.js new file mode 100644 index 0000000000..22623deb69 --- /dev/null +++ b/cypress/e2e/ideyalabs/custom-fields/create-text-field-custom-field.cy.js @@ -0,0 +1,137 @@ +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import CustomFields from '../../../support/fragments/settings/users/customFields'; +import TopMenu from '../../../support/fragments/topMenu'; +import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; +import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; + +const textFieldData = { + fieldLabel: `Test${getFourDigitRandomNumber()}`, + helpText: `Testdata${getFourDigitRandomNumber()}`, +}; +const testAreaData = { + fieldLabel: `dataArea${getFourDigitRandomNumber()}`, + helpText: `fillData${getFourDigitRandomNumber()}`, +}; +const checkboxData = { + fieldLabel: `CheckBox${getFourDigitRandomNumber()}`, + helpText: `testdata${getFourDigitRandomNumber()}`, +}; +const radioButtonData = { + data: { + fieldLabel: `RadioButton${getFourDigitRandomNumber()}`, + helpText: `testData${getFourDigitRandomNumber()}`, + label1: `Radio1${getFourDigitRandomNumber()}`, + label2: `Radio2${getFourDigitRandomNumber()}`, + }, +}; +const label2 = `select${getFourDigitRandomNumber()}`; +const singleSelectData = { + data: { + fieldLabel: `Single Select Dropdown${getFourDigitRandomNumber()}`, + helpText: 'select One Data', + label1: `Select${getFourDigitRandomNumber()}`, + label2, + }, +}; + +describe('Settings', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Delete test data', () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.editButton(); + CustomFields.deleteCustomField(`${textFieldData.fieldLabel} · Text field`); + CustomFields.deleteCustomField(`${testAreaData.fieldLabel} · Text area`); + CustomFields.deleteCustomField(`${checkboxData.fieldLabel} · Checkbox`); + CustomFields.deleteCustomField(`${radioButtonData.data.fieldLabel} · Radio button set`); + CustomFields.deleteCustomField(`${singleSelectData.data.fieldLabel} · Single select`); + CustomFields.confirmDeletion(); + CustomFields.verifyDeletedCustomFields(`${textFieldData.fieldLabel} · Text field`); + CustomFields.verifyDeletedCustomFields(`${testAreaData.fieldLabel} · Text area`); + CustomFields.verifyDeletedCustomFields(`${checkboxData.fieldLabel} · Checkbox`); + CustomFields.verifyDeletedCustomFields(`${radioButtonData.data.fieldLabel} · Radio button set`); + CustomFields.verifyDeletedCustomFields(`${singleSelectData.data.fieldLabel} · Single select`); + }); + + it( + 'C15693 Create a text field custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomTextField(textFieldData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyTextField(textFieldData.fieldLabel); + } + ); + + it( + 'C15694 Create a text area custom field and add help text (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomTextArea(testAreaData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyTextArea(testAreaData.fieldLabel); + } + ); + + it( + 'C15695 Create a checkbox custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomCheckBox(checkboxData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyCheckBox(checkboxData.fieldLabel); + } + ); + + it( + 'C15696 Create a radio button custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomRadioButton(radioButtonData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyRadioButton(radioButtonData.data.fieldLabel); + } + ); + + it( + 'C15697 Create a single select custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomSingleSelect(singleSelectData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifySingleSelect(singleSelectData.data.fieldLabel, label2); + } + ); + + it( + 'C15701 Change custom fields order (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.editButton(); + UsersSearchPane.dragAndDropCustomFields(); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyDragItem(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/eHoldingsExports.cy.js b/cypress/e2e/ideyalabs/eHoldingsExports.cy.js new file mode 100644 index 0000000000..663e8f78fe --- /dev/null +++ b/cypress/e2e/ideyalabs/eHoldingsExports.cy.js @@ -0,0 +1,114 @@ +import exportJobs from '../../support/fragments/ideyalabs/exportJobs'; +import testTypes from '../../support/dictionary/testTypes'; +import eHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; +import eHoldingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import eHoldingsSearch from '../../support/fragments/eholdings/eHoldingsSearch'; +import invoices from '../../support/fragments/invoices/invoices'; +import loansPage from '../../support/fragments/loans/loansPage'; +import topMenu from '../../support/fragments/topMenu'; +import fileManager from '../../support/utils/fileManager'; + +const testData = { + batchGroup: 'FOLIO', + packageOptions: 'Holdings status', + selectionStatus: 'Selected', + searchOption: 'BRITISH MEDICAL JOURNAL', + fileNameMask: '*package*', + data: { + packageName: 'VLeBooks', + title: 'ebook', + }, + packageFields: { + packageOne: 'Holdings status', + packageTwo: 'Agreements', + }, + titleFields: { + titleOne: 'Agreements', + titleTwo: 'Access status type', + }, +}; + +describe('Eholdings - exports', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C356417 Export of selected ""Package"" without titles. User chooses ""Package"" fields to export. (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsPackagesSearch.byName(testData.searchOption); + eHoldingsPackagesSearch.bySelectionStatus(testData.selectionStatus); + eHoldingsPackages.openPackage(); + exportJobs.exportsPackageCSVClick(); + exportJobs.packageFieldsToExportRadio(); + exportJobs.packageFieldsToExportDropdown(testData.packageOptions); + exportJobs.titleFieldsToExportRadio(); + exportJobs.clickExportButton(); + exportJobs.verifyJobIDRecord(); + fileManager.verifyFile( + loansPage.verifyFileName, + testData.fileNameMask, + loansPage.verifyContentOfExportFileName, + ['Package Holdings Status', 'Selected'] + ); + } + ); + + it( + 'C367972 Export button must be disabled when user tries to export Package record with more than 10k of Title records (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsPackagesSearch.byName(testData.data.packageName); + eHoldingsPackages.openPackage(); + exportJobs.exportsPackageCSVClick(); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageOne + ); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageTwo + ); + exportJobs.allPackageFieldsToExportRadioButton(); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleOne); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleTwo); + exportJobs.allTitleFieldsToExportRadioButton(); + exportJobs.clickCancelButton(); + exportJobs.filterTitles(testData.data.title); + exportJobs.exportsPackageCSVClick(); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageOne + ); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageTwo + ); + exportJobs.allPackageFieldsToExportRadioButton(); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleOne); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleTwo); + exportJobs.allTitleFieldsToExportRadioButton(); + exportJobs.clickExportButton(); + exportJobs.verifyJobIDRecord(); + fileManager.verifyFile( + loansPage.verifyFileName, + testData.fileNameMask, + loansPage.verifyContentOfExportFileName, + ['Package Holdings Status', 'Selected'] + ); + } + ); + + it( + 'C353217 Download batch export files from full screen view with Voucher export permission (FTP/JSON) - upload to server (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.invoicesPath); + invoices.selectFolio(); + invoices.voucherExportManualExport(testData.batchGroup); + invoices.verifyDownloadButtonAndClick(); + // In Voucher Export screen, when performing Run Manual Export Voucher, Export record status = 'Error' due to that download button is not visible. + } + ); +}); diff --git a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js new file mode 100644 index 0000000000..418646a72f --- /dev/null +++ b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js @@ -0,0 +1,234 @@ +import devTeams from '../../../support/dictionary/devTeams'; +import testTypes from '../../../support/dictionary/testTypes'; +import circulationRules from '../../../support/fragments/circulation/circulation-rules'; +import eHoldingsNewCustomPackage from '../../../support/fragments/eholdings/eHoldingsNewCustomPackage'; +import eHoldingsPackages from '../../../support/fragments/eholdings/eHoldingsPackages'; +import eHoldingsPackagesSearch from '../../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import eHoldingsProviderEdit from '../../../support/fragments/eholdings/eHoldingsProviderEdit'; +import eHoldingsProviders from '../../../support/fragments/eholdings/eHoldingsProviders'; +import eHoldingsProvidersSearch from '../../../support/fragments/eholdings/eHoldingsProvidersSearch'; +import eHoldingsSearch from '../../../support/fragments/eholdings/eHoldingsSearch'; +import organizations from '../../../support/fragments/organizations/organizations'; +import newRequest from '../../../support/fragments/requests/newRequest'; +import settingsMenu from '../../../support/fragments/settingsMenu'; +import topMenu from '../../../support/fragments/topMenu'; +import eHolding from './eHolding'; + +describe('Create a custom package', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(topMenu.eholdingsPath); + }); + after('Deleting created Package', () => { + eHolding.deletePackage(); + }); + it( + 'C683 Search packages for [JSTOR]. Filter results to only show selected packages (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + eHolding.switchToPackage(); + eHolding.verifyPackage(); + } + ); + it( + 'C692 Create a custom package', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHolding.createAndVerify(); + } + ); + it( + 'C695 Package Record: Search all titles included in a package (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + eHolding.switchToPackageAndSearch(); + eHoldingsPackages.openPackage(); + eHoldingsProviders.titlesSearch(); + eHoldingsProviders.clickSearchTitles(); + eHoldingsProviders.subjectsAssertion(); + } + ); + it( + 'C17090 Title Record - Packages accordion - Filter packages list (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToTitles(); + eHoldingsProvidersSearch.byProvider('Journal of Fish Biology'); + eHoldingsProviders.viewPackage(); + eHolding.searchButton(); + eHolding.dropdownValuesSelect([ + 'Agricultural & Environmental Science Database (DRAA)', + 'Biological Sciences Database (DRAA)', + ]); + eHolding.searchActions(); + eHolding.verifyFilterPackages(); + } + ); + it( + 'C157916 Title - Packages accordion - Filter by Holding Status (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToTitles(); + eHoldingsProvidersSearch.byProvider('Journal of Fish Biology'); + eHoldingsProviders.viewPackage(); + eHolding.searchButton(); + eHolding.bySelectionStatusSection('Selected'); + } + ); + it( + 'C360543 Check the content of ""Title information"" accordion in ""Title"" detail record (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit( + 'https://bugfest-orchid.int.aws.folio.org/eholdings/titles/41327?searchType=titles&q=journal&offset=1' + ); + eHolding.verifyAlternativesTitles(); + } + ); + it( + 'C367967 Verify that ""Packages"" accordion will return records after collapsing/expanding in ""Provider"" detail record (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsProvidersSearch.byProvider('Wiley'); + eHoldingsProviders.viewProvider(); + eHolding.packageAccordionClick(); + eHolding.verifyPackageButtonClick('Collapse all', 'false'); + eHolding.packageAccordionClick(); + eHolding.verifyPackageButtonClick('Expand all', 'true'); + } + ); + it( + 'C703 Set [Show titles in package to patrons] to Hide (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Edinburgh Scholarship Online'); + eHoldingsPackagesSearch.bySelectionStatus('Selected'); + eHoldingsProviders.viewPackage(); + eHolding.editActions(); + eHolding.patronRadioButton(); + eHoldingsProviderEdit.saveAndClose(); + eHolding.verifyAlternativeRadio(); + } + ); + it( + 'C3464 Update Package Proxy (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Edinburgh Scholarship Online'); + eHoldingsProviders.viewPackage(); + eHoldingsPackages.updateProxy(); + eHolding.verifyProxy(); + } + ); + it( + 'C648 Closed Library Due Date (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToTitles(); + eHoldingsProvidersSearch.byProvider('Fashion'); + eHoldingsProvidersSearch.verifyTitleSearch(); + } + ); + it( + 'C350418 Check that user can create ""Recall"" Item level request (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.requestsPath); + newRequest.openNewRequestPane(); + newRequest.enterItemInfo('1234567890'); + newRequest.verifyRequestInformation(); + newRequest.enterRequesterInfo({ + requesterBarcode: '000000098538', + pickupServicePoint: 'API', + }); + newRequest.enterRequestAndPatron('Testing'); + newRequest.saveRequestAndClose(); + } + ); + it( + 'C3466 Edit/Add a token to the Gale Academic OneFile (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Gale Academic OneFile'); + eHoldingsPackagesSearch.bySelectionStatus('Selected'); + eHoldingsProviders.viewPackage(); + eHolding.editActions(); + eHolding.providerToken(); + eHolding.checkToken(); + } + ); + it( + 'C694 Search providers for [Gale | Cengage]. Then Search list of packages on Provider detail record for all selected packages (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + eHolding.switchToPackages(); + eHoldingsPackages.openPackage(); + eHolding.packageButton(); + eHolding.bySelectionStatusOpen('Selected'); + } + ); + it( + 'C654 Test behavior for incomplete vs complete circulation rules (i.e., all policy types must be present; else error (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.settingsPath); + cy.visit(settingsMenu.circulationRulesPath); + circulationRules.fillInPolicy({ + priorityType: 'g ', + loanPolicyName: 'irina-loan-policy', + overdueFinePolicyName: 'no-overdue-fine', + lostItemFeePolicyName: 'lostsetfines', + requestPolicyName: 'allow-all', + noticePolicyName: 'julies-check-out-policy', + priorityTypeName: 'ip', + }); + circulationRules.saveCirculationRules(); + circulationRules.verifyToast(); + } + ); + it( + 'C656 Ensure interface alerts user of syntax errors in rules (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + circulationRules.policyError({ + priorityType: 'g ', + priorityTypeName: 'ip', + loanPolicyName: 'irina-loan-policy', + }); + circulationRules.saveCirculationRules(); + circulationRules.verifyError(); + } + ); + it( + 'C699 Add or edit package custom coverage (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHolding.switchToPackage(); + eHoldingsPackages.openPackage(); + organizations.editOrganization(); + eHolding.generateRandomDates(); + eHolding.verifyAlternativeDates(); + } + ); + it( + 'C343241 Access eholdings app menu (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsNewCustomPackage.clickOneHoldingCarat(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/eholdings/eHolding.js b/cypress/e2e/ideyalabs/eholdings/eHolding.js new file mode 100644 index 0000000000..5ea99c3ca9 --- /dev/null +++ b/cypress/e2e/ideyalabs/eholdings/eHolding.js @@ -0,0 +1,293 @@ +import { + Accordion, + Button, + FieldSet, + KeyValue, + Modal, + MultiSelect, + NavListItem, + PaneContent, + RadioButton, + Section, + Select, + Spinner, + TextArea, + TextField, +} from '../../../interactors'; +import eHoldingsNewCustomPackage from '../../support/fragments/eholdings/eHoldingsNewCustomPackage'; +import eHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; +import eholdingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import eHoldingsProvidersSearch from '../../support/fragments/eholdings/eHoldingsProvidersSearch'; +import eHoldingsSearch from '../../support/fragments/eholdings/eHoldingsSearch'; +import topMenu from '../../support/fragments/topMenu'; +import dateTools from '../../support/utils/dateTools'; +import getRandomPostfix, { + randomFourDigitNumber, + randomTwoDigitNumber, +} from '../../support/utils/stringTools'; + +const editButton = Button('Edit'); +const actionsButton = Button('Actions'); +const searchButton = Button('Search'); +const description = TextArea({ name: 'description' }); +const SaveAndClose = Button('Save & close'); +const availableProxies = ['Inherited - None', 'FOLIO-Bugfest', 'EZProxy']; +const SearchButton = Section({ id: 'providerShowProviderList' }).find( + Button({ ariaLabel: 'Toggle filters pane' }) +); +const iconSearch = Button({ icon: 'search' }); +const proxySelect = Select({ id: 'eholdings-proxy-id' }); +const selectionStatusAccordion = Accordion({ + id: 'accordion-toggle-button-filter-packages-selected', +}); +const selectionStatusSection = Section({ id: 'filter-packages-selected' }); +const accordionClick = Button({ + id: 'accordion-toggle-button-providerShowProviderList', +}); +const patronRadioButton = FieldSet('Show titles in package to patrons').find( + RadioButton({ checked: false }) +); +const tagsClick = Button({ id: 'accordion-toggle-button-providerShowTags' }); +const providerClick = Button({ + id: 'accordion-toggle-button-providerShowProviderSettings', +}); +const notesClick = Button({ id: 'accordion-toggle-button-providerShowNotes' }); +const packagesClick = Button({ + id: 'accordion-toggle-button-providerShowProviderInformation', +}); +const packageName = `package_${getRandomPostfix()}`; +const deletePackage = Button('Delete package'); +const confirmModal = Modal('Delete custom package'); + +export default { + packageAccordionClick() { + cy.expect(accordionClick.exists()); + cy.do([accordionClick.click(), accordionClick.click()]); + cy.expect(Spinner().absent()); + }, + verifyPackageButtonClick(name, open) { + cy.expect(Button(name).exists()); + cy.do(Button(name).click()); + cy.expect([ + accordionClick.has({ ariaExpanded: open }), + tagsClick.has({ ariaExpanded: open }), + providerClick.has({ ariaExpanded: open }), + notesClick.has({ ariaExpanded: open }), + packagesClick.has({ ariaExpanded: open }), + ]); + }, + + createAndVerify: () => { + cy.do(Button('New').click()); + eHoldingsNewCustomPackage.fillInRequiredProperties(packageName); + eHoldingsNewCustomPackage.saveAndClose(); + cy.expect(PaneContent({ id: `${packageName}-content` }).exists()); + return packageName; + }, + + deletePackage: () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider(packageName); + eHoldingsPackages.openPackage(); + cy.do(actionsButton.click()); + cy.do(deletePackage.click()); + cy.do(confirmModal.find(Button('Yes, delete')).click()); + }, + + switchToPackage() { + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('JSTOR'); + eholdingsPackagesSearch.bySelectionStatus('Selected'); + }, + + verifyPackage() { + cy.expect(PaneContent({ id: 'search-results-content' }).exists()); + }, + + switchToPackages() { + cy.visit(topMenu.eholdingsPath); + eHoldingsProvidersSearch.byProvider('Gale Cengage'); + }, + + switchToPackageAndSearch() { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Wiley Online Library'); + eholdingsPackagesSearch.bySelectionStatus('Selected'); + }, + + editActions: () => { + cy.expect(Spinner().absent()); + cy.do(actionsButton.click()); + cy.expect(editButton.exists()); + cy.do(editButton.click()); + }, + + getAlternateTitles: () => cy.then(() => KeyValue('Alternate title(s)').value()), + + verifyAlternativesTitles() { + this.getAlternateTitles().then((val) => { + expect(val).to.include(';'); + }); + }, + + searchActions() { + cy.expect(searchButton.exists()); + cy.do(searchButton.click()); + }, + + verifyFilterPackages() { + cy.expect(Section({ id: 'titleShowPackages' }).exists()); + }, + + patronRadioButton: () => { + cy.expect(patronRadioButton.exists()); + cy.do(patronRadioButton.click()); + }, + + changeProxy: () => { + cy.get('select#eholdings-proxy-id option:selected') + .invoke('text') + .then((text) => { + const options = availableProxies.filter((option) => option !== text); + cy.do(proxySelect.choose(options[randomTwoDigitNumber()])); + }); + }, + + dropdownValuesSelect(names) { + cy.expect(MultiSelect().exists()); + cy.do(MultiSelect().select(names)); + }, + + bySelectionStatus(selectionStatus) { + cy.expect(selectionStatusAccordion.exists()); + cy.do(selectionStatusAccordion.clickHeader()); + cy.do(selectionStatusAccordion.find(RadioButton(selectionStatus)).click()); + cy.do(Button('Search').click()); + }, + + bySelectionStatusSection(selectionStatus) { + cy.expect(selectionStatusSection.exists()); + cy.do(selectionStatusSection.find(RadioButton(selectionStatus)).click()); + }, + + bySelectionStatusOpen(selectionStatus) { + cy.do(selectionStatusSection.find(Button('Selection status')).click()); + cy.do(selectionStatusSection.find(RadioButton(selectionStatus)).click()); + cy.do(Button('Search').click()); + }, + + editSchedule({ data }) { + cy.do([ + NavListItem(data.name).click(), + Button('Actions').click(), + Button('Edit').click(), + description.fillIn(data.description), + SaveAndClose.click(), + ]); + }, + + packageSearch() { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('VLeBooks'); + eholdingsPackagesSearch.bySelectionStatus('Selected'); + }, + + packageButton: () => { + cy.expect(SearchButton.exists()); + cy.do(SearchButton.click()); + }, + + searchButton() { + cy.expect(iconSearch.exists()); + cy.do(iconSearch.click()); + }, + + modelSearch() { + cy.do(Modal({ id: 'package-filter-modal' }).find(Button('Search').click())); + }, + + providerToken() { + cy.do( + TextArea({ name: 'providerTokenValue' }).fillIn( + `Test${randomFourDigitNumber()}` + ) + ); + cy.expect(SaveAndClose.exists()); + cy.do(SaveAndClose.click()); + }, + + getProxyValue: () => cy.then(() => KeyValue('Proxy').value()), + + verifyProxy() { + this.getProxyValue().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + + getToken: () => cy.then(() => KeyValue('Provider token').value()), + + checkToken() { + this.getToken().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + + getAlternateRadio: () => cy.then(() => KeyValue('Show titles in package to patrons').value()), + + verifyAlternativeRadio() { + this.getAlternateRadio().then((val) => { + const radioArray = ['Yes', 'No']; + const newRadioArray = radioArray.filter((x) => !x.includes(val)); + expect(val).to.not.equal(newRadioArray[0]); + }); + }, + + getDatesValue: () => cy.then(() => KeyValue('Custom coverage dates').value()), + + verifyAlternativeDates() { + this.getDatesValue().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + + formatDate(dateString) { + const date = new Date(dateString); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are zero-based, so we add 1 + const day = date.getDate().toString().padStart(2, '0'); + const year = date.getFullYear(); + return `${month}/${day}/${year}`; + }, + + generateRandomDates() { + const startDate = new Date(dateTools.editFromDateRange()); // Use your desired start date + const endDate = new Date(dateTools.editEndDateRange()); // Use your desired end date + let fromDate = this.getRandomDate(startDate, endDate); + let toDate = this.getRandomDate(startDate, endDate); + // Keep generating new dates until the "to" date is greater than the "from" date + while (toDate <= fromDate) { + fromDate = this.getRandomDate(startDate, endDate); + toDate = this.getRandomDate(startDate, endDate); + } + const reqFromDate = this.formatDate(fromDate); + const reqToDate = this.formatDate(endDate); + // Start the fill in process in dates + cy.do([ + TextField({ id: 'begin-coverage-0' }).fillIn(reqFromDate), + TextField({ id: 'end-coverage-0' }).fillIn(reqToDate), + SaveAndClose.click(), + ]); + }, + + getRandomDate(startDate, endDate) { + const start = startDate.getTime(); + const end = endDate.getTime(); + const randomTime = start + Math.random() * (end - start); + return new Date(randomTime); + }, +}; diff --git a/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js new file mode 100644 index 0000000000..ba7ae891ab --- /dev/null +++ b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js @@ -0,0 +1,55 @@ +import exportJobs from '../../../../../support/ideyalabs/exportJobs'; +import testTypes from '../../../../../support/dictionary/testTypes'; +import exportManagerSearchPane from '../../../../../support/fragments/exportManager/exportManagerSearchPane'; +import topMenu from '../../../../../support/fragments/topMenu'; + +const testData = { + integrationMethod: 'Integration name', + sucessStatus: 'Successful', + failedStatus: 'Failed', + exportMethod: 'Integration name', + fileName: 'AAA_Integration name_2023-06-20_14_36_04.edi', + jobFileName: 'AAA_Integration name_2023-06-20_14:36:04.edi', +}; + +describe('Export Manager', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C358971 Already exported order is not included repeatedly in next exports(thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.exportManagerOrganizationsPath); + exportManagerSearchPane.selectExportMethod(testData.integrationMethod); + exportManagerSearchPane.searchBySuccessful(); + exportManagerSearchPane.verifyResult(testData.sucessStatus); + exportManagerSearchPane.verifyResultAndClick(testData.sucessStatus); + cy.exec('java -jar sikuli_ide.jar -r ftp.sikuli'); + // Used sikuli to open the exported .edi file with ""Notepad"" + // Based on the Testcase we need to change the PNG in the sikuli folder as it changes from the system to system + exportManagerSearchPane.rerunJob(); + cy.reload(); + exportManagerSearchPane.verifyResult(testData.failedStatus); + } + ); + + it( + 'C365123 Downloading the exact .edi file that was exported for a given export job with Successful status(thunderjet)', + { tags: [testTypes.extendedPath] }, + () => { + cy.visit(topMenu.exportManagerOrganizationsPath); + exportManagerSearchPane.selectExportMethod(testData.exportMethod); + exportManagerSearchPane.searchBySuccessful(); + exportManagerSearchPane.selectSearchResultItem(); + exportJobs.verifyFileName(testData.jobFileName); + exportManagerSearchPane.verifyResultAndClick(testData.sucessStatus); + exportManagerSearchPane.downloadJob(); + cy.verifyDownload(testData.fileName); + cy.exec('java -jar sikuli_ide.jar -r ss.sikuli'); + // Used sikuli to Navigate to local directory for downloaded files and open downloaded file with ""Notepad"" + // Based on the Testcase we need to change the PNG in the sikuli folder as it changes from the system to system + } + ); +}); diff --git a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js new file mode 100644 index 0000000000..4bf2eaaa76 --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js @@ -0,0 +1,93 @@ +import financeHelper from '../../../support/fragments/finance/financeHelper'; +import fiscalYears from '../../../support/fragments/finance/fiscalYears/fiscalYears'; +import funds from '../../../support/fragments/finance/funds/funds'; +import groups from '../../../support/fragments/finance/groups/groups'; +import ledgers from '../../../support/fragments/finance/ledgers/ledgers'; +import topMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; + +const testData = { + fiscalName: 'Fiscal Year 2024', + selectName: 'Fiscal Year 2024', + ledgerName: 'Future', + fiscalYearQuantity1: '300.00', + fiscalYearQuantity2: '300.00', + selectLedgerName: 'Future', + groupsName: 'Test N5', + selectGroupName: 'Test N5', + fundName: 'AA1', + selectFundName: 'AA1', + searchByInvoiceName: '12344', + selectSearchByInvoiceNameRecord: '12344', + selectInvoiceLineNumber: '12320886456-1', + searchByFinanceName: 'Ledger NIX 1', + selectsearchByFinanceNameRecord: 'Ledger NIX 1', + fillRolloverFiscalYearINFo: 'NIX2024', + ledgername2: 'Ledger NIX 1', + selectLedgerName2: 'Ledger NIX 1', + searchByParameterFiscalYear: 'Name', + searchByNameFiscalYesar: 'AA2023', + selectFirstFiscalRecord: 'AA2023', + searchByParameterFiscalYear2: 'Name', + searchByNameFiscalYear2: 'AA2024', + selectSecondFiscalRecord: 'AA2024', + searchByInvoiceName2: '12344', + selectSearchByInvoiceNameRecord2: '12344', + selectFundIDFromthelist: 'Fund A(A)', + selectCurrentBudgerFromthelist: 'A-FYA2023', + selectTransactionListDetailsResultsFromCurrentBudget: '3/6/2023, 7:48 AM', + selectviewDetailsPreviousBudgets: 'BFYRO-FYRO2021', + searchFundName: 'AF2', + selectFundNameRecordList: 'AF2', + selectCurrentBudgerFromthelistFunds: 'AF2-AF2024', + selectTransactionListDetailsResultsFromEmbaranceDate: '6/20/2023, 5:39 AM', + viewDetailsPreviousBudgetsRecord: 'AF2-AF2021', + fundFinancialQuantity1: '1,000.00', + fundFinancialQuantity2: '974.00', + groupFinancialQuantity1: '2,000.00', + groupFinancialQuantity2: '2,000.00', + ledgerFinancialQuantity1: '0.00', + ledgerFinancialQuantity2: '0.00', +}; + +describe('Finance: Funds', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C377030 "Available balance" is displayed as a negative number when running a deficit(Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.financePath); + fiscalYears.clickOnFiscalYear(); + financeHelper.searchByName(testData.fiscalName); + financeHelper.selectFirstFinance(testData.selectName); + ledgers.checkFinancialSummeryQuality( + testData.fiscalYearQuantity1, + testData.fiscalYearQuantity2 + ); + ledgers.closeOpenedPage(); + fiscalYears.clickOnLedgerTab(); + financeHelper.searchByName(testData.ledgerName); + ledgers.selectLedger(testData.selectLedgerName); + ledgers.checkFinancialSummeryQuality( + testData.ledgerFinancialQuantity1, + testData.ledgerFinancialQuantity2 + ); + ledgers.closeOpenedPage(); + groups.clickOnGroupTab(); + groups.searchByName(testData.groupsName); + groups.selectGroup(testData.selectGroupName); + ledgers.checkFinancialSummeryQuality( + testData.groupFinancialQuantity1, + testData.groupFinancialQuantity2 + ); + ledgers.closeOpenedPage(); + funds.clickOnFundsTab(); + funds.searchByName(testData.fundName); + funds.selectFund(testData.selectFundName); + funds.selectBudgetDetails(); + funds.checkBudgetQuantity1( + testData.fundFinancialQuantity1, + testData.fundFinancialQuantity2 + ); + }); +}); diff --git a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js new file mode 100644 index 0000000000..f0ed0f6af2 --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js @@ -0,0 +1,115 @@ +import financeHelper from '../../../../support/fragments/finance/financeHelper'; +import ledgers from '../../../../support/fragments/finance/ledgers/ledgers'; +import invoices from '../../../../support/fragments/invoices/invoices'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; + +const testData = { + fiscalName: 'Fiscal Year 2024', + selectName: 'Fiscal Year 2024', + ledgerName: 'Future', + fiscalYearQuantity1: '300.00', + fiscalYearQuantity2: '300.00', + selectLedgerName: 'Future', + groupsName: 'Test N5', + selectGroupName: 'Test N5', + fundName: 'AA1', + selectFundName: 'AA1', + searchByInvoiceName: '12344', + selectSearchByInvoiceNameRecord: '12344', + selectInvoiceLineNumber: '12320886456-1', + searchByFinanceName: 'Ledger NIX 1', + selectsearchByFinanceNameRecord: 'Ledger NIX 1', + fillRolloverFiscalYearINFo: 'NIX2024', + ledgername2: 'Ledger NIX 1', + selectLedgerName2: 'Ledger NIX 1', + searchByParameterFiscalYear: 'Name', + searchByNameFiscalYesar: 'AA2023', + selectFirstFiscalRecord: 'AA2023', + searchByParameterFiscalYear2: 'Name', + searchByNameFiscalYear2: 'AA2024', + selectSecondFiscalRecord: 'AA2024', + searchByInvoiceName2: '12344', + selectSearchByInvoiceNameRecord2: '12344', + selectFundIDFromthelist: 'Fund A(A)', + selectCurrentBudgerFromthelist: 'A-FYA2023', + selectTransactionListDetailsResultsFromCurrentBudget: '3/6/2023, 7:48 AM', + selectviewDetailsPreviousBudgets: 'BFYRO-FYRO2021', + searchFundName: 'AF2', + selectFundNameRecordList: 'AF2', + selectCurrentBudgerFromthelistFunds: 'AF2-AF2024', + selectTransactionListDetailsResultsFromEmbaranceDate: '6/20/2023, 5:39 AM', + viewDetailsPreviousBudgetsRecord: 'AF2-AF2021', + fundFinancialQuantity1: '1,000.00', + fundFinancialQuantity2: '974.00', + groupFinancialQuantity1: '2,000.00', + groupFinancialQuantity2: '2,000.00', + ledgerFinancialQuantity1: '0.00', + ledgerFinancialQuantity2: '0.00', +}; +const rollOverData = { + ledgerName: 'AE2', + selectLedger: 'AE2', + fiscalYearDate: 'AE2025', + rollOverDate: '7/21/2023', + searchByParameter: 'Name', + searchByName: 'AE2', + selectFundRecord: 'AE2', + searchledger: 'Test N8', + selectLedgerName: 'Test N8', + fillInRolloverInfo: 'FYG2222', + currentBudeget: 'Test N11-FYG2024', + plannedBudget: 'Test N11-FYG1111', + selectEmbranceResult: '6/20/2023, 4:41 AM', +}; + +const encumbranceData = { + searchByName: 'autotest_ledger_275.5001376680388208', + selectFirstLedger: 'autotest_ledger_275.5001376680388208', + selectFirstCheckBox: 'FY2024', + rollOverDate: '7/21/2023', + fillInRolloverInfo: 'FY2029', + ledgerName: 'AJ', + selectLedgerName: 'AJ', + fundName: 'AJ2', + selectFund: 'AJ2', + selectCurrentBudgerFromthelist: 'AJ2-AJ2024', + transactionListDetailsResultsFromEmbarance: '7/3/2023, 8:12 AM', +}; + +describe('Finance: Fiscal Year Rollover', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C375267 Encumbrances are rolled over correctly when order fund distribution was changed and related paid invoice exists (based on Remaining) (Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.financePath); + financeHelper.searchByName(encumbranceData.searchByName); + financeHelper.selectFirstLedger(encumbranceData.selectFirstLedger); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.selectFirstCheckBox(encumbranceData.selectFirstCheckBox); + ledgers.clickonViewledgerDetails(); + ledgers.rolloverLogs(); + ledgers.exportRollover(encumbranceData.rollOverDate); + ledgers.closeOpenedPage(); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.fillInRolloverInfo(encumbranceData.fillInRolloverInfo); + ledgers.clickonViewledgerDetails(); + ledgers.resetAll(); + financeHelper.searchByName(encumbranceData.ledgerName); + financeHelper.selectFirstLedger(encumbranceData.selectLedgerName); + ledgers.selectFund(); + ledgers.closeOpenedPage(); + financeHelper.searchByName(encumbranceData.fundName); + financeHelper.selectFirstFundRecord(encumbranceData.selectFund); + invoices.selectCurrentBudgerFromthelist( + encumbranceData.selectCurrentBudgerFromthelist + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromEmbarance( + encumbranceData.transactionListDetailsResultsFromEmbarance + ); + }); +}); diff --git a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js new file mode 100644 index 0000000000..f4392b981c --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js @@ -0,0 +1,62 @@ +import financeHelper from '../../../../support/fragments/finance/financeHelper'; +import ledgers from '../../../../support/fragments/finance/ledgers/ledgers'; +import invoices from '../../../../support/fragments/invoices/invoices'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; + +const rollOverData = { + ledgerName: 'AE2', + selectLedger: 'AE2', + fiscalYearDate: 'AE2025', + rollOverDate: '7/21/2023', + searchByParameter: 'Name', + searchByName: 'AE2', + selectFundRecord: 'AE2', + searchledger: 'Test N8', + selectLedgerName: 'Test N8', + fillInRolloverInfo: 'FYG2222', + currentBudeget: 'Test N11-FYG2024', + plannedBudget: 'Test N11-FYG1111', + selectEmbranceResult: '6/20/2023, 4:41 AM', +}; + +describe('Finance: Fiscal Year Rollover', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C359604 Make more than one preview for one ledger and same fiscal year with ""Test rollover"", check test rollover results(Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.financePath); + financeHelper.searchByName(rollOverData.ledgerName); + financeHelper.selectFirstLedger(rollOverData.selectLedger); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.selectFirstCheckBox(rollOverData.fiscalYearDate); + ledgers.clickonViewledgerDetails(); + ledgers.rolloverLogs(); + ledgers.exportRollover(rollOverData.rollOverDate); + ledgers.closeOpenedPage(); + ledgers.clickOnFundTab(); + invoices.searchByParameter( + rollOverData.searchByParameter, + rollOverData.searchByName + ); + financeHelper.selectFirstFundRecord(rollOverData.selectFundRecord); + ledgers.clickOnFiscalyearTab(); + ledgers.clickOnLedgerTab(); + financeHelper.searchByName(rollOverData.searchledger); + financeHelper.selectFirstLedger(rollOverData.selectLedgerName); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.fillInRolloverInfo(rollOverData.fillInRolloverInfo); + ledgers.clickonViewledgerDetails(); + ledgers.selectFund(); + invoices.selectCurrentBudgerFromthelist(rollOverData.currentBudeget); + ledgers.closeOpenedPage(); + invoices.viewDetailsPlannedBudgets(rollOverData.plannedBudget); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromEmbarance( + rollOverData.selectEmbranceResult + ); + }); +}); diff --git a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js new file mode 100644 index 0000000000..084f3cb7fb --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js @@ -0,0 +1,96 @@ +import invoice from '../../../../support/fragments/ideyalabs/invoice'; +import invoices from '../../../../support/fragments/invoices/invoices'; +import topMenu from '../../../../support/fragments/topMenu'; +import dateTools from '../../../../support/utils/dateTools'; +import getRandomPostfix from '../../../../support/utils/stringTools'; +import testTypes from '../../../../support/dictionary/testTypes'; + +const orderOne = { + templateName: 'Adlibris book order (adlibris)', + orderType: 'One-time', +}; + +const orderOnePOLine = { + title: `AutoTest_${getRandomPostfix}`, + fundID: 'Alpha FYRO (AFYRO)', +}; + +const orderTwo = { + templateName: 'Amazon book orders (Amazon-B)', + orderType: 'Ongoing', +}; + +const orderTwoPOLine = { + title: `AutoTest_${getRandomPostfix}`, + fundID: 'PO Fund 1 (POF1)', + price: '1', + valueOne: '90', + valueTwo: '10', +}; + +const newInvoice = { + invoiceDate: dateTools.getCurrentDate(), + status: 'Open', + invoiceNumber: getRandomPostfix(), + vendorName: '1517 THE LEGACY PROJECT', + accountingCode: '1233', + batchGroup: 'BG1', +}; + +const invoiceLines = { + invoiceLineOne: '12320886456-1', + invoiceLineTwo: '12320886456-1', + invoiceLineThree: '12320877456-1', + invoiceLineFour: '12320873456-1', +}; + +const fundDistribution = { + fundIDOne: 'Alpha FYRO (AFYRO)', + fundIDTwo: 'Beta FYRO (BFYRO)', +}; + +describe('ui-invoices: Invoice creation', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(topMenu.ordersPath); + }); + + it( + 'C353566 Correct fund validation to approve invoice (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + invoice.createOrder(orderOne.orderType, orderOne.templateName); + invoice.POLines(orderOnePOLine.title, orderOnePOLine.fundID); + invoice.purchaseOrder(); + invoice.createAnotherOrder(orderTwo.orderType, orderTwo.templateName); + invoice.POLinesForAnotherOrder( + orderTwoPOLine.title, + orderTwoPOLine.price, + orderTwoPOLine.fundID, + orderTwoPOLine.valueOne, + orderTwoPOLine.valueTwo + ); + invoice.purchaseAnotherOrder(); + cy.visit(topMenu.invoicesPath); + invoices.createVendorInvoice(newInvoice); + invoice.searchByNumber(newInvoice.invoiceNumber); + invoice.selectInvoice(newInvoice.invoiceNumber); + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineOne); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineTwo); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineThree); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineFour); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoice.addFundDistributionToLine2(fundDistribution.fundIDOne); + invoice.addFundDistributionToLine4(fundDistribution.fundIDTwo); + invoice.adjustments(); + invoice.approveInvoice(); // Approve API failure + } + ); +}); diff --git a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js new file mode 100644 index 0000000000..42af3dec04 --- /dev/null +++ b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js @@ -0,0 +1,273 @@ +import marc from '../../support/ideyalabs/marc'; +import eHoldingsPackage from '../../support/fragments/eholdings/eHoldingsPackage'; +import holdingsRecordView from '../../support/fragments/inventory/holdingsRecordView'; +import inventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import inventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import browseContributors from '../../support/fragments/inventory/search/browseContributors'; +import marcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import marcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +import quickMarcEditor from '../../support/fragments/quickMarcEditor'; +import settingsMenu from '../../support/fragments/settingsMenu'; +import topMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; + +const testData = { + source: 'MARC', + tag100Content: { + secondBoxValue: "''", + thirdBoxValue: "''", + fourthBoxValue: '$a María de Jesús, $c de Agreda, sister, $d 1602-1665', + fifthBoxValue: '', + sixthBoxValue: '$0 id.loc.gov/authorities/childrensSubjects/sj2018050004', + seventhBoxValue: '', + }, + tag700Content: { + secondBoxValue: "''", + thirdBoxValue: "''", + fourthBoxValue: '$a TestPersonalName', + fifthBoxValue: '', + sixthBoxValue: '$0 id.loc.gov/authorities/names/n00000911', + seventhBoxValue: '', + }, + search: { + searchOption: 'Keyword', + value: 'personal', + }, + search240: { + searchOption: 'Keyword', + value: 'personal', + }, + search730: { + searchOption: 'Keyword', + value: 'Iroquois people', + }, + + rowIndex: { + row100: 5, + row700: 6, + }, + tags: { + tag100: '100', + tag700: '700', + tag245: '245', + tagLDR: 'LDR', + tag240: '240', + tag730: '730', + tag650: '650', + tag852: '852', + tag866: '866', + }, + fieldContents: { + tag100Content: 'Author, Person', + tag700Content: ' ', + tag245Content: 'The most important book', + tagLDRContent: '00000naa\\a2200000uu\\4500', + tag240Content: 'test 123', + tag730Content: 'test 123', + tag852Content: 'KU/CC/DI/A', + tag866Content: 'Test', + tag100$0Content: '3052328889 $0 3052044 $0 971255', + tag650Content: 'sh85095299', + tag035Content: '(OCoLC)ocn607TST001', + }, + accordions: { + contributor: 'Contributor', + subject: 'Subject', + titleData: 'Title data', + }, + contributor: { + name: 'María de Jesús, de Agreda, sister, 1602-1665', + }, + sourceValues: { + folio: 'ADMINISTRATOR, DIKU', + }, +}; + +describe('New Marc Bib Record and new MARC Holdings record', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Delete created MARC Holdings record', () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultItem(); + marc.openCreatedHoldingView(); + marc.deleteHolding(); + }); + + it('C9236 Settings: Add/Edit a custom label (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(settingsMenu.eHoldingsPath); + eHoldingsPackage.customLabel({ + labelOne: 'AutomatingTheFolioApplicationAndTestingApplication', + labelTwo: 'Test :', + }); + eHoldingsPackage.verifyCustomLabel(); + }); + + it('C380726 Link ""Contributor"" fields when creating ""MARC Bibliographic"" record (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + quickMarcEditor.updateExistingField( + testData.tags.tagLDR, + testData.fieldContents.tagLDRContent + ); + marcAuthority.addNewField( + 6, + testData.tags.tag100, + `$a ${testData.fieldContents.tag100Content}` + ); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag100); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search.searchOption, + testData.search.value + ); + marcAuthorities.clickLinkButton(); + marcAuthority.addNewField( + 7, + testData.tags.tag700, + `$a ${testData.fieldContents.tag700Content}` + ); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag700); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search.searchOption, + testData.search.value + ); + marcAuthorities.clickLinkButton(); + marc.saveAndClose(); + inventoryInstance.editMarcBibliographicRecord(); + marc.crossIcon(); + inventoryInstance.viewSource(); + marc.crossIcon(); + inventorySearchAndFilter.switchToBrowseTab(); + browseContributors.select(); + browseContributors.browse(testData.contributor.name); + browseContributors.checkSearchResultRecord(testData.contributor.name); + }); + + it('C350646 Create a new MARC Holdings record for existing ""Instance"" record (Spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultItem(); + inventoryInstance.goToMarcHoldingRecordAdding(); + quickMarcEditor.updateExistingField( + testData.tags.tag852, + `$b ${testData.fieldContents.tag852Content}` + ); + marcAuthority.addNewField( + 5, + testData.tags.tag866, + `$a ${testData.fieldContents.tag866Content}` + ); + marc.saveAndClose(); + cy.wait(5000); // Wait Needed: need to wait until the View Source Button will be enabled + marc.crossIcon(); + marc.openCreatedHoldingView(); + holdingsRecordView.viewSource(); + marc.crossIcon(); + marc.recordLastUpdated(); + marc.checkFieldContentMatch(); + }); + + it('C380747 Add non-controllable subfields to a linked field when creating ""MARC Bibliographic"" record (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.checkReadOnlyTags(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + quickMarcEditor.updateExistingField( + testData.tags.tagLDR, + testData.fieldContents.tagLDRContent + ); + marcAuthority.addNewField( + 4, + testData.tags.tag240, + `$a ${testData.fieldContents.tag240Content}` + ); + marcAuthority.addNewField( + 5, + testData.tags.tag730, + `$a ${testData.fieldContents.tag730Content}` + ); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag240); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search240.searchOption, + testData.search240.value + ); + marcAuthorities.clickLinkButton(); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag730); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search730.searchOption, + testData.search730.value + ); + marcAuthorities.clickLinkButton(); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag240); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag730); + marc.saveAndClose(); + inventoryInstance.editMarcBibliographicRecord(); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag240); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag730); + }); + + it('C389495 Auto-linking fields with multiple ""$0"" when creating new ""MARC Bib"" record (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + marcAuthority.addNewField( + 4, + testData.tags.tag100, + `$0 ${testData.fieldContents.tag100$0Content}` + ); + marcAuthority.addNewField( + 5, + testData.tags.tag650, + `$0 ${testData.fieldContents.tag650Content}` + ); + // Not able to save linking issue + marcAuthorities.clickLinkButton(); + marc.saveAndClose(); + inventoryInstance.viewSource(); + }); + + it('C380736 Search created ""MARC bib"" record by Title, OCLC number (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + marcAuthority.addNewField( + 4, + testData.tags.tag035, + `$0 ${testData.fieldContents.tag035Content}` + ); + }); +}); diff --git a/cypress/e2e/ideyalabs/notes/note-type.cy.js b/cypress/e2e/ideyalabs/notes/note-type.cy.js new file mode 100644 index 0000000000..866e103227 --- /dev/null +++ b/cypress/e2e/ideyalabs/notes/note-type.cy.js @@ -0,0 +1,52 @@ +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import AgreementsDetails from '../../../support/fragments/agreements/agreementsDetails'; +import ExistingNoteEdit from '../../../support/fragments/notes/existingNoteEdit'; +import ExistingNoteView from '../../../support/fragments/notes/existingNoteView'; +import NewNote from '../../../support/fragments/notes/newNote'; +import TopMenu from '../../../support/fragments/topMenu'; +import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; + +const noteData = `New Note${getFourDigitRandomNumber()}`; +const noteType = `Item${getFourDigitRandomNumber()}`; + +describe('Settings', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C16985 Settings | Set up a note type (spitfire)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.notesPath); + NewNote.fillNote(noteData); + cy.visit(TopMenu.agreementsPath); + AgreementsDetails.agreementListClick('2020 ACS Publications'); + AgreementsDetails.openNotesSection(); + AgreementsDetails.clickOnNewButton(); + NewNote.clickOnNoteType(noteData); + NewNote.deleteNote(noteData); + } + ); + + it( + 'C1304 Settings | Edit a note type (spitfire)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.notesPath); + ExistingNoteEdit.clickEditButton(noteType); + cy.visit(TopMenu.agreementsPath); + AgreementsDetails.agreementListClick('2020 ACS Publications'); + AgreementsDetails.openNotesSection(); + AgreementsDetails.clickOnNewButton(); + NewNote.clickOnNoteType(noteType); + AgreementsDetails.clickCancelButton(); + NewNote.closeWithoutSaveButton(); + AgreementsDetails.openNotesSection(); + AgreementsDetails.clickOnNoteRecord(); + ExistingNoteView.gotoEdit(); + NewNote.clickOnNoteType(noteType); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js new file mode 100644 index 0000000000..ca1cce5b27 --- /dev/null +++ b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js @@ -0,0 +1,35 @@ +import invoice from '../../../support/fragments/ideyalabs/invoice'; +import topMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; + +const searchInvoiceNumber = { + parameter: 'Keyword', + value: '17210-4', +}; + +const fundID = 'Fund B (b)'; + +describe('Orders', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(topMenu.ordersPath); + }); + + it( + 'C368486 Editing fund distribution in PO line when related Reviewed invoice exists (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.orderLinesPath); + invoice.searchByParameter( + searchInvoiceNumber.parameter, + searchInvoiceNumber.value + ); + invoice.orderLinesResults(); + invoice.orderList(searchInvoiceNumber.value); + invoice.PODetails(fundID); // API getting failed while changing Fund ID in bugfest ENV + invoice.clickOnViewTransactions(); + cy.visit(topMenu.invoicesPath); + invoice.verifyTransactionsPane(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js new file mode 100644 index 0000000000..9a294037ab --- /dev/null +++ b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js @@ -0,0 +1,18 @@ +import order from '../../../../support/ideyaLabs/orders'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; + +describe('Orders: Export in edifact format ', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C365619 Re-exported Order contains more than two PO lines is successfully exported in the next scheduled run (Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.ordersPath); + order.switchToOrders(); + order.status(); + order.poNumberRecord(); + order.reExportActions(); + order.reExportOrderModal(); + }); +}); diff --git a/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js b/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js new file mode 100644 index 0000000000..a72d36a89f --- /dev/null +++ b/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js @@ -0,0 +1,43 @@ +import orderFragment from '../../../../support/fragments/orders/orders'; +import orderLines from '../../../../support/fragments/orders/orderLines'; +import receiving from '../../../../support/fragments/receiving/receiving'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; + +const orderDetails = { + searchByParameter: 'PO line number', + enterPoLineNumber: '20692-1', + checkOrderLineSearchResults: '20692-1', + titleName: 'Approve rolled', + caption: 'Done', + enumeration: 'Electronic', + poLineNumber: '20692-1', +}; + + + + +describe('Orders: Receiving and Check-in ', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C378899 Encumbrance releases when receive piece for order with payment status "Payment Not Required" (Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.ordersPath); + orderLines.clickOnOrderLines(); + orderLines.searchByParameter( + orderDetails.searchByParameter, + orderDetails.enterPoLineNumber + ); + orderLines.checkOrderlineSearchResults( + orderDetails.checkOrderLineSearchResults + ); + orderLines.selectOrderline(orderDetails.checkOrderLineSearchResults); + orderLines.receiveOrderLineViaActions(); + orderLines.selectreceivedTitleName(orderDetails.titleName); + receiving.addPieceProcess(orderDetails.caption, orderDetails.enumeration); + receiving.quickReceivePieceAdd(orderDetails.enumeration); + receiving.clickOnPOLnumber(orderDetails.poLineNumber); + orderFragment.selectFundIDFromthelist(); + }); +}); diff --git a/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js new file mode 100644 index 0000000000..4d05ff24a4 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js @@ -0,0 +1,30 @@ +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import TopMenu from '../../../support/fragments/topMenu'; +import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; + +const categoryName = `Test${getFourDigitRandomNumber()}`; + +describe('Settings', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C731 Create new categories (thunderjet)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(SettingsMenu.organizationsPath); + Organizations.addNewCategory(categoryName); + cy.visit(TopMenu.organizationsPath); + Organizations.searchByParameters('All', 'organization'); + Organizations.selectOrganization('New organization'); + Organizations.editOrganization(); + Organizations.verifyNewCategory(categoryName); + cy.visit(SettingsMenu.organizationCategoryPath); + Organizations.deleteCreatedCategory(categoryName); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/settings.cy.js b/cypress/e2e/ideyalabs/settings.cy.js new file mode 100644 index 0000000000..2eb9bfd90e --- /dev/null +++ b/cypress/e2e/ideyalabs/settings.cy.js @@ -0,0 +1,65 @@ +import uuid from 'uuid'; +import TestTypes from '../../support/dictionary/testTypes'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; +import permissions from '../../support/dictionary/permissions'; +import UserEdit from '../../support/fragments/users/userEdit'; +import Users from '../../support/fragments/users/users'; +import eHoldingsPackage from '../../support/fragments/eholdings/eHoldingsPackage'; +import settingsMenu from '../../support/fragments/settingsMenu'; + +describe('Creating custom labels', () => { + const userData = {}; + const testData = { + servicePointS: ServicePoints.getDefaultServicePointWithPickUpLocation( + 'S', + uuid() + ), + }; + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.createViaApi(testData.servicePointS); + testData.defaultLocation = Location.getDefaultLocation( + testData.servicePointS.id + ); + }); + cy.createTempUser([ + permissions.uiSettingseholdingsViewEditCreateDelete.gui, + permissions.uieHoldingsTitlesPackagesCreateDelete.gui, + ]) + .then((userProperties) => { + userData.username = userProperties.username; + userData.password = userProperties.password; + userData.userId = userProperties.userId; + }) + .then(() => { + UserEdit.addServicePointsViaApi( + [testData.servicePointS.id], + userData.userId, + testData.servicePointS.id + ); + cy.login(userData.username, userData.password); + }); + }); + + after('Deleting created entities', () => { + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [ + testData.servicePointS.id, + ]); + ServicePoints.deleteViaApi(testData.servicePointS.id); + Users.deleteViaApi(userData.userId); + }); + it( + 'C9236 Settings: Add/Edit a custom label(spitfire)', + { tags: [TestTypes.ideaLabsTests] }, + () => { + cy.visit(settingsMenu.eHoldingsPath); + eHoldingsPackage.customLabel({ + labelOne: 'AutomatingTheFolioApplicationAndTestingApplication', + labelTwo: 'Test :', + }); + cy.visit('/eholdings/resources/58-473-185972'); + eHoldingsPackage.verifyCustomLabel(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js b/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js new file mode 100644 index 0000000000..7bbe13ad6e --- /dev/null +++ b/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js @@ -0,0 +1,32 @@ +import titleLevelRequests from '../../../../support/fragments/settings/circulation/titleLevelRequests'; +import SettingsMenu from '../../../../support/fragments/settingsMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; + +const patronData = { + notice1: 'Requested item - available', + notice2: 'Test TLR', + notice3: 'Requested item - available', +}; + + + +describe('Orders: Receiving and Check-in ', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C350428 Patron notice (Vega)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(SettingsMenu.circulationTitleLevelRequestsPath); + titleLevelRequests.selectConfirmationNoticeDropdown({ + notice1: patronData.notice1, + }); + titleLevelRequests.selectCancelleationNoticeDropdown({ + notice2: patronData.notice2, + }); + titleLevelRequests.selectExpirationNoticeDropdown({ + notice3: patronData.notice3, + }); + titleLevelRequests.clickOnSaveButton(); + titleLevelRequests.checkUpdateTLRCalloutAppeared(); + }); +}); diff --git a/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js b/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js index 8e338cf500..d06e0cb4fa 100644 --- a/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js +++ b/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js @@ -163,6 +163,8 @@ describe('orders: Receive piece from Order', () => { InventorySearchAndFilter.instanceTabIsDefault(); InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); + // TODO need to wait until result is displayed + cy.wait(1500); InventoryInstances.selectInstance(); InventoryInstances.verifyInstanceDetailsView(); InventoryInstance.openHoldings(effectiveLocation.name); @@ -179,6 +181,8 @@ describe('orders: Receive piece from Order', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); + // TODO need to wait until result is displayed + cy.wait(1500); InventoryInstances.selectInstance(); InventoryInstances.verifyInstanceDetailsView(); InventoryInstance.openHoldings(effectiveLocation.name); diff --git a/cypress/e2e/inventory/export-cql.cy.js b/cypress/e2e/inventory/export-cql.cy.js new file mode 100644 index 0000000000..13351a2d34 --- /dev/null +++ b/cypress/e2e/inventory/export-cql.cy.js @@ -0,0 +1,90 @@ +import TopMenu from '../../support/fragments/topMenu'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryActions from '../../support/fragments/inventory/inventoryActions'; +import FileManager from '../../support/utils/fileManager'; +import testTypes from '../../support/dictionary/testTypes'; +import permissions from '../../support/dictionary/permissions'; +import getRandomPostfix from '../../support/utils/stringTools'; +import devTeams from '../../support/dictionary/devTeams'; +import Users from '../../support/fragments/users/users'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import InventoryHoldings from '../../support/fragments/inventory/holdings/inventoryHoldings'; +import { ITEM_STATUS_NAMES } from '../../support/constants'; + +let userId; +const instanceTitle = `Inventory export test ${Number(new Date())}`; +const itemBarcode = `testItem_${getRandomPostfix()}`; +let locationName = ''; + +describe('ui-inventory: exports', () => { + before('navigates to Inventory', () => { + let source; + + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.dataExportAll.gui, + permissions.dataExportEnableModule.gui, + ]) + .then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading + }); + cy.getAdminToken() + .then(() => { + cy.getLoanTypes({ limit: 1 }); + cy.getMaterialTypes({ limit: 1 }); + cy.getInstanceTypes({ limit: 1 }); + cy.getLocations({ limit: 1 }); + cy.getHoldingTypes({ limit: 1 }); + source = InventoryHoldings.getHoldingSources({ limit: 1 }); + }) + .then(() => { + locationName = Cypress.env('locations')[0].name; + cy.createInstance({ + instance: { + instanceTypeId: Cypress.env('instanceTypes')[0].id, + title: instanceTitle, + languages: ['eng'] + }, + holdings: [{ + holdingsTypeId: Cypress.env('holdingsTypes')[0].id, + permanentLocationId: Cypress.env('locations')[0].id, + sourceId: source.id, + }], + items: [ + [{ + barcode: itemBarcode, + missingPieces: '3', + numberOfMissingPieces: '3', + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: Cypress.env('loanTypes')[0].id }, + materialType: { id: Cypress.env('materialTypes')[0].id }, + }], + ], + }); + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + Users.deleteViaApi(userId); + FileManager.deleteFileFromDownloadsByMask('SearchInstanceCQLQuery*'); + }); + + it('C9287 Export CQL query (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + InventorySearchAndFilter.byLanguage(); + InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); + InventorySearchAndFilter.byEffectiveLocation(locationName); + InventorySearchAndFilter.saveCQLQuery(); + + FileManager.verifyFile( + InventoryActions.verifySaveCQLQueryFileName, + 'SearchInstanceCQLQuery*', + InventoryActions.verifySaveCQLQuery, + [instanceTitle] + ); + }); +}); diff --git a/cypress/e2e/inventory/export.cy.js b/cypress/e2e/inventory/export.cy.js index e3aa3d0ea0..b8274ae32e 100644 --- a/cypress/e2e/inventory/export.cy.js +++ b/cypress/e2e/inventory/export.cy.js @@ -16,7 +16,6 @@ import { ITEM_STATUS_NAMES } from '../../support/constants'; let userId; const instanceTitle = `Inventory export test ${Number(new Date())}`; -let locationName = ''; describe('ui-inventory: exports', () => { before('navigates to Inventory', () => { @@ -83,7 +82,7 @@ describe('ui-inventory: exports', () => { InventoryInstance.deleteInstanceViaApi(instance.id); }); Users.deleteViaApi(userId); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + FileManager.deleteFileFromDownloadsByMask('QuickInstanceExport*', 'SearchInstanceUUIDs*'); }); it('C9284 Export small number of Instance UUIDs (30 or fewer) (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { @@ -104,20 +103,6 @@ describe('ui-inventory: exports', () => { }); }); - it('C9287 Export CQL query (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - InventorySearchAndFilter.byLanguage(); - InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); - InventorySearchAndFilter.byEffectiveLocation(locationName); - InventorySearchAndFilter.saveCQLQuery(); - - FileManager.verifyFile( - InventoryActions.verifySaveCQLQueryFileName, - 'SearchInstanceCQLQuery*', - InventoryActions.verifySaveCQLQuery, - [instanceTitle] - ); - }); - it('C196757 Export selected records (MARC) (firebird)', { tags: [testTypes.smoke, devTeams.firebird, testTypes.broken] }, () => { InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); cy.do(InventorySearchAndFilter.getSearchResult().find(Checkbox()).click()); diff --git a/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js new file mode 100644 index 0000000000..effc0de4ea --- /dev/null +++ b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js @@ -0,0 +1,98 @@ +import TopMenu from '../../../support/fragments/topMenu'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import TestTypes from '../../../support/dictionary/testTypes'; +import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import DevTeams from '../../../support/dictionary/devTeams'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import Users from '../../../support/fragments/users/users'; +import Permissions from '../../../support/dictionary/permissions'; + +describe('MARC -> MARC Holdings', () => { + const testData = { + tag001: '001', + tag001value: '$a Second 001 field' + }; + + const marcFile = { + marc: 'marcBibFileC387461.mrc', + fileName: `testMarcFile.C387461.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }; + + const recordIDs = []; + + before('Creating user, data', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiQuickMarcQuickMarcHoldingsEditorCreate.gui, + Permissions.uiQuickMarcQuickMarcHoldingsEditorAll.gui, + ]).then(createdUserProperties => { + testData.createdUserProperties = createdUserProperties; + + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFile(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + recordIDs.push(link.split('/')[5]); + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstance.searchByTitle(recordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.goToMarcHoldingRecordAdding(); + QuickMarcEditor.updateExistingField('852', QuickMarcEditor.getExistingLocation()); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveHoldings(); + + HoldingsRecordView.getHoldingsIDInDetailView().then((holdingsID) => { + recordIDs.push(holdingsID); + }); + }); + }); + cy.login(createdUserProperties.username, createdUserProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + }); + + after('Deleting created user, data', () => { + Users.deleteViaApi(testData.createdUserProperties.userId); + cy.deleteHoldingRecordViaApi(recordIDs[1]); + InventoryInstance.deleteInstanceViaApi(recordIDs[0]); + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + }); + + it('C387461 Add multiple 001s when editing "MARC Holdings" record', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstances.searchBySource('MARC'); + InventoryInstance.searchByTitle(recordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkSource('MARC'); + // "Edit in quickMARC" option might not be active immediately when opening MARC Holdings + // this option becomes active after reopening Holdings view window + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); + HoldingsRecordView.editInQuickMarc(); + QuickMarcEditor.addEmptyFields(5); + QuickMarcEditor.checkEmptyFieldAdded(6); + QuickMarcEditor.updateExistingField('', testData.tag001value); + QuickMarcEditor.updateTagNameToLockedTag(6, '001'); + QuickMarcEditor.checkFourthBoxDisabled(6); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveHoldings(); + HoldingsRecordView.editInQuickMarc(); + QuickMarcEditor.checkReadOnlyTags(); + QuickMarcEditor.verifyNoFieldWithContent(testData.tag001value); + }); +}); diff --git a/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js b/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js index 36a912e36a..6ac35ef8e5 100644 --- a/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js +++ b/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js @@ -32,6 +32,9 @@ describe('Manage holding records with MARC source', { retries: 2 }, () => { HoldingsRecordView.checkSource('MARC'); HoldingsRecordView.checkActionsMenuOptionsInMarcSource(); HoldingsRecordView.tryToDelete(); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.close(); HoldingsRecordView.editInQuickMarc(); diff --git a/cypress/e2e/inventory/keyboard-shortcuts.cy.js b/cypress/e2e/inventory/keyboard-shortcuts.cy.js index 7002f27f24..71b4cb3314 100644 --- a/cypress/e2e/inventory/keyboard-shortcuts.cy.js +++ b/cypress/e2e/inventory/keyboard-shortcuts.cy.js @@ -34,7 +34,7 @@ describe('ui-inventory: keyboard shortcut', () => { Users.deleteViaApi(userId); }); - it('C345297 Keyboard Shortcut. Access to drop down menu (folijet)', { tags: [testTypes.smoke, devTeams.folijet] }, () => { + it('C345297 Keyboard Shortcut. Access to drop down menu (folijet)', { tags: [testTypes.smoke, devTeams.thunderjet] }, () => { InventoryKeyboardShortcuts.verifyInventoryDropdownIsShown('false'); InventoryKeyboardShortcuts.openInventoryMenu(); diff --git a/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js b/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js index 9ca468e612..83b0071df3 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js @@ -10,6 +10,7 @@ import ServicePoints from '../../../support/fragments/settings/tenant/servicePoi import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; +import CirculationRules from '../../../support/fragments/circulation/circulation-rules'; describe('ui-inventory: Mark an item as Missing', () => { let user = {}; @@ -19,6 +20,24 @@ describe('ui-inventory: Mark an item as Missing', () => { const createdRequestsIds = []; let createdItems = []; let materialType = ''; + let addedCirculationRule; + let originalCirculationRules; + + before(() => { + let materialBookId; + cy.getAdminToken(); + cy.getMaterialTypes({ query: 'name="video recording"' }).then(type => { + materialBookId = type.id; + }); + CirculationRules.getViaApi().then((circulationRule) => { + originalCirculationRules = circulationRule.rulesAsText; + const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); + const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n} l ${ruleProps.l}`; + addedCirculationRule = ` \nm ${materialBookId}: ${defaultProps}`; + cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); + }); + }); + beforeEach(() => { cy.getAdminToken() .then(() => { @@ -60,6 +79,10 @@ describe('ui-inventory: Mark an item as Missing', () => { }); }); + after(() => { + CirculationRules.deleteRuleViaApi(addedCirculationRule); + }); + afterEach(() => { createdItems.forEach(item => { cy.deleteItemViaApi(item.itemId); diff --git a/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js b/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js index 62f18f1d70..33de4bc57d 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js @@ -10,6 +10,7 @@ import ServicePoints from '../../../support/fragments/settings/tenant/servicePoi import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import DevTeams from '../../../support/dictionary/devTeams'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import CirculationRules from '../../../support/fragments/circulation/circulation-rules'; describe('ui-inventory: Mark items as withdrawn', () => { let user = {}; @@ -19,6 +20,23 @@ describe('ui-inventory: Mark items as withdrawn', () => { const createdRequestsIds = []; let createdItems = []; let materialType = ''; + let addedCirculationRule; + let originalCirculationRules; + + before(() => { + let materialBookId; + cy.getAdminToken(); + cy.getMaterialTypes({ query: 'name="video recording"' }).then(type => { + materialBookId = type.id; + }); + CirculationRules.getViaApi().then((circulationRule) => { + originalCirculationRules = circulationRule.rulesAsText; + const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); + const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n} l ${ruleProps.l}`; + addedCirculationRule = ` \nm ${materialBookId}: ${defaultProps}`; + cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); + }); + }); beforeEach(() => { cy.getAdminToken() @@ -62,6 +80,10 @@ describe('ui-inventory: Mark items as withdrawn', () => { }); }); + after(() => { + CirculationRules.deleteRuleViaApi(addedCirculationRule); + }); + afterEach(() => { createdItems.forEach(item => { cy.deleteItemViaApi(item.itemId); diff --git a/cypress/e2e/inventory/moving-items.cy.js b/cypress/e2e/inventory/moving-items.cy.js index 44a7a2d35c..b4d11200ec 100644 --- a/cypress/e2e/inventory/moving-items.cy.js +++ b/cypress/e2e/inventory/moving-items.cy.js @@ -145,6 +145,9 @@ describe('ui-inventory: moving items', { retries: 2 }, () => { InventoryInstances.selectInstance(); InventoryInstance.openHoldingView(); HoldingsRecordView.checkHrId(holdingsRecordhrId); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(`004\t${initialInstanceHrId}`); }); diff --git a/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js b/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js index 18be11d1c2..11ec7b1a4e 100644 --- a/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js +++ b/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js @@ -24,7 +24,7 @@ describe('Inventory -> Call Number Browse', () => { volume: 'v.1', enumeration: 'e.2', chronology: 'ch.3', - shelvingOrderValue: 'PRT 3718 _V 11 E 12 CH 13 C 14 SUF', + shelvingOrderValue: 'PRT 718 V.1 E.2 CH.3 C.4 SUF', }; const itemA1 = { @@ -134,7 +134,7 @@ describe('Inventory -> Call Number Browse', () => { BrowseCallNumber.checkExactSearchResult(itemA1.itemCallNumber); }); - it('C359593 Verify that clicking on "Call number" value execute search for "Instance" record by "Shelving order" value (spitfire)', { tags: [DevTeams.spitfire, TestTypes.criticalPath] }, () => { + it('C405529 Verify that clicking on "Call number" value execute search for "Instance" record by "Shelving order" value (spitfire)', { tags: [DevTeams.spitfire, TestTypes.criticalPath] }, () => { searchAndOpenInstance(testData.parameter, item.instanceName); InventoryInstance.addItem(); InventoryInstance.fillItemRequiredFields(); diff --git a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js new file mode 100644 index 0000000000..ba93a81df6 --- /dev/null +++ b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js @@ -0,0 +1,160 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import Permissions from '../../../support/dictionary/permissions'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import Users from '../../../support/fragments/users/users'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import { JOB_STATUS_NAMES } from '../../../support/constants'; +import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; +import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; + +describe('Search in Inventory', () => { + const testData = { + tag130: '130', + tag240: '240', + tag010: '010', + querySearchOption: 'Query search', + searchQueries: { + allRecords: 'alternativeTitles.alternativeTitle = "bible"', + secondLinkedRecord: 'alternativeTitles.alternativeTitle = "Hosanna Bible"', + bothLinkedRecords: 'alternativeTitles.alternativeTitle = "Hosanna Bible" OR alternativeTitles.alternativeTitle = "Bible. Polish."', + linkedAndFirstNotLinkedRecords: 'alternativeTitles.alternativeTitle = "Hosanna Bible" OR alternativeTitles.alternativeTitle = "Bible. Polish." OR alternativeTitles.alternativeTitle = "Bible1"' + }, + searchResults: { + firstLinkedRecord: 'Prayer Bible (Test record with 130 linked field).', + secondLinkedRecord: 'Prayer Bible (Test record with 240 linked field).', + firstNotLinkedRecord: 'Prayer Bible (Test record without linked field: 246).', + secondNotLinkedRecord: 'Prayer Bible (Test record without linked field: 270).', + } + }; + + const marcFiles = [ + { + marc: 'marcBibFileC375256.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numberOfRecords: 4 + }, + { + marc: 'marcAuthFileC375256_1.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Bible. Polish. Biblia Płocka C375256', + authority010FieldValue: 'n92085235375256', + numberOfRecords: 1 + }, + { + marc: 'marcAuthFileC375256_2.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Abraham, Angela, C375256 Hosanna Bible', + authority010FieldValue: 'n99036055375256', + numberOfRecords: 1 + }, + ]; + + const createdRecordIDs = []; + + before('Importing data, linking Bib fields', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFile(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFile.fileName); + for (let i = 0; i < marcFile.numberOfRecords; i++) { + Logs.getCreatedItemsID(i).then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); + } + }); + }); + // linking fields in MARC Bib records + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag130); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag130); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.searchByTitle(createdRecordIDs[1]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag240); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[2].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[2].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag240); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + }); + + after('Deleting user, records', () => { + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index > marcFiles[0].numberOfRecords - 1) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + for (let i = 0; i < marcFiles.length; i++) { + DataImport.selectLog(i); + } + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + }); + + it('C375256 Query search | Search by "Alternative title" field of linked "MARC Bib" records (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.allRecords); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstNotLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondNotLinkedRecord); + InventorySearchAndFilter.checkRowsCount(4); + + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.secondLinkedRecord); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.checkRowsCount(1); + + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.bothLinkedRecords); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.checkRowsCount(2); + + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.linkedAndFirstNotLinkedRecords); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstNotLinkedRecord); + InventorySearchAndFilter.checkRowsCount(3); + }); +}); diff --git a/cypress/e2e/invoices/approve-invoice-with-payment-credit.cy.js b/cypress/e2e/invoices/approve-invoice-with-payment-credit.cy.js new file mode 100644 index 0000000000..b7db05f974 --- /dev/null +++ b/cypress/e2e/invoices/approve-invoice-with-payment-credit.cy.js @@ -0,0 +1,139 @@ +import permissions from '../../support/dictionary/permissions'; +import testType from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +import TopMenu from '../../support/fragments/topMenu'; +import NewInvoice from '../../support/fragments/invoices/newInvoice'; +import Invoices from '../../support/fragments/invoices/invoices'; +import Funds from '../../support/fragments/finance/funds/funds'; +import Organizations from '../../support/fragments/organizations/organizations'; +import Users from '../../support/fragments/users/users'; +import NewOrder from '../../support/fragments/orders/newOrder'; +import Orders from '../../support/fragments/orders/orders'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import FiscalYears from '../../support/fragments/finance/fiscalYears/fiscalYears'; +import Ledgers from '../../support/fragments/finance/ledgers/ledgers'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import FinanceHelp from '../../support/fragments/finance/financeHelper'; + +describe('ui-invoices: Cancelling approved invoices', () => { + const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const defaultFund = { ...Funds.defaultUiFund }; + const secondOrder = { ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true, + reEncumber: true }; + const firstOrder = { + approved: true, + reEncumber: true, + }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const allocatedQuantity = '100'; + let user; + let firstOrderNumber; + let servicePointId; + let location; + + before(() => { + cy.getAdminToken(); + FiscalYears.createViaApi(firstFiscalYear) + .then(firstFiscalYearResponse => { + firstFiscalYear.id = firstFiscalYearResponse.id; + defaultLedger.fiscalYearOneId = firstFiscalYear.id; + Ledgers.createViaApi(defaultLedger) + .then(ledgerResponse => { + defaultLedger.id = ledgerResponse.id; + defaultFund.ledgerId = defaultLedger.id; + + Funds.createViaApi(defaultFund) + .then(fundResponse => { + defaultFund.id = fundResponse.fund.id; + + cy.loginAsAdmin({ path:TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.addBudget(allocatedQuantity); + }); + }); + }); + ServicePoints.getViaApi() + .then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) + .then(res => { + location = res; + }); + }); + Organizations.createOrganizationViaApi(organization) + .then(responseOrganizations => { + organization.id = responseOrganizations; + invoice.accountingCode = organization.erpCode; + firstOrder.orderType = 'One-time'; + }); + secondOrder.vendor = organization.name; + firstOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(secondOrder).then(firstOrderResponse => { + secondOrder.id = firstOrderResponse.id; + firstOrderNumber = firstOrderResponse.poNumber; + Orders.checkCreatedOrder(secondOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 5); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '20', '1', '20', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + }); + + cy.createTempUser([ + permissions.uiFinanceViewEditCreateFundAndBudget.gui, + permissions.uiInvoicesApproveInvoices.gui, + permissions.uiInvoicesPayInvoices.gui, + permissions.viewEditCreateInvoiceInvoiceLine.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.invoicesPath, waiter: Invoices.waitLoading }); + }); + }); + after(() => { + Organizations.deleteOrganizationViaApi(organization.id); + Users.deleteViaApi(user.userId); + }); + + it('C347897 Approve invoice with both payment and credit (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLinePOLLookUWithSubTotal(firstOrderNumber, '10'); + Invoices.createInvoiceLinePOLLookUWithSubTotal(firstOrderNumber, '-10'); + Invoices.createInvoiceLinePOLLookUWithSubTotal(firstOrderNumber, '10'); + Invoices.approveInvoice(); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.selectBudgetDetails(); + Funds.checkFinancialActivityAndOverages('$10.00', '$10.00', '$0.00', '$20.00'); + Funds.viewTransactions(); + Funds.checkOrderInTransactionList(defaultFund.code, '($10.00)'); + Funds.checkInvoiceInTransactionList(2, 'Pending payment', '($10.00)', 'Invoice'); + Funds.checkInvoiceInTransactionList(3, 'Pending payment', '$10.00', 'Invoice'); + Funds.checkInvoiceInTransactionList(4, 'Pending payment', '($10.00)', 'Invoice'); + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoice.invoiceNumber); + Invoices.selectInvoice(invoice.invoiceNumber); + Invoices.payInvoice(); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.selectBudgetDetails(); + Funds.checkFinancialActivityAndOverages('$10.00', '$0.00', '$10.00', '$20.00'); + Funds.viewTransactions(); + Funds.checkInvoiceInTransactionList(2, 'Payment', '($10.00)', 'Invoice'); + Funds.checkInvoiceInTransactionList(3, 'Credit', '$10.00', 'Invoice'); + Funds.checkInvoiceInTransactionList(4, 'Payment', '($10.00)', 'Invoice'); + }); +}); diff --git a/cypress/e2e/invoices/save-invoice-fiscal-year-after-fund-distribution-change.cy.js b/cypress/e2e/invoices/save-invoice-fiscal-year-after-fund-distribution-change.cy.js new file mode 100644 index 0000000000..c23a276d8c --- /dev/null +++ b/cypress/e2e/invoices/save-invoice-fiscal-year-after-fund-distribution-change.cy.js @@ -0,0 +1,133 @@ +import financeHelper from '../../support/fragments/finance/financeHelper'; +import fiscalYears from '../../support/fragments/finance/fiscalYears/fiscalYears'; +import ledgers from '../../support/fragments/finance/ledgers/ledgers'; +import invoices from '../../support/fragments/invoices/invoices'; +import topMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; + +const testData = { + fiscalName: 'Fiscal Year 2024', + selectName: 'Fiscal Year 2024', + ledgerName: 'Future', + fiscalYearQuantity1: '300.00', + fiscalYearQuantity2: '300.00', + selectLedgerName: 'Future', + groupsName: 'Test N5', + selectGroupName: 'Test N5', + fundName: 'AA1', + selectFundName: 'AA1', + searchByInvoiceName: '12344', + selectSearchByInvoiceNameRecord: '12344', + selectInvoiceLineNumber: '12320886456-1', + searchByFinanceName: 'Ledger NIX 1', + selectsearchByFinanceNameRecord: 'Ledger NIX 1', + fillRolloverFiscalYearINFo: 'NIX2024', + ledgername2: 'Ledger NIX 1', + selectLedgerName2: 'Ledger NIX 1', + searchByParameterFiscalYear: 'Name', + searchByNameFiscalYesar: 'AA2023', + selectFirstFiscalRecord: 'AA2023', + searchByParameterFiscalYear2: 'Name', + searchByNameFiscalYear2: 'AA2024', + selectSecondFiscalRecord: 'AA2024', + searchByInvoiceName2: '12344', + selectSearchByInvoiceNameRecord2: '12344', + selectFundIDFromthelist: 'Fund A(A)', + selectCurrentBudgerFromthelist: 'A-FYA2023', + selectTransactionListDetailsResultsFromCurrentBudget: '3/6/2023, 7:48 AM', + selectviewDetailsPreviousBudgets: 'BFYRO-FYRO2021', + searchFundName: 'AF2', + selectFundNameRecordList: 'AF2', + selectCurrentBudgerFromthelistFunds: 'AF2-AF2024', + selectTransactionListDetailsResultsFromEmbaranceDate: '6/20/2023, 5:39 AM', + viewDetailsPreviousBudgetsRecord: 'AF2-AF2021', + fundFinancialQuantity1: '1,000.00', + fundFinancialQuantity2: '974.00', + groupFinancialQuantity1: '2,000.00', + groupFinancialQuantity2: '2,000.00', + ledgerFinancialQuantity1: '0.00', + ledgerFinancialQuantity2: '0.00', +}; + +describe('Users-loans App', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C396360 Save invoice fiscal year after fund distribution change to fund using different ledger if FY was undefined(Thunderjet)', { tags: [testTypes.criticalPath, devTeams.thunderjet] }, () => { + cy.visit(topMenu.invoicesPath); + invoices.searchByNumber(testData.searchByInvoiceName); + invoices.clickOnFirstInvoicesResultList( + testData.selectSearchByInvoiceNameRecord + ); + invoices.selectInvoiceLine(testData.selectInvoiceLineNumber); + invoices.editInvoiceLine(); + invoices.selectFundID(); + invoices.editVendorInvoiceNumber(); + cy.visit(topMenu.financePath); + financeHelper.searchByName(testData.searchByFinanceName); + financeHelper.selectFirstLedger(testData.selectsearchByFinanceNameRecord); + ledgers.clickonViewledgerDetails(); + ledgers.resetAll(); + financeHelper.searchByName(testData.ledgername2); + financeHelper.selectFirstLedger(testData.selectLedgerName2); + ledgers.clickOnFiscalyearTab(); + invoices.searchByParameter( + testData.searchByParameterFiscalYear, + testData.searchByNameFiscalYesar + ); + financeHelper.selectFirstFiscalRecord(testData.selectFirstFiscalRecord); + fiscalYears.editFiscalYearDetails(); + fiscalYears.filltheStartAndEndDateoncalenderstartDateField1(); + ledgers.resetAll(); + invoices.searchByParameter( + testData.searchByParameterFiscalYear2, + testData.searchByNameFiscalYear2 + ); + financeHelper.selectFirstFiscalRecord(testData.selectSecondFiscalRecord); + fiscalYears.editFiscalYearDetails(); + fiscalYears.filltheStartAndEndDateoncalenderstartDateField2(); + cy.visit(topMenu.invoicesPath); + invoices.searchByNumber(testData.searchByInvoiceName2); + invoices.clickOnFirstInvoicesResultList( + testData.selectSearchByInvoiceNameRecord2 + ); + invoices.approveInvoice(); // API Failure + invoices.selectInvoiceLine(testData.selectInvoiceLineNumber); + invoices.selectFundIDFromthelist(testData.selectFundIDFromthelist); + invoices.selectCurrentBudgerFromthelist( + testData.selectCurrentBudgerFromthelist + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromCurrentBudget( + testData.selectTransactionListDetailsResultsFromCurrentBudget + ); + invoices.closeTwoXmarkInOneScreen(); + ledgers.closeOpenedPage(); + ledgers.closeOpenedPage(); + invoices.viewDetailsPreviousBudgets( + testData.selectviewDetailsPreviousBudgets + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromPreviousBudget(); + cy.visit(topMenu.financePath); + ledgers.clickOnFundTab(); + invoices.searchByParameter(testData.searchByParameterFiscalYear, testData.searchFundName); + financeHelper.selectFirstFundRecord(testData.selectFundNameRecordList); + invoices.selectCurrentBudgerFromthelist( + testData.selectTransactionListDetailsResultsFromEmbaranceDate + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromEmbarance( + testData.selectTransactionListDetailsResultsFromEmbaranceDate + ); + ledgers.closeOpenedPage(); + ledgers.closeOpenedPage(); + invoices.viewDetailsPreviousBudgets( + testData.viewDetailsPreviousBudgetsRecord + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromPreviousBudgetEmbrance(); + }); +}); diff --git a/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js index c575d49446..8531b1c5e1 100644 --- a/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js @@ -18,9 +18,16 @@ describe('MARC Authority -> Edit linked Authority record', () => { tag001: '001', tag010: '010', tag100: '100', + tag155: '155', + tag655: '655', tag700: '700', subfieldZValue: 'n12345', - updatedSubfieldZValue: 'n12345678910' + updatedSubfieldZValue: 'n12345678910', + updated155FieldValue: 'Drama C374159 cinema', + updated010FieldValue: 'gf20140262973741590', + autoUpdateUserName: 'Automated linking update', + subjectAccordion: 'Subject', + authorityIconText: 'Linked to MARC authority' }; const marcFiles = [ @@ -30,12 +37,26 @@ describe('MARC Authority -> Edit linked Authority record', () => { jobProfileToRun: 'Default - Create instance and SRS MARC Bib', instanceTitle: 'The coronation of Queen Elizabeth II C376596' }, + { + marc: 'marcBibFileC374159.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + instanceTitle: 'Titanic / written and directed by James Cameron. C374159' + }, { marc: 'marcAuthFileC376596.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'Elizabeth C376596', authority010FieldValue: 'n80126296376596', + }, + { + marc: 'marcAuthFileC374159.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Drama C374159', + authority010FieldValue: 'gf2014026297374159', + authority555FieldValue: 'Literature C374159' } ]; @@ -75,22 +96,38 @@ describe('MARC Authority -> Edit linked Authority record', () => { MarcAuthorities.switchToSearch(); InventoryInstance.verifySelectMarcAuthorityModal(); InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(marcFiles[1].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.searchResults(marcFiles[2].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[2].authority010FieldValue}`); InventoryInstance.clickLinkButton(); QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag700); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); + InventoryInstance.searchByTitle(createdRecordIDs[1]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag655); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(marcFiles[3].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[3].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag655); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); }); }); + beforeEach('Login', () => { + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); + }); + after('Deleting user, data', () => { Users.deleteViaApi(testData.userProperties.userId); createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); + if (index > 1) MarcAuthority.deleteViaAPI(id); else InventoryInstance.deleteInstanceViaApi(id); }); cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); @@ -101,31 +138,55 @@ describe('MARC Authority -> Edit linked Authority record', () => { DataImport.confirmDeleteImportLogs(); }); - it('C376596 Add/Edit/Delete "$z" subfield in "010" field of linked "MARC authority" record when "010" = "$0" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire], retries: 1 }, () => { - MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); - MarcAuthorities.selectTitle(marcFiles[1].authorityHeading); + it('C376596 Add/Edit/Delete "$z" subfield in "010" field of linked "MARC authority" record when "010" = "$0" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[2].authorityHeading); + MarcAuthorities.selectTitle(marcFiles[2].authorityHeading); MarcAuthority.edit(); - QuickMarcEditor.checkContent(`$a ${marcFiles[1].authority010FieldValue}`, 4); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue} $z ${testData.subfieldZValue}`); + QuickMarcEditor.checkContent(`$a ${marcFiles[2].authority010FieldValue}`, 4); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue} $z ${testData.subfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); + MarcAuthorities.searchBy('Keyword', marcFiles[2].authorityHeading); MarcAuthorities.verifyNumberOfTitles(4, '1'); MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.verifyTagFieldAfterLinking(60, testData.tag700, '0', '\\', - `$a ${marcFiles[1].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[1].authority010FieldValue}`, ''); + `$a ${marcFiles[2].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[2].authority010FieldValue}`, ''); + }); + + it('C374159 Edit values in "1XX" and "010" fields of linked "MARC Authority" record when "$0" = "010 $a" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[3].authority555FieldValue); + MarcAuthorities.selectTitle(marcFiles[3].authority555FieldValue); + MarcAuthority.edit(); + QuickMarcEditor.updateExistingField(testData.tag155, `$a ${testData.updated155FieldValue}`); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${testData.updated010FieldValue}`); + QuickMarcEditor.saveAndCloseUpdatedLinkedBibField(); + QuickMarcEditor.confirmUpdateLinkedBibs(1); + MarcAuthorities.searchBy('Keyword', testData.updated155FieldValue); + MarcAuthorities.checkResultList([testData.updated155FieldValue]); + MarcAuthorities.verifyNumberOfTitles(4, '1'); + MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); + + InventoryInstance.checkInstanceTitle(marcFiles[1].instanceTitle); + InventoryInstance.verifyRecordStatus(testData.autoUpdateUserName); + InventoryInstance.verifyInstanceSubject(11, 0, `${testData.authorityIconText}${testData.updated155FieldValue}`); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane(testData.subjectAccordion); + + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.checkPaneheaderContains(`Source: ${testData.autoUpdateUserName}`); + QuickMarcEditor.verifyTagFieldAfterLinking(52, '655', '\\', '7', `$a ${testData.updated155FieldValue}`, '', `$0 id.loc.gov/authorities/genreForms/${testData.updated010FieldValue}`, '$2 fast'); }); }); diff --git a/cypress/e2e/marc-authority/marc-authority-sort.cy.js b/cypress/e2e/marc-authority/marc-authority-sort.cy.js index 61a90bc8cd..6e1f404b0a 100644 --- a/cypress/e2e/marc-authority/marc-authority-sort.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-sort.cy.js @@ -11,6 +11,9 @@ import Logs from '../../support/fragments/data_import/logs/logs'; import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('MARC Authority Sort', () => { const testData = { authority: { diff --git a/cypress/e2e/marc-authority/open-marc-bib-650-field-using-number-of-title-link.cy.js b/cypress/e2e/marc-authority/open-marc-bib-650-field-using-number-of-title-link.cy.js new file mode 100644 index 0000000000..0435319539 --- /dev/null +++ b/cypress/e2e/marc-authority/open-marc-bib-650-field-using-number-of-title-link.cy.js @@ -0,0 +1,110 @@ +import TestTypes from '../../support/dictionary/testTypes'; +import DevTeams from '../../support/dictionary/devTeams'; +import Permissions from '../../support/dictionary/permissions'; +import TopMenu from '../../support/fragments/topMenu'; +import Users from '../../support/fragments/users/users'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import DataImport from '../../support/fragments/data_import/dataImport'; +import Logs from '../../support/fragments/data_import/logs/logs'; +import JobProfiles from '../../support/fragments/data_import/job_profiles/jobProfiles'; +import getRandomPostfix from '../../support/utils/stringTools'; +import MarcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; + +describe('MARC -> MARC Authority', () => { + const testData = { + tag: '650', + marcValue: 'Speaking Oratory debating', + rowIndex: 15, + searchOption: 'Keyword', + instanceTitle: 'Abraham Lincoln, by Lillian Hertz. Prize essay in Alexander Hamilton junior high school P.S. 186, June 24, 1927.', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC375271.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }, + { + marc: 'marcAuthFileForC375271.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1, + } + ]; + + const createdAuthorityIDs = []; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFile(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(marcFile.fileName); + for (let i = 0; i < marcFile.numOfRecords; i++) { + Logs.getCreatedItemsID(i).then(link => { + createdAuthorityIDs.push(link.split('/')[5]); + }); + } + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.clickLinkIconInTagField(testData.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(testData.marcValue); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex(testData.tag, testData.rowIndex); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }) + + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); + }); + }); + + after('Deleting created user', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + createdAuthorityIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + }); + + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + for (let i = 0; i < 2; i++) { + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + } + }); + + it('C375271 "Number of titles" link in "MARC authority" app opens linked "MARC bib" record with controlled "650" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchByParameter(testData.searchOption, testData.marcValue); + MarcAuthorities.checkRow(testData.marcValue); + MarcAuthorities.verifyNumberOfTitles(4, '1'); + MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); + InventorySearchAndFilter.verifySearchResult(testData.instanceTitle); + InventoryInstance.checkPresentedText(testData.instanceTitle); + }); +}); diff --git a/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js b/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js index 663c25b39b..09c9243a1c 100644 --- a/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js +++ b/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js @@ -15,8 +15,9 @@ import SettingsMenu from '../../../support/fragments/settingsMenu'; import InteractorsTools from '../../../support/utils/interactorsTools'; import DateTools from '../../../support/utils/dateTools'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Edifact export', () => { - const order = { ...NewOrder.defaultOneTimeOrder }; const organization = { ...NewOrganization.defaultUiOrganizations, @@ -49,13 +50,13 @@ describe('orders: Edifact export', () => { cy.getAdminToken(); ServicePoints.getViaApi() - .then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) - .then(res => { - location = res; - }); - }); + .then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) + .then(res => { + location = res; + }); + }); Organizations.createOrganizationViaApi(organization) .then(organizationsResponse => { @@ -70,20 +71,20 @@ describe('orders: Edifact export', () => { Organizations.fillIntegrationInformation(integrationName1, integartionDescription1, 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(); - Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); - OrderLines.fillInPOLineInfoForExportWithLocation(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId); - OrderLines.backToEditingOrder(); - }); - + .then((response) => { + orderNumber = response.body.poNumber; + cy.visit(TopMenu.ordersPath); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); + OrderLines.fillInPOLineInfoForExportWithLocation(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId); + OrderLines.backToEditingOrder(); + }); + cy.createTempUser([ permissions.uiOrdersDelete.gui, - permissions.uiOrdersCreate.gui, + permissions.uiOrdersCreate.gui, permissions.uiOrdersEdit.gui, ]) .then(userProperties => { @@ -97,11 +98,11 @@ describe('orders: Edifact export', () => { cy.visit(SettingsMenu.ordersPurchaseOrderLinesLimit); Organizations.deleteOrganizationViaApi(organization.id); NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - location.institutionId, - location.campusId, - location.libraryId, - location.id - ); + location.institutionId, + location.campusId, + location.libraryId, + location.id + ); Users.deleteViaApi(user.userId); }); @@ -109,6 +110,6 @@ describe('orders: Edifact export', () => { Orders.searchByParameter('PO number', orderNumber); Orders.selectFromResultsList(); Orders.deleteOrderViaActions(); - InteractorsTools.checkCalloutMessage(`The purchase order ${orderNumber} was successfully deleted`) + InteractorsTools.checkCalloutMessage(`The purchase order ${orderNumber} was successfully deleted`); }); }); diff --git a/cypress/e2e/orders/pol-search-am-filter.cy.js b/cypress/e2e/orders/pol-search-am-filter.cy.js index 5083bb0480..8bc1aab8f0 100644 --- a/cypress/e2e/orders/pol-search-am-filter.cy.js +++ b/cypress/e2e/orders/pol-search-am-filter.cy.js @@ -13,6 +13,8 @@ import OrderLines from '../../support/fragments/orders/orderLines'; import SettingsMenu from '../../support/fragments/settingsMenu'; import SettingsOrders from '../../support/fragments/settings/orders/settingsOrders'; +Cypress.on('uncaught:exception', () => false); + describe('orders: export', () => { const order = { ...NewOrder.defaultOneTimeOrder }; const organization = { diff --git a/cypress/e2e/users/create-new-permission-set.cy.js b/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js similarity index 74% rename from cypress/e2e/users/create-new-permission-set.cy.js rename to cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js index a97fc623e7..11b011aea8 100644 --- a/cypress/e2e/users/create-new-permission-set.cy.js +++ b/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js @@ -1,8 +1,8 @@ -import devTeams from '../../support/dictionary/devTeams'; -import { getTestEntityValue } from '../../support/utils/stringTools'; -import TestTypes from '../../support/dictionary/testTypes'; -import SettingsMenu from '../../support/fragments/settingsMenu'; -import PermissionSets from '../../support/fragments/settings/users/permissionSets'; +import devTeams from '../../../support/dictionary/devTeams'; +import { getTestEntityValue } from '../../../support/utils/stringTools'; +import TestTypes from '../../../support/dictionary/testTypes'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import PermissionSets from '../../../support/fragments/settings/users/permissionSets'; describe('Permission Sets', () => { const newPermissionSet = { diff --git a/cypress/e2e/permissions/permission-sets/setting-users-view-all-settings-works-as-expected.cy.js b/cypress/e2e/permissions/permission-sets/setting-users-view-all-settings-works-as-expected.cy.js new file mode 100644 index 0000000000..f1391a48cb --- /dev/null +++ b/cypress/e2e/permissions/permission-sets/setting-users-view-all-settings-works-as-expected.cy.js @@ -0,0 +1,94 @@ +import uuid from 'uuid'; +import devTeams from '../../../support/dictionary/devTeams'; +import permissions from '../../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../../support/utils/stringTools'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import TestTypes from '../../../support/dictionary/testTypes'; +import Users from '../../../support/fragments/users/users'; +import PatronGroups from '../../../support/fragments/settings/users/patronGroups'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import UserEdit from '../../../support/fragments/users/userEdit'; +import UsersOwners from '../../../support/fragments/settings/users/usersOwners'; +import WaiveReasons from '../../../support/fragments/settings/users/waiveReasons'; +import RefundReasons from '../../../support/fragments/settings/users/refundReasons'; +import PaymentMethods from '../../../support/fragments/settings/users/paymentMethods'; +import UsersSettingsGeneral from '../../../support/fragments/settings/users/usersSettingsGeneral'; + +describe('Permission Sets', () => { + let userData; + const patronGroup = { + name: getTestEntityValue('GroupPermissionSets'), + }; + const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotestPermissionSets', uuid()), + }; + const ownerBody = { + ...UsersOwners.getDefaultNewOwner(uuid()), + servicePointOwner: [ + { + value: testData.userServicePoint.id, + label: testData.userServicePoint.name, + }, + ], + }; + const waiveReason = WaiveReasons.getDefaultNewWaiveReason(uuid()); + const refundReason = RefundReasons.getDefaultNewRefundReason(uuid()); + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.createViaApi(testData.userServicePoint); + UsersOwners.createViaApi(ownerBody); + WaiveReasons.createViaApi(waiveReason); + PaymentMethods.createViaApi(ownerBody.id).then((paymentRes) => { + testData.paymentMethodId = paymentRes.id; + testData.paymentMethodName = paymentRes.name; + }); + RefundReasons.createViaApi(refundReason); + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser([permissions.uiUsersViewAllSettings.gui], patronGroup.name).then((userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi( + testData.userServicePoint.id, + userData.userId, + testData.userServicePoint.id + ); + cy.login(userData.username, userData.password); + }); + }); + }); + + after('Deleting created entities', () => { + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + RefundReasons.deleteViaApi(refundReason.id); + WaiveReasons.deleteViaApi(waiveReason.id); + PaymentMethods.deleteViaApi(testData.paymentMethodId); + UsersOwners.deleteViaApi(ownerBody.id); + }); + + it( + 'C402752 Verify that "Setting (Users): View all settings" works as expected Scenario 2 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.usersOwnersPath); + UsersSettingsGeneral.checkEntityInTable({ reason: ownerBody.owner, description: ownerBody.desc }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.waiveReasons); + UsersSettingsGeneral.checkEntityInTable({ reason: waiveReason.nameReason, description: waiveReason.description }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.paymentsPath); + PaymentMethods.checkPaymentMethodInTable(ownerBody.owner, testData.paymentMethodName); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.refundReasons); + UsersSettingsGeneral.checkEntityInTable({ reason: refundReason.nameReason, description: refundReason.description }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + } + ); +}); diff --git a/cypress/e2e/permissions/permission-to-view-all-tags-settings-is-added.cy.js b/cypress/e2e/permissions/permission-to-view-all-tags-settings-is-added.cy.js new file mode 100644 index 0000000000..9909c88e77 --- /dev/null +++ b/cypress/e2e/permissions/permission-to-view-all-tags-settings-is-added.cy.js @@ -0,0 +1,80 @@ +import devTeams from '../../support/dictionary/devTeams'; +import permissions from '../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../support/utils/stringTools'; +import TopMenu from '../../support/fragments/topMenu'; +import SettingsMenu from '../../support/fragments/settingsMenu'; +import TestTypes from '../../support/dictionary/testTypes'; +import Users from '../../support/fragments/users/users'; +import PatronGroups from '../../support/fragments/settings/users/patronGroups'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import UserEdit from '../../support/fragments/users/userEdit'; +import TagsGeneral from '../../support/fragments/settings/tags/tags-general'; +import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; + +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + +describe('Permissions Tags', () => { + let userData; + let servicePointId; + const patronGroup = { + name: getTestEntityValue('groupTags'), + }; + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }).then((servicePoints) => { + servicePointId = servicePoints[0].id; + }); + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser( + [ + permissions.uiUserCanEnableDisableTags.gui, + permissions.uiUserEdit.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiViewTagsSettings.gui, + ], + patronGroup.name + ).then((userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password, { + path: SettingsMenu.tagsGeneralPath, + waiter: TagsGeneral.waitLoading, + }); + }); + }); + }); + + after('Deleting created entities', () => { + cy.loginAsAdmin({ + path: SettingsMenu.tagsGeneralPath, + waiter: TagsGeneral.waitLoading, + }); + TagsGeneral.changeEnableTagsStatus('enable'); + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + }); + + it( + 'C396357 Verify that new permission to view all the Tags settings is added', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + TagsGeneral.changeEnableTagsStatus('disable'); + cy.visit(TopMenu.usersPath); + UsersSearchPane.waitLoading(); + UsersSearchPane.searchByUsername(userData.username); + UsersSearchPane.waitLoading(); + UserEdit.addPermissions([permissions.uiUserCanEnableDisableTags.gui]); + UserEdit.saveAndClose(); + cy.login(userData.username, userData.password, { + path: SettingsMenu.tagsGeneralPath, + waiter: TagsGeneral.waitLoading, + }); + TagsGeneral.checkEnableTagsNotAvailable(); + } + ); +}); diff --git a/cypress/e2e/quickmark/holding-quickmark.cy.js b/cypress/e2e/quickmark/holding-quickmark.cy.js index b5d6df5009..23fddddf3a 100644 --- a/cypress/e2e/quickmark/holding-quickmark.cy.js +++ b/cypress/e2e/quickmark/holding-quickmark.cy.js @@ -16,6 +16,9 @@ import JobProfiles from '../../support/fragments/data_import/job_profiles/jobPro import Logs from '../../support/fragments/data_import/logs/logs'; import getRandomPostfix from '../../support/utils/stringTools'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('MARC -> MARC Holdings', () => { const testData = {}; const fileName = `testMarcFile.${getRandomPostfix()}.mrc`; @@ -51,6 +54,9 @@ describe('MARC -> MARC Holdings', () => { cy.login(testData.user.username, testData.user.password, { path: TopMenu.inventoryPath, waiter: InventorySearchAndFilter.waitLoading }); InventorySearchAndFilter.searchInstanceByTitle(instanceID); InventorySearchAndFilter.selectViewHoldings(); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.editInQuickMarc(); }); @@ -74,16 +80,23 @@ describe('MARC -> MARC Holdings', () => { const expectedInSourceRow = QuickMarcEditor.fillAllAvailableValues(undefined, undefined, HoldingsRecordView.newHolding.rowsCountInQuickMarcEditor); QuickMarcEditor.pressSaveAndClose(); HoldingsRecordView.waitLoading(); - + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(expectedInSourceRow); }); it('C345398 Edit MARC 008 (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { + //Wait until the page to be loaded fully. + cy.wait(1000); QuickMarcEditor.checkNotExpectedByteLabelsInTag008Holdings(); const changed008TagValue = QuickMarcEditor.updateAllDefaultValuesIn008TagInHoldings(); HoldingsRecordView.waitLoading(); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(changed008TagValue); InventoryViewSource.close(); @@ -107,6 +120,11 @@ describe('MARC -> MARC Holdings', () => { QuickMarcEditor.pressSaveAndClose(); InteractorsTools.checkCalloutMessage('Record cannot be saved. An 852 is required.', calloutTypes.error); QuickMarcEditor.closeWithoutSavingAfterChange(); + //TODO: Delete below four lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + HoldingsRecordView.waitLoading(); + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(QuickMarcEditor.getSourceContent(initialTagContent)); }); diff --git a/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js b/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js new file mode 100644 index 0000000000..c47c1a41fa --- /dev/null +++ b/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js @@ -0,0 +1,78 @@ +import uuid from 'uuid'; +import devTeams from '../../support/dictionary/devTeams'; +import permissions from '../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../support/utils/stringTools'; +import SettingsMenu from '../../support/fragments/settingsMenu'; +import TestTypes from '../../support/dictionary/testTypes'; +import Users from '../../support/fragments/users/users'; +import PatronGroups from '../../support/fragments/settings/users/patronGroups'; +import NewNoticePolicyTemplate from '../../support/fragments/circulation/newNoticePolicyTemplate'; +import NoticePolicyTemplate from '../../support/fragments/circulation/notice-policy-template'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; +import UserEdit from '../../support/fragments/users/userEdit'; + +describe('Patron Notices', () => { + let userData; + const patronGroup = { + name: getTestEntityValue('groupNoticePolicy'), + }; + const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotestReceiveNotice', uuid()), + }; + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.createViaApi(testData.userServicePoint); + testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); + Location.createViaApi(testData.defaultLocation); + NoticePolicyTemplate.createViaApi('Loan').then((noticeTemplateResp) => { + testData.noticeTemplateBody = noticeTemplateResp.body; + }); + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser([permissions.uiCirculationSettingsNoticeTemplates.gui], patronGroup.name).then( + (userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi( + testData.userServicePoint.id, + userData.userId, + testData.userServicePoint.id + ); + cy.login(userData.username, userData.password, { + path: SettingsMenu.circulationPatronNoticeTemplatesPath, + waiter: NewNoticePolicyTemplate.waitLoading, + }); + } + ); + }); + }); + + after('Deleting created entities', () => { + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + NoticePolicyTemplate.deleteViaApi(testData.noticeTemplateBody.id); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + Location.deleteViaApiIncludingInstitutionCampusLibrary( + testData.defaultLocation.institutionId, + testData.defaultLocation.campusId, + testData.defaultLocation.libraryId, + testData.defaultLocation.id + ); + }); + + it( + 'C387434 Add "Discovery display name" as notice token in Settings', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + NewNoticePolicyTemplate.editTemplate(testData.noticeTemplateBody.name); + NewNoticePolicyTemplate.clearBody(); + NewNoticePolicyTemplate.addToken('item.effectiveLocationDiscoveryDisplayName'); + NewNoticePolicyTemplate.saveAndClose(); + NewNoticePolicyTemplate.waitLoading(); + NoticePolicyTemplate.checkPreview('Main Library'); + } + ); +}); diff --git a/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js b/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js index b4c9e8e90d..a735726976 100644 --- a/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js +++ b/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js @@ -1,3 +1,4 @@ +import moment from 'moment'; import uuid from 'uuid'; import TestTypes from '../../support/dictionary/testTypes'; import { ITEM_STATUS_NAMES } from '../../support/constants'; @@ -51,6 +52,7 @@ describe('Loan notice triggers', () => { category: 'Loan', subject: getTestEntityValue(noticeName), body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -290,10 +292,13 @@ describe('Loan notice triggers', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.uponAt); + delete noticeTemplates.uponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.uponAt); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.afterOnce); + delete noticeTemplates.afterOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.afterOnce); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.afterRecurring); + delete noticeTemplates.afterRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.afterRecurring); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); diff --git a/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js b/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js index 7baa9a4079..999a2725aa 100644 --- a/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js +++ b/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js @@ -1,4 +1,4 @@ -// This test is failing due to the CIRCSTORE-412 bug. +import moment from 'moment'; import uuid from 'uuid'; import TestTypes from '../../support/dictionary/testTypes'; import { REQUEST_TYPES } from '../../support/constants'; @@ -57,6 +57,7 @@ describe('Request notice triggers', () => { category: 'Request', subject: getTestEntityValue(noticeName), body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -304,16 +305,22 @@ describe('Request notice triggers', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.itemRecaled); + delete noticeTemplates.itemRecaled.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.itemRecaled); NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.recallRequest); + delete noticeTemplates.recallRequest.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.recallRequest); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.awaitingPickUp); + delete noticeTemplates.awaitingPickUp.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.awaitingPickUp); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.holdShelfBeforeOnce); + delete noticeTemplates.holdShelfBeforeOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfBeforeOnce); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.holdShelfBeforeRecurring); + delete noticeTemplates.holdShelfBeforeRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfBeforeRecurring); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.holdShelfUponAt); + delete noticeTemplates.holdShelfUponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfUponAt); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); diff --git a/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js b/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js index 8c7663a4f9..086b68d927 100644 --- a/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js +++ b/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js @@ -1,4 +1,5 @@ import uuid from 'uuid'; +import moment from 'moment'; import { ITEM_STATUS_NAMES, REQUEST_TYPES } from '../../support/constants'; import TestTypes from '../../support/dictionary/testTypes'; import devTeams from '../../support/dictionary/devTeams'; @@ -44,6 +45,7 @@ describe('Request notice triggers', () => { category: 'Request', subject: getTestEntityValue(noticeName), body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -189,8 +191,10 @@ describe('Request notice triggers', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.pageRequest); + delete noticeTemplates.pageRequest.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.pageRequest); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.cancelRequest); + delete noticeTemplates.cancelRequest.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.cancelRequest); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); @@ -233,11 +237,12 @@ describe('Request notice triggers', () => { NewRequest.waitLoadingNewRequestPage(); NewRequest.enterItemInfo(itemData.barcode); NewRequest.verifyItemInformation([itemData.barcode, itemData.title]); - NewRequest.verifyRequestInformation(ITEM_STATUS_NAMES.AVAILABLE); NewRequest.enterRequesterInfo({ requesterBarcode: userData.barcode, pickupServicePoint: testData.userServicePoint.name, }); + NewRequest.verifyRequestInformation(ITEM_STATUS_NAMES.AVAILABLE); + NewRequest.chooseRequestType(REQUEST_TYPES.PAGE); // needed to prevent from error "Cannot create a request without Instance ID" // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); diff --git a/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js b/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js index 4b176cd9e7..1a2f9b1186 100644 --- a/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js +++ b/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js @@ -35,6 +35,7 @@ describe('Triggers: Check Out, Loan due date change, Check in', () => { description: 'Created by autotest team', body: 'Test_email_body', category: 'Loan', + previewText: 'Test_email_body' }; const checkOutTemplate = { ...defaultTemplate }; checkOutTemplate.name += ' Check out'; @@ -247,10 +248,13 @@ describe('Triggers: Check Out, Loan due date change, Check in', () => { { tags: [TestTypes.smoke, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(checkOutTemplate); + delete checkOutTemplate.previewText; NewNoticePolicyTemplate.checkAfterSaving(checkOutTemplate); NewNoticePolicyTemplate.createPatronNoticeTemplate(loanDueDateChangeTemplate); + delete loanDueDateChangeTemplate.previewText; NewNoticePolicyTemplate.checkAfterSaving(loanDueDateChangeTemplate); NewNoticePolicyTemplate.createPatronNoticeTemplate(checkInTemplate); + delete checkInTemplate.previewText; NewNoticePolicyTemplate.checkAfterSaving(checkInTemplate); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); diff --git a/cypress/e2e/requests/edit-request.cy.js b/cypress/e2e/requests/edit-request.cy.js index ee29021ce6..584e1796d5 100644 --- a/cypress/e2e/requests/edit-request.cy.js +++ b/cypress/e2e/requests/edit-request.cy.js @@ -47,7 +47,7 @@ describe('ui-requests: Request: Edit requests. Make sure that edits are being sa }); it('C556 Request: Edit requests. Make sure that edits are being saved. (vega)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + { tags: [TestTypes.smoke, DevTeams.vega] }, () => { cy.visit(TopMenu.requestsPath); Object.values(EditRequest.requestStatuses).forEach(status => { EditRequest.checkIsEditsBeingSaved(requestData, instanceData, status); diff --git a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js index cda8d184a1..8f16914ad0 100644 --- a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js +++ b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js @@ -44,11 +44,13 @@ describe('Mapping profile - setup', () => { ExportNewFieldMappingProfile.createNewFieldMappingProfile(fieldMappingProfileName, ['Source record storage (entire record)', 'Holdings', 'Item']); ModalSelectTransformations.verifyCheckboxDisabled('Instance'); ModalSelectTransformations.uncheckItemRecordTypeChechbox(); + ModalSelectTransformations.searchItemTransformationsByName('Holdings - ID'); ModalSelectTransformations.clickNthCheckbox(); ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', '$a'); ModalSelectTransformations.uncheckHoldingsRecordTypeChechbox(); ModalSelectTransformations.checkItemRecordTypeChechbox(); + ModalSelectTransformations.searchItemTransformationsByName('Item - ID'); ModalSelectTransformations.clickNthCheckbox(); ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', '$a'); diff --git a/cypress/e2e/settings/orders/create-order-template.cy.js b/cypress/e2e/settings/orders/create-order-template.cy.js index 3684b4619e..d6c438319d 100644 --- a/cypress/e2e/settings/orders/create-order-template.cy.js +++ b/cypress/e2e/settings/orders/create-order-template.cy.js @@ -11,6 +11,8 @@ import getRandomPostfix from '../../../support/utils/stringTools'; import Orders from '../../../support/fragments/orders/orders'; import TopMenu from '../../../support/fragments/topMenu'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Settings', () => { const organization = { ...NewOrganization.defaultUiOrganizations }; const acquisitionMethod = { ...AcquisitionMethods.defaultAcquisitionMethod }; diff --git a/cypress/e2e/settings/orders/edit-order-template.cy.js b/cypress/e2e/settings/orders/edit-order-template.cy.js index 1cd5cbbdfc..f09f7723d2 100644 --- a/cypress/e2e/settings/orders/edit-order-template.cy.js +++ b/cypress/e2e/settings/orders/edit-order-template.cy.js @@ -11,6 +11,8 @@ import getRandomPostfix from '../../../support/utils/stringTools'; import Orders from '../../../support/fragments/orders/orders'; import TopMenu from '../../../support/fragments/topMenu'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Settings', () => { const organization = { ...NewOrganization.defaultUiOrganizations }; const acquisitionMethod = { ...AcquisitionMethods.defaultAcquisitionMethod }; diff --git a/cypress/e2e/settings/orders/increase-pol-limit.cy.js b/cypress/e2e/settings/orders/increase-pol-limit.cy.js index 2e23f55853..ed4ce97acc 100644 --- a/cypress/e2e/settings/orders/increase-pol-limit.cy.js +++ b/cypress/e2e/settings/orders/increase-pol-limit.cy.js @@ -14,6 +14,8 @@ import SettingsOrders from '../../../support/fragments/settings/orders/settingsO import SettingsMenu from '../../../support/fragments/settingsMenu'; import Users from '../../../support/fragments/users/users'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Settings', () => { const order = { ...NewOrder.defaultOneTimeOrder, @@ -97,7 +99,7 @@ describe('orders: Settings', () => { Orders.searchByParameter('PO number', orderNumber); Orders.selectFromResultsList(); Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId, '4'); OrderLines.backToEditingOrder(); Orders.createPOLineViaActions(); diff --git a/cypress/e2e/settings/remote-storage/configurations.cy.js b/cypress/e2e/settings/remote-storage/configurations.cy.js index 6e6b58fbec..302256c572 100644 --- a/cypress/e2e/settings/remote-storage/configurations.cy.js +++ b/cypress/e2e/settings/remote-storage/configurations.cy.js @@ -7,7 +7,10 @@ import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; let user; -const name = `AutotestConfigurationName${getRandomPostfix()}`; + +const dematicEMS = RemoteStorageHelper.configurations.DematicEMS; +const caiaSoft = RemoteStorageHelper.configurations.CaiaSoft; +const dematicStagingDirector = RemoteStorageHelper.configurations.DematicStagingDirector; describe('remote-storage-configuration', () => { before('create test data', () => { @@ -18,14 +21,11 @@ describe('remote-storage-configuration', () => { }); after('delete test data', () => { - RemoteStorageHelper.deleteRemoteStorage(name); Users.deleteViaApi(user.userId); }); it('C343219 Check “Accession tables” page without configurations with CaiaSoft provider (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - const dematicEMS = RemoteStorageHelper.configurations.DematicEMS; - const caiaSoft = RemoteStorageHelper.configurations.CaiaSoft; - const dematicStagingDirector = RemoteStorageHelper.configurations.DematicStagingDirector; + const name = `AutotestConfigurationName${getRandomPostfix()}`; dematicEMS.create(name); RemoteStorageHelper.verifyCreatedConfiguration(name, dematicEMS); @@ -39,5 +39,17 @@ describe('remote-storage-configuration', () => { RemoteStorageHelper.closeWithSaving(); RemoteStorageHelper.verifyEditedConfiguration(name, { provider: `${dematicStagingDirector.title} (TCP/IP)` }); RemoteStorageHelper.verifyDataSynchronizationSettingsAccordion(true); + + RemoteStorageHelper.deleteRemoteStorage(name); + }); + + it('C343287 Data synchronization settings field must be undefined for any provider except Dematic StagingDirector (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + const name = `AutotestConfigurationName${getRandomPostfix()}`; + + RemoteStorageHelper.verifyProviderDataSynchronizationSettings(); + dematicStagingDirector.create(name); + RemoteStorageHelper.verifyCreatedConfiguration(name, dematicStagingDirector); + + RemoteStorageHelper.deleteRemoteStorage(name); }); }); diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js new file mode 100644 index 0000000000..d53fe8c65c --- /dev/null +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -0,0 +1,75 @@ +import settingsMenu from '../../../../support/fragments/settingsMenu'; +import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; + +describe('Build the Cornell bursar transfer file', () => { + before(() => { + cy.loginAsAdmin({ + path: settingsMenu.usersTransferCriteria, + waiter: TransferFeeFine.waitLoadingTransferCriteria, + }); + }); + + it('should be able to open all the panes', () => { + TransferFeeFine.openAllPanes(); + TransferFeeFine.verifyOpenAllPanes(); + }); + + it('should be able to set scheduling', () => { + TransferFeeFine.setTransferCriteriaScheduling( + 'Weeks', + '1', + '11:00 P', + ['Monday'] + ); + TransferFeeFine.verifyTransferCriteriaScheduling( + 'WEEK', + '1', + '11:00 PM', + ['Monday'] + ); + }); + + it('should be able to set no criteria', () => { + TransferFeeFine.setCriteria(false); + TransferFeeFine.verifyCriteria(false); + }); + + // Aggregate by patron: Box unchecked + it('should be able to set aggregate by patron', () => { + TransferFeeFine.setAggregateByPatron(false); + TransferFeeFine.verifyAggregateByPatron(false); + }); + + // Header Format + it('should be able to set header format', () => { + TransferFeeFine.clearFormat('header'); + TransferFeeFine.verifyClearFormat('header'); + TransferFeeFine.addCornellHeaderFormat(); + TransferFeeFine.verifyAddCornellHeaderFormat(); + }); + + // Account Data Format + it('should be able to set account data format', () => { + TransferFeeFine.clearFormat('data'); + TransferFeeFine.verifyClearFormat('data'); + TransferFeeFine.addCornellDataFormat(); + TransferFeeFine.verifyAddCornellDataFormat(); + }); + + // Footer Format + it('should be able to set footer format', () => { + TransferFeeFine.clearFormat('footer'); + TransferFeeFine.verifyClearFormat('footer'); + }); + + // Transer account data to + it('should be able to set transfer account data to', () => { + TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('b25fd8e7-a0e7-4690-ab0b-94039739c0db', '90c1820f-60bf-4b9a-99f5-d677ea78ddca'); + }); + + it('should be able to run manually', () => { + TransferFeeFine.runManually(); + TransferFeeFine.verifyRunManually(); + }); +}); diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js new file mode 100644 index 0000000000..abbbafba8b --- /dev/null +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js @@ -0,0 +1,75 @@ +import settingsMenu from '../../../../support/fragments/settingsMenu'; +import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; + +describe('Build the Duke bursar transfer file', () => { + before(() => { + cy.loginAsAdmin({ + path: settingsMenu.usersTransferCriteria, + waiter: TransferFeeFine.waitLoadingTransferCriteria, + }); + }); + + it('should be able to open all the panes', () => { + TransferFeeFine.openAllPanes(); + TransferFeeFine.verifyOpenAllPanes(); + }); + + it('should be able to set scheduling', () => { + TransferFeeFine.setTransferCriteriaScheduling( + 'Weeks', + '0', + '3:30 P', + ['Monday'] + ); + TransferFeeFine.verifyTransferCriteriaScheduling( + 'WEEK', + '0', + '3:30 PM', + ['Monday'] + ); + }); + + it('should be able to set no criteria', () => { + TransferFeeFine.setCriteria(false); + TransferFeeFine.verifyCriteria(false); + }); + + // Aggregate by patron: Box unchecked + it('should be able to set aggregate by patron', () => { + TransferFeeFine.setAggregateByPatron(false); + TransferFeeFine.verifyAggregateByPatron(false); + }); + + // Header Format + it('should be able to set header format', () => { + TransferFeeFine.clearFormat('header'); + TransferFeeFine.verifyClearFormat('header'); + TransferFeeFine.addDukeHeaderFormat(); + TransferFeeFine.verifyAddDukeHeaderFormat(); + }); + + // Account Data Format + it('should be able to set account data format', () => { + TransferFeeFine.clearFormat('data'); + TransferFeeFine.verifyClearFormat('data'); + TransferFeeFine.addDukeDataFormat(); + TransferFeeFine.verifyAddDukeDataFormat(); + }); + + // Footer Format + it('should be able to set footer format', () => { + TransferFeeFine.clearFormat('footer'); + TransferFeeFine.verifyClearFormat('footer'); + }); + + // Transer account data to + it('should be able to set transfer account data to', () => { + TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('b25fd8e7-a0e7-4690-ab0b-94039739c0db', '90c1820f-60bf-4b9a-99f5-d677ea78ddca'); + }); + + it('should be able to run manually', () => { + TransferFeeFine.runManually(); + TransferFeeFine.verifyRunManually(); + }); +}); diff --git a/cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js b/cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cypress/e2e/settings/users/owners.cy.js b/cypress/e2e/settings/users/owners.cy.js index fdcd4c5dea..112b4f8f45 100644 --- a/cypress/e2e/settings/users/owners.cy.js +++ b/cypress/e2e/settings/users/owners.cy.js @@ -8,6 +8,9 @@ import Features from '../../../support/dictionary/features'; import users from '../../../support/fragments/users/users'; import ServicePoint from '../../../support/fragments/servicePoint/servicePoint'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('ui-users-settings: Owners', () => { describe('Owner creation', () => { const servicePoints = []; diff --git a/cypress/e2e/settings/users/waiveReasons.cy.js b/cypress/e2e/settings/users/waiveReasons.cy.js index ebdd63071b..46d72d163b 100644 --- a/cypress/e2e/settings/users/waiveReasons.cy.js +++ b/cypress/e2e/settings/users/waiveReasons.cy.js @@ -4,6 +4,7 @@ import Features from '../../../support/dictionary/features'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import WaiveReasons from '../../../support/fragments/settings/users/waiveReasons'; import getRandomPostfix from '../../../support/utils/stringTools'; +import UsersSettingsGeneral from '../../../support/fragments/settings/users/usersSettingsGeneral'; describe('Management of waive reasons', () => { beforeEach(() => { @@ -23,14 +24,14 @@ describe('Management of waive reasons', () => { WaiveReasons.fillReasonParameters(testReason); WaiveReasons.checkSaveButtonState({ isDisabled: false }); WaiveReasons.trySave(); - WaiveReasons.checkReason(testReason); + UsersSettingsGeneral.checkEntityInTable(testReason); // update testReason.description = 'test description'; WaiveReasons.startEdit(testReason.reason); WaiveReasons.fillReasonParameters(testReason); WaiveReasons.checkSaveButtonState({ isDisabled: false }); WaiveReasons.trySave(); - WaiveReasons.checkReason(testReason); + UsersSettingsGeneral.checkEntityInTable(testReason); // delete WaiveReasons.delete(testReason.reason); }); diff --git a/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js b/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js index 47e6634aa0..f92b46c3e5 100644 --- a/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js +++ b/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js @@ -1,38 +1,133 @@ +import uuid from 'uuid'; import devTeams from '../../support/dictionary/devTeams'; import permissions from '../../support/dictionary/permissions'; import { getTestEntityValue } from '../../support/utils/stringTools'; +import { + FULFILMENT_PREFERENCES, + REQUEST_LEVELS, + REQUEST_TYPES, + ITEM_STATUS_NAMES, +} from '../../support/constants'; +import generateItemBarcode from '../../support/utils/generateItemBarcode'; +import TopMenu from '../../support/fragments/topMenu'; import SettingsMenu from '../../support/fragments/settingsMenu'; import TestTypes from '../../support/dictionary/testTypes'; import EditStaffClips from '../../support/fragments/circulation/editStaffClips'; import Users from '../../support/fragments/users/users'; import PatronGroups from '../../support/fragments/settings/users/patronGroups'; +import Requests from '../../support/fragments/requests/requests'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import UserEdit from '../../support/fragments/users/userEdit'; +import NewRequest from '../../support/fragments/requests/newRequest'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; describe('Staff slips', () => { let userData; const patronGroup = { name: getTestEntityValue('groupStaffSlips'), }; + const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotestTLR', uuid()), + itemBarcode: generateItemBarcode(), + }; + const instanceData = { + title: getTestEntityValue('InstanceStaffSlips'), + }; before('Preconditions', () => { - cy.getAdminToken().then(() => { - PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { - patronGroup.id = patronGroupResponse; - }); - cy.createTempUser([permissions.uiCirculationCreateEditRemoveStaffSlips.gui], patronGroup.name).then( - (userProperties) => { + cy.getAdminToken() + .then(() => { + ServicePoints.createViaApi(testData.userServicePoint); + testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); + Location.createViaApi(testData.defaultLocation); + cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { + testData.instanceTypeId = instanceTypes[0].id; + }); + cy.getHoldingTypes({ limit: 1 }).then((holdingTypes) => { + testData.holdingTypeId = holdingTypes[0].id; + }); + cy.getLoanTypes({ limit: 1 }).then((loanTypes) => { + testData.loanTypeId = loanTypes[0].id; + }); + cy.getMaterialTypes({ limit: 1 }).then((materialTypes) => { + testData.materialTypeId = materialTypes.id; + }); + }) + .then(() => { + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId: testData.instanceTypeId, + title: instanceData.title, + }, + holdings: [ + { + holdingsTypeId: testData.holdingTypeId, + permanentLocationId: testData.defaultLocation.id, + }, + ], + items: [ + { + barcode: testData.itemBarcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: testData.loanTypeId }, + materialType: { id: testData.materialTypeId }, + }, + ], + }).then((specialInstanceIds) => { + instanceData.instanceId = specialInstanceIds.instanceId; + instanceData.holdingId = specialInstanceIds.holdingIds[0].id; + instanceData.itemId = specialInstanceIds.holdingIds[0].itemIds[0]; + }); + }) + .then(() => { + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser( + [permissions.uiCirculationCreateEditRemoveStaffSlips.gui, permissions.requestsAll.gui], + patronGroup.name + ).then((userProperties) => { userData = userProperties; + UserEdit.addServicePointViaApi( + testData.userServicePoint.id, + userData.userId, + testData.userServicePoint.id + ); + }); + }) + .then(() => { + Requests.createNewRequestViaApi({ + fulfillmentPreference: FULFILMENT_PREFERENCES.HOLD_SHELF, + holdingsRecordId: testData.holdingTypeId, + instanceId: instanceData.instanceId, + item: { barcode: testData.itemBarcode }, + itemId: instanceData.itemId, + pickupServicePointId: testData.userServicePoint.id, + requestDate: new Date(), + requestExpirationDate: new Date(new Date().getTime() + 86400000), + requestLevel: REQUEST_LEVELS.ITEM, + requestType: REQUEST_TYPES.PAGE, + requesterId: userData.userId, + }).then((request) => { + testData.requestsId = request.body.id; cy.login(userData.username, userData.password); - } - ); - }); - }); - - afterEach('Clear template', () => { - EditStaffClips.editAndClearTransit(); + }); + }); }); after('Deleting created entities', () => { + Requests.deleteRequestViaApi(testData.requestsId); + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); + ServicePoints.deleteViaApi(testData.userServicePoint.id); Users.deleteViaApi(userData.userId); PatronGroups.deleteViaApi(patronGroup.id); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(testData.itemBarcode); + Location.deleteViaApiIncludingInstitutionCampusLibrary( + testData.defaultLocation.institutionId, + testData.defaultLocation.campusId, + testData.defaultLocation.libraryId, + testData.defaultLocation.id + ); }); it( @@ -45,6 +140,7 @@ describe('Staff slips', () => { EditStaffClips.saveAndClose(); EditStaffClips.checkAfterUpdate('Transit'); EditStaffClips.checkPreview('Transit', 'Undergraduate'); + EditStaffClips.editAndClearTransit(); } ); @@ -58,6 +154,24 @@ describe('Staff slips', () => { EditStaffClips.saveAndClose(); EditStaffClips.checkAfterUpdate('Transit'); EditStaffClips.checkPreview('Transit', 'Library Technical Services; IT Operations'); + EditStaffClips.editAndClearTransit(); + } + ); + + it( + 'C388508 Verify that token "currentDateTime" is populated in the pick slip', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.circulationStaffSlipsPath); + EditStaffClips.editPickslip(); + EditStaffClips.addToken(['staffSlip.currentDateTime']); + EditStaffClips.saveAndClose(); + EditStaffClips.checkAfterUpdate('Pick slip'); + cy.visit(TopMenu.requestsPath); + NewRequest.printPickSlips(); + cy.visit(SettingsMenu.circulationStaffSlipsPath); + EditStaffClips.editPickslip(); + EditStaffClips.clearStaffClips(); } ); }); diff --git a/cypress/fixtures/marcAuthFileC374159.mrc b/cypress/fixtures/marcAuthFileC374159.mrc new file mode 100644 index 0000000000..fc869d1c04 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC374159.mrc @@ -0,0 +1 @@ +02799cz a2200421n 4500001000800000005001700008008004100025010002300066035001700089040003500106155001800141455001100159455002200170455001000192455001600202455001900218455001600237455001800253455002500271455002100296555002600317670005800343670030600401670035900707670022301066670021501289670039601504670015101900670006702051670005902118670004102177910005102218910005302269985000802322985002302330906001202353906001202365985899020210911060015.0141201|| anznnbabn |a ana | agf2014026297374159 agf2014026297 aIlChALCSbengcDLCflcgftdDLC aDrama C374159 aDramas wnneaFilmed plays aPlays aPlayscripts aScripts, Stage aStage plays aStage scripts wnneaTelevised plays aTheatrical works wgaLiterature C374159 aLCSH, Oct. 22, 2014b(Drama. UF Plays. BT Literature) aAbrams, M. A glossary of literary terms, c1999b(Drama. The form of composition designed for performance in the theater, in which actors take the roles of the characters, perform the indicated action, and utter the written dialogue. (The common alternative name for a dramatic composition is a play.)) aQuinn, E. A dictionary of literary and thematic terms, c1999b(drama: In its broadest sense, any work in which actors assume roles before an audience, either in a theater or on radio or television. Drama is a major literary genre, frequently subdivided into the categories of tragedy, comedy, and tragicomedy; play: A composition written to be performed) aThe American heritage dictionary of the English language, ©2000, updated 2009, via WWW, Mar. 11, 2014b(theatrical, noun 1. Stage performances or a stage performance, especially by amateurs. Often used in the plural.) aOxford dictionaries website, July 11, 2014b(play, noun 3. A dramatic work for the stage or to be broadcast. Synonyms: drama, theatrical work; screenplay, comedy, tragedy; production, performance, show, sketch) aMerriam-Webster online, July 11, 2014b(play noun 2. a written work in which the story is told through speech and action that is intended to be acted out on stage. Synonyms: drama, dramatization. Related Words: interlude, playlet; comedy, comedy drama, docudrama, dramedy, melodrama, monodrama, musical, musical comedy, psychodrama, tragedy, tragicomedy; magnum opus, opus, work; adaptation) aWynston, G.P. Adapting stage drama for radio : techniques of preparing stage scripts for Canadian Broadcasting Corporation radio production, 1976. aVickers, S. Drama scripts for people with special needs, 2005. aHirsch, M.E. Chinese shadow theater playscripts, 1998. aChayefsky, P. The stage plays, 1995. aRecord saved by td14 on 09/10/2021 at 10:08:18 aProposal saved by tc03 on 01/08/2019 at 15:51:22 aMvI eLiterature project t1515v0 t1812v0 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileC375256_1.mrc b/cypress/fixtures/marcAuthFileC375256_1.mrc new file mode 100644 index 0000000000..9620834267 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC375256_1.mrc @@ -0,0 +1 @@ +00598cz a2200169n 450000100070000000500170000700800410002401000200006503500210008504000180010613000450012443000190016943000190018867001800020767500320038795300090041976691219920825111123.7920825n| acannaab |a ana an92085235375256 a(DLC)n 92085235 aDLCcDLCdDLC 0aBible.lPolish.sBiblia PłockadC375256 0aBiblia Płocka 0aPłocka Biblia aKnapiński, R. Iluminacje romańskiej Biblii Płockiej, 1992:bt.p. (Biblii Płockiej) p. 315 (Early Romanesque Polish handwriting, Biblia Płocka, 2nd quarter of XII cent.) aEnc. Pow. PWNaUltima Thule asd14 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileC375256_2.mrc b/cypress/fixtures/marcAuthFileC375256_2.mrc new file mode 100644 index 0000000000..0549b63845 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC375256_2.mrc @@ -0,0 +1 @@ +00406nz a2200145n 450000100070000000500170000700800410002401000200006503500210008504000180010610000450012440000500016967000320021995300090025192724919990513143117.3990513n| acannaabn |a aaa an99036055375256 a(DLC)n 99036055 aDLCbengcDLC10aAbraham, Angela,dC375256tHosanna Bible10aAbraham, Angela,d1958-tJesus loves me Bible aJesus loves me Bible, 1999. ash21 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileForC375271.mrc b/cypress/fixtures/marcAuthFileForC375271.mrc new file mode 100644 index 0000000000..6b0ea0bf64 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC375271.mrc @@ -0,0 +1 @@ +01068cz a2200337n 4500001000800000005001700008008004100025010001700066035002100083035001500104040001800119053001900137150004300156360006000199450001800259450002800277450001300305550003000318550001600348550003300364550002500397550001400422550001400436550002700450550002600477550002000503680014200523681003200665906001800697953001500715474525120120327095430.0860211i| anannbabn |a ana ash 85095299 a(DLC)sh 85095299 a(DLC)91936 aDLCcDLCdDLC 0aPN4001bPN4355 aSpeaking Oratorybdebating1test01111 isubdivisionaOratoryiunder names of individual persons aArgumentation wnneaOratory, Primitive aSpeaking wgaLanguage and languages wgaRhetoric wgaSpeeches, addresses, etc. aDebates and debating aElocution aEloquence aLectures and lecturing aPersuasion (Rhetoric) aPublic speaking iHere are entered works on the rhetorical aspects of speeches. Works on speaking effectively in public are entered underaPublic speaking. iNote underaPublic speaking t9350ute03v0 axx00bta28 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC374159.mrc b/cypress/fixtures/marcBibFileC374159.mrc new file mode 100644 index 0000000000..4a5acc4e4b --- /dev/null +++ b/cypress/fixtures/marcBibFileC374159.mrc @@ -0,0 +1 @@ +03127cgm a2200733 i 4500001001400000008004100014007001000055005001700065035002400082040006000106024001700166028004600183035002200229037004600251041003300297043001200330050002200342082001800364245006200382250003700444264006100481300005700542336005000599337002300649338003000672344001900702344001900721344002100740344002200761344001100783344001200794347002200806347001200828347002000840380002700860538015100887546007001038500002701108511006201135500005301197500001701250521010001267520023601367610003201603650004501635650003601680650002701716650003101743610005001774650005501824650005001879650004201929650004601971651005202017655003702069700005802106700003202164700002702196700002502223700003302248710005302281994001402334948004502348in00000000001210223s2021 cau194 vleng dvd csaizq20221124071431.3 a(OCoLC)on1238102243 aTEFMTbengerdacTEFMTdTEFdOCLCOdOCLCFdOCLCQdOCLCO1 a03242935510242a59215486000bParamount Home Entertainment a(OCoLC)1238102243 bMidwest Tapenhttp://www.midwesttapes.com1 aengafreaspajengjfreheng aln----- 4aPN1997b.T58 202104a791.43/7222300aTitanic /cwritten and directed by James Cameron. C374159 a[English/French/Spanish version] 1aLos Angeles, CA :bParamount Home Entertainment,c[2021] a2 videodiscs (194 min.) :bsound, color ;c4 3/4 in. atwo-dimensional moving imagebtdi2rdacontent avideobv2rdamedia avideodiscbvd2rdacarrier adigital2rdatr boptical2rdarm gsurround2rdacpc h2.0 Dolby digital h5.1 EX h6.1 DTS avideo file2rdaft bBlu-ray eregion A2rdare aMotion pictures2lcgft aBlu-ray, wide screen; 5.1 surround EX, 6.1 DTS surround (English), 2.0 Dolby digital surround (English, French, Spanish); requires Blu-ray player. aEnglish, French or Spanish dialogue; English or French subtitles. aTitle from sell sheet.1 aLeonardo DiCaprio, Kate Winslet, Billy Zane, Kathy Bates. aOriginally released as a motion picture in 1997. aWide screen.8 aRating: PG-13; for disaster related peril, and violence, nudity, sensuality and brief language. aTitanic is an extraordinary retelling of the doomed voyage that follows the destinies of the Titanic's victims and survivors as their stories of passion, betrayal, and hope unfold amidst the tragic events of the ship's final hours.20aTitanic (Steamship)vDrama. 0aShipwreckszNorth Atlantic OceanvDrama. 0aMan-woman relationshipsvDrama. 0aSocial classesvDrama. 0aShipwreck survivalvDrama.27aTitanic (Steamship)2fast0(OCoLC)fst00522117 7aMan-woman relationships.2fast0(OCoLC)fst01007080 7aShipwreck survival.2fast0(OCoLC)fst01761960 7aShipwrecks.2fast0(OCoLC)fst01116638 7aSocial classes.2fast0(OCoLC)fst01122346 7aNorth Atlantic Ocean.2fast0(OCoLC)fst01242477 7aDrama.2fast0(OCoLC)fst014238791 aCameron, James,d1954-escreenwriter,efilm director.1 aDiCaprio, Leonardo,eactor.1 aWinslet, Kate,eactor.1 aZane, Billy,eactor.1 aBates, Kathy,d1948-eactor.2 aParamount Home Entertainment (Firm),epublisher. aZ0bPAOLF hNO HOLDINGS IN PAOLF - 24 OTHER HOLDINGS \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC375256.mrc b/cypress/fixtures/marcBibFileC375256.mrc new file mode 100644 index 0000000000..6a14ad141f --- /dev/null +++ b/cypress/fixtures/marcBibFileC375256.mrc @@ -0,0 +1 @@ +03800cam 2200601 i 4500001002100000008004100021006001900062007001500081005001700096035002400113040007600137019001500213020003600228020003300264020001500297020001800312035004100330050001000371082001800381130005100399245005400450246002100504250002300525264004900548264001100597300003900608336002600647337002600673338003600699588002600735500004600761500006500807500002200872520036700894505060101261505038901862520020902251630002002460630003402480630002202514630003702536655002202573655005302595710003202648776012902680856010702809856010802916938004503024938002903069938004103098994001403139948004503153nin00009530419375256190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aHoly BiblelEnglish.sEnglish Standard.f2016.10aPrayer Bible (Test record with 130 linked field).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS03769cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375240002600393245005400419246002100473250002300494264004900517264001100566300003900577336002600616337002600642338003600668588002600704500004600730500006500776500002200841520036700863505060101230505038901831520020902220630002002429630003402449630002202483630003702505655002202542655005302564710003202617776012902649856010702778856010802885938004502993938002903038938004103067994001403108948004503122nin00009530419190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aHoly Bible of England10aPrayer Bible (Test record with 240 linked field).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS03759cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375246001200393245005800405246002100463250002300484264004900507264001100556300003900567336002600606337002600632338003600658588002600694500004600720500006500766500002200831520036700853505060101220505038901821520020902210630002002419630003402439630002202473630003702495655002202532655005302554710003202607776012902639856010702768856010802875938004502983938002903028938004103057994001403098948004503112nin00009530419190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aBible 110aPrayer Bible (Test record without linked field: 246).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS03759cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375247001200393245005800405246002100463250002300484264004900507264001100556300003900567336002600606337002600632338003600658588002600694500004600720500006500766500002200831520036700853505060101220505038901821520020902210630002002419630003402439630002202473630003702495655002202532655005302554710003202607776012902639856010702768856010802875938004502983938002903028938004103057994001403098948004503112nin00009530419190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aBible 210aPrayer Bible (Test record without linked field: 270).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC387461.mrc b/cypress/fixtures/marcBibFileC387461.mrc new file mode 100644 index 0000000000..38bc75964a --- /dev/null +++ b/cypress/fixtures/marcBibFileC387461.mrc @@ -0,0 +1 @@ +01248cas a2200397 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808200110023322200420024424500510028626000470033726500380038430000150042231000220043732100250045936200230048457000290050765000330053665000450056965500420061470000450065685300180070186300230071990200160074290500210075894800370077995000340081636683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553 a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 a270.0504aThe Journal of ecclesiastical history04aThe Journal of ecclesiastical history. C387461 aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC375271.mrc b/cypress/fixtures/marcBibFileForC375271.mrc new file mode 100644 index 0000000000..e4a2e20233 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC375271.mrc @@ -0,0 +1 @@ +00757nam a2200217 4500001001000000003000400010005001700014008004100031035002100072035001900093040001300112041000800125100002800133245011800161260002700279300001900306600005900325600008000384650006000464903001500524in2340312ICU19951122000000.0950906s1927 xxu 000 0 eng d a(ICU)BID21137833 a(OCoLC)9192518 aICUcICU0 aeng1 aHertz, Lillian,d1913?-10aAbraham Lincoln,cby Lillian Hertz. Prize essay in Alexander Hamilton junior high school P.S. 186, June 24, 1927. a[United States,c1927] a[4] p.c18 cm.10aLincoln, Abraham,d1809-1865xAddresses, sermons, etc.17aLincoln, Abraham,d1809-18652fast0http://id.worldcat.org/fast/fst00030184 7aOratory.2fast0http://id.worldcat.org/fast/fst01047214 aOCLC/RECON \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC386867.mrc b/cypress/fixtures/marcFileForC386867.mrc new file mode 100644 index 0000000000..58dff95bba --- /dev/null +++ b/cypress/fixtures/marcFileForC386867.mrc @@ -0,0 +1 @@ +01769cas a2200469 a 4500001001200000003000600012005001700018006001900035007001500054008004100069010001700110040005700127019001500184022002800199035003900227042001400266050001600280050001000296082001400306049000900320130005300329210003900382222005400421245004500475246000800520260006100528310001500589336002600604337002600630338003600656362004600692500014700738650004400885650004300929650004100972655002501013710005201038711003501090776010001125841001701225856005701242ocm68188263OCoLC20200717090254.0m o d cr cnu||||||||060504c20069999txufr pso 0 a0eng c a 2006214613 aNSDbengcNSDdWAUdDLCdHULdOCLCQdOCLCFdOCLdAU@ a10582857450 a1931-7603l1931-760321 a(OCoLC)68188263z(OCoLC)1058285745 apccansdp10aISSN RECORD14aQL64010a598.1214 aILGA0 aHerpetological conservation and biology (Online)0 aHerpetol. conserv. biol.b(Online) 0aHerpetological conservation and biologyb(Online)10aHerpetological conservation and biology.13aHCB a[Texarkana, Tex.] :b[publisher not identified],c[2006] aSemiannual atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier1 aBegan with: Vol. 1, issue 1 (Sept. 2006). aPublished in partnership with: Partners in Amphibian & Reptile Conservation (PARC), World Congress of Herpetology, Las Vegas Springs Preserve. 0aHerpetologyxConservationvPeriodicals. 0aAmphibiansxConservationvPeriodicals. 0aReptilesxConservationvPeriodicals. 0aElectronic journals.2 aPartners in Amphibian and Reptile Conservation.2 aWorld Congress of Herpetology.1 tHerpetological conservation and biology (Print)x2151-0733w(DLC) 2009202029w(OCoLC)427887140 av.1- (1992-)40uhttp://www.herpconbio.orgzAvailable to Lehigh users \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC400649.mrc b/cypress/fixtures/marcFileForC400649.mrc new file mode 100644 index 0000000000..762a0e2e01 --- /dev/null +++ b/cypress/fixtures/marcFileForC400649.mrc @@ -0,0 +1 @@ +05077cam a2200769 i 4500006001900000007001500019007001500034008004100049005001700090010001700107040013000124019012200254020003600376020003300412020001500445020001800460035021300478037002700691042001300718043003000731050002100761049000900782111015900791245013500950250002201085264004901107300003401156336002601190337002601216338003601242490008501278504004101363505071401404506005402118533008402172538023702256583008502493588002502578650004302603651004902646651005202695650004302747650005102790650005702841650004802898650005702946651003903003651003603042650005303078651005603131651006203187655002203249655006503271655003903336655002203375700009503397710007203492776024703564830013403811856005003945856005003995856006004045856006004105950004904165950003804214951005504252m o d cr bn||||||abpcr bn||||||ada100317s1981 mx ob 100 0 eng c20230310182223.3 a 83138637 aOCLCEbengerdaepncOCLCEdOCLCQdOCLCOdOCLCQdOCLCFdOCLdOCLCQdCOOdVT2dJSTORdIYUdGZMdUPMdAUMdU9XdUABdNOCdOCLCO a606272588a1056778856a1061083900a1091325862a1115069902a1154285075a1155075406a1181901831a1181903791a1228540641 a9786076284384q(electronic bk.) a6076284382q(electronic bk.) z9681201078 z9789681201074 a(OCoLC)tst557659379z(OCoLC)606272588z(OCoLC)1056778856z(OCoLC)1061083900z(OCoLC)1091325862z(OCoLC)1115069902z(OCoLC)1154285075z(OCoLC)1155075406z(OCoLC)1181901831z(OCoLC)1181903791z(OCoLC)1228540641 a22573/ctvcxggb5bJSTOR apccadlr aa------an------as------ 4aJC375b.I57 1976 aMAIN2 aInternational Congress of Human Sciences in Asia and North African(30th :d1976 :cMexico City, Mexico)0http://id.loc.gov/authorities/names/no202009168710aKingship in Asia and early America :bXXX International Congress of Human Sciences in Asia and North Africa /ceditor, A.L. Basham aPrimera edición 1aMéxico, D.F. :bColegio de México,c1981 a1 online resource (256 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier1 a30th International Congress of Human Sciences in Asia and North Africa. Seminars aIncludes bibliographical references.0 aSacral and not-so-sacral kingship in the ancient Near East / John van Seters -- Kingship in Islam: an historical analysis / S.A.A. Rizvi -- Aspects of the nature and functions of Vedic kingship / James A. Santucci -- Ideas of kingship in Hinduism and Buddhism / A.L.Barsham -- The socio-economic bases of "Oriental despotism" in early India / R.S. Sharma -- Some aspects of kingship in ancient Java / S. Supomo -- Ideologies and traditions of monarchy and government in Imperial China / Hok-lam Chan -- Monarchy and government: traditions and ideologies in pre-modern Japan / Joseph M. Kitagawa -- Kingship in ancient Mexico / Pedro Carrasco -- The Inka and political power in the Andes / Franklin Pease, G.Y. 3Use copyfRestrictions unspecified5MiAaHDL2star aElectronic reproduction.b[S.l.] :cHathiTrust Digital Library,d2010.5MiAaHDL aMaster and use copy. Digital master created according to Benchmark for Faithful Digital Reproductions of Monographs and Serials, Version 1. Digital Library Federation, December 2002.uhttp://purl.oclc.org/DLF/benchrepro02125MiAaHDL1 adigitizedc2010hHathiTrust Digital Librarylcommitted to preserve5MiAaHDL2pda0 aPrint version record 0aKings and rulers, AncientvCongresses. 0aAsiaxKings and rulersxHistoryvCongresses. 0aAmericaxKings and rulersxHistoryvCongresses. 6aRois et souverains anciensxCongrès. 6aRois et souverainszAsiexHistoirexCongrès. 6aRois et souverainszAmériquexHistoirexCongrès. 7aKings and rulers.2fast0(OCoLC)fst00987694 7aKings and rulers, Ancient.2fast0(OCoLC)fst00987739 7aAmerica.2fast0(OCoLC)fst01239786 7aAsia.2fast0(OCoLC)fst01240495 7aRois et souverainsxTitulaturesxCongrès.2ram 7aAsiexRois et souverainsxHistoirexCongrès.2ram 7aAmériquexRois et souverainsxHistoirexCongrès.2ram 4aElectronic books. 7aConference papers and proceedings.2fast0(OCoLC)fst01423772 7aHistory.2fast0(OCoLC)fst01411628 0aElectronic books.1 aBasham, A. L.q(Arthur Llewellyn),eeditor.0http://id.loc.gov/authorities/names/n500184002 aColegio de México.0http://id.loc.gov/authorities/names/n7914279708iPrint version:aInternational Congress of Human Sciences in Asia and North Africa (30th : 1976 : Mexico City, Mexico).tKingship in Asia and early America.b1a ed.dMéxico, D.F. : Colegio de México, 1981w(DLC) 83138637w(OCoLC)10099013 0a30th International Congress of Human Sciences in Asia and North Africa.pSeminars.0http://id.loc.gov/authorities/names/n8370347040uhttps://muse.jhu.edu/book/67428yProject Muse40uhttps://muse.jhu.edu/book/74528yProject Muse40uhttps://www.jstor.org/stable/10.2307/j.ctv26d9pvyJSTOR40uhttps://www.jstor.org/stable/10.2307/j.ctvcwp01nyJSTOR aProject MusebProject Muse Open Access Books aJSTORbBooks at JSTOR Open Access aAdditional title added to collection Muse.oaebooks \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC401727.mrc b/cypress/fixtures/marcFileForC401727.mrc new file mode 100644 index 0000000000..05242a8609 --- /dev/null +++ b/cypress/fixtures/marcFileForC401727.mrc @@ -0,0 +1 @@ +02070cam a2200421Li 4500001001400000003000600014005001700020006001900037007001500056008004100071020003200112020003500144020001500179035002000194040008400214043001200298050002600310100002900336245004900365250001900414264004100433300005100474336002600525337002600551338003600577347001900613490001800632505050800650506004301158588004701201650005101248655002901299830001901328852005101347856017601398901005601574998001801630in00000840947OCoLC20140805232713.0m o u cr cn|||||||||000807s1999 cau o 001 0 eng d a0585165645 (electronic bk.) a9780585165646 (electronic bk.) z0873375351 a(OCoLC)44960117 aN$TbengerdacN$TdOCLdOCLCQdHALANdOCLCQdTUUdOCLCQdOCLCOdOCLCQdUtOrBLW an-us--- 4aKF750.Z9bC585 1999eb1 aClifford, Denis,eauthor10aEstate planning basics /cby Denis Clifford. aFirst edition. 1aBerkeley, Calif. :bNolo.com,c1999. a1 online resource (1 volume (various pagings)) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier adata file2rda1 aQuick & legal00gChapter 1tA First Look At Estate Planning --gChapter 2tYour Beneficiaries --gChapter 3tChildren --gChapter 4tWills --gChapter 5tLiving Trusts --gChapter 6tOther Probate Avoidance Methods --gChapter 7tRetirement Plans as Estate Planning Devices --gChapter 8tEstate Tax --gChapter 9tReducing Federal Estate Taxes --gChapter 10tProperty Control Trusts --gChapter 11tPlanning For Incapacity: Medical Care and Finances --gChapter 12tLawyers --gChapter 13tFinalizing Your Estate Plan.1 aUMass Amherst patrons have access.5MU aDescription based on print version record. 0aEstate planningzUnited StatesvPopular works. 7aElectronic books.2local 0aQuick & legal. aNICj4354tLC ModifiedpTestPrefh322sTestSuf40uhttp://silk.library.umass.edu/login?url=https://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=10241yUMass: Link to resourcezEBSCOfResource aho00004554073b2091fabd-ca95-5e3c-a54f-3c7a4b156a21 aUMb012473750 \ No newline at end of file diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c1d21b845a..c231b76c3e 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1 +1,8 @@ require('cypress-downloadfile/lib/downloadFileCommand'); + +Cypress.on('uncaught:exception', (err, runnable) => { + // returning false here prevents Cypress from + // failing the test + console.log(`${runnable?.title}: ${err?.message}`); + return false; +}); diff --git a/cypress/support/dictionary/devTeams.js b/cypress/support/dictionary/devTeams.js index eb2a9b04f8..0a1dc0631c 100644 --- a/cypress/support/dictionary/devTeams.js +++ b/cypress/support/dictionary/devTeams.js @@ -5,4 +5,5 @@ export default { thunderjet: 'thunderjet', folijet: 'folijet', volaris: 'volaris', + ideaLabsTests: 'ideaLabsTests' }; diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index de7de680da..1540f18774 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -62,6 +62,8 @@ export default { inventoryCRUDHoldings: { internal: 'ui-inventory.holdings.delete', gui: 'Inventory: View, create, edit, delete holdings' }, // Tags uiTagsPermissionAll: { internal: 'ui-tags.permission.all', gui:'Tags: All permissions' }, + uiViewTagsSettings: { internal: 'ui-tags.settings.view', gui:'Settings (Tags): Can view tags settings' }, + uiUserCanEnableDisableTags: { internal: 'ui-tags.settings.all', gui:'Settings (Tags): Can enable or disable tags for all apps' }, // Settings->Owners uiUsersSettingsAllFeeFinesRelated: { internal: 'ui-users.settings.feefines.all', gui:'Settings (Users): Can create, edit and remove all feefines-related entries' }, uiUsersSettingsOwners: { internal: 'ui-users.settings.owners', gui: 'Settings (Users): Can create, edit and remove owners' }, @@ -111,6 +113,7 @@ export default { uiUsersCreatePatronLimits: { internal: 'ui-users.settings.limits', gui: 'Settings (Users): Can create, edit and remove patron blocks limits' }, uiUsersCreatePatronConditions: { internal: 'ui-users.settings.conditions', gui: 'Settings (Users): Can view and edit patron blocks conditions' }, uiUsersCustomField: { internal: 'ui-users.settings.customfields.all', gui: 'Settings (Users): Can create, edit, view and delete custom fields' }, + uiUsersViewAllSettings: { internal: 'ui-users.settings.view', gui: 'Settings (Users): View all settings' }, // Remote Storage remoteStorageCRUD: { internal: 'ui-remote-storage.settings.remote-storages.edit', gui: 'Remote storage: Create, edit, delete' }, remoteStorageView: { internal: 'ui-remote-storage.settings.remote-storages.view', gui: 'Remote storage: View' }, @@ -225,6 +228,10 @@ export default { settingsDataImportCanViewOnly:{ internal:'ui-data-import.settings.readOnly', gui:'Settings (Data import): Can view only' }, settingsTenantViewLocation:{ internal:'ui - tenant - settings.settings.location.view', gui:'Settings (Tenant): View locations' }, settingsUsersCRUD: { internal: 'ui-users.settings.transfers.all', gui: 'Settings (Users): Can create, edit and remove transfer accounts' }, + // Added the below permissions for custom label creation + + uiSettingseholdingsViewEditCreateDelete:{ internal: 'ui-eholdings.settings.all', gui: 'Settings (eholdings): Can create, edit, view, and delete custom labels' }, + // Timers okapiTimersPatch: { internal: 'okapi.proxy.self.timers.patch', gui: 'Okapi - patch timer for current tenant' }, // Export manager diff --git a/cypress/support/dictionary/testTypes.js b/cypress/support/dictionary/testTypes.js index 1e99f917ef..83cf6717cf 100644 --- a/cypress/support/dictionary/testTypes.js +++ b/cypress/support/dictionary/testTypes.js @@ -2,4 +2,5 @@ export default { smoke:'smoke', criticalPath: 'criticalPth', extendedPath: 'extendedPath', long: 'long', - broken: 'broken' }; + broken: 'broken', + ideaLabsTests: 'ideaLabsTests' }; diff --git a/cypress/support/fragments/agreements/agreementsDetails.js b/cypress/support/fragments/agreements/agreementsDetails.js index ec8aaba836..1332804ac6 100644 --- a/cypress/support/fragments/agreements/agreementsDetails.js +++ b/cypress/support/fragments/agreements/agreementsDetails.js @@ -1,18 +1,15 @@ -import { Accordion, Button, including, HTML, Section, MultiColumnListCell, Badge, Modal, Checkbox, MultiColumnList, MultiColumnListRow, SelectionOption, SearchField } from '../../../../interactors'; -import NewNote from '../notes/newNote'; +import { Accordion, Button, including, HTML, Section, MultiColumnListCell, Badge, Modal, Checkbox, MultiColumnList, MultiColumnListRow, SelectionOption, SearchField, Spinner } from '../../../../interactors'; import { getLongDelay } from '../../utils/cypressTools'; import ExistingNoteEdit from '../notes/existingNoteEdit'; - +import NewNote from '../notes/newNote'; const rootXpath = '//section[@id="pane-view-agreement"]'; -const rootSection = Section({ id : 'pane-view-agreement' }); +const rootSection = Section({ id: 'pane-view-agreement' }); const headerXpath = `${rootXpath}//div[@id="pane-view-agreement-content"]//h2`; const rootCss = 'section[id=pane-view-agreement]'; const notesSectionXpath = `${rootXpath}//section[@id="notes"]`; const noteTitleXpath = `${notesSectionXpath}//strong[contains(.,'Title')]/..`; const notesAccordionXpath = `${notesSectionXpath}//button[@id="accordion-toggle-button-notes"]`; - - const newNoteButton = Button('New', { id: 'note-create-button' }); const actionsButton = Button('Actions'); const deleteButton = Button('Delete'); @@ -20,6 +17,7 @@ const deleteButtonInConfirmation = Button('Delete', { id: 'clickable-delete-agre const showMoreLink = Button('Show more'); const notesAccordion = rootSection.find(Accordion({ id: 'notes' })); const deleteConfirmationModal = Modal({ id: 'delete-agreement-confirmation' }); +const cancelButton = Button('Cancel'); function waitLoading() { cy.xpath(headerXpath).should('be.visible'); @@ -31,11 +29,11 @@ export default { waitLoadingWithExistingNote(title) { waitLoading(); - cy.expect(rootSection.find(Section({ id: 'notes' })).find(MultiColumnListCell({ columnIndex:1 })).find(HTML(including(title))).exists()); + cy.expect(rootSection.find(Section({ id: 'notes' })).find(MultiColumnListCell({ columnIndex: 1 })).find(HTML(including(title))).exists()); }, openNotesSection() { - cy.do(rootSection.find(Section({ id :'notes' })).find(Button({ id:'accordion-toggle-button-notes' })).click()); + cy.do(rootSection.find(Section({ id: 'notes' })).find(Button({ id: 'accordion-toggle-button-notes' })).click()); cy.expect(rootSection.find(newNoteButton).exists()); }, @@ -45,6 +43,16 @@ export default { NewNote.save(); }, + clickOnNoteRecord() { + cy.expect(Spinner().absent()); + cy.do((MultiColumnList({ id: 'notes-list' }).click({ row: 0 }))); + }, + + clickOnNewButton() { + cy.expect(rootSection.exists()); + cy.do(rootSection.find(newNoteButton).click()); + }, + checkNotesCount(notesCount) { cy.expect(rootSection.find(Section({ id: 'notes' }).find(Badge())).has({ value: notesCount.toString() })); }, @@ -93,17 +101,22 @@ export default { cy.do(Button('Local KB search').click()); }, + clickCancelButton() { + cy.expect((cancelButton).exists()); + cy.do(cancelButton.click()); + }, + selectCurrentStatusInPackages() { cy.wait(4000); cy.do(Section({ id: 'filter-accordion-status' }).find(Checkbox({ id: 'clickable-filter-status-current' })).click()); }, selectPackageFromList(row = 0) { - cy.do(MultiColumnList({ id:'list-packages' }).find(MultiColumnListRow({ indexRow: `row-${row}` })).click()); + cy.do(MultiColumnList({ id: 'list-packages' }).find(MultiColumnListRow({ indexRow: `row-${row}` })).click()); }, addPackageToBusket() { - cy.do(Section({ id:'pane-view-eresource' }).find(Button('Add package to basket')).click()); + cy.do(Section({ id: 'pane-view-eresource' }).find(Button('Add package to basket')).click()); }, openBusket() { @@ -136,4 +149,8 @@ export default { Button('Save & close').click() ]); }, + + agreementListClick(agreementName) { + cy.do(MultiColumnListCell(agreementName).click()); + } }; diff --git a/cypress/support/fragments/agreements/newAgreement.js b/cypress/support/fragments/agreements/newAgreement.js index 811df256ea..041e30108a 100644 --- a/cypress/support/fragments/agreements/newAgreement.js +++ b/cypress/support/fragments/agreements/newAgreement.js @@ -1,47 +1,120 @@ +import { Accordion, Badge, Button, Callout, HTML, Link, Modal, MultiColumnListRow, Section, TextField, including } from '../../../../interactors'; import DateTools from '../../utils/dateTools'; import getRandomPostfix from '../../utils/stringTools'; -import { Button, TextField } from '../../../../interactors'; +import topMenu from '../topMenu'; export default class NewAgreement { - // TODO: start to use interactors instead of selectors - static #rootCss = 'section[id="pane-agreement-form"]' - static #statusCss = `${this.#rootCss} select[id="edit-agreement-status"]`; - static #nameField = TextField({ id: 'edit-agreement-name' }); - static #startDateField = TextField({ id: 'period-start-date-0' }); - static #saveButton = Button('Save & close'); - - static #statusValue = { - closed: 'Closed', - draft: 'Draft', - requested: 'Requested', - inNegotiation: 'In negotiation', - active: 'Active', - } - - static #defaultAgreement = { - name: `autotest_agreement_${getRandomPostfix()}`, - status: this.#statusValue.draft, - startDate: DateTools.getCurrentDate() - } - - static get defaultAgreement() { - return this.#defaultAgreement; - } - - - static fill(specialAgreement = this.#defaultAgreement) { - cy.do(this.#nameField.fillIn(specialAgreement.name)); - cy.get(this.#statusCss) - .select(specialAgreement.status) - .should('have.value', specialAgreement.status.toLowerCase()); - cy.do(this.#startDateField.fillIn(specialAgreement.startDate)); - } - - static save() { - cy.do(this.#saveButton.click()); - } - - static waitLoading() { - cy.expect(this.#nameField.exists()); - } + + // TODO: start to use interactors instead of selectors + static #rootCss = 'section[id="pane-agreement-form"]' + static #statusCss = `${this.#rootCss} select[id="edit-agreement-status"]`; + static #nameField = TextField({ id: 'edit-agreement-name' }); + static #startDateField = TextField({ id: 'period-start-date-0' }); + static #saveButton = Button('Save & close'); + + static #newButton = Section({ id: 'packageShowAgreements' }).find(Button('New')) + static #agreementLine = Section({ id: 'lines' }).find(Button('Agreement lines')) + static #agreementBadge = Section({ id: 'lines' }) + static #rowInList = Section({ id: 'lines' }).find(MultiColumnListRow({ index: 0 }).find(Link('VLeBooks'))) + static #rowClick = Section({ id: 'lines' }).find(MultiColumnListRow({ index: 0 })) + static #cancel = Button({ ariaLabel: 'Close VLeBooks' }) + static #newButtonClick = Button('New') + static #recordLastUpdated = Section({ id: 'agreementInfoRecordMeta' }).find(Button(including('Record last updated'))) + static #actionButton = Section({ id: 'pane-view-agreement' }).find(Button('Actions')) + static #deleteButton = Button('Delete') + static #deleteConfirmationModal = Modal({ id: 'delete-agreement-confirmation' }); + static #deleteButtonInConfirmation = Button('Delete', { id: 'clickable-delete-agreement-confirmation-confirm' }); + static #searchAgreement = TextField({ id: 'input-agreement-search' }) + static #agreementLineDeleteModel = Modal({ id: 'delete-agreement-line-confirmation' }) + static #deleteButtonInLine = Button('Delete', { id:'clickable-delete-agreement-line-confirmation-confirm' }) + + static #statusValue = { + closed: 'Closed', + draft: 'Draft', + requested: 'Requested', + inNegotiation: 'In negotiation', + active: 'Active', + } + + static #defaultAgreement = { + name: `autotest_agreement_${getRandomPostfix()}`, + status: this.#statusValue.draft, + startDate: DateTools.getCurrentDate() + } + + static get defaultAgreement() { + return this.#defaultAgreement; + } + + static fill(specialAgreement = this.#defaultAgreement) { + cy.do(this.#nameField.fillIn(specialAgreement.name)); + cy.get(this.#statusCss) + .select(specialAgreement.status) + .should('have.value', specialAgreement.status.toLowerCase()); + cy.do(this.#startDateField.fillIn(specialAgreement.startDate)); + } + + static save() { + cy.do(this.#saveButton.click()); + } + + static waitLoading() { + cy.expect(this.#nameField.exists()); + } + + static searchAgreement(specialAgreement = this.#defaultAgreement) { + cy.do(this.#searchAgreement.fillIn(specialAgreement.name)); + cy.do(Button('Search').click()); + cy.expect(Section({ id:'pane-view-agreement' }).find(HTML(including(specialAgreement.name, { class: 'headline' }))).exists()); + } + + static validateDateAndTime() { + cy.wrap(this.#recordLastUpdated.text()).as('date'); + cy.get('@date').then((val) => { + const dateTimePattern = /\d{1,2}\/\d{1,2}\/\d{4} \d{1,2}:\d{2} [AP]M/g; + const dateTimes = val.match(dateTimePattern)[0]; + cy.expect(this.#recordLastUpdated.has({ text: including(`Record last updated: ${dateTimes}`) })); + cy.expect(Accordion({ headline: 'Update information' }).has({ content: including(`Record created: ${dateTimes}`) })); + }); + } + + static newButton() { + cy.do(this.#newButton.click()); + } + + static agreementLine() { + cy.do([this.#agreementLine.click(), + this.#rowInList.click(), + this.#cancel.click()]); + } + + static findAgreement(specialAgreement = this.#defaultAgreement) { + cy.visit(topMenu.agreementsPath); + cy.do([this.#searchAgreement.fillIn(specialAgreement.name), + Button('Search').click(), + ]); + } + + static deleteAgreement() { + cy.do([ + this.#agreementLine.click(), + this.#rowClick.click()]); + cy.do([Section({ id:'pane-view-agreement-line' }).find(Button('Actions')).click(), + Button('Delete').click(), + this.#agreementLineDeleteModel.find(this.#deleteButtonInLine).click()]); + cy.expect([Callout({ type:'success' }).exists(), + Callout({ type:'success' }).has({ text:'Agreement line deleted' })]); + cy.expect(this.#agreementBadge.find(Badge()).has({ value: '0' })); + cy.do(this.#actionButton.click()); + cy.expect(this.#deleteButton.exists()); + cy.do(this.#deleteButton.click()); + cy.expect(this.#deleteConfirmationModal.exists()); + cy.do(this.#deleteConfirmationModal.find(this.#deleteButtonInConfirmation).click()); + cy.expect([Callout({ type:'success' }).exists(), + Callout({ type:'success' }).has({ text:'Agreement line deleted' })]); + } + + static newButtonClick() { + cy.do(this.#newButtonClick.click()); + } } diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index d4fcfa020a..d3a45f1d31 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -93,10 +93,6 @@ export default { cy.expect(Button('Download errors (CSV)').exists()); }, - clickSuppressedFromDiscoveryCheckbox() { - cy.do(Checkbox('Suppressed from discovery').click()); - }, - verifyActionAfterChangingRecords() { cy.do(actionsBtn.click()); cy.expect([ @@ -178,6 +174,7 @@ export default { addNewBulkEditFilterString() { cy.do(plusBtn.click()); + cy.wait(1000); }, fillPatronGroup(group = 'staff (Staff Member)', rowIndex = 0) { @@ -232,11 +229,19 @@ export default { ]); }, - editSuppressFromDiscovery(value, rowIndex = 0) { + editItemsSuppressFromDiscovery(value, rowIndex = 0) { + cy.do([ + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Suppress from discovery'), + RepeatableFieldItem({ index: rowIndex }).find(Select({ content: including('Set') })).choose(`Set ${value}`), + ]); + }, + + editHoldingsSuppressFromDiscovery(value, rowIndex = 0) { cy.do([ RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Suppress from discovery'), - RepeatableFieldItem({ index: rowIndex }).find(Select({ content: including('Set') })).choose(value), + RepeatableFieldItem({ index: rowIndex }).find(Select({ content: including('Set') })).choose(`Set ${value}`), ]); + cy.expect(Checkbox('Apply to items records').has({ checked: value })); }, verifyNoMatchingOptionsForLocationFilter() { diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js index b77820bba6..7c9e543b71 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -725,10 +725,6 @@ export default { cy.expect(resultsAccordion.find(MultiColumnListHeader(title)).exists()); }, - verifyResultColumnValue(value) { - cy.expect(MultiColumnListCell(value).exists()); - }, - verifyResultColumTitlesDoNotInclude(title) { cy.expect(resultsAccordion.find(MultiColumnListHeader(title)).absent()); }, diff --git a/cypress/support/fragments/check-in-actions/checkInActions.js b/cypress/support/fragments/check-in-actions/checkInActions.js index d57967207b..1165cf6572 100644 --- a/cypress/support/fragments/check-in-actions/checkInActions.js +++ b/cypress/support/fragments/check-in-actions/checkInActions.js @@ -186,7 +186,7 @@ export default { .find(HTML(including('No items have been entered yet.'))) .exists()); }, - + backdateCheckInItem:(date, barcode) => { cy.do(Button('today').click()); cy.do(TextField({ name:'item.checkinDate' }).fillIn(date)); diff --git a/cypress/support/fragments/circulation/circulation-rules.js b/cypress/support/fragments/circulation/circulation-rules.js index 8b3dc2b8b6..86b600a16f 100644 --- a/cypress/support/fragments/circulation/circulation-rules.js +++ b/cypress/support/fragments/circulation/circulation-rules.js @@ -1,11 +1,12 @@ import { kebabCase } from 'lodash'; import { + Button, CodeMirror, CodeMirrorHint, - Button, } from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; + const calloutMessages = { CIRCULATION_RULES_UPDATE_SUCCESS: 'Rules were successfully updated.', }; @@ -14,23 +15,47 @@ export default { defaultcirculationPolicy: { 'rulesAsText': 'circulation policy' }, + + verifyError() { + cy.expect(cy.get("[class^='rule-error']").contains('Must contain one of each policy type, missing type r')); + }, + + policyError({ + priorityType, + priorityTypeName, + loanPolicyName, + }) { + if (priorityType) { + this.fillInCirculationRules(priorityType); + this.clickCirculationRulesHintItem(priorityTypeName); + this.fillInCirculationRules(': '); + } + this.fillInCirculationRules('l '); + this.clickCirculationRulesHintItem(loanPolicyName); + }, + clearCirculationRules() { cy.do(CodeMirror().clear()); }, + fillInCirculationRules(value) { cy.do(CodeMirror().fillIn(value)); }, + fillInPriority(value = 'priority: t, s, c, b, a, m, g') { this.fillInCirculationRules(value); this.fillInNewLine(); }, + fillInNewLine() { this.fillInCirculationRules('\n'); }, + fillInFallbackPolicy(policyData) { this.fillInCirculationRules('fallback-policy: '); this.fillInPolicy(policyData); }, + fillInPolicy({ priorityType, priorityTypeName, @@ -57,33 +82,44 @@ export default { this.clickCirculationRulesHintItem(noticePolicyName); this.fillInNewLine(); }, + clickCirculationRulesHintItem(name) { cy.do(CodeMirrorHint().clickItem(kebabCase(name))); }, + saveCirculationRules() { + cy.expect(Button('Save').exists()); cy.do(Button('Save').click()); }, + + verifyToast() { + InteractorsTools.checkCalloutMessage('Rules were successfully updated.'); + }, + checkUpdateCirculationRulesCalloutAppeared() { InteractorsTools.checkCalloutMessage(calloutMessages.CIRCULATION_RULES_UPDATE_SUCCESS); }, + checkNoticePolicyAddedToCirculationRules(noticePolicyId) { this.getViaApi().then((circulationRules) => { cy.expect(circulationRules.rulesAsText).to.include(`n ${noticePolicyId}`); }); }, + getViaApi() { return cy.getCirculationRules(); }, + updateViaApi(data) { return cy.updateCirculationRules(data); }, + getRuleProps(defaultRules) { const oIndex = defaultRules.indexOf(' o ', 2); const lIndex = defaultRules.indexOf(' l ', 2); const iIndex = defaultRules.indexOf(' i ', 2); const rIndex = defaultRules.indexOf(' r ', 2); const nIndex = defaultRules.indexOf(' n ', 2); - const baseRuleProps = { 'o': defaultRules.substring(oIndex + 3, oIndex + 39), 'l': defaultRules.substring(lIndex + 3, lIndex + 39), @@ -91,13 +127,14 @@ export default { 'r': defaultRules.substring(rIndex + 3, rIndex + 39), 'n': defaultRules.substring(nIndex + 3, nIndex + 39) }; - return baseRuleProps; }, + addRuleViaApi(defaultRules, ruleParams, priority, priorityId) { const withNewRule = defaultRules + ' \n' + priority + priorityId + ': i ' + ruleParams.i + ' l ' + ruleParams.l + ' r ' + ruleParams.r + ' o ' + ruleParams.o + ' n ' + ruleParams.n; return cy.updateCirculationRules({ rulesAsText: withNewRule }); }, + deleteRuleViaApi(rule) { this.getViaApi().then((circulationRules) => { const allRules = circulationRules.rulesAsText; diff --git a/cypress/support/fragments/circulation/newNoticePolicyTemplate.js b/cypress/support/fragments/circulation/newNoticePolicyTemplate.js index e57246f6ce..430d1e855d 100644 --- a/cypress/support/fragments/circulation/newNoticePolicyTemplate.js +++ b/cypress/support/fragments/circulation/newNoticePolicyTemplate.js @@ -1,6 +1,6 @@ /* eslint-disable cypress/no-unnecessary-waiting */ import getRandomPostfix from '../../utils/stringTools'; -import { Button, TextField, TextArea, KeyValue, Checkbox, Link, Heading, Select, Pane, Modal, PaneContent } from '../../../../interactors'; +import { Button, TextField, TextArea, KeyValue, Checkbox, Link, Heading, Select, Pane, Modal, PaneContent, NavListItem, RichEditor, including } from '../../../../interactors'; import richTextEditor from '../../../../interactors/rich-text-editor'; import { NOTICE_CATEGORIES } from './notice-policy'; import { actionsButtons } from './newNoticePolicy'; @@ -56,9 +56,12 @@ export default { cy.do(Select({ name: 'category' }).choose(category)); }, - checkPreview: () => { + checkPreview: (previewText) => { cy.do(PaneContent({ id: 'patron-notice-template-pane-content' }).find(Button('Preview')).click()); - cy.expect(Modal('Preview of patron notice template').exists()); + cy.expect([ + Modal(including('Preview of patron notice template')).exists(), + Modal({ content: including(previewText) }).exists(), + ]); cy.do(Button('Close').click()); }, @@ -79,6 +82,10 @@ export default { return cy.wrap(noticePolicyTemplateToken); }, + clearBody() { + cy.do(RichEditor().fillIn('')); + }, + saveAndClose() { return cy.do([saveButton.has({ disabled: false }), saveButton.click(), @@ -147,6 +154,14 @@ export default { ]); }, + editTemplate(name) { + cy.do([ + NavListItem(name).click(), + actionsButton.click(), + actionsButtons.edit.click(), + ]); + }, + typeTemplateName: (noticePolicytemplateName) => { cy.do(nameField.fillIn(noticePolicytemplateName)); }, @@ -161,7 +176,7 @@ export default { this.addToken('item.title'); this.create(template, false); this.chooseCategory(template.category); - this.checkPreview(); + this.checkPreview(template.previewText); this.saveAndClose(); this.waitLoading(); }, @@ -170,7 +185,7 @@ export default { this.duplicateTemplate(); this.typeTemplateName(template.name); this.typeTemplateSubject(template.subject); - this.checkPreview(); + this.checkPreview(template.previewText); this.saveAndClose(); this.waitLoading(); }, diff --git a/cypress/support/fragments/circulation/notice-policy-template.js b/cypress/support/fragments/circulation/notice-policy-template.js index 6255671438..e7d5bc36b4 100644 --- a/cypress/support/fragments/circulation/notice-policy-template.js +++ b/cypress/support/fragments/circulation/notice-policy-template.js @@ -1,5 +1,7 @@ import uuid from 'uuid'; import getRandomPostfix from '../../utils/stringTools'; +import { Button, Modal, including } from '../../../../interactors'; + const defaultNoticeTemplateBody = { active: true, @@ -10,7 +12,7 @@ const defaultNoticeTemplateBody = { }, body: '