From f0b1b0bfa80574772e0f89ff2c019074c7eb932e Mon Sep 17 00:00:00 2001 From: Vineethasakhamuri <117971735+Vineethasakhamuri@users.noreply.github.com> Date: Wed, 2 Aug 2023 21:37:49 +0530 Subject: [PATCH 001/437] Check out/santosh ideyalabs (#1406) * checkOut/SantoshIdeyalabs --- cypress/e2e/ideyalabs/checkout.cy.js | 96 +++++++++ .../fragments/marcAuthority/marcAuthority.js | 6 +- cypress/support/fragments/topMenu.js | 6 +- .../fragments/users/usersSearchPane.js | 17 ++ cypress/support/ideyaLabs/users.js | 199 ++++++++++++++++++ 5 files changed, 318 insertions(+), 6 deletions(-) create mode 100644 cypress/e2e/ideyalabs/checkout.cy.js create mode 100644 cypress/support/ideyaLabs/users.js diff --git a/cypress/e2e/ideyalabs/checkout.cy.js b/cypress/e2e/ideyalabs/checkout.cy.js new file mode 100644 index 0000000000..f901904ea4 --- /dev/null +++ b/cypress/e2e/ideyalabs/checkout.cy.js @@ -0,0 +1,96 @@ +import users from '../../support/a_ideyalabs/users'; +import testTypes from '../../support/dictionary/testTypes'; +import topMenu from '../../support/fragments/topMenu'; +import userLoans from '../../support/fragments/users/loans/userLoans'; +import usersSearchPane from '../../support/fragments/users/usersSearchPane'; +import getRandomPostfix from '../../support/utils/stringTools'; + +const testData = { + loanBarcode: '81264459', + patronBarcodeOne: '0000074372', + patronBarcodeTwo: '322', + itemBarcodeOne: '132431', + status: 'Active', + name: 'A2L 3, Holly', + parameter: 'Keyword (name, email, identifier)', + note: { + details: `Test details ${getRandomPostfix()}`, + editTitle: `Test Title ${getRandomPostfix()}`, + }, + patronBarcode: '555555', + itemBarcode: '108204829', +}; + +describe('Checkout item', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Delete test data', () => { + cy.visit(topMenu.usersPath); + usersSearchPane.searchByStatus(testData.status); + usersSearchPane.searchByKeywords(testData.name); + users.openNote(); + users.deleteNote(); + users.verifyNoteAbsent(); + }); + + it( + 'C343243 Check out app: Display a pop-up note and Close note', + { tags: testTypes.ideaLabsTests }, + () => { + cy.visit(topMenu.usersPath); + usersSearchPane.searchByStatus(testData.status); + usersSearchPane.searchByKeywords(testData.parameter, testData.name); + users.createNote(testData.note.details); + users.getUserBarcode(); + users.editNote(testData.note.editTitle, testData.note.details); + users.verifyNoteExist(); + } + ); + + it( + 'C642 Cannot find the patron and item that meet circulation rule criteria (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.checkOutPath); + users.enterPatronBarcodeCheckOut(testData.patronBarcodeOne); + users.clickOpenLoansCount(); + userLoans.checkOffLoanByBarcode(testData.loanBarcode); + users.renewButton(); + users.checkRenewConfirmationModal(); + } + ); + + it( + 'C646 Cannot find the patron and item that meet circulation rule criteria (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.checkOutPath); + users.enterPatronBarcodeCheckOut(testData.patronBarcodeTwo); + users.enterItemBarcodeCheckOut(testData.itemBarcodeOne); + users.closeButton(); + users.clickOpenLoansCount(); + users.dueDate(); + users.verifyItemBarcode(testData.itemBarcodeOne); + } + ); + + it( + 'C777 Check out: override non-circulating items (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.checkOutPath); + users.enterPatronBarcodeCheckOut(testData.patronBarcode); + users.enterItemBarcodeCheckOut(testData.itemBarcode); + users.closeButton(); + users.enterPatronBarcodeCheckOut(testData.patronBarcode); + users.enterItemBarcodeCheckOut(testData.itemBarcode); + users.patronOverride(); + users.cancelButton(); + users.enterPatronBarcodeCheckOut(testData.patronBarcode); + users.enterItemBarcodeCheckOut(testData.itemBarcode); + users.closeButton(); + } + ); +}); diff --git a/cypress/support/fragments/marcAuthority/marcAuthority.js b/cypress/support/fragments/marcAuthority/marcAuthority.js index ccbbafdd3a..a338a44138 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthority.js +++ b/cypress/support/fragments/marcAuthority/marcAuthority.js @@ -125,7 +125,7 @@ export default { ]); cy.expect(Callout('Record cannot be saved. A MARC tag must contain three characters.').exists()); }, - + checkAddNew1XXTag: (rowIndex, tag, content) => { cy.do([ QuickMarcEditorRow({ index: rowIndex }).find(addFieldButton).click(), @@ -168,8 +168,8 @@ export default { cy.do(saveAndCloseButton.click()); cy.expect(Callout('Record has been updated.').exists()); }, - - deleteTag: (rowIndex) => { + + deleteTag: (rowIndex) => { cy.do(QuickMarcEditorRow({ index: rowIndex }).find(deleteFieldButton).click()); }, diff --git a/cypress/support/fragments/topMenu.js b/cypress/support/fragments/topMenu.js index ee97996dfe..dfc3cac64a 100644 --- a/cypress/support/fragments/topMenu.js +++ b/cypress/support/fragments/topMenu.js @@ -31,7 +31,7 @@ const exportManagerOrganizationsPath = 'export-manager/edi-jobs'; const customFieldsPath = '/settings/users/custom-fields'; const notesPath = '/settings/notes/general'; const permissionSetPath = '/settings/users/perms?layer=add'; -const customLabel = '/settings/eholdings'; +const customLabel = '/settings/eholdings' export default { @@ -65,8 +65,8 @@ export default { exportManagerPath, exportManagerOrganizationsPath, customFieldsPath, - notesPath, - permissionSetPath, + notesPath, + permissionSetPath, customLabel, openCheckInApp:() => { cy.do(Link({ href: including('/checkin') }).click()); diff --git a/cypress/support/fragments/users/usersSearchPane.js b/cypress/support/fragments/users/usersSearchPane.js index e71ece67c5..3b9a438d3d 100644 --- a/cypress/support/fragments/users/usersSearchPane.js +++ b/cypress/support/fragments/users/usersSearchPane.js @@ -21,6 +21,7 @@ const actionButton = Section({ id: 'pane-userdetails' }).find(Button('Actions')) const editButton = Button('Edit'); const additionalInfo = Button('Additional information'); const saveAndClose = Button('Save & close'); +const openLoanSectionButton = Button({id: 'accordion-toggle-button-loansSection'}); export default { @@ -38,6 +39,14 @@ export default { ]); }, + searchByLastName(lastName) { + return cy.do([ + Select({ id: 'input-user-search-qindex' }).choose('Last name'), + TextField({ id: 'input-user-search' }).fillIn(lastName), + Button({ id: 'submit-user-search' }).click(), + ]); + }, + searchByUsername(username) { cy.do([ Select({ id: 'input-user-search-qindex' }).choose('Username'), @@ -61,6 +70,10 @@ export default { return cy.do(Link({ href: including(userId) }).click()); }, + openUserLoanSection: () => { + cy.do([openLoanSectionButton.click()]); + }, + verifyTextField: (name) => { cy.do([actionButton.click(), editButton.click(), @@ -111,6 +124,10 @@ export default { }); }, + additionalInfoButton() { + cy.do(additionalInfo.click()); + }, + verifyDragItem() { cy.expect(additionalInfo.exists()); cy.do(additionalInfo.click()); diff --git a/cypress/support/ideyaLabs/users.js b/cypress/support/ideyaLabs/users.js new file mode 100644 index 0000000000..30a616a25c --- /dev/null +++ b/cypress/support/ideyaLabs/users.js @@ -0,0 +1,199 @@ +import { + Accordion, + Button, + Checkbox, + HTML, + KeyValue, + Link, + Modal, + MultiColumnList, + MultiColumnListCell, + MultiColumnListRow, + PaneContent, + RichEditor, + Section, + Select, + TextArea, + TextField, + including, +} from '../../../interactors'; +import topMenu from '../fragments/topMenu'; +import getRandomPostfix from '../utils/stringTools'; + +const titleField = TextField({ name: 'title' }); +const detailsField = RichEditor('Details'); +const submitButton = Button({ type: 'submit' }); +const newButton = Button('New'); +const checkOutApp = Checkbox({ name: 'popUpOnCheckOut' }); +const userNoteModal = Modal('User note'); +const searchField = TextField({ id: 'input-user-search' }); +const searchButton = Button('Search'); +const usersPane = PaneContent({ id: 'users-search-results-pane-content' }); +const renewButton = Button('Renew'); +const patronBarcodeTextField = TextField({ id: 'input-patron-identifier' }); +const itemBarcodeTextField = TextField({ id: 'input-item-barcode' }); +const patronButton = Button({ id: 'clickable-find-patron' }); +const itemButton = Button({ id: 'clickable-add-item' }); +const actionsButton = Button('Actions'); +const deleteButton = Button('Delete'); +const deleteButtonInConfirmation = Button({ id: 'clickable-confirm-delete-note-confirm' }); +const title = `Test Title ${getRandomPostfix()}`; + +export default { + createNote: (details) => { + cy.expect(Accordion({ id: 'notesAccordion' }).exists()); + cy.do([ + Accordion({ id: 'notesAccordion' }).clickHeader(), + newButton.click(), + titleField.fillIn(title), + detailsField.fillIn(details), + checkOutApp.click(), + submitButton.click(), + ]); + }, + + editNote: (details) => { + cy.expect(Accordion({ id: 'notesAccordion' }).exists()); + cy.do([ + Accordion({ id: 'notesAccordion' }).clickHeader(), + Section({ id: 'notesAccordion' }) + .find(MultiColumnListRow({ index: 0 })) + .find(Button('Edit')) + .click(), + detailsField.fillIn(details), + submitButton.click(), + ]); + }, + + deleteNote: () => { + cy.do([ + actionsButton.click(), + deleteButton.click(), + deleteButtonInConfirmation.click(), + Accordion({ id: 'notesAccordion' }).clickHeader(), + ]); + }, + + verifyNoteExist: () => { + cy.expect(Section({ id: 'notesAccordion' }).find(MultiColumnListRow({ index: 0, content: title })).exists()); + }, + + verifyNoteAbsent: () => { + cy.expect(Section({ id: 'notesAccordion' }).find(MultiColumnListRow({ index: 0, content: title })).absent()); + }, + + openNote: () => { + cy.expect(Accordion({ id: 'notesAccordion' }).exists()); + cy.do([ + Accordion({ id: 'notesAccordion' }).clickHeader(), + Section({ id: 'notesAccordion' }) + .find(MultiColumnListRow({ index: 0 })) + .click(), + ]); + }, + + selectRecord: (userName) => { + cy.expect(usersPane.find(Select(userName)).exists()); + cy.do(usersPane.find(Select(userName)).click()); + }, + + selectUserRecord: (content) => { + cy.expect(usersPane.find(Link(content)).exists()); + cy.do(usersPane.find(Link(content)).click()); + }, + + getBarcode: () => cy.then(() => KeyValue('Barcode').value()), + + getUserBarcode() { + this.getBarcode().then((barcode) => { + cy.visit(topMenu.checkOutPath); + cy.expect(patronBarcodeTextField.exists()); + cy.do([ + patronBarcodeTextField.fillIn(barcode), + patronButton.click(), + userNoteModal.find(Button('Close')).click(), + ]); + cy.visit(topMenu.usersPath); + cy.do([ + Select({ id: 'input-user-search-qindex' }).choose('Barcode'), + searchField.fillIn(barcode), + searchButton.click(), + ]); + }); + }, + + enterPatronBarcodeCheckOut: (patronBarcode) => { + cy.expect(patronBarcodeTextField.exists()); + cy.do(patronBarcodeTextField.fillIn(patronBarcode)); + cy.expect(patronButton.exists()); + cy.do(patronButton.click()); + }, + + enterItemBarcodeCheckOut: (searchItemBarcode) => { + cy.expect(itemBarcodeTextField.exists()); + cy.do(itemBarcodeTextField.fillIn(searchItemBarcode)); + cy.expect(itemButton.exists()); + cy.do(itemButton.click()); + }, + + closeButton: () => { + cy.expect(Modal('Patron blocked from borrowing').find(Button('Close')).exists()); + cy.do(Modal('Patron blocked from borrowing').find(Button('Close')).click()); + }, + + cancelButton:() => { + cy.expect(Modal('Override patron block').find(Button('Cancel')).exists()); + cy.do(Modal('Override patron block').find(Button('Cancel')).click()); + }, + + saveAndCloseButton:() => { + cy.expect(TextArea({ type:'text' }).exists()); + cy.do([ + TextArea({ type:'text' }).fillIn('test'), + Button('Save & close').click()]); + }, + + patronOverride: () => { + cy.expect(Modal('Patron blocked from borrowing').find(Button('Override')).exists()); + cy.do([ + Modal('Patron blocked from borrowing').find(Button('Override')).click(), + ]); + }, + + dueDate: (rowIndex = 0) => { + cy.wrap(MultiColumnListCell({ row: rowIndex, columnIndex: 3 }).text()).as( + 'date' + ); + cy.get('@date').then((val) => { + // here log is used to print the due date + cy.log(val); + }); + }, + + getOpenLoans: () => cy.then(() => KeyValue('Open loans').value()), + + clickOpenLoansCount() { + this.getOpenLoans().then((val) => { + cy.expect(Section({ id: 'patron-details' }).find(KeyValue('Open loans')).exists()); + cy.do( + Section({ id: 'patron-details' }) + .find(KeyValue('Open loans')) + .find(Link(val)) + .click() + ); + }); + }, + + renewButton: () => { + cy.expect(renewButton.exists()); + cy.do(renewButton.click()); + }, + + checkRenewConfirmationModal: () => { + cy.expect(Modal({ id: 'bulk-renewal-modal-label' }).exists()); + }, + + verifyItemBarcode:(barcode) => { + cy.expect(MultiColumnList({ id: 'list-loanshistory' }).find(HTML(including(barcode))).exists()); + }, +}; From 2f57ac7033883a06a865940019a7368a6c0ab454 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Wed, 2 Aug 2023 21:27:36 +0300 Subject: [PATCH 002/437] Idealabs (#1441) * skipped failed tests * fix for tests --- cypress/e2e/eholdings/eholdings-packages.cy.js | 4 ++-- cypress/e2e/ideyalabs/agreements/agreements.cy.js | 2 +- cypress/e2e/ideyalabs/checkout.cy.js | 4 ++-- cypress/e2e/ideyalabs/circulationLog.cy.js | 2 +- .../custom-fields/create-text-field-custom-field.cy.js | 2 +- cypress/e2e/ideyalabs/eHoldingsExports.cy.js | 2 +- cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js | 2 +- .../orders-export-to-a-vendor/B_exportManager.cy.js | 2 +- .../ideyalabs/finance/available-balance-is-displayed.cy.js | 2 +- .../encumbrances-are-rolled-over-correctly.cy.js | 2 +- .../preview-for-one-ledger-and-same-fiscal year.cy.js | 2 +- .../ideyalabs/finance/funds/correct-fund-validation.cy.js | 2 +- cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js | 2 +- cypress/e2e/ideyalabs/notes/note-type.cy.js | 2 +- .../ideyalabs/orders/editing-fund-distribution-in-pol.cy.js | 2 +- .../orders/export-in-edifact-format/re-exported-order.cy.js | 2 +- ...umbrance-releases-with-payment-not-required-status.cy.js | 2 +- .../e2e/ideyalabs/organizations/create-new-categories.cy.js | 2 +- cypress/e2e/ideyalabs/settings.cy.js | 2 +- .../patron-notice.cy.js | 2 +- cypress/support/fragments/invoices/invoices.js | 2 +- cypress/support/ideyalabs/marc.js | 6 ------ 22 files changed, 23 insertions(+), 29 deletions(-) diff --git a/cypress/e2e/eholdings/eholdings-packages.cy.js b/cypress/e2e/eholdings/eholdings-packages.cy.js index 4939ee49ef..08a521c624 100644 --- a/cypress/e2e/eholdings/eholdings-packages.cy.js +++ b/cypress/e2e/eholdings/eholdings-packages.cy.js @@ -28,7 +28,7 @@ describe('eHoldings packages management', () => { eHoldingsPackages.getNotSelectedPackageIdViaApi().then(specialPackage => { cy.login(userProperties.username, userProperties.password, { path: `${TopMenu.eholdingsPath}/packages/${specialPackage.id}`, waiter: () => eHoldingsPackage.waitLoading(specialPackage.name) }); - eHoldingsPackage.addToHodlings(); + eHoldingsPackage.addToHoldings(); eHoldingsPackage.verifyHoldingStatus(); eHoldingsPackage.filterTitles(); eHoldingsPackage.checkEmptyTitlesList(); @@ -75,7 +75,7 @@ describe('eHoldings packages management', () => { eHoldingsPackage.filterTitles(eHoldingsPackage.filterStatuses.notSelected); eHoldingsPackage.checkEmptyTitlesList(); // reset test data - eHoldingsPackage.addToHodlings(); + eHoldingsPackage.addToHoldings(); }); }); }); diff --git a/cypress/e2e/ideyalabs/agreements/agreements.cy.js b/cypress/e2e/ideyalabs/agreements/agreements.cy.js index 260cf8466f..ca5f50d35e 100644 --- a/cypress/e2e/ideyalabs/agreements/agreements.cy.js +++ b/cypress/e2e/ideyalabs/agreements/agreements.cy.js @@ -11,7 +11,7 @@ const defaultAgreement = { status: 'Active', startDate: dateTools.getCurrentDate() }; -describe('Agreement', () => { +describe.skip('Agreement', () => { before('Login to Folio', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/checkout.cy.js b/cypress/e2e/ideyalabs/checkout.cy.js index f901904ea4..ee9296c50f 100644 --- a/cypress/e2e/ideyalabs/checkout.cy.js +++ b/cypress/e2e/ideyalabs/checkout.cy.js @@ -1,4 +1,4 @@ -import users from '../../support/a_ideyalabs/users'; +import users from '../../support/ideyalabs/users'; import testTypes from '../../support/dictionary/testTypes'; import topMenu from '../../support/fragments/topMenu'; import userLoans from '../../support/fragments/users/loans/userLoans'; @@ -21,7 +21,7 @@ const testData = { itemBarcode: '108204829', }; -describe('Checkout item', () => { +describe.skip('Checkout item', () => { before('Login', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/circulationLog.cy.js b/cypress/e2e/ideyalabs/circulationLog.cy.js index 8cc1c6265b..d56efcc6b4 100644 --- a/cypress/e2e/ideyalabs/circulationLog.cy.js +++ b/cypress/e2e/ideyalabs/circulationLog.cy.js @@ -23,7 +23,7 @@ const testData = { }, }; -describe('CirculationLog App', () => { +describe.skip('CirculationLog App', () => { before('Login', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); 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 index 22623deb69..c7038ed712 100644 --- 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 @@ -35,7 +35,7 @@ const singleSelectData = { }, }; -describe('Settings', () => { +describe.skip('Settings', () => { before('Login to Folio', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/eHoldingsExports.cy.js b/cypress/e2e/ideyalabs/eHoldingsExports.cy.js index 663e8f78fe..bf5cbae63f 100644 --- a/cypress/e2e/ideyalabs/eHoldingsExports.cy.js +++ b/cypress/e2e/ideyalabs/eHoldingsExports.cy.js @@ -28,7 +28,7 @@ const testData = { }, }; -describe('Eholdings - exports', () => { +describe.skip('Eholdings - exports', () => { before('Login', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js index 418646a72f..2948332053 100644 --- a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js +++ b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js @@ -14,7 +14,7 @@ import settingsMenu from '../../../support/fragments/settingsMenu'; import topMenu from '../../../support/fragments/topMenu'; import eHolding from './eHolding'; -describe('Create a custom package', () => { +describe.skip('Create a custom package', () => { before('Login', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); cy.visit(topMenu.eholdingsPath); 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 index ba7ae891ab..b59ae4d805 100644 --- 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 @@ -12,7 +12,7 @@ const testData = { jobFileName: 'AAA_Integration name_2023-06-20_14:36:04.edi', }; -describe('Export Manager', () => { +describe.skip('Export Manager', () => { before('Login', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js index 4bf2eaaa76..0804c2bd02 100644 --- a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js +++ b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js @@ -50,7 +50,7 @@ const testData = { ledgerFinancialQuantity2: '0.00', }; -describe('Finance: Funds', () => { +describe.skip('Finance: Funds', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); 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 index f0ed0f6af2..4d88984e9b 100644 --- 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 @@ -77,7 +77,7 @@ const encumbranceData = { transactionListDetailsResultsFromEmbarance: '7/3/2023, 8:12 AM', }; -describe('Finance: Fiscal Year Rollover', () => { +describe.skip('Finance: Fiscal Year Rollover', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); 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 index f4392b981c..3675a18ff6 100644 --- 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 @@ -20,7 +20,7 @@ const rollOverData = { selectEmbranceResult: '6/20/2023, 4:41 AM', }; -describe('Finance: Fiscal Year Rollover', () => { +describe.skip('Finance: Fiscal Year Rollover', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js index 084f3cb7fb..83e449bad6 100644 --- a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js +++ b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js @@ -49,7 +49,7 @@ const fundDistribution = { fundIDTwo: 'Beta FYRO (BFYRO)', }; -describe('ui-invoices: Invoice creation', () => { +describe.skip('ui-invoices: Invoice creation', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); cy.visit(topMenu.ordersPath); diff --git a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js index 42af3dec04..8e0545fcbd 100644 --- a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js +++ b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js @@ -84,7 +84,7 @@ const testData = { }, }; -describe('New Marc Bib Record and new MARC Holdings record', () => { +describe.skip('New Marc Bib Record and new MARC Holdings record', () => { before('Login', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/notes/note-type.cy.js b/cypress/e2e/ideyalabs/notes/note-type.cy.js index 866e103227..0d741c24e1 100644 --- a/cypress/e2e/ideyalabs/notes/note-type.cy.js +++ b/cypress/e2e/ideyalabs/notes/note-type.cy.js @@ -10,7 +10,7 @@ import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; const noteData = `New Note${getFourDigitRandomNumber()}`; const noteType = `Item${getFourDigitRandomNumber()}`; -describe('Settings', () => { +describe.skip('Settings', () => { before('Login to Folio', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); 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 index ca1cce5b27..d26dac3343 100644 --- a/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js +++ b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js @@ -9,7 +9,7 @@ const searchInvoiceNumber = { const fundID = 'Fund B (b)'; -describe('Orders', () => { +describe.skip('Orders', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); cy.visit(topMenu.ordersPath); 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 index 9a294037ab..1594cdaaf8 100644 --- 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 @@ -2,7 +2,7 @@ import order from '../../../../support/ideyaLabs/orders'; import topMenu from '../../../../support/fragments/topMenu'; import testTypes from '../../../../support/dictionary/testTypes'; -describe('Orders: Export in edifact format ', () => { +describe.skip('Orders: Export in edifact format ', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); 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 index a72d36a89f..873266b804 100644 --- 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 @@ -17,7 +17,7 @@ const orderDetails = { -describe('Orders: Receiving and Check-in ', () => { +describe.skip('Orders: Receiving and Check-in ', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js index 4d05ff24a4..c061d16a53 100644 --- a/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js +++ b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js @@ -7,7 +7,7 @@ import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; const categoryName = `Test${getFourDigitRandomNumber()}`; -describe('Settings', () => { +describe.skip('Settings', () => { before('Login to Folio', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/ideyalabs/settings.cy.js b/cypress/e2e/ideyalabs/settings.cy.js index 2eb9bfd90e..d9331ea9c9 100644 --- a/cypress/e2e/ideyalabs/settings.cy.js +++ b/cypress/e2e/ideyalabs/settings.cy.js @@ -8,7 +8,7 @@ import Users from '../../support/fragments/users/users'; import eHoldingsPackage from '../../support/fragments/eholdings/eHoldingsPackage'; import settingsMenu from '../../support/fragments/settingsMenu'; -describe('Creating custom labels', () => { +describe.skip('Creating custom labels', () => { const userData = {}; const testData = { servicePointS: ServicePoints.getDefaultServicePointWithPickUpLocation( 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 index 7bbe13ad6e..22f5e234ac 100644 --- 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 @@ -10,7 +10,7 @@ const patronData = { -describe('Orders: Receiving and Check-in ', () => { +describe.skip('Orders: Receiving and Check-in ', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index 33d333fced..8360b9e9b2 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -89,7 +89,7 @@ export default { Selection('Batch group*').open(), SelectionList().select(invoice.batchGroup), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').checked(false).click() + Checkbox('Export to accounting').click() ]); this.checkVendorPrimaryAddress(vendorPrimaryAddress); cy.do(saveAndClose.click()); diff --git a/cypress/support/ideyalabs/marc.js b/cypress/support/ideyalabs/marc.js index 644c4aea73..a14c008605 100644 --- a/cypress/support/ideyalabs/marc.js +++ b/cypress/support/ideyalabs/marc.js @@ -6,16 +6,10 @@ import { Spinner, TextField, including, - Accordion, - Button, Checkbox, KeyValue, Modal, - Section, Select, - Spinner, - TextField, - including, SearchField, QuickMarcEditorRow, Callout From bb73528a3c6bb95461de8b671dd338fbb67a5813 Mon Sep 17 00:00:00 2001 From: nhanaa Date: Wed, 2 Aug 2023 14:14:04 -0500 Subject: [PATCH 003/437] Add helper function for scheduling in transfer criteria --- .../fragments/users/transferFeeFine.js | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 5af15bdd90..11943fbd92 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,4 +1,4 @@ -import { Button, Modal, TextField, Select, Pane } from '../../../../interactors'; +import { Button, Modal, TextField, Select, Pane, MultiSelect } from '../../../../interactors'; const rootModal = Modal({ id: 'transfer-modal' }); const amountTextfield = rootModal.find(TextField({ id: 'amount' })); @@ -22,6 +22,25 @@ export default { cy.do(Select({ name: 'schedulePeriod' }).choose(period)); }, + setTransferCriteriaScheduling(frequency = 'Never (run manually)', interval, time, weekDays) { + cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); + + if (frequency !== 'Never (run manually)') { + cy.do([ + Select({ name: 'scheduling.interval' }).choose(interval), + TextField({ name: 'scheduling.time' }).fillIn(time) + ]); + } + + if (frequency === 'Weekly') { + if (weekDays === undefined) { + cy.do(MultiSelect({ name: 'scheduling.weekDay' }).choose('Monday')); + } else { + weekDays.map((day) => cy.do(MultiSelect({ name: 'scheduling.weekDay' }).choose(day))); + } + } + }, + typeScheduleTime(time) { // time: string like 9:15 AM cy.do([ From c116ce3a709991db3f4b558ac90185e969b9dfb4 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Thu, 3 Aug 2023 08:15:05 +0300 Subject: [PATCH 004/437] Fix for idealabs folders (#1442) Fixed ideaLabs folder --- cypress/e2e/ideyalabs/checkout.cy.js | 2 +- cypress/e2e/ideyalabs/circulationLog.cy.js | 2 +- .../orders-export-to-a-vendor/B_exportManager.cy.js | 2 +- cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js | 2 +- cypress/support/{ideyalabs => ideyaLabs}/circulationlog.js | 0 cypress/support/{ideyalabs => ideyaLabs}/marc.js | 0 6 files changed, 4 insertions(+), 4 deletions(-) rename cypress/support/{ideyalabs => ideyaLabs}/circulationlog.js (100%) rename cypress/support/{ideyalabs => ideyaLabs}/marc.js (100%) diff --git a/cypress/e2e/ideyalabs/checkout.cy.js b/cypress/e2e/ideyalabs/checkout.cy.js index ee9296c50f..f49219d230 100644 --- a/cypress/e2e/ideyalabs/checkout.cy.js +++ b/cypress/e2e/ideyalabs/checkout.cy.js @@ -1,4 +1,4 @@ -import users from '../../support/ideyalabs/users'; +import users from '../../support/ideyaLabs/users'; import testTypes from '../../support/dictionary/testTypes'; import topMenu from '../../support/fragments/topMenu'; import userLoans from '../../support/fragments/users/loans/userLoans'; diff --git a/cypress/e2e/ideyalabs/circulationLog.cy.js b/cypress/e2e/ideyalabs/circulationLog.cy.js index d56efcc6b4..d54ef0b0c2 100644 --- a/cypress/e2e/ideyalabs/circulationLog.cy.js +++ b/cypress/e2e/ideyalabs/circulationLog.cy.js @@ -4,7 +4,7 @@ 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'; +import circulationlog from '../../support/ideyaLabs/circulationlog'; const testData = { itemA: '4502015', 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 index b59ae4d805..ed58cb34ae 100644 --- 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 @@ -1,4 +1,4 @@ -import exportJobs from '../../../../../support/ideyalabs/exportJobs'; +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'; diff --git a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js index 8e0545fcbd..fba5b30d7d 100644 --- a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js +++ b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js @@ -1,4 +1,4 @@ -import marc from '../../support/ideyalabs/marc'; +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'; diff --git a/cypress/support/ideyalabs/circulationlog.js b/cypress/support/ideyaLabs/circulationlog.js similarity index 100% rename from cypress/support/ideyalabs/circulationlog.js rename to cypress/support/ideyaLabs/circulationlog.js diff --git a/cypress/support/ideyalabs/marc.js b/cypress/support/ideyaLabs/marc.js similarity index 100% rename from cypress/support/ideyalabs/marc.js rename to cypress/support/ideyaLabs/marc.js From 631de62f31f3e499f97fc377b5486b924f334293 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Thu, 3 Aug 2023 08:38:19 +0300 Subject: [PATCH 005/437] fix for idealab tests (#1443) --- cypress/e2e/ideyalabs/eholdings/eHolding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/ideyalabs/eholdings/eHolding.js b/cypress/e2e/ideyalabs/eholdings/eHolding.js index 5ea99c3ca9..93263f0fe4 100644 --- a/cypress/e2e/ideyalabs/eholdings/eHolding.js +++ b/cypress/e2e/ideyalabs/eholdings/eHolding.js @@ -13,7 +13,7 @@ import { Spinner, TextArea, TextField, -} from '../../../interactors'; +} from '../../../../interactors'; import eHoldingsNewCustomPackage from '../../support/fragments/eholdings/eHoldingsNewCustomPackage'; import eHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; import eholdingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; From 6ff95580435d1e4f8c7c90b2e12b0008a9b5e335 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Thu, 3 Aug 2023 19:58:31 +0500 Subject: [PATCH 006/437] added C398021 (#1444) --- .../user-able-to-edit-user-records.cy.js | 57 +++++++++++++++++++ cypress/support/fragments/users/userEdit.js | 8 +++ cypress/support/fragments/users/users.js | 4 +- 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/users/user-able-to-edit-user-records.cy.js diff --git a/cypress/e2e/users/user-able-to-edit-user-records.cy.js b/cypress/e2e/users/user-able-to-edit-user-records.cy.js new file mode 100644 index 0000000000..bf53f73176 --- /dev/null +++ b/cypress/e2e/users/user-able-to-edit-user-records.cy.js @@ -0,0 +1,57 @@ +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 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 UsersSearchPane from '../../support/fragments/users/usersSearchPane'; + +describe('Permissions Tags', () => { + let userData; + let servicePointId; + const newMiddleName = getTestEntityValue('newMiddleName'); + const patronGroup = { + name: getTestEntityValue('groupUserChange'), + }; + + 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.uiUserEdit.gui, permissions.uiUsersPermissionsView.gui], + patronGroup.name + ).then((userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password, { + path: TopMenu.usersPath, + waiter: UsersSearchPane.waitLoading, + }); + }); + }); + }); + + after('Deleting created entities', () => { + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + }); + + it( + 'C398021 Verify that user is able to edit user records without error messages (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + UsersSearchPane.searchByUsername(userData.username); + UserEdit.changeMiddleName(newMiddleName); + UserEdit.saveAndClose(); + Users.verifyMiddleNameOnUserDetailsPane(newMiddleName); + } + ); +}); diff --git a/cypress/support/fragments/users/userEdit.js b/cypress/support/fragments/users/userEdit.js index b529a7c25a..88373f722b 100644 --- a/cypress/support/fragments/users/userEdit.js +++ b/cypress/support/fragments/users/userEdit.js @@ -43,6 +43,14 @@ const addServicePointsViaApi = (servicePointIds, userId, defaultServicePointId) export default { addServicePointsViaApi, + changeMiddleName(midName) { + cy.do([ + userDetailsPane.find(actionsButton).click(), + editButton.click(), + TextField({ id: 'adduser_middlename' }).fillIn(midName), + ]); + }, + addPermissions(permissions) { cy.do([ userDetailsPane.find(actionsButton).click(), diff --git a/cypress/support/fragments/users/users.js b/cypress/support/fragments/users/users.js index 89a2143672..f83ed6b0a3 100644 --- a/cypress/support/fragments/users/users.js +++ b/cypress/support/fragments/users/users.js @@ -90,8 +90,8 @@ export default { cy.expect(userDetailsPane.find(KeyValue('First name')).has({ value: `${firstName}` })); }, - verifyMiddleNameOnUserDetailsPane(firstName) { - cy.expect(userDetailsPane.find(KeyValue('Middle name')).has({ value: `${firstName}` })); + verifyMiddleNameOnUserDetailsPane(middleName) { + cy.expect(userDetailsPane.find(KeyValue('Middle name')).has({ value: `${middleName}` })); }, verifyPatronGroupOnUserDetailsPane(patronGroup) { From 9b04b0bd8b0777b117f5232dbd59565b950e3a56 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Thu, 3 Aug 2023 18:36:03 +0300 Subject: [PATCH 007/437] FAT-1306-C692 (#1440) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-1306: initial implementation * FAT-1306: method added * FAT-1306: methods added * FAT-1306: merge conflict solved * FAT-1306: method updated --- .../eholdings/eholdings-custom-packages.cy.js | 45 ++++++++++++++++++ .../eholdings/eHoldingsNewCustomPackage.js | 17 +++++-- .../eholdings/eHoldingsPackageView.js | 20 +++++++- .../fragments/eholdings/eHoldingsPackages.js | 46 +++++++++++++++++++ 4 files changed, 122 insertions(+), 6 deletions(-) create mode 100644 cypress/e2e/eholdings/eholdings-custom-packages.cy.js diff --git a/cypress/e2e/eholdings/eholdings-custom-packages.cy.js b/cypress/e2e/eholdings/eholdings-custom-packages.cy.js new file mode 100644 index 0000000000..c254688635 --- /dev/null +++ b/cypress/e2e/eholdings/eholdings-custom-packages.cy.js @@ -0,0 +1,45 @@ +import TestTypes from '../../support/dictionary/testTypes'; +import TopMenu from '../../support/fragments/topMenu'; +import EHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; +import EHoldingSearch from '../../support/fragments/eholdings/eHoldingsSearch'; +import EHoldingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import EHoldingsPackageView from '../../support/fragments/eholdings/eHoldingsPackageView'; +import EHoldingsTitlesSearch from '../../support/fragments/eholdings/eHoldingsTitlesSearch'; +import permissions from '../../support/dictionary/permissions'; +import Users from '../../support/fragments/users/users'; +import DevTeams from '../../support/dictionary/devTeams'; +import getRandomPostfix from '../../support/utils/stringTools'; + +describe('eHoldings -> Package', () => { + const testData = { + customPackageName: `C692_package_${getRandomPostfix()}`, + }; + + before('Creating user, logging in', () => { + cy.createTempUser([ + permissions.uieHoldingsTitlesPackagesCreateDelete.gui, + permissions.uieHoldingsRecordsEdit.gui, + permissions.uieHoldingsPackageTitleSelectUnselect.gui + ]).then(userProperties => { + testData.userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { path: TopMenu.eholdingsPath, waiter: EHoldingsTitlesSearch.waitLoading }); + }); + }); + + after('Deleting user, data', () => { + Users.deleteViaApi(testData.userId); + EHoldingsPackages.deletePackageViaAPI(testData.customPackageName); + }); + + it('C692 Create a custom package (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + EHoldingSearch.switchToPackages(); + EHoldingsPackages.createCustomPackage(testData.customPackageName); + EHoldingsPackageView.waitLoading(); + EHoldingsPackageView.verifyPackageName(testData.customPackageName); + EHoldingsPackageView.verifyPackageType('Custom'); + EHoldingsPackages.checkPackageExistsViaAPI(testData.customPackageName, true); + EHoldingsPackageView.close(); + EHoldingsPackagesSearch.byName(testData.customPackageName); + EHoldingsPackages.checkPackageInResults(testData.customPackageName); + }); +}); diff --git a/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js b/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js index 0c9a765442..43e81d2ba8 100644 --- a/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js +++ b/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js @@ -5,6 +5,8 @@ const keyboardShortcut = Button('Keyboard shortcuts'); const KBcontent = Button({ id: 'content-item' }); const systemStatus = Button({ id: 'system-status-item' }); +const calloutPackageCreatedText = 'Custom package created.'; + export default { waitLoading: () => { @@ -17,12 +19,17 @@ export default { saveAndClose: () => { cy.do(Button('Save & close').click()); }, + + checkPackageCreatedCallout() { + cy.expect(HTML(including(calloutPackageCreatedText)).exists()); + }, + clickOneHoldingCarat: () => { cy.do([caratButton.click(), - KBcontent.click(), - caratButton.click(), - systemStatus.click(), - caratButton.click(), - keyboardShortcut.click()]); + KBcontent.click(), + caratButton.click(), + systemStatus.click(), + caratButton.click(), + keyboardShortcut.click()]); } }; diff --git a/cypress/support/fragments/eholdings/eHoldingsPackageView.js b/cypress/support/fragments/eholdings/eHoldingsPackageView.js index c74b80b508..1f955720d0 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackageView.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackageView.js @@ -1,9 +1,27 @@ -import { Button } from '../../../../interactors'; +import { Button, HTML, Pane, Section, KeyValue, including } from '../../../../interactors'; import eHoldingsPackages from './eHoldingsPackages'; export default { close:() => { cy.do(Button({ icon: 'times' }).click()); eHoldingsPackages.waitLoading(); + }, + + waitLoading() { + cy.expect([ + Section({ id: 'packageShowInformation' }).exists(), + Button('Actions').exists() + ]); + }, + + verifyPackageName(packageName) { + cy.expect([ + Pane({ title: packageName }).exists(), + HTML(packageName, { className: including('headline') }).exists() + ]); + }, + + verifyPackageType(packageType) { + cy.expect(KeyValue('Package type').has({ value: packageType })); } }; diff --git a/cypress/support/fragments/eholdings/eHoldingsPackages.js b/cypress/support/fragments/eholdings/eHoldingsPackages.js index 757a353c10..a22ec9588d 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackages.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackages.js @@ -13,6 +13,7 @@ const selectedText = "#packageShowHoldingStatus div[class^='headline']"; const actionButton = Button('Actions'); const deletePackageButton = Button('Delete package'); const confirmModal = Modal('Delete custom package'); +const addNewPackageButton = Button('New'); export default { create: (packageName = `package_${getRandomPostfix()}`) => { @@ -100,6 +101,51 @@ export default { return cy.get('@packageId'); }, + checkPackageInResults(packageName, rowNumber = 0) { + cy.expect(resultSection.find(ListItem({ className: including('list-item-'), index: rowNumber })).has({ h3Value: packageName })); + }, + + createCustomPackage(packageName) { + cy.do(addNewPackageButton.click()); + eHoldingsNewCustomPackage.waitLoading(); + eHoldingsNewCustomPackage.fillInRequiredProperties(packageName); + eHoldingsNewCustomPackage.saveAndClose(); + eHoldingsNewCustomPackage.checkPackageCreatedCallout(); + }, + + checkPackageExistsViaAPI(packageName, isCustom = false, timeOutSeconds = 15) { + let timeCounter = 0; + function checkPackage() { + cy.okapiRequest({ path: 'eholdings/packages', + searchParams: { 'q': packageName }, + isDefaultSearchParamsRequired : false }).then(({ body }) => { + if (body.data[0] || timeCounter >= timeOutSeconds) { + cy.expect(body.data[0].attributes.isCustom).equals(isCustom); + } else { + // wait 1 second before retrying request + cy.wait(1000); + checkPackage(); + timeCounter++; + } + }); + } + checkPackage(); + }, + + deletePackageViaAPI(packageName) { + cy.okapiRequest({ + path: 'eholdings/packages', + searchParams: { 'q': packageName }, + isDefaultSearchParamsRequired : false + }).then(({ body }) => { + cy.okapiRequest({ + method: 'DELETE', + path: `eholdings/packages/${body.data[0].id}`, + isDefaultSearchParamsRequired : false + }); + }); + }, + updateProxy() { cy.get(selectedText) .invoke('text') From 7b8fb91d2cdde9af30685ba98150651bd5c7230b Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Thu, 3 Aug 2023 20:15:38 +0300 Subject: [PATCH 008/437] fix for ideylabs (#1446) --- cypress/support/fragments/invoices/invoices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index 8360b9e9b2..674f5ef2a6 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -205,7 +205,7 @@ export default { id: 'clickable-delete-invoice-confirmation-confirm', }).click() ); - InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceDeletedMessage); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceDeletedMessage); }, createInvoiceLine: (invoiceLine) => { @@ -339,7 +339,7 @@ export default { Button('Approve').click(), submitButton.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceApprovedMessage); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceApprovedMessage); }, searchByNumber: (invoiceNumber) => { @@ -364,7 +364,7 @@ export default { Button('Pay').click(), submitButton.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.InvoicePaidMessage); + InteractorsTools.checkCalloutMessage(invoiceStates.invoicePaidMessage); }, updateCurrency: (currency) => { From e97ee47bd85b07945d68ba1f836936073c6157b3 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:16:35 +0300 Subject: [PATCH 009/437] Folijet fix master (#1445) * changed getRandomPostfix method * delete function cy.locale * uncommented code * deleted unused import --- ...-logs-in-app-holdings-instance-hrids.cy.js | 4 +- ...-logs-in-app-holdings-items-barcodes.cy.js | 8 +- .../e2e/match-on-pol-and-update-items.cy.js | 2 +- .../field-protection-modification.cy.js | 8 +- .../item-update-via-match-by-status.cy.js | 30 +- ...d-check-in-out-notes-from-marc-field.cy.js | 16 +- ...lationship-between-url-and-link-test.cy.js | 5 +- ...-update-select-fields-works-properly.cy.js | 18 +- ...g-on-newly-created-035-does-not-work.cy.js | 20 +- ...aking-incorrect-records-into-account.cy.js | 38 +-- ...-records-do-or-do-not-have-999-field.cy.js | 4 +- .../delete-logs-from-view-all.cy.js | 2 +- ...t-summary-table-for-creating-actions.cy.js | 16 +- ...t-summury-table-for-updating-actions.cy.js | 52 ++-- .../can-view-only-permission.cy.js | 2 +- .../user-cannot-delete-import-logs.cy.js | 17 +- ...ve-mapping-profile-to-action-profile.cy.js | 4 +- ...-profile-with-associated-job-profile.cy.js | 6 +- .../edit-existing-action-profile.cy.js | 2 +- .../edit-existing-mapping-profile.cy.js | 2 +- .../edit-existing-match-profile.cy.js | 2 +- ...elds-required-in-invoice-map-profile.cy.js | 2 +- .../e2e/ideyalabs/eholdings/G_eholdings.cy.js | 1 - ...cumbrances-are-rolled-over-correctly.cy.js | 4 +- .../funds/correct-fund-validation.cy.js | 4 +- .../e2e/ideyalabs/inventory_newMarcBib.cy.js | 273 ------------------ .../fragments/inventory/holdingsRecordView.js | 2 +- .../inventory/inventorySearchAndFilter.js | 5 +- cypress/support/fragments/orders/orders.js | 5 +- cypress/support/ideyaLabs/marc.js | 74 ++--- 30 files changed, 170 insertions(+), 458 deletions(-) delete mode 100644 cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js index c177471759..9a7bf1d9d0 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js @@ -95,8 +95,8 @@ describe('Bulk Edit - Logs', () => { instance.materialTypeId = res.id; instance2.materialTypeId = res.id; }); - const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint-${getRandomPostfix}`, uuid()); - const servicePoint2 = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint2-${getRandomPostfix}`, uuid()); + const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint-${getRandomPostfix()}`, uuid()); + const servicePoint2 = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint2-${getRandomPostfix()}`, uuid()); instance.defaultLocation = Location.getDefaultLocation(servicePoint.id); instance2.defaultLocation = Location.getDefaultLocation(servicePoint2.id); Location.createViaApi(instance.defaultLocation); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-items-barcodes.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-items-barcodes.cy.js index c626ccfb45..a6e9458b74 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-items-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-items-barcodes.cy.js @@ -93,10 +93,10 @@ describe('Bulk Edit - Logs', () => { instance.materialTypeId = res.id; instance2.materialTypeId = res.id; }); - const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint-${getRandomPostfix}`, uuid()); - const servicePoint2 = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint2-${getRandomPostfix}`, uuid()); - tempLocation = ServicePoints.getDefaultServicePointWithPickUpLocation(`tempLocation-${getRandomPostfix}`, uuid()); - tempLocation2 = ServicePoints.getDefaultServicePointWithPickUpLocation(`tempLocation2-${getRandomPostfix}`, uuid()); + const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint-${getRandomPostfix()}`, uuid()); + const servicePoint2 = ServicePoints.getDefaultServicePointWithPickUpLocation(`servicePoint2-${getRandomPostfix()}`, uuid()); + tempLocation = ServicePoints.getDefaultServicePointWithPickUpLocation(`tempLocation-${getRandomPostfix()}`, uuid()); + tempLocation2 = ServicePoints.getDefaultServicePointWithPickUpLocation(`tempLocation2-${getRandomPostfix()}`, uuid()); instance.defaultLocation = Location.getDefaultLocation(servicePoint.id); instance2.defaultLocation = Location.getDefaultLocation(servicePoint2.id); tempLocation = Location.getDefaultLocation(tempLocation.id); 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 5509cb0abd..3d38e43b5d 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 @@ -248,7 +248,7 @@ describe('ui-data-import', () => { const checkReceivedPiece = (number, title) => { cy.visit(TopMenu.ordersPath); Orders.resetFilters(); - Orders.searchByParameter('PO number', `${number}-1`); + Orders.searchByParameter('PO number', number); Orders.selectFromResultsList(number); OrderView.openPolDetails(title); OrderLines.openReceiving(); 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 93a8d99502..27ebd7aef2 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 @@ -25,20 +25,20 @@ describe('ui-data-import', () => { const fieldsForDelete = ['977', '978', '979']; const fieldsForDeleteIds = []; // unique file name to upload - const fileName = `C350678autotestFileProtection.${getRandomPostfix}.mrc`; + const fileName = `C350678autotestFileProtection.${getRandomPostfix()}.mrc`; - const mappingProfile = { name: `C350678 Remove extraneous MARC fields ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + profileName: `C350678 Create bib and instance, but remove some MARC fields first ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; 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 14e04424d7..ec7262ef3a 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 @@ -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 ${getRandomPostfix}`; + const jobProfileNameForExport = `C357552 Bibs with Item HRIDs ${getRandomPostfix()}`; // file names - const nameMarcFileForImportCreate = `C357552autotestFile.${getRandomPostfix}.mrc`; - const nameForCSVFile = `C357552autotestFile${getRandomPostfix}.csv`; - const nameMarcFileForUpdate = `C357552autotestFile${getRandomPostfix}.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 ${getRandomPostfix}`, + name: `C357552 Create simple holdings ${getRandomPostfix()}`, permanentLocation: LOCATION_NAMES.ONLINE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C357552 Create simple holdings ${getRandomPostfix}` } + name: `C357552 Create simple holdings ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Create simple items ${getRandomPostfix}`, + 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 ${getRandomPostfix}` } + name: `C357552 Create simple items ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Update Item by POL match ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + profileName: `C357552 Create simple instance, holdings, items ${getRandomPostfix()}`, }; const updateJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C357552 Update item based on HRID and Status ${getRandomPostfix}`, + profileName: `C357552 Update item based on HRID and Status ${getRandomPostfix()}`, }; const exportMappingProfile = { - name: `C357552 Item HRID ${getRandomPostfix}`, + name: `C357552 Item HRID ${getRandomPostfix()}`, }; before('create test data', () => { 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 8e988e9935..1128f2af6d 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 @@ -29,7 +29,7 @@ describe('ui-data-import', () => { let user; const rowNumbers = [0, 1]; const instanceHrids = []; - const marcFileName = `C368005 autotestFile.${getRandomPostfix}.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 ${getRandomPostfix}`, + name: `C368005 Create instance for mapping notes ${getRandomPostfix()}`, catalogingDate: '###TODAY###' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C368005 Create instance for mapping notes ${getRandomPostfix}` } + name: `C368005 Create instance for mapping notes ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368005 Create holdings for mapping notes ${getRandomPostfix}`, + 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 ${getRandomPostfix}` } + name: `C368005 Create holdings for mapping notes ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368005 Create item for mapping notes ${getRandomPostfix}`, + 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 ${getRandomPostfix}` } + name: `C368005 Create items for mapping notes ${getRandomPostfix()}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C368005 Create mappings for item notes ${getRandomPostfix}`, + 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 index bfa3a15b16..1aab5fe026 100644 --- 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 @@ -66,7 +66,7 @@ describe('ui-data-import', () => { name: `C400649 Create ER Holdings ${getRandomPostfix()}`, holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - relationship: 'Resource', + relationship: '"Resource"', uri: '856$u', linkText: '856$y', materialsSpecified: '856$3', @@ -85,7 +85,8 @@ describe('ui-data-import', () => { cy.createTempUser([ permissions.moduleDataImportEnabled.gui, permissions.settingsDataImportEnabled.gui, - permissions.inventoryAll.gui + permissions.inventoryAll.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui ]) .then(userProperties => { user = userProperties; 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 86dd69419c..8c780c139f 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 @@ -26,33 +26,33 @@ describe('ui-data-import', () => { let instanceHrid; const quantityOfItems = '1'; // unique file names - const marcFileForCreate = `C17019 oneMarcBib.mrc${getRandomPostfix}`; - const editedMarcFileName = `C17019 editedMarcFile.${getRandomPostfix}.mrc`; - const fileNameForUpdate = `C17019 marcFileForUpdate.${getRandomPostfix}.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.${getRandomPostfix}`, + 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.${getRandomPostfix}`, + 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.${getRandomPostfix}`, + 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.${getRandomPostfix}`, + 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.${getRandomPostfix}`, + 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.${getRandomPostfix}`, + profileName: `C17019 autotest job profile.${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; 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 2335dc8ac9..7f3124b4dd 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 @@ -32,13 +32,13 @@ describe('ui-data-import', () => { let firstInstanceHrid; let secondInstanceHrid; // unique file names - 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 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + profileName: `C358138 Update instance via 035 ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -140,8 +140,6 @@ describe('ui-data-import', () => { InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { firstInstanceHrid = initialInstanceHrId; }); - - FileDetails.openInstanceInInventory('Created'); InventoryInstance.verifyResourceIdentifier(resourceIdentifierForFirstInstance.type, resourceIdentifierForFirstInstance.value, 2); InventoryInstance.viewSource(); InventoryViewSource.contains('035\t'); @@ -216,8 +214,6 @@ describe('ui-data-import', () => { InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { secondInstanceHrid = initialInstanceHrId; }); - - FileDetails.openInstanceInInventory('Created'); InventoryInstance.verifyResourceIdentifier(resourceIdentifierForSecondInstance.type, resourceIdentifierForSecondInstance.value, 3); InventoryInstance.viewSource(); InventoryViewSource.contains('035\t'); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js index 46ea866a6c..6d33a8826f 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js @@ -20,12 +20,14 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import GenerateIdentifierCode from '../../../support/utils/generateIdentifierCode'; +import FileManager from '../../../support/utils/fileManager'; import Users from '../../../support/fragments/users/users'; describe('ui-data-import', () => { let user; + const randomIdentifierCode = GenerateIdentifierCode.getRandomIdentifierCode(); const quantityOfItems = '1'; - const identifier = 'ccn00999523'; const protectedFields = { firstField: '020', secondField: '514' @@ -34,6 +36,7 @@ describe('ui-data-import', () => { const filePathToUpload = 'marcBibFileForC380390.mrc'; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; const fileNameForCreate = `C380390 autotest file.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C380390 autotest file.${getRandomPostfix()}.mrc`; const fileNameForMatch = `C380390 autotest file.${getRandomPostfix()}.mrc`; const fileNameForUpdate = `C380390 autotest file.${getRandomPostfix()}.mrc`; const matchProfile = { @@ -43,7 +46,7 @@ describe('ui-data-import', () => { subfield: 'a' }, qualifierType: 'Begins with', - qualifierValue: 'ccn', + qualifierValue: `${randomIdentifierCode}`, existingRecordFields: { field: '035', subfield: 'a' @@ -90,15 +93,6 @@ describe('ui-data-import', () => { field: protectedFields.secondField }) .then((secondResp) => { protectedFieldIds.push(secondResp.id); }); - - InventorySearchAndFilter.getInstancesByIdentifierViaApi(identifier) - .then(instances => { - if (instances) { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); }); cy.createTempUser([ @@ -118,22 +112,30 @@ describe('ui-data-import', () => { MatchProfiles.deleteMatchProfile(matchProfile.profileName); ActionProfiles.deleteActionProfile(actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); Users.deleteViaApi(user.userId); protectedFieldIds.forEach(fieldId => MarcFieldProtection.deleteMarcFieldProtectionViaApi(fieldId)); - InventorySearchAndFilter.getInstancesByIdentifierViaApi(identifier) + InventorySearchAndFilter.getInstancesByIdentifierViaApi(`${randomIdentifierCode}00999523`) .then(instances => { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); + if (instances) { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + } }); }); it('C380390 Verify updating record via 035 match, without taking incorrect records into account (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // change files for create instance using random identifier code + DataImport.editMarcFile(filePathToUpload, editedMarcFileName, + ['ccn'], [randomIdentifierCode]); + // upload a marc file // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - DataImport.uploadFile(filePathToUpload, fileNameForCreate); + DataImport.uploadFile(editedMarcFileName, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileNameForCreate); @@ -156,7 +158,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - DataImport.uploadFile(filePathToUpload, fileNameForMatch); + DataImport.uploadFile(editedMarcFileName, fileNameForMatch); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileNameForMatch); @@ -193,7 +195,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - DataImport.uploadFile(filePathToUpload, fileNameForUpdate); + DataImport.uploadFile(editedMarcFileName, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileNameForUpdate); 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 064f01f279..58042995d8 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 @@ -14,8 +14,8 @@ import FileManager from '../../../support/utils/fileManager'; describe('ui-data-import', () => { let user; let instanceHrid; - const fileName = `oneMarcBib.mrc${getRandomPostfix}`; - const editedMarcFileName = `C359209 editedMarcFile.${getRandomPostfix}.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 66fe9b4eaf..06ffa45942 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 @@ -21,7 +21,7 @@ describe('ui-data-import', () => { user = userProperties; for (let i = 0; i < 101; i++) { - const fileName = `oneMarcBib.mrc${getRandomPostfix}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); } 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 7334c3f077..34c37c48f5 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 @@ -26,35 +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.${getRandomPostfix}.mrc`; + const nameMarcFile = `C356801autotestFile.${getRandomPostfix()}.mrc`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356801 instance mapping profile ${getRandomPostfix}` }, + name: `C356801 instance mapping profile ${getRandomPostfix()}` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356801 instance action profile ${getRandomPostfix}` } + name: `C356801 instance action profile ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356801 holdings mapping profile ${getRandomPostfix}`, + name: `C356801 holdings mapping profile ${getRandomPostfix()}`, pernanentLocation: `"${LOCATION_NAMES.ONLINE}"`, pernanentLocationUI: LOCATION_NAMES.ONLINE_UI }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356801 holdings action profile ${getRandomPostfix}` } + name: `C356801 holdings action profile ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356801 item mapping profile ${getRandomPostfix}`, + 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: `C356801 item action profile ${getRandomPostfix}` } + name: `C356801 item action profile ${getRandomPostfix()}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C356801 job profile ${getRandomPostfix}` + profileName: `C356801 job profile ${getRandomPostfix()}` }; before('create test data', () => { 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 13c0923510..721c383e21 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 @@ -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.${getRandomPostfix}.mrc`; - const nameForCSVFile = `C356802autotestFile${getRandomPostfix}.csv`; - const nameMarcFileForImportUpdate = `C356802autotestFile${getRandomPostfix}.mrc`; - const jobProfileNameForExport = `C356802 job profile.${getRandomPostfix}`; + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + 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 ${getRandomPostfix}`, + profileName: `C356802 update job profile ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -407,7 +407,7 @@ describe('ui-data-import', () => { NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); NewFieldMappingProfile.fillCallNumberType(`"${collectionOfMappingAndActionProfiles[1].mappingProfile.callNumberType}"`); NewFieldMappingProfile.fillCallNumber(collectionOfMappingAndActionProfiles[1].mappingProfile.callNumber); - NewFieldMappingProfile.addElectronicAccess(collectionOfMappingAndActionProfiles[1].mappingProfile.relationship, collectionOfMappingAndActionProfiles[1].mappingProfile.uri); + NewFieldMappingProfile.addElectronicAccess(`"${collectionOfMappingAndActionProfiles[1].mappingProfile.relationship}"`, collectionOfMappingAndActionProfiles[1].mappingProfile.uri); FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); 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 c3e0fb7d53..2ae37897c3 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 @@ -14,7 +14,7 @@ import Users from '../../../support/fragments/users/users'; describe('ui-data-import', () => { let user; let instanceHrid; - const fileName = `oneMarcBib.mrc${getRandomPostfix}`; + 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 b54ff47eb8..6ad5ea23a7 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 @@ -6,17 +6,14 @@ import TopMenu from '../../../support/fragments/topMenu'; 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 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'; import { JOB_STATUS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { let user; - let instanceHrid; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const fileName = `C353641 autotestFile.${getRandomPostfix}.mrc`; + const fileName = `C353641 autotestFile.${getRandomPostfix()}.mrc`; before('create test data', () => { cy.createTempUser([ @@ -30,10 +27,6 @@ describe('ui-data-import', () => { after('delete test data', () => { Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); }); it('C353641 A user can not delete import logs with standard Data import: Can upload files, import, and view logs permission (folijet)', @@ -45,14 +38,6 @@ describe('ui-data-import', () => { JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileName); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - 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/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 ae920cab56..fdb9fa2db6 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 @@ -13,12 +13,12 @@ import ConfirmRemoval from '../../../support/fragments/data_import/action_profil describe('ui-data-import', () => { const mappingProfile = { - name: `C11115 autotest mapping profile ${getRandomPostfix}`, + name: `C11115 autotest mapping profile ${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { - name: `C11115 autotest action profile ${getRandomPostfix}`, + 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 1aa657646c..0b5faf28f7 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 @@ -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 ${getRandomPostfix}`, + name: `C367994 autotest mapping profile ${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C367994 autotest action profile ${getRandomPostfix}` + name: `C367994 autotest action profile ${getRandomPostfix()}` }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C367994 autotest job profile${getRandomPostfix}`, + 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 5f14543a54..37e2b188cf 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 @@ -14,7 +14,7 @@ describe('ui-data-import', () => { let user; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C2348 autotest action profile ${getRandomPostfix}` + 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 7644d62c9f..ad5da61e0f 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 @@ -14,7 +14,7 @@ import Users from '../../../support/fragments/users/users'; describe('ui-data-import', () => { let user; const mappingProfile = { - name: `C2351 autotest mapping profile ${getRandomPostfix}`, + 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 be065f21b8..34ec6d338a 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 @@ -14,7 +14,7 @@ import { EXISTING_RECORDS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { let user; const matchProfile = { - profileName: `C2339 autotest MatchProf${getRandomPostfix}`, + 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 1084e55b2f..c37102d84e 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 @@ -10,7 +10,7 @@ import SettingsMenu from '../../../support/fragments/settingsMenu'; describe('ui-data-import', () => { let user = null; - const mappingProfileName = `C343284 invoice mapping profile ${getRandomPostfix}`; + const mappingProfileName = `C343284 invoice mapping profile ${getRandomPostfix()}`; before('login', () => { cy.createTempUser([ diff --git a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js index 2948332053..f72ec67703 100644 --- a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js +++ b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js @@ -1,4 +1,3 @@ -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'; 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 index 4d88984e9b..1fd14d6a9a 100644 --- 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 @@ -84,8 +84,8 @@ describe.skip('Finance: Fiscal Year Rollover', () => { 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); + financeHelper.searchByName(testData.searchByName); + financeHelper.selectFirstLedger(rollOverData.selectFirstLedger); ledgers.clickonViewledgerDetails(); ledgers.rollover(); ledgers.selectFirstCheckBox(encumbranceData.selectFirstCheckBox); diff --git a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js index 83e449bad6..3d9037098e 100644 --- a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js +++ b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js @@ -11,7 +11,7 @@ const orderOne = { }; const orderOnePOLine = { - title: `AutoTest_${getRandomPostfix}`, + title: `AutoTest_${getRandomPostfix()}`, fundID: 'Alpha FYRO (AFYRO)', }; @@ -21,7 +21,7 @@ const orderTwo = { }; const orderTwoPOLine = { - title: `AutoTest_${getRandomPostfix}`, + title: `AutoTest_${getRandomPostfix()}`, fundID: 'PO Fund 1 (POF1)', price: '1', valueOne: '90', diff --git a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js deleted file mode 100644 index fba5b30d7d..0000000000 --- a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js +++ /dev/null @@ -1,273 +0,0 @@ -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 MariÌa de JesuÌ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: 'MariÌa de JesuÌs, de Agreda, sister, 1602-1665', - }, - sourceValues: { - folio: 'ADMINISTRATOR, DIKU', - }, -}; - -describe.skip('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/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index 74527e0caf..5a403d5d5d 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -143,7 +143,7 @@ export default { checkMarkAsSuppressedFromDiscoveryAbsent: () => cy.expect(root .find(HTML(including('Warning: Holdings is marked suppressed from discovery'))) .absent()), - checkElectronicAccess:(relationshipValue, uriValue, linkText = 'no value set', urlPublicNote = 'no value set') => { + checkElectronicAccess:(relationshipValue, uriValue, linkText = '-', urlPublicNote = '-') => { cy.expect(electronicAccessAccordion .find(MultiColumnListCell({ row: 0, columnIndex: 0, content: relationshipValue })) .exists()); diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 55adc5eced..b367f5c77f 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -62,9 +62,10 @@ const instancesList = paneResultsSection.find(MultiColumnList({ id: 'list-invent const searchInstanceByHRID = (id) => { cy.do([ Select({ id: 'input-inventory-search-qindex' }).choose('Instance HRID'), - TextField({ id: 'input-inventory-search' }).fillIn(id), - searchButton.click() + TextField({ id: 'input-inventory-search' }).fillIn(id) ]); + cy.wait(1000); + cy.do(searchButton.click()); InventoryInstances.waitLoading(); }; diff --git a/cypress/support/fragments/orders/orders.js b/cypress/support/fragments/orders/orders.js index b82fe89475..e7174e7c4e 100644 --- a/cypress/support/fragments/orders/orders.js +++ b/cypress/support/fragments/orders/orders.js @@ -57,9 +57,10 @@ export default { searchByParameter(parameter, value) { cy.do([ searchForm.selectIndex(parameter), - searchForm.fillIn(value), - Button('Search').click(), + searchForm.fillIn(value) ]); + cy.wait(1000); + cy.do(Button('Search').click()); }, waitLoading() { cy.expect([ diff --git a/cypress/support/ideyaLabs/marc.js b/cypress/support/ideyaLabs/marc.js index a14c008605..f7395e1429 100644 --- a/cypress/support/ideyaLabs/marc.js +++ b/cypress/support/ideyaLabs/marc.js @@ -8,28 +8,27 @@ import { including, Checkbox, KeyValue, - Modal, Select, SearchField, QuickMarcEditorRow, Callout -} from "../../../interactors"; -import holdingsRecordView from "../fragments/inventory/holdingsRecordView"; +} from '../../../interactors'; +import holdingsRecordView from '../fragments/inventory/holdingsRecordView'; -const rootSection = Section({ id: "marc-view-pane" }); -const filterSection = Section({ id: "pane-filter" }); -const saveAndCloseBtn = Button("Save & close"); +const rootSection = Section({ id: 'marc-view-pane' }); +const filterSection = Section({ id: 'pane-filter' }); +const saveAndCloseBtn = Button('Save & close'); const closeButton = Button({ - ariaLabel: "Close The !!!Kung of Nyae Nyae / Lorna Marshall.", + ariaLabel: 'Close The !!!Kung of Nyae Nyae / Lorna Marshall.', }); const buttonLink = Button({ icon: 'unlink' }); const editorSection = Section({ id: 'quick-marc-editor-pane' }); -const linkHeadingsButton = Button("Link headings"); -const searchButton = Button({ type: "submit" }); -const actionsButton = Button("Actions"); -const deleteButton = Button("Delete"); +const linkHeadingsButton = Button('Link headings'); +const searchButton = Button({ type: 'submit' }); +const actionsButton = Button('Actions'); +const deleteButton = Button('Delete'); const deleteButtonInConfirmation = Button({ - id: "clickable-delete-confirmation-modal-confirm", + id: 'clickable-delete-confirmation-modal-confirm', }); const availableProxies = ['Inherited - None', 'FOLIO-Bugfest', 'EZProxy']; const proxySelect = Select({ id: 'eholdings-proxy-id' }); @@ -42,6 +41,7 @@ const fullTextFinderCheckbox = Checkbox({ const saveButton = Button('Save'); const verifyCustomLabel = Section({ id: 'resourceShowCustomLabels' }); const RandomValue = Math.floor(Math.random() * 2); +const packageId = null; cy.intercept(`eholdings/packages/${packageId}/resources?**`).as( 'getTitles' ); @@ -64,14 +64,14 @@ export default { }, printButton: () => { - cy.do(rootSection.find(Button("Actions")).click()); - cy.do(Button("Print").click()); + cy.do(rootSection.find(Button('Actions')).click()); + cy.do(Button('Print').click()); }, searchByValue: (value) => { cy.do( filterSection - .find(TextField({ id: "input-inventory-search" })) + .find(TextField({ id: 'input-inventory-search' })) .fillIn(value) ); searchButton.click(); @@ -86,63 +86,63 @@ export default { }, popupUnlinkButton: () => { - cy.do(Button("Unlink").click()); + cy.do(Button('Unlink').click()); }, keepLinkingButton: () => { - cy.do(Button("Keep linking").click()); + cy.do(Button('Keep linking').click()); }, closeEditMarc: () => { - cy.do(Button({ icon: "times" }).click()); + cy.do(Button({ icon: 'times' }).click()); }, crossIcon: () => { - cy.do(Button({ icon: "times" }).click()); + cy.do(Button({ icon: 'times' }).click()); }, create006Tag: () => { - cy.get(".quickMarcEditorAddField:last").click(); + cy.get('.quickMarcEditorAddField:last').click(); cy.get('[class*="quickMarcEditorRow--"]:last-child') - .find("input") + .find('input') .then(([tag]) => { - cy.wrap(tag).type("006"); + cy.wrap(tag).type('006'); }); - cy.get('[class*="quickMarcEditorRow--"]:last-child').contains("Type"); - cy.get('[class*="quickMarcEditorRow--"]:last-child select').select("a"); + cy.get('[class*="quickMarcEditorRow--"]:last-child').contains('Type'); + cy.get('[class*="quickMarcEditorRow--"]:last-child select').select('a'); }, create007Tag: () => { - cy.get(".quickMarcEditorAddField:last").click(); + cy.get('.quickMarcEditorAddField:last').click(); cy.get('[class*="quickMarcEditorRow--"]:last-child') - .find("input") + .find('input') .then(([tag]) => { - cy.wrap(tag).type("007"); + cy.wrap(tag).type('007'); }); - cy.get('[class*="quickMarcEditorRow--"]:last-child').contains("Type"); - cy.get('[class*="quickMarcEditorRow--"]:last-child select').select("a"); + cy.get('[class*="quickMarcEditorRow--"]:last-child').contains('Type'); + cy.get('[class*="quickMarcEditorRow--"]:last-child select').select('a'); }, recordLastUpdated: () => { cy.expect(Spinner().absent()); cy.do( - Accordion("Administrative data") - .find(Button(including("Record last updated"))) + Accordion('Administrative data') + .find(Button(including('Record last updated'))) .click() ); }, checkFieldContentMatch() { - cy.wrap(Accordion({ headline: "Update information" }).text()).as("message"); - cy.get("@message").then((val) => { + cy.wrap(Accordion({ headline: 'Update information' }).text()).as('message'); + cy.get('@message').then((val) => { const sourceRegex = /Source: [^\n]*/; const sourceLineMatch = val.match(sourceRegex); - const sourceText = sourceLineMatch ? sourceLineMatch[0].slice(8) : ""; - const words = sourceText.split(", "); - const swappedString = words.join(", "); + const sourceText = sourceLineMatch ? sourceLineMatch[0].slice(8) : ''; + const words = sourceText.split(', '); + const swappedString = words.join(', '); holdingsRecordView.editInQuickMarc(); cy.expect( - PaneHeader({ id: "paneHeaderquick-marc-editor-pane" }).has({ + PaneHeader({ id: 'paneHeaderquick-marc-editor-pane' }).has({ text: including(`Source: ${swappedString}`), }) ); From 4ecf3006ddd377103a78ecaf2e63659c54b52310 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Fri, 4 Aug 2023 16:47:44 +0300 Subject: [PATCH 010/437] fix for idealabs tests (#1450) --- cypress/e2e/ideyalabs/eholdings/eHolding.js | 16 ++++++++-------- .../finance/available-balance-is-displayed.cy.js | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cypress/e2e/ideyalabs/eholdings/eHolding.js b/cypress/e2e/ideyalabs/eholdings/eHolding.js index 93263f0fe4..618d03de5d 100644 --- a/cypress/e2e/ideyalabs/eholdings/eHolding.js +++ b/cypress/e2e/ideyalabs/eholdings/eHolding.js @@ -14,17 +14,17 @@ import { 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 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'; +} from '../../../support/utils/stringTools'; const editButton = Button('Edit'); const actionsButton = Button('Actions'); diff --git a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js index 0804c2bd02..4e4aee55fb 100644 --- a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js +++ b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js @@ -56,7 +56,7 @@ describe.skip('Finance: Funds', () => { }); it('C377030 "Available balance" is displayed as a negative number when running a deficit(Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { - cy.visit(topMenu.financePath); +/* cy.visit(topMenu.financePath); fiscalYears.clickOnFiscalYear(); financeHelper.searchByName(testData.fiscalName); financeHelper.selectFirstFinance(testData.selectName); @@ -88,6 +88,6 @@ describe.skip('Finance: Funds', () => { funds.checkBudgetQuantity1( testData.fundFinancialQuantity1, testData.fundFinancialQuantity2 - ); + );*/ }); }); From b8c700fa4a6a05ec68acb25bc0703f8dc78ead18 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Fri, 4 Aug 2023 16:51:24 +0300 Subject: [PATCH 011/437] FAT-6971 fixed failed tests (vega) (#1451) --- cypress/e2e/settings/users/conditions.cy.js | 4 ++++ .../user-can-change-type-for-request.cy.js | 2 ++ ...user-can-create-item-level-request-from-item-record.cy.js | 1 + .../user-can-create-page-Item-level-request.cy.js | 1 + cypress/support/fragments/inventory/createPageTypeRequest.js | 5 +++-- cypress/support/fragments/requests/newRequest.js | 5 ++++- 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/settings/users/conditions.cy.js b/cypress/e2e/settings/users/conditions.cy.js index 742aad65a8..38cd26d137 100644 --- a/cypress/e2e/settings/users/conditions.cy.js +++ b/cypress/e2e/settings/users/conditions.cy.js @@ -30,6 +30,8 @@ describe('ui-users-settings: Conditions in Patron blocks', () => { // If Borrowing and/or Renewals and/or Requests is check marked, then Message to be displayed specialCondition.clickByCheckbox(specialCheckBox); specialCondition.trySave(); + // in order to get error message Save button should be clicked two times + specialCondition.trySave(); specialCondition.checkRequiredMessageField(); specialCondition.checkEmptyMessageValidation(); // uncheck special checkbox @@ -38,6 +40,8 @@ describe('ui-users-settings: Conditions in Patron blocks', () => { // If Message to be displayed is entered, then Borrowing and/or Renewals and/or Requests must be set selected; specialCondition.setMessage('Test message'); specialCondition.trySave(); + // in order to get error message Save button should be clicked two times + specialCondition.trySave(); specialCondition.checkRequiredCheckboxValidation(); // save change based on validator error message specialCondition.clickByCheckbox(specialCheckBox); diff --git a/cypress/e2e/title-level-request/user-can-change-type-for-request.cy.js b/cypress/e2e/title-level-request/user-can-change-type-for-request.cy.js index 075556df7e..df5c86befc 100644 --- a/cypress/e2e/title-level-request/user-can-change-type-for-request.cy.js +++ b/cypress/e2e/title-level-request/user-can-change-type-for-request.cy.js @@ -183,6 +183,7 @@ describe('Title Level Request. Request Detail', () => { requesterBarcode: userData.barcode, pickupServicePoint: testData.userServicePoint.name, }); + NewRequest.chooseRequestType(REQUEST_TYPES.PAGE); NewRequest.saveRequestAndClose(); RequestDetail.waitLoading(); cy.wait('@createRequest').then((intercept) => { @@ -210,6 +211,7 @@ describe('Title Level Request. Request Detail', () => { requesterBarcode: userData.barcode, pickupServicePoint: testData.userServicePoint.name, }); + NewRequest.chooseRequestType(REQUEST_TYPES.PAGE); NewRequest.saveRequestAndClose(); RequestDetail.waitLoading(); cy.wait('@createRequest').then((intercept) => { diff --git a/cypress/e2e/title-level-request/user-can-create-item-level-request-from-item-record.cy.js b/cypress/e2e/title-level-request/user-can-create-item-level-request-from-item-record.cy.js index 4da621da6a..169cd46171 100644 --- a/cypress/e2e/title-level-request/user-can-create-item-level-request-from-item-record.cy.js +++ b/cypress/e2e/title-level-request/user-can-create-item-level-request-from-item-record.cy.js @@ -166,6 +166,7 @@ describe('Create Item or Title level request', () => { requesterBarcode: userData.barcode, pickupServicePoint: testData.userServicePoint.name, }); + NewRequest.chooseRequestType(REQUEST_TYPES.PAGE); NewRequest.saveRequestAndClose(); NewRequest.waitLoading(); cy.wait('@createRequest').then((intercept) => { diff --git a/cypress/e2e/title-level-request/user-can-create-page-Item-level-request.cy.js b/cypress/e2e/title-level-request/user-can-create-page-Item-level-request.cy.js index fef5ae08b2..faeca95f5e 100644 --- a/cypress/e2e/title-level-request/user-can-create-page-Item-level-request.cy.js +++ b/cypress/e2e/title-level-request/user-can-create-page-Item-level-request.cy.js @@ -159,6 +159,7 @@ describe('Create Item or Title level request', () => { requesterBarcode: userData.barcode, pickupServicePoint: testData.userServicePoint.name, }); + NewRequest.chooseRequestType(REQUEST_TYPES.PAGE); NewRequest.saveRequestAndClose(); NewRequest.waitLoading(); cy.wait('@createRequest').then((intercept) => { diff --git a/cypress/support/fragments/inventory/createPageTypeRequest.js b/cypress/support/fragments/inventory/createPageTypeRequest.js index 0bc5fd6f72..2fdbf03b53 100644 --- a/cypress/support/fragments/inventory/createPageTypeRequest.js +++ b/cypress/support/fragments/inventory/createPageTypeRequest.js @@ -14,10 +14,10 @@ import { import MarkItemAsMissing from './markItemAsMissing'; import Requests from '../requests/requests'; import newRequest from '../requests/newRequest'; -import { ITEM_STATUS_NAMES } from '../../constants'; +import { ITEM_STATUS_NAMES, REQUEST_TYPES } from '../../constants'; const actionsButton = Button('Actions'); -const newRequestButton = Button('New Request'); +const newRequestButton = Button('New request'); const selectUserModal = Modal('Select User'); const loanAndAvailabilitySection = Section({ id: 'acc06' }); const itemInfoSection = Section({ id: 'item-info' }); @@ -108,6 +108,7 @@ export default { saveAndClose(servicePointName = 'Circ Desk 1') { Requests.verifyFulfillmentPreference(); newRequest.choosepickupServicePoint(servicePointName); + newRequest.chooseRequestType(REQUEST_TYPES.PAGE); newRequest.saveRequestAndClose(); Requests.verifyRequestsPage(); this.verifyNewRequest(); diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index 449c7af6fc..5ea6d49c64 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -100,6 +100,9 @@ export default { // need to wait until instanceId is uploaded cy.wait(2500); this.choosepickupServicePoint(newRequest.pickupServicePoint); + // need to wait for loading dropdown options + cy.wait(1000); + this.chooseRequestType(REQUEST_TYPES.PAGE); this.saveRequestAndClose(); this.waitLoading(); }, @@ -154,7 +157,7 @@ export default { }, verifyHridInformation: (allContentToCheck) => { - return allContentToCheck.forEach(contentToCheck => cy.expect(Section({ id: 'section-instance-info' }, including(contentToCheck)).exists())); + return allContentToCheck.forEach(contentToCheck => cy.expect(HTML({ id: 'section-instance-info' }, including(contentToCheck)).exists())); }, verifyRequestInformation: (itemStatus) => { From a742e39a342ebc25302e98c7a4aead42d37a7bdd Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Fri, 4 Aug 2023 16:57:12 +0300 Subject: [PATCH 012/437] Master Fix (#1449) * Master fix * Master fix * Fix Master --------- Co-authored-by: Ostap Voitsekhovskyi --- .../cancelling-approved-invoices.cy.js | 2 +- .../e2e/orders/edit-pol-in-open-order.cy.js | 9 ++--- ...ting-fund-and-increasing-cost-in-pol.cy.js | 4 +- ...iving-includes-order-closed-statuses.cy.js | 2 +- ...ceiving-pieces-from-order-for-PE-mix.cy.js | 4 +- .../serials-receiving.cy.js | 2 +- .../update-barcode.cy.js | 4 +- .../support/fragments/finance/funds/funds.js | 28 +++++++++----- .../fragments/finance/groups/groups.js | 3 ++ .../fragments/finance/ledgers/ledgers.js | 37 +++++++++++-------- .../inventory/inventoryKeyboardShortcuts.js | 1 + .../fragments/organizations/organizations.js | 9 ++--- .../support/fragments/receiving/receiving.js | 2 +- 13 files changed, 61 insertions(+), 46 deletions(-) diff --git a/cypress/e2e/invoices/cancelling-approved-invoices.cy.js b/cypress/e2e/invoices/cancelling-approved-invoices.cy.js index 83bbf804fd..3def4b08df 100644 --- a/cypress/e2e/invoices/cancelling-approved-invoices.cy.js +++ b/cypress/e2e/invoices/cancelling-approved-invoices.cy.js @@ -89,7 +89,7 @@ describe('ui-invoices: Cancelling approved invoices', () => { Invoices.approveInvoice(); }); }); - +cy.wait(10000); cy.createTempUser([ permissions.uiFinanceViewFundAndBudget.gui, permissions.viewEditDeleteInvoiceInvoiceLine.gui, diff --git a/cypress/e2e/orders/edit-pol-in-open-order.cy.js b/cypress/e2e/orders/edit-pol-in-open-order.cy.js index e2af7c7151..b999b6ef9a 100644 --- a/cypress/e2e/orders/edit-pol-in-open-order.cy.js +++ b/cypress/e2e/orders/edit-pol-in-open-order.cy.js @@ -20,11 +20,10 @@ describe('ui-orders: Orders', () => { const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; const defaultLedger = { ...Ledgers.defaultUiLedger }; const defaultFund = { ...Funds.defaultUiFund }; - const defaultOrder = { ...NewOrder.defaultOneTimeOrder , + const defaultOrder = { ...NewOrder.defaultOneTimeOrder, approved: true, reEncumber: true, - orderType: 'One-time', - }; + orderType: 'One-time' }; const organization = { ...NewOrganization.defaultUiOrganizations }; const invoice = { ...NewInvoice.defaultUiInvoice }; const allocatedQuantity = '1000'; @@ -35,7 +34,7 @@ describe('ui-orders: Orders', () => { before(() => { cy.getAdminToken(); - + FiscalYears.createViaApi(defaultFiscalYear) .then(response => { defaultFiscalYear.id = response.id; @@ -78,7 +77,7 @@ describe('ui-orders: Orders', () => { orderNumber = orderResponse.poNumber; Orders.checkCreatedOrder(defaultOrder); OrderLines.addPOLine(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '100', '1', '100', location.institutionId); OrderLines.backToEditingOrder(); Orders.openOrder(); diff --git a/cypress/e2e/orders/editing-fund-and-increasing-cost-in-pol.cy.js b/cypress/e2e/orders/editing-fund-and-increasing-cost-in-pol.cy.js index e5e7bc51b2..79dbf9f51d 100644 --- a/cypress/e2e/orders/editing-fund-and-increasing-cost-in-pol.cy.js +++ b/cypress/e2e/orders/editing-fund-and-increasing-cost-in-pol.cy.js @@ -100,7 +100,7 @@ describe('ui-orders: Orders', () => { orderNumber = orderResponse.poNumber; Orders.checkCreatedOrder(defaultOrder); OrderLines.addPOLine(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(firstFund, '50', '1', '50', location.institutionId); OrderLines.backToEditingOrder(); Orders.openOrder(); @@ -113,7 +113,7 @@ describe('ui-orders: Orders', () => { Invoices.payInvoice(); }); cy.createTempUser([ - permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiFinanceViewFundAndBudget.gui,permissions.uiFinanceViewEditFundAndBudget.gui, permissions.uiInvoicesCanViewInvoicesAndInvoiceLines.gui, permissions.uiOrdersEdit.gui, ]) diff --git a/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js b/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js index 092b7ea8fb..28486cb47a 100644 --- a/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js +++ b/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js @@ -79,7 +79,7 @@ describe('orders: Receiving and Check-in', () => { Orders.searchByParameter('PO number', orderNumber); Orders.selectFromResultsList(); Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', locationResponse.institutionId, '4'); OrderLines.backToEditingOrder(); Orders.openOrder(); diff --git a/cypress/e2e/orders/receiving-and-check-in/receiving-pieces-from-order-for-PE-mix.cy.js b/cypress/e2e/orders/receiving-and-check-in/receiving-pieces-from-order-for-PE-mix.cy.js index 4ce3acf683..96e79cc437 100644 --- a/cypress/e2e/orders/receiving-and-check-in/receiving-pieces-from-order-for-PE-mix.cy.js +++ b/cypress/e2e/orders/receiving-and-check-in/receiving-pieces-from-order-for-PE-mix.cy.js @@ -93,7 +93,7 @@ describe('Orders: Receiving and Check-in', () => { after(() => { cy.loginAsAdmin({ path:TopMenu.receivingPath, waiter: Receiving.waitLoading }); Orders.searchByParameter('PO number', orderNumber); - Receiving.selectFromResultsList(); + Receiving.selectLinkFromResultsList(); Receiving.unreceiveFromReceivedSection(); cy.visit(TopMenu.ordersPath); Orders.searchByParameter('PO number', orderNumber); @@ -112,7 +112,7 @@ describe('Orders: Receiving and Check-in', () => { Orders.selectFromResultsList(orderNumber); Orders.openOrder(); Orders.receiveOrderViaActions(); - Receiving.selectFromResultsList(); + Receiving.selectLinkFromResultsList(); Receiving.receiveFromExpectedSection(); Receiving.receiveAllPhysicalItemsWithBarcodes(barcodeForFirstItem, barcodeForSecondItem); Receiving.clickOnInstance(); diff --git a/cypress/e2e/orders/receiving-and-check-in/serials-receiving.cy.js b/cypress/e2e/orders/receiving-and-check-in/serials-receiving.cy.js index dba61f5e8f..e6951127f5 100644 --- a/cypress/e2e/orders/receiving-and-check-in/serials-receiving.cy.js +++ b/cypress/e2e/orders/receiving-and-check-in/serials-receiving.cy.js @@ -98,7 +98,7 @@ describe('Orders: Receiving and Check-in', () => { Orders.openOrder(); OrderLines.selectPOLInOrder(0); OrderLines.receiveOrderLineViaActions(); - Receiving.selectFromResultsList(); + Receiving.selectLinkFromResultsList(); Receiving.addPiece(firstPiece.caption, firstPiece.copyNumber, firstPiece.enumeration, firstPiece.chronology); Receiving.selectPiece(firstPiece.caption); Receiving.selectConnectedInEditPiece(); diff --git a/cypress/e2e/orders/receiving-and-check-in/update-barcode.cy.js b/cypress/e2e/orders/receiving-and-check-in/update-barcode.cy.js index 4493db4d89..c07c18a5c1 100644 --- a/cypress/e2e/orders/receiving-and-check-in/update-barcode.cy.js +++ b/cypress/e2e/orders/receiving-and-check-in/update-barcode.cy.js @@ -95,7 +95,7 @@ describe('Orders: Receiving and Check-in', () => { after(() => { cy.loginAsAdmin({ path:TopMenu.receivingPath, waiter: Receiving.waitLoading }); Orders.searchByParameter('PO number', orderNumber); - Receiving.selectFromResultsList(); + Receiving.selectLinkFromResultsList(); Receiving.unreceiveFromReceivedSection(); cy.visit(TopMenu.ordersPath); Orders.searchByParameter('PO number', orderNumber); @@ -114,7 +114,7 @@ describe('Orders: Receiving and Check-in', () => { Orders.selectFromResultsList(orderNumber); Orders.openOrder(); Orders.receiveOrderViaActions(); - Receiving.selectFromResultsList(); + Receiving.selectLinkFromResultsList(); Receiving.receiveFromExpectedSection(); Receiving.receiveAllPhysicalItemsWithBarcodes(barcodeForFirstItem, barcodeForSecondItem); Receiving.clickOnInstance(); diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 2df9e41b2e..705e96954b 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -158,6 +158,15 @@ export default { ]); }, + addTrunsferTo: (fund) => { + cy.do([ + actionsButton.click(), + Button('Edit').click(), + MultiSelect({ label: 'Transfer to' }).select([fund]), + saveAndCloseButton.click() + ]); + }, + checkAddGroupToFund: (group) => { cy.expect(Pane({ id: 'pane-fund-details' }).exists()); cy.expect( @@ -229,10 +238,11 @@ export default { cy.do(Accordion('Current budget').find(newButton).click()); cy.expect(Modal('Current budget').exists()); cy.do([ - Modal('Current budget') - .find(TextField({ name: 'allocated' })) - .fillIn(allocatedQuantity.toString()), - Button('Save').click(), + Modal('Current budget').find(TextField({ name: 'allocated' })).fillIn(allocatedQuantity.toString()), + ]); + cy.wait(4000); + cy.do([ + Button('Save').click() ]); }, @@ -850,10 +860,10 @@ export default { cy.wait(4000); }, - moveAllocationWithError: (firstFund, secondFund, amount) => { - cy.do([actionsButton.click(), Button('Move allocation').click()]); - cy.wait(4000); + moveAllocationWithError: (secondFund, amount) => { cy.do([ + actionsButton.click(), + Button('Move allocation').click(), addTransferModal.find(Button({ name: 'fromFundId' })).click(), ]); cy.wait(6000); @@ -862,9 +872,7 @@ export default { addTransferModal.find(TextField({ name: 'amount' })).fillIn(amount), addTransferModal.find(confirmButton).click(), ]); - InteractorsTools.checkCalloutErrorMessage( - `$50.00 was not successfully allocated because ${secondFund.code} has no budget` - ); + InteractorsTools.checkCalloutErrorMessage(`$${amount}.00 was not successfully allocated because ${secondFund.code} has no budget`); cy.do(addTransferModal.find(cancelButton).click()); }, }; diff --git a/cypress/support/fragments/finance/groups/groups.js b/cypress/support/fragments/finance/groups/groups.js index 054377ae5d..3986da5747 100644 --- a/cypress/support/fragments/finance/groups/groups.js +++ b/cypress/support/fragments/finance/groups/groups.js @@ -69,6 +69,9 @@ export default { Section({ id: 'fund' }).find(Button('Add to group')).click(), fundModal.find(SearchField({ id: 'input-record-search' })).fillIn(fundName), fundModal.find(Button({ type: 'submit' })).click(), + ]); + cy.wait(4000); + cy.do([ MultiColumnList({ id: 'list-plugin-find-records' }) .find(MultiColumnListHeader({ id:'list-column-ischecked' })) .find(Checkbox()) diff --git a/cypress/support/fragments/finance/ledgers/ledgers.js b/cypress/support/fragments/finance/ledgers/ledgers.js index 1ce22c4cb6..9ec539419e 100644 --- a/cypress/support/fragments/finance/ledgers/ledgers.js +++ b/cypress/support/fragments/finance/ledgers/ledgers.js @@ -59,17 +59,19 @@ export default { cy.do(Section({ id: 'pane-ledger-details' }).visible); }, - rollover: () => { - cy.do([Button('Actions').click(), rolloverButton.click()]); - }, - clickOnLedgerTab: () => { - cy.do([ledgertab.click()]); - }, - clickOnFiscalyearTab: () => { - cy.do([fiscalYearTab.click()]); - }, - clickOnFundTab: () => { - cy.do([fundtab.click()]); + rollover : () => { + cy.wait(8000); + + cy.do([ + Button('Actions').click(), + + ]); + cy.wait(8000); + + cy.do([ + + rolloverButton.click() + ]); }, closeRolloverInfo: () => { @@ -107,7 +109,7 @@ export default { fillInRolloverInfo(fiscalYear) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded - cy.wait(3000); + cy.wait(8000); cy.do([ fiscalYearSelect.choose(fiscalYear), // rolloverAllocationCheckbox.click(), @@ -119,9 +121,12 @@ export default { ), rolloverButton.click(), ]); - cy.wait(4000); + cy.wait(8000); this.continueRollover(); - cy.do([rolloverConfirmButton.click()]); + cy.wait(8000); + cy.do([ + rolloverConfirmButton.click(), + ]); }, continueRollover: () => { @@ -332,7 +337,9 @@ export default { isDefaultSearchParamsRequired: false, }), - selectLedger: (ledgerName) => { + selectLedger:(ledgerName) => { + cy.wait(8000); + cy.do(Pane({ id: 'ledger-results-pane' }).find(Link(ledgerName)).click()); }, diff --git a/cypress/support/fragments/inventory/inventoryKeyboardShortcuts.js b/cypress/support/fragments/inventory/inventoryKeyboardShortcuts.js index 1518e937db..c3d77b28af 100644 --- a/cypress/support/fragments/inventory/inventoryKeyboardShortcuts.js +++ b/cypress/support/fragments/inventory/inventoryKeyboardShortcuts.js @@ -19,6 +19,7 @@ export default { cy.expect(Modal(modalName).exists()); }, pressHotKey(hotKey) { + cy.wait(6000); cy.get('body').type(hotKey); }, closeShortcuts() { diff --git a/cypress/support/fragments/organizations/organizations.js b/cypress/support/fragments/organizations/organizations.js index 88a7da29f7..318a4275f0 100644 --- a/cypress/support/fragments/organizations/organizations.js +++ b/cypress/support/fragments/organizations/organizations.js @@ -340,12 +340,7 @@ export default { }, checkSearchResults: (organization) => { - cy.expect( - organizationsList - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 3 })) - .has({ content: organization.name }) - ); + cy.expect(organizationsList.find(Link(organization.name)).exists()); }, selectYesInIsVendor: () => { @@ -507,11 +502,13 @@ export default { .fillIn(contact.lastName), addContacsModal.find(searchButtonInModal).click(), ]); + cy.wait(6000); SearchHelper.selectCheckboxFromResultsList(); cy.do([ addContacsModal.find(saveButton).click(), Button('Save & close').click(), ]); + cy.wait(6000); }, addIntrefaceToOrganization: (defaultInterface) => { diff --git a/cypress/support/fragments/receiving/receiving.js b/cypress/support/fragments/receiving/receiving.js index 94613c8033..ec4d4b20b5 100644 --- a/cypress/support/fragments/receiving/receiving.js +++ b/cypress/support/fragments/receiving/receiving.js @@ -214,7 +214,7 @@ export default { ]); }, - selectFromResultsList1: () => { + selectLinkFromResultsList: () => { cy.do(MultiColumnList({ id: 'receivings-list' }).find(Link()).click()); }, From 57876f72578763f0e445af06f6e736297230284e Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Fri, 4 Aug 2023 19:21:15 +0300 Subject: [PATCH 013/437] FAT-1303-C683 (#1447) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-1303: initial implementation * FAT-1303: commented in related tests --- .../eholdings/eholdings-packages-search.cy.js | 37 +++++++++++++++++++ .../e2e/ideyalabs/eholdings/G_eholdings.cy.js | 4 ++ .../fragments/eholdings/eHoldingsPackages.js | 7 ++++ 3 files changed, 48 insertions(+) create mode 100644 cypress/e2e/eholdings/eholdings-packages-search.cy.js diff --git a/cypress/e2e/eholdings/eholdings-packages-search.cy.js b/cypress/e2e/eholdings/eholdings-packages-search.cy.js new file mode 100644 index 0000000000..b172dc5134 --- /dev/null +++ b/cypress/e2e/eholdings/eholdings-packages-search.cy.js @@ -0,0 +1,37 @@ +import TestTypes from '../../support/dictionary/testTypes'; +import TopMenu from '../../support/fragments/topMenu'; +import EHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; +import EHoldingSearch from '../../support/fragments/eholdings/eHoldingsSearch'; +import EHoldingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import EHoldingsTitlesSearch from '../../support/fragments/eholdings/eHoldingsTitlesSearch'; +import Permissions from '../../support/dictionary/permissions'; +import Users from '../../support/fragments/users/users'; +import DevTeams from '../../support/dictionary/devTeams'; + +describe('eHoldings -> Package', () => { + const testData = { + searchQuery: 'JSTOR', + selectedStatus: 'Selected' + }; + + before('Creating user, logging in', () => { + cy.createTempUser([ + Permissions.moduleeHoldingsEnabled.gui, + Permissions.uieHoldingsRecordsEdit.gui + ]).then(userProperties => { + testData.userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { path: TopMenu.eholdingsPath, waiter: EHoldingsTitlesSearch.waitLoading }); + }); + }); + + after('Deleting user, data', () => { + Users.deleteViaApi(testData.userId); + }); + + it('C683 Search packages for [JSTOR]. Filter results to only show selected packages (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + EHoldingSearch.switchToPackages(); + EHoldingsPackagesSearch.byName(testData.searchQuery); + EHoldingsPackagesSearch.bySelectionStatus(testData.selectedStatus); + EHoldingsPackages.checkOnlySelectedPackagesInResults(); + }); +}); diff --git a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js index f72ec67703..ffa4176100 100644 --- a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js +++ b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js @@ -29,6 +29,8 @@ describe.skip('Create a custom package', () => { eHolding.verifyPackage(); } ); + // test below is implemented in scope of FAT-1303 in: + // cypress/e2e/eholdings/eholdings-packages-search.cy.js it( 'C692 Create a custom package', { tags: [testTypes.ideaLabsTests] }, @@ -38,6 +40,8 @@ describe.skip('Create a custom package', () => { eHolding.createAndVerify(); } ); + // test below is implemented in scope of FAT-1306 in: + // cypress/e2e/eholdings/eholdings-custom-packages.cy.js it( 'C695 Package Record: Search all titles included in a package (spitfire)', { tags: [testTypes.ideaLabsTests] }, diff --git a/cypress/support/fragments/eholdings/eHoldingsPackages.js b/cypress/support/fragments/eholdings/eHoldingsPackages.js index a22ec9588d..6f4fc105d0 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackages.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackages.js @@ -169,4 +169,11 @@ export default { eHoldingsProvidersSearch.byProvider('VLeBooks'); eHoldingsPackagesSearch.bySelectionStatus('Selected'); }, + + checkOnlySelectedPackagesInResults() { + cy.expect([ + resultSection.find(ListItem({ text: including(eHoldingsPackage.filterStatuses.selected) })).exists(), + resultSection.find(ListItem({ text: including(eHoldingsPackage.filterStatuses.notSelected) })).absent() + ]); + } }; From d8618747a21b5377d063cb9fd8db76ef395eefcd Mon Sep 17 00:00:00 2001 From: nayimovag Date: Mon, 7 Aug 2023 12:50:53 +0500 Subject: [PATCH 014/437] FAT-1232-1240 (#1448) --- ...-in-app-user-custom-fields-semicolon.cy.js | 94 ++++++++++--------- .../filter-declared-lost.cy.js | 15 +-- .../circulation-log/marked-as-missing.cy.js | 5 + cypress/e2e/circulation-log/search.cy.js | 8 ++ .../export-manager/search-filter-verify.cy.js | 2 +- cypress/e2e/ideyalabs/circulationLog.cy.js | 3 +- cypress/e2e/inventory/export-cql.cy.js | 90 ------------------ cypress/e2e/inventory/export.cy.js | 17 ++++ .../fragments/circulation-log/searchPane.js | 18 ++++ .../data-export/dataExportResults.js | 12 +-- .../fragments/inventory/inventoryActions.js | 43 ++++----- 11 files changed, 125 insertions(+), 182 deletions(-) delete mode 100644 cypress/e2e/inventory/export-cql.cy.js diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js index 6d7a9a5a00..ac79fb099f 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js @@ -25,60 +25,62 @@ const customFieldData = { const userBarcodesFileName = `userBarcodes_${getRandomPostfix()}.csv`; const previewOfProposedChangesFileName = `*-Updates-Preview-${userBarcodesFileName}`; -describe('Bulk Edit-- Users - in app approach', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditUpdateRecords.gui, - permissions.bulkEditLogsView.gui, - permissions.uiUsersPermissionsView.gui, - permissions.uiUsersCustomField.gui, - permissions.uiUserEdit.gui, - ], 'faculty') - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: SettingsMenu.customFieldsPath, - waiter: CustomFields.waitLoading +describe('bulk-edit', () => { + describe('in-app approach', { retries: 1 }, () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditUpdateRecords.gui, + permissions.bulkEditLogsView.gui, + permissions.uiUsersPermissionsView.gui, + permissions.uiUsersCustomField.gui, + permissions.uiUserEdit.gui, + ], 'faculty') + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: SettingsMenu.customFieldsPath, + waiter: CustomFields.waitLoading + }); + FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, user.barcode); + CustomFields.addMultiSelectCustomField(customFieldData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByUsername(user.username); + UserEdit.addMultiSelectCustomField(customFieldData); }); - FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, user.barcode); - }); - }); + }); - after('delete test data', () => { - FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); - FileManager.deleteFileFromDownloadsByMask(previewOfProposedChangesFileName); - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); + FileManager.deleteFileFromDownloadsByMask(previewOfProposedChangesFileName); + Users.deleteViaApi(user.userId); + }); - it('C389568 In app | Verify that User\'s Custom fields with semicolons are updated correctly (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - CustomFields.addMultiSelectCustomField(customFieldData); - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByUsername(user.username); - UserEdit.addMultiSelectCustomField(customFieldData); - cy.visit(TopMenu.bulkEditPath); + it('C389568 In app | Verify that User\'s Custom fields with semicolons are updated correctly (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + cy.visit(TopMenu.bulkEditPath); - BulkEditSearchPane.checkUsersRadio(); - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.uploadFile(userBarcodesFileName); - BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.uploadFile(userBarcodesFileName); + BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Custom fields'); + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Custom fields'); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.fillPatronGroup('staff (Staff Member)'); - BulkEditActions.confirmChanges(); - BulkEditActions.downloadPreview(); - BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName, ['staff'], 'patronGroup', true); - BulkEditActions.commitChanges(); - BulkEditSearchPane.verifyChangesUnderColumns('Custom fields', `${customFieldData.fieldLabel}:${customFieldData.label1};${customFieldData.label2}`); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.fillPatronGroup('staff (Staff Member)'); + BulkEditActions.confirmChanges(); + BulkEditActions.downloadPreview(); + BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName, ['staff'], 'patronGroup', true); + BulkEditActions.commitChanges(); + BulkEditSearchPane.verifyChangesUnderColumns('Custom fields', `${customFieldData.fieldLabel}:${customFieldData.label1};${customFieldData.label2}`); - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByUsername(user.username); - Users.verifyPatronGroupOnUserDetailsPane('staff'); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByUsername(user.username); + Users.verifyPatronGroupOnUserDetailsPane('staff'); - cy.visit(SettingsMenu.customFieldsPath); - CustomFields.deleteCustomField(customFieldData.fieldLabel); + cy.visit(SettingsMenu.customFieldsPath); + CustomFields.deleteCustomField(customFieldData.fieldLabel); + }); }); }); diff --git a/cypress/e2e/circulation-log/filter-declared-lost.cy.js b/cypress/e2e/circulation-log/filter-declared-lost.cy.js index 51097b6647..8de08eab12 100644 --- a/cypress/e2e/circulation-log/filter-declared-lost.cy.js +++ b/cypress/e2e/circulation-log/filter-declared-lost.cy.js @@ -16,10 +16,6 @@ import UsersOwners from '../../support/fragments/settings/users/usersOwners'; import PaymentMethods from '../../support/fragments/settings/users/paymentMethods'; import Location from '../../support/fragments/settings/tenant/locations/newLocation'; import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; -import SearchResults from '../../support/fragments/circulation-log/searchResults'; -import LoansPage from '../../support/fragments/loans/loansPage'; -import ItemRecordView from '../../support/fragments/inventory/item/itemRecordView'; -import TopMenuNavigation from '../../support/fragments/topMenuNavigation'; let user; const item = { @@ -111,15 +107,6 @@ describe('circulation-log', () => { it('C45934 Check the Actions button from filtering Circulation log by declared lost (firebird)', { tags: [TestTypes.criticalPath, devTeams.firebird] }, () => { SearchPane.setFilterOptionFromAccordion('loan', 'Declared lost'); - SearchResults.chooseActionByRow(0, 'Loan details'); - LoansPage.waitLoading(); - TopMenuNavigation.navigateToApp('Circulation log'); - - SearchResults.chooseActionByRow(0, 'User details'); - Users.verifyFirstNameOnUserDetailsPane(user.firstName); - TopMenuNavigation.navigateToApp('Circulation log'); - - SearchResults.clickOnCell(item.barcode, 0); - ItemRecordView.waitLoading(); + SearchPane.checkActionButtonAfterFiltering(user.firstName, item.barcode); }); }); diff --git a/cypress/e2e/circulation-log/marked-as-missing.cy.js b/cypress/e2e/circulation-log/marked-as-missing.cy.js index 61a584f065..501d49faac 100644 --- a/cypress/e2e/circulation-log/marked-as-missing.cy.js +++ b/cypress/e2e/circulation-log/marked-as-missing.cy.js @@ -86,4 +86,9 @@ describe('circulation-log', () => { circAction: 'Marked as missing', }); }); + + it('C45934 Check the Actions button from filtering Circulation log by marked as missing (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + SearchPane.searchByMarkedAsMissing(); + SearchPane.checkActionButtonAfterFiltering(user.firstName, item.barcode); + }); }); diff --git a/cypress/e2e/circulation-log/search.cy.js b/cypress/e2e/circulation-log/search.cy.js index 01055c8e4a..6eede1225f 100644 --- a/cypress/e2e/circulation-log/search.cy.js +++ b/cypress/e2e/circulation-log/search.cy.js @@ -23,6 +23,7 @@ const ITEM_BARCODE = `123${getRandomPostfix()}`; let userId; let source; let servicePointId; +let firstName; describe('circulation-log', () => { before('create inventory instance', () => { @@ -33,6 +34,7 @@ describe('circulation-log', () => { ]) .then(userProperties => { userId = userProperties.userId; + firstName = userProperties.firstName; cy.login(userProperties.username, userProperties.password); cy.visit(TopMenu.circulationLogPath); cy.getAdminToken() @@ -204,4 +206,10 @@ describe('circulation-log', () => { SearchPane.searchByServicePoint('Circ Desk 2'); SearchPane.verifyResultCells(); }); + + it('C16981 Check the Actions button from filtering Circulation log by changed due date (firebird)', { tags: [TestTypes.criticalPath, devTeams.firebird] }, () => { + cy.visit(TopMenu.circulationLogPath); + SearchPane.searchByChangedDueDate(); + SearchPane.checkActionButtonAfterFiltering(firstName, ITEM_BARCODE); + }); }); diff --git a/cypress/e2e/export-manager/search-filter-verify.cy.js b/cypress/e2e/export-manager/search-filter-verify.cy.js index 75e53c745e..5b9ff1254b 100644 --- a/cypress/e2e/export-manager/search-filter-verify.cy.js +++ b/cypress/e2e/export-manager/search-filter-verify.cy.js @@ -85,10 +85,10 @@ describe('export manager', () => { InteractorsTools.checkCalloutMessage(jobCompletedCalloutMessage); cy.visit(TopMenu.exportManagerPath); - FileManager.deleteFileFromDownloadsByMask('CIRCULATION_LOG*'); }); after('check in item, delete instance, user and files', () => { + FileManager.deleteFileFromDownloadsByMask('CIRCULATION_LOG*'); CheckInActions.checkinItemViaApi({ checkInDate: moment.utc().format(), servicePointId: testData.servicepointId, diff --git a/cypress/e2e/ideyalabs/circulationLog.cy.js b/cypress/e2e/ideyalabs/circulationLog.cy.js index d54ef0b0c2..9da296c3f6 100644 --- a/cypress/e2e/ideyalabs/circulationLog.cy.js +++ b/cypress/e2e/ideyalabs/circulationLog.cy.js @@ -1,4 +1,3 @@ -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'; @@ -28,7 +27,7 @@ describe.skip('CirculationLog App', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C17092 Filter circulation log by (notice) send (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C17092 Filter circulation log by (notice) send', { tags: [testTypes.criticalPath] }, () => { cy.visit(topMenu.circulationLogPath); searchPane.setFilterOptionFromAccordion( testData.accordion, diff --git a/cypress/e2e/inventory/export-cql.cy.js b/cypress/e2e/inventory/export-cql.cy.js deleted file mode 100644 index 13351a2d34..0000000000 --- a/cypress/e2e/inventory/export-cql.cy.js +++ /dev/null @@ -1,90 +0,0 @@ -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 b8274ae32e..4d215e956d 100644 --- a/cypress/e2e/inventory/export.cy.js +++ b/cypress/e2e/inventory/export.cy.js @@ -16,6 +16,8 @@ import { ITEM_STATUS_NAMES } from '../../support/constants'; let userId; const instanceTitle = `Inventory export test ${Number(new Date())}`; +let locationName; +let locationId; describe('ui-inventory: exports', () => { before('navigates to Inventory', () => { @@ -40,6 +42,7 @@ describe('ui-inventory: exports', () => { }) .then(() => { locationName = Cypress.env('locations')[0].name; + locationId = Cypress.env('locations')[0].id; cy.createInstance({ instance: { instanceTypeId: Cypress.env('instanceTypes')[0].id, @@ -103,6 +106,20 @@ 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, + [locationId, instanceTitle, 'eng'] + ); + }); + 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/support/fragments/circulation-log/searchPane.js b/cypress/support/fragments/circulation-log/searchPane.js index 4645c3c757..c8341629ee 100644 --- a/cypress/support/fragments/circulation-log/searchPane.js +++ b/cypress/support/fragments/circulation-log/searchPane.js @@ -13,6 +13,11 @@ import { MultiSelect } from '../../../../interactors'; import DateTools from '../../utils/dateTools'; +import SearchResults from './searchResults'; +import LoansPage from '../loans/loansPage'; +import Users from '../users/users'; +import ItemRecordView from '../inventory/item/itemRecordView'; +import TopMenuNavigation from '../topMenuNavigation'; const dropdownButton = MultiColumnListRow({ rowIndexInParent: 'row-0' }).find(Dropdown()).find(Button()); const actionsButton = Button('Actions'); @@ -190,4 +195,17 @@ export default { cy.do(actionsButton.click()); cy.expect(Button('Export results (CSV)', { disabled: true }).exists()); }, + + checkActionButtonAfterFiltering(name, barcode) { + SearchResults.chooseActionByRow(0, 'Loan details'); + LoansPage.waitLoading(); + TopMenuNavigation.navigateToApp('Circulation log'); + + SearchResults.chooseActionByRow(0, 'User details'); + Users.verifyFirstNameOnUserDetailsPane(name); + TopMenuNavigation.navigateToApp('Circulation log'); + + SearchResults.clickOnCell(barcode, 0); + ItemRecordView.waitLoading(); + }, }; diff --git a/cypress/support/fragments/data-export/dataExportResults.js b/cypress/support/fragments/data-export/dataExportResults.js index 4032df2c95..fb0cb51533 100644 --- a/cypress/support/fragments/data-export/dataExportResults.js +++ b/cypress/support/fragments/data-export/dataExportResults.js @@ -24,9 +24,9 @@ export default { exported: MultiColumnListCell({ 'row': 0, columnIndex: 3 }), failed: MultiColumnListCell({ 'row': 0, columnIndex: 4 }), jobProfile: MultiColumnListCell({ 'row': 0, columnIndex: 5 }), - endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 6 }), - runBy: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), - id: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), + endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), + runBy: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), + id: MultiColumnListCell({ 'row': 0, columnIndex: 9 }), }; cy.getAdminToken().then(() => { cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { @@ -70,9 +70,9 @@ export default { exported: MultiColumnListCell({ 'row': 0, columnIndex: 3 }), failed: MultiColumnListCell({ 'row': 0, columnIndex: 4 }), jobProfile: MultiColumnListCell({ 'row': 0, columnIndex: 5 }), - endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 6 }), - runBy: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), - id: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), + endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), + runBy: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), + id: MultiColumnListCell({ 'row': 0, columnIndex: 9 }), }; cy.getAdminToken().then(() => { cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { diff --git a/cypress/support/fragments/inventory/inventoryActions.js b/cypress/support/fragments/inventory/inventoryActions.js index db4505ec73..1d9c2e5c3d 100644 --- a/cypress/support/fragments/inventory/inventoryActions.js +++ b/cypress/support/fragments/inventory/inventoryActions.js @@ -4,12 +4,12 @@ import InventoryInstance from './inventoryInstance'; import FileManager from '../../utils/fileManager'; const importButtonInActions = Button({ id: 'dropdown-clickable-import-record' }); -const reImportButtonInActions = Button({ id:'dropdown-clickable-reimport-record' }); +const reImportButtonInActions = Button({ id: 'dropdown-clickable-reimport-record' }); const importButtonInModal = Button('Import'); const OCLWorldCatIdentifierTextField = TextField({ name: 'externalIdentifier' }); -const importTypeSelect = Select({ name :'externalIdentifierType' }); +const importTypeSelect = Select({ name: 'externalIdentifierType' }); -function open() { cy.do(Section({ id:'pane-results' }).find(Button('Actions')).click()); } +function open() { cy.do(Section({ id: 'pane-results' }).find(Button('Actions')).click()); } // TODO: merge inventoryActions and InventoryInstances export default { @@ -25,8 +25,8 @@ export default { }, openNewFastAddRecordForm() { cy.do([ - Section({ id:'pane-results' }).find(Button('Actions')).click(), - Button({ id:'new-fast-add-record' }).click() + Section({ id: 'pane-results' }).find(Button('Actions')).click(), + Button({ id: 'new-fast-add-record' }).click() ]); }, optionsIsDisabled: (array) => { @@ -52,12 +52,12 @@ export default { InventoryInstance.checkExpectedMARCSource(); }, - openSingleReportImportModal:() => { + openSingleReportImportModal: () => { open(); cy.do(importButtonInActions.click()); }, - openReImportModal:() => { + openReImportModal: () => { open(); cy.do(reImportButtonInActions.click()); }, @@ -66,8 +66,10 @@ export default { fillImportFields(specialOCLCWorldCatidentifier = InventoryInstance.validOCLC.id) { // TODO: remove in the future, now related with differenes in our environments if (Cypress.env('is_kiwi_release')) { - const oclcWorldCat = { text:'OCLC WorldCat', - value : '6f171ee7-7a0a-4dd4-8959-bd67ec07cc88' }; + const oclcWorldCat = { + text: 'OCLC WorldCat', + value: '6f171ee7-7a0a-4dd4-8959-bd67ec07cc88' + }; cy.do(importTypeSelect.choose(oclcWorldCat.text)); cy.expect(importTypeSelect.has({ value: oclcWorldCat.value })); @@ -103,23 +105,18 @@ export default { DateTools.verifyDate(actualDate); }, - verifySaveCQLQuery(actualQuery, kw = '*', lang = 'eng') { - cy.url().then((url) => { - const params = new URLSearchParams(url.split('?')[1]); - const effectiveLocationId = /\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/gm.exec(params.get('filters'))[0]; + verifySaveCQLQuery(actualQuery, locationId, kw = '*', lang = 'eng') { + const expectedKeywords = `keyword all "${kw}"`; + expect(actualQuery).to.have.string(expectedKeywords); - const expectedKeywords = `keyword all "${kw}"`; - expect(actualQuery).to.have.string(expectedKeywords); + const expectedISBN = `isbn="${kw}"`; + expect(actualQuery).to.have.string(expectedISBN); - const expectedISBN = `isbn="${kw}"`; - expect(actualQuery).to.have.string(expectedISBN); + const expectedLang = `languages=="${lang}"`; + expect(actualQuery).to.have.string(expectedLang); - const expectedLang = `languages=="${lang}"`; - expect(actualQuery).to.have.string(expectedLang); - - const expectedEffectiveLocationId = `items.effectiveLocationId=="${effectiveLocationId}"`; - expect(actualQuery).to.have.string(expectedEffectiveLocationId); - }); + const expectedEffectiveLocationId = `items.effectiveLocationId=="${locationId}"`; + expect(actualQuery).to.have.string(expectedEffectiveLocationId); }, verifyInstancesMARCFileName(actualName) { From e7857a2410e4a95811d8ed7742f605161934c386 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:47:32 +0500 Subject: [PATCH 015/437] added C405545 (#1457) --- ...-view-all-settings-works-as-expected.cy.js | 28 ++++++++++++++++++- .../fragments/settings/users/departments.js | 25 +++++++++++++++++ .../settings/users/usersSettingsGeneral.js | 6 ++-- cypress/support/fragments/settingsMenu.js | 3 ++ 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 cypress/support/fragments/settings/users/departments.js 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 index f1391a48cb..a37e9901b1 100644 --- 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 @@ -1,7 +1,7 @@ import uuid from 'uuid'; import devTeams from '../../../support/dictionary/devTeams'; import permissions from '../../../support/dictionary/permissions'; -import { getTestEntityValue } from '../../../support/utils/stringTools'; +import getRandomPostfix, { getTestEntityValue } from '../../../support/utils/stringTools'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import TestTypes from '../../../support/dictionary/testTypes'; import Users from '../../../support/fragments/users/users'; @@ -13,6 +13,7 @@ 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'; +import Departments from '../../../support/fragments/settings/users/departments'; describe('Permission Sets', () => { let userData; @@ -22,6 +23,11 @@ describe('Permission Sets', () => { const testData = { userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotestPermissionSets', uuid()), }; + const departmentBody = { + code: getRandomPostfix(), + id: uuid(), + name: getTestEntityValue('PSDepartment'), + }; const ownerBody = { ...UsersOwners.getDefaultNewOwner(uuid()), servicePointOwner: [ @@ -43,6 +49,7 @@ describe('Permission Sets', () => { testData.paymentMethodId = paymentRes.id; testData.paymentMethodName = paymentRes.name; }); + Departments.createViaApi(departmentBody); RefundReasons.createViaApi(refundReason); PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { patronGroup.id = patronGroupResponse; @@ -64,6 +71,7 @@ describe('Permission Sets', () => { ServicePoints.deleteViaApi(testData.userServicePoint.id); Users.deleteViaApi(userData.userId); PatronGroups.deleteViaApi(patronGroup.id); + Departments.deleteViaApi(departmentBody.id); RefundReasons.deleteViaApi(refundReason.id); WaiveReasons.deleteViaApi(waiveReason.id); PaymentMethods.deleteViaApi(testData.paymentMethodId); @@ -91,4 +99,22 @@ describe('Permission Sets', () => { UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); } ); + + it( + 'C405545 Verify that "Settings(users):View all settings" works as expected Scenario 6 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.patronGroups); + UsersSettingsGeneral.checkEntityInTable({ reason: 'undergrad', description: 'Undergraduate Student' }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.addressTypes); + UsersSettingsGeneral.checkEntityInTable({ reason: 'Work', description: 'Work Address' }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.departments); + Departments.waitLoading(); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + } + ); }); diff --git a/cypress/support/fragments/settings/users/departments.js b/cypress/support/fragments/settings/users/departments.js new file mode 100644 index 0000000000..c880085c08 --- /dev/null +++ b/cypress/support/fragments/settings/users/departments.js @@ -0,0 +1,25 @@ +import { REQUEST_METHOD } from '../../../constants'; +import { PaneHeader } from '../../../../../interactors'; + +export default { + waitLoading: () => cy.expect(PaneHeader('Departments').exists()), + + createViaApi: (body) => { + return cy + .okapiRequest({ + method: REQUEST_METHOD.POST, + path: 'departments', + isDefaultSearchParamsRequired: false, + body, + }) + .then((response) => response.body.id); + }, + + deleteViaApi: (id) => { + return cy.okapiRequest({ + method: REQUEST_METHOD.DELETE, + path: `departments/${id}`, + isDefaultSearchParamsRequired: false, + }); + }, +}; diff --git a/cypress/support/fragments/settings/users/usersSettingsGeneral.js b/cypress/support/fragments/settings/users/usersSettingsGeneral.js index df73da5b9c..265f63cbf1 100644 --- a/cypress/support/fragments/settings/users/usersSettingsGeneral.js +++ b/cypress/support/fragments/settings/users/usersSettingsGeneral.js @@ -28,9 +28,9 @@ export default { checkEditDeleteNewButtonsNotDisplayed: () => { cy.expect([ - Button({ id: including('clickable-add-settings') }).absent(), - Button({ id: including('clickable-edit-settings') }).absent(), - Button({ id: including('clickable-delete-settings') }).absent(), + rootSection.find(Button({ id: including('clickable-add') })).absent(), + rootSection.find(Button({ id: including('clickable-edit') })).absent(), + rootSection.find(Button({ id: including('clickable-delete') })).absent(), ]); }, }; diff --git a/cypress/support/fragments/settingsMenu.js b/cypress/support/fragments/settingsMenu.js index dd70662522..19fb881e6d 100644 --- a/cypress/support/fragments/settingsMenu.js +++ b/cypress/support/fragments/settingsMenu.js @@ -72,6 +72,9 @@ export default { ordersInstanceTypePath: 'settings/orders/instance-type', ordersLoanTypePath: 'settings/orders/loan-type', // Users + patronGroups: 'settings/users/groups', + addressTypes: 'settings/users/addresstypes', + departments: 'settings/users/departments', permissionSets: 'settings/users/perms', usersOwnersPath: 'settings/users/owners', usersPath: 'settings/users', From c18980ef0ffc245bcb8177706865ca6d5a1ea4fe Mon Sep 17 00:00:00 2001 From: nayimovag Date: Mon, 7 Aug 2023 16:14:39 +0500 Subject: [PATCH 016/437] FAT-7209 (#1458) --- ...-suppressed-holdings-false-items-not.cy.js | 127 ++++++++++++++++++ ...p-suppressed-holdings-true-items-not.cy.js | 5 + .../fragments/bulk-edit/bulk-edit-actions.js | 4 + 3 files changed, 136 insertions(+) create mode 100644 cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js new file mode 100644 index 0000000000..fdce8519f4 --- /dev/null +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js @@ -0,0 +1,127 @@ +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 TopMenuNavigation from '../../../../support/fragments/topMenuNavigation'; +import InstanceRecordView from '../../../../support/fragments/inventory/instanceRecordView'; + +// 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, + }); + }); + cy.getInstanceById(item.instanceId) + .then(body => { + body.discoverySuppress = true; + cy.updateInstance(body); + }); + 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('C402326 Verify "Suppress from discovery" option is set to False when Holdings are suppressed and 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 = false; + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); + BulkEditActions.checkApplyToItemsRecordsCheckbox(); + 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.searchInstanceByHRID(item.instanceHRID); + InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.checkMarkAsSuppressedFromDiscoveryAbsent(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsAbsent(); + }); +}); 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 index b567b15e23..a97e097acf 100644 --- 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 @@ -53,6 +53,11 @@ describe('Bulk Edit - Logs', () => { temporaryLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87' }); }); + cy.getInstanceById(item.instanceId) + .then(body => { + body.discoverySuppress = true; + cy.updateInstance(body); + }); cy.getInstance({ limit: 1, expandAll: true, query: `"id"=="${item.instanceId}"` }) .then(instance => { item.instanceHRID = instance.hrid; diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index d3a45f1d31..d0f8243dab 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -244,6 +244,10 @@ export default { cy.expect(Checkbox('Apply to items records').has({ checked: value })); }, + checkApplyToItemsRecordsCheckbox() { + cy.do(Checkbox('Apply to items records').click()); + }, + verifyNoMatchingOptionsForLocationFilter() { cy.expect(HTML('No matching options').exists()); }, From c526da707125a61b489acff7fc223c8336538018 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:57:02 +0500 Subject: [PATCH 017/437] added C404380 (#1460) --- ...-view-all-settings-works-as-expected.cy.js | 13 +++++++- .../fragments/settings/users/limits.js | 30 ++++++++++++------- 2 files changed, 32 insertions(+), 11 deletions(-) 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 index a37e9901b1..ad9a28aae3 100644 --- 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 @@ -14,6 +14,7 @@ import RefundReasons from '../../../support/fragments/settings/users/refundReaso import PaymentMethods from '../../../support/fragments/settings/users/paymentMethods'; import UsersSettingsGeneral from '../../../support/fragments/settings/users/usersSettingsGeneral'; import Departments from '../../../support/fragments/settings/users/departments'; +import Limits from '../../../support/fragments/settings/users/limits'; describe('Permission Sets', () => { let userData; @@ -101,7 +102,17 @@ describe('Permission Sets', () => { ); it( - 'C405545 Verify that "Settings(users):View all settings" works as expected Scenario 6 (volaris)', + 'add Verify that "Settings(users): View all settings" works as expected Scenario 4 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.limitsPath); + Limits.selectGroup('undergrad'); + Limits.verifyLimitsCantBeChanged(); + } + ); + + it( + 'C405545 Verify that "Settings(users): View all settings" works as expected Scenario 6 (volaris)', { tags: [TestTypes.extendedPath, devTeams.volaris] }, () => { cy.visit(SettingsMenu.patronGroups); diff --git a/cypress/support/fragments/settings/users/limits.js b/cypress/support/fragments/settings/users/limits.js index 6ecc048d48..91b0abe642 100644 --- a/cypress/support/fragments/settings/users/limits.js +++ b/cypress/support/fragments/settings/users/limits.js @@ -17,18 +17,28 @@ export default { } }).then(response => response.body.id); }, - selectGroup: (groupName) => { + getLimitIdViaApi(limitName) { + return Conditions.getConditionsViaApi().then( + (conditions) => conditions.find((condition) => condition.name === limitName).id + ); + }, + + selectGroup(groupName) { cy.do(NavListItem(groupName).click()); }, - setLimit: (limitName, number) => { - Conditions.getConditionsViaApi().then(conditions => { - return conditions.find(condition => condition.name === limitName).id; - }).then((limitId) => { - cy.do([ - TextField({ name: limitId }).fillIn(number), - saveButton.click(), - ]); + setLimit(limitName, number) { + this.getLimitIdViaApi(limitName).then((limitId) => { + cy.do([TextField({ name: limitId }).fillIn(number), saveButton.click()]); + }); + }, + + verifyLimitsCantBeChanged() { + cy.wrap(Conditions.conditionsValues).each((limitName) => { + this.getLimitIdViaApi(limitName).then((limitId) => { + cy.expect(TextField({ name: limitId }).is({ disabled: true })); + }); }); - } + cy.expect(Button('Save').is({ disabled: true })); + }, }; From 1ff9cd8a0a96cf96be048fd85e5fe25f09d533cb Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:20:42 +0500 Subject: [PATCH 018/437] added C404383 (#1459) --- ...-view-all-settings-works-as-expected.cy.js | 19 ++++++++++++++++--- .../fragments/settings/users/conditions.js | 12 +++++++++++- 2 files changed, 27 insertions(+), 4 deletions(-) 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 index ad9a28aae3..e2fe039af6 100644 --- 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 @@ -2,6 +2,7 @@ import uuid from 'uuid'; import devTeams from '../../../support/dictionary/devTeams'; import permissions from '../../../support/dictionary/permissions'; import getRandomPostfix, { getTestEntityValue } from '../../../support/utils/stringTools'; +import Arrays from '../../../support/utils/arrays'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import TestTypes from '../../../support/dictionary/testTypes'; import Users from '../../../support/fragments/users/users'; @@ -14,6 +15,7 @@ import RefundReasons from '../../../support/fragments/settings/users/refundReaso import PaymentMethods from '../../../support/fragments/settings/users/paymentMethods'; import UsersSettingsGeneral from '../../../support/fragments/settings/users/usersSettingsGeneral'; import Departments from '../../../support/fragments/settings/users/departments'; +import Conditions from '../../../support/fragments/settings/users/conditions'; import Limits from '../../../support/fragments/settings/users/limits'; describe('Permission Sets', () => { @@ -80,7 +82,7 @@ describe('Permission Sets', () => { }); it( - 'C402752 Verify that "Setting (Users): View all settings" works as expected Scenario 2 (volaris)', + 'C402752 Verify that "Settings (Users): View all settings" works as expected Scenario 2 (volaris)', { tags: [TestTypes.extendedPath, devTeams.volaris] }, () => { cy.visit(SettingsMenu.usersOwnersPath); @@ -102,7 +104,7 @@ describe('Permission Sets', () => { ); it( - 'add Verify that "Settings(users): View all settings" works as expected Scenario 4 (volaris)', + 'C404380 Verify that "Settings (Users): View all settings" works as expected Scenario 4 (volaris)', { tags: [TestTypes.extendedPath, devTeams.volaris] }, () => { cy.visit(SettingsMenu.limitsPath); @@ -112,7 +114,18 @@ describe('Permission Sets', () => { ); it( - 'C405545 Verify that "Settings(users): View all settings" works as expected Scenario 6 (volaris)', + 'C404383 Verify that "Settings (Users): View all settings" works as expected Scenario 5 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.conditionsPath); + Conditions.waitLoading(); + Conditions.select(Arrays.getRandomElement(Conditions.conditionsValues)); + Conditions.verifyConditionsCantBeChanged(); + } + ); + + it( + 'C405545 Verify that "Settings (Users): View all settings" works as expected Scenario 6 (volaris)', { tags: [TestTypes.extendedPath, devTeams.volaris] }, () => { cy.visit(SettingsMenu.patronGroups); diff --git a/cypress/support/fragments/settings/users/conditions.js b/cypress/support/fragments/settings/users/conditions.js index 4d16c5a394..659b280bbd 100644 --- a/cypress/support/fragments/settings/users/conditions.js +++ b/cypress/support/fragments/settings/users/conditions.js @@ -1,4 +1,4 @@ -import { Section, NavListItem, TextArea, Button } from '../../../../../interactors'; +import { Checkbox, Section, NavListItem, TextArea, Button } from '../../../../../interactors'; import Condition from './condition'; const rootPaneset = Section({ id:'app-settings-nav-pane' }); @@ -58,6 +58,16 @@ export default { isDefaultSearchParamsRequired : false, }).then(response => response.body.patronBlockConditions), + verifyConditionsCantBeChanged: () => { + cy.expect([ + Checkbox({ id: 'blockBorrowing' }).is({ disabled: true }), + Checkbox({ id: 'blockRenewals' }).is({ disabled: true }), + Checkbox({ id: 'blockRequests' }).is({ disabled: true }), + TextArea({ id: 'message' }).is({ disabled: true }), + Button('Save').is({ disabled: true }), + ]); + }, + setConditionState: (message, blockCheckboxes = [true, true, true]) => { cy.get('[class*="partonBlockForm"] input') .each((item, index) => { From d6f4db5276475a0e0ac7c80edc4ce036c3e80895 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 7 Aug 2023 16:44:57 +0300 Subject: [PATCH 019/437] fix C357552 (#1454) * fix C357552 * deleted line * uncommented code --- ...e-open-orders-electronic-resource-with-no-inventory.cy.js | 2 +- .../item-update-via-match-by-status.cy.js | 3 +-- cypress/support/fragments/data_import/logs/fileDetails.js | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js index 183450ab74..629f234488 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js @@ -47,7 +47,7 @@ describe('ui-data-import', () => { typeValue: FOLIO_RECORD_TYPE.ORDER }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C375989 Test Order ${getRandomPostfix()}`, + profileName: `C380483 Test Order ${getRandomPostfix()}`, }; before('login', () => { 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 ec7262ef3a..5d795f2b4f 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 @@ -219,8 +219,7 @@ describe('ui-data-import', () => { cy.wait(2500); JobProfiles.createJobProfile(updateJobProfile); NewJobProfile.linkMatchProfile(matchProfileItemHrid.profileName); - NewJobProfile.linkMatchProfileForMatches(matchProfileItemStatus.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[2].actionProfile.name); + NewJobProfile.linkMatchAndActionProfilesForSubMatches(matchProfileItemStatus.profileName, collectionOfMappingAndActionProfiles[2].actionProfile.name); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(updateJobProfile.profileName); diff --git a/cypress/support/fragments/data_import/logs/fileDetails.js b/cypress/support/fragments/data_import/logs/fileDetails.js index a32ebb7366..e7bee5d438 100644 --- a/cypress/support/fragments/data_import/logs/fileDetails.js +++ b/cypress/support/fragments/data_import/logs/fileDetails.js @@ -228,11 +228,12 @@ export default { }, checkStatusByTitle:(title, itemStatus) => { - cy.do(MultiColumnListCell({ content: title }).perform( + cy.do(resultsList.find(MultiColumnListCell({ content: title })).perform( element => { const rowNumber = element.parentElement.parentElement.getAttribute('data-row-index'); - cy.expect(MultiColumnListRow({ indexRow: rowNumber }) + cy.wait(1000); + cy.expect(resultsList.find(MultiColumnListRow({ indexRow: rowNumber })) .find(MultiColumnListCell({ columnIndex: 5 })) .has({ content: itemStatus })); } From 9ee5468dde42294d1639f4ad4e2380a9a4dd9613 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 7 Aug 2023 16:50:38 +0300 Subject: [PATCH 020/437] fix C347830 (#1452) --- .../match-on-instance-identifier-scen3.cy.js | 20 ++++++++++++++----- .../match_profiles/newMatchProfile.js | 15 ++++++++++++-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js index a072a00193..05fb6558a1 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js @@ -1,3 +1,4 @@ +import generateItemBarcode from '../../../support/utils/generateItemBarcode'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import TopMenu from '../../../support/fragments/topMenu'; @@ -26,15 +27,18 @@ import Users from '../../../support/fragments/users/users'; describe('ui-data-import', () => { let userId = null; + const randomIdentifierCode = `(OCoLC)847143${generateItemBarcode()}8`; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; const filePathForCreateInstance = 'marcFileForMatchOnIdentifierForCreate.mrc'; const filePathForUpdateInstance = 'marcFileForMatchOnIdentifierForUpdate_3.mrc'; + const editedMarcFileNameForCreate = `C347830 marcFileForCreate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForUpdate = `C347830 marcFileForUpdate.${getRandomPostfix()}.mrc`; const fileNameForCreateInstance = `C347830autotestFile.${getRandomPostfix()}.mrc`; const fileNameForUpdateInstance = `C347830autotestFile.${getRandomPostfix()}.mrc`; const instanceGeneralNote = 'IDENTIFIER UPDATE 3'; const resourceIdentifiers = [ { type: 'UPC', value: 'ORD32671387-4' }, - { type: 'OCLC', value: '(OCoLC)84714376518561876438' }, + { type: 'OCLC', value: randomIdentifierCode }, { type: 'Invalid UPC', value: 'ORD32671387-4' }, { type: 'System control number', value: '(AMB)84714376518561876438' }, ]; @@ -51,7 +55,8 @@ describe('ui-data-import', () => { qualifierValue: '(OCoLC)', compareValue: 'Numerics only', existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - existingRecordOption: NewMatchProfile.optionsList.systemControlNumber + existingRecordOption: NewMatchProfile.optionsList.identifierOCLC, + compareValueInComparison: 'Numerics only' }; const mappingProfile = { name: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, @@ -122,9 +127,14 @@ describe('ui-data-import', () => { it('C347830 Match on Instance identifier match meets both the Identifier type and Data requirements Scenario 3 (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.editMarcFile(filePathForCreateInstance, editedMarcFileNameForCreate, + ['(OCoLC)84714376518561876438'], [randomIdentifierCode]); + DataImport.editMarcFile(filePathForUpdateInstance, editedMarcFileNameForUpdate, + ['(OCoLC)84714376518561876438'], [randomIdentifierCode]); + + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); + DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileNameForCreateInstance); @@ -163,7 +173,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForUpdateInstance, fileNameForUpdateInstance); + DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileNameForUpdateInstance); diff --git a/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js b/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js index 392c6bc65f..c3c7a2e810 100644 --- a/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js +++ b/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js @@ -28,7 +28,8 @@ const optionsList = { status: 'Loan and availability: Status', barcode: 'Admin data: Barcode', instanceStatusTerm: 'Admin data: Instance status term', - holdingsType: 'Admin data: Holdings type' + holdingsType: 'Admin data: Holdings type', + identifierOCLC: 'Identifier: OCLC' }; function fillExistingRecordFields(value = '', selector) { @@ -75,6 +76,13 @@ function fillQualifierInIncomingPart(qualifierType, qualifierValue) { ]); } +function fillQualifierInExistingComparisonPart(compareValueInComparison) { + cy.contains('Existing Instance record').then(elem => { + elem.parent()[0].querySelectorAll('input[type="checkbox"]')[1].click(); + }); + cy.do(Select({ name: 'profile.matchDetails[0].existingMatchExpression.qualifier.comparisonPart' }).choose(compareValueInComparison)); +} + function fillQualifierInExistingPart(qualifierType, qualifierValue) { cy.contains('Existing MARC Bibliographic record').then(elem => { elem.parent()[0].querySelector('input[type="checkbox').click(); @@ -127,6 +135,7 @@ export default { selectExistingRecordField, fillStaticValue, fillOnlyComparePartOfTheValue, + fillQualifierInExistingComparisonPart, fillMatchProfileForm:({ profileName, @@ -251,7 +260,8 @@ export default { existingRecordType, compareValue, qualifierType, - qualifierValue + qualifierValue, + compareValueInComparison }) { fillName(profileName); selectExistingRecordType(existingRecordType); @@ -264,6 +274,7 @@ export default { fillOnlyComparePartOfTheValue(compareValue); selectMatchCriterion(matchCriterion); selectExistingRecordField(existingRecordOption); + fillQualifierInExistingComparisonPart(compareValueInComparison); }, fillMatchProfileWithQualifierInIncomingAndExistingRecords({ From aed9cfb6db13a3b7c8058e95c1d82255ad1e8600 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Mon, 7 Aug 2023 18:25:38 +0300 Subject: [PATCH 021/437] FAT-4932-C360532 (#1453) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-4932: test added --- .../marc-authority-search.cy.js | 72 +++++++++++++++++++ cypress/fixtures/marcAuthFileC360532.mrc | 1 + .../marcAuthority/marcAuthorities.js | 12 ++++ 3 files changed, 85 insertions(+) create mode 100644 cypress/e2e/marc-authority/marc-authority-search.cy.js create mode 100644 cypress/fixtures/marcAuthFileC360532.mrc diff --git a/cypress/e2e/marc-authority/marc-authority-search.cy.js b/cypress/e2e/marc-authority/marc-authority-search.cy.js new file mode 100644 index 0000000000..1655841fff --- /dev/null +++ b/cypress/e2e/marc-authority/marc-authority-search.cy.js @@ -0,0 +1,72 @@ +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 MarcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +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 MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import { JOB_STATUS_NAMES } from '../../support/constants'; + +describe('MARC -› MARC Authority', () => { + const testData = { + expectedProperties: [ + 'authRefType', + 'headingRef', + 'headingType', + 'id', + 'naturalId', + 'sourceFileId', + ] + }; + + const marcFile = { + marc: 'marcAuthFileC360532.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C360532 Cartoons & Comics' + }; + + before('Creating user, importing record', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + ]).then(createdUserProperties => { + testData.userProperties = 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(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + testData.createdRecordID = link.split('/')[5]; + }); + }); + }); + }); + + before('Login', () => { + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); + }); + + after('Deleting user, record', () => { + Users.deleteViaApi(testData.userProperties.userId); + MarcAuthority.deleteViaAPI(testData.createdRecordID); + }); + + it('C360532 Verify that "sourceFileId" and "naturalId" fields exist in response to search "MARC Authority" records. (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchBy('Keyword', 'Cartoons & Comics'); + MarcAuthorities.verifyAuthorityPropertiesAfterSearch(testData.expectedProperties); + }); +}); + diff --git a/cypress/fixtures/marcAuthFileC360532.mrc b/cypress/fixtures/marcAuthFileC360532.mrc new file mode 100644 index 0000000000..c741c0a0c9 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC360532.mrc @@ -0,0 +1 @@ +00542cz a2200205n 4500001000800000005001700008008004100025010002000066035002300086040002500109130003000134430003000164430002400194643002400218644001100242645001100253646001100264670005200275953000900327103569220081219072118.0831017n| acaabaaan |a ana  an83700634360532 a(OCoLC)oca01040186 aDLCbengcDLCdOCoLC 0aC360532 Cartoons & Comics 0aReihe "Cartoons & Comics" 0aCartoons und Comics aZürichbEdition C af5DLC at5DLC as5DLC aGrasso, M. Sati(e)risches, 1982:bp. 1 of cover aec29 \ No newline at end of file diff --git a/cypress/support/fragments/marcAuthority/marcAuthorities.js b/cypress/support/fragments/marcAuthority/marcAuthorities.js index 58fcdd8292..fd1a0910b0 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthorities.js +++ b/cypress/support/fragments/marcAuthority/marcAuthorities.js @@ -458,4 +458,16 @@ export default { verifyEmptyNumberOfTitles() { cy.expect(MultiColumnListCell({ columnIndex: 4 }).has({ content: '' })); }, + + verifyAuthorityPropertiesAfterSearch(expectedProperties) { + cy.intercept('GET', '/search/authorities?**').as('get-authorities'); + cy.wait('@get-authorities').its('response.statusCode').should('equal', 200); + cy.get('@get-authorities').then(data => { + data.response.body.authorities.forEach(authority => { + expectedProperties.forEach(expectedProperty => { + cy.expect(authority).to.have.property(expectedProperty); + }); + }); + }); + } }; From c20cdc3669994439a78d86e455fd25039dd98e72 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Mon, 7 Aug 2023 21:10:37 +0300 Subject: [PATCH 022/437] FAT-7328-C380704-Fix (#1455) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7328: initial fix * FAT-7328: const name update * FAT-7328: timeout updated * FAT-7328: moved method to before block * FAT-7328: typo fixed * FAT-7328: increased max timeout * FAT-7328: deleted empty lines --- .../create-new-marc-bib-edit-ldr.cy.js | 22 ++++++++-------- cypress/support/fragments/quickMarcEditor.js | 25 +++++++++++++++++++ 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js b/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js index ead145ef96..b6d0b2f350 100644 --- a/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js +++ b/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js @@ -6,7 +6,7 @@ import Users from '../../support/fragments/users/users'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; -import { replaceByIndex } from '../../support/utils/stringTools'; +import getRandomPostfix, { replaceByIndex } from '../../support/utils/stringTools'; import { randomizeArray } from '../../support/utils/arrays'; describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { @@ -17,7 +17,7 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { }, fieldContents: { - tag245Content: 'Create Bib, edit LDR test', + tag245Content: `Created_Bib_${getRandomPostfix()}` }, LDRValues: { @@ -37,29 +37,30 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { }; const updatedLDRValuesArray = Object.values(testData.LDRValues.updatedLDRValues); - const createdInstanceIDs = []; - - const users = {}; + const userData = {}; before(() => { cy.createTempUser([ Permissions.inventoryAll.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorCreate.gui, ]).then(createdUserProperties => { - users.C380707UserProperties = createdUserProperties; + userData.C380707UserProperties = createdUserProperties; }); cy.createTempUser([ Permissions.inventoryAll.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorCreate.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, ]).then(createdUserProperties => { - users.C380704UserProperties = createdUserProperties; + userData.C380704UserProperties = createdUserProperties; + cy.loginAsAdmin({ path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }).then(() => { + QuickMarcEditor.waitAndCheckFirstBibRecordCreated(); + }); }); }); after('Deleting created users, Instances', () => { - Object.values(users).forEach((user) => { + Object.values(userData).forEach((user) => { Users.deleteViaApi(user.userId); }); createdInstanceIDs.forEach(instanceID => { @@ -68,7 +69,7 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { }); it('C380707 Editing LDR 10, 11, 20-23 values when creating a new "MARC bib" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - cy.login(users.C380707UserProperties.username, users.C380707UserProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.login(userData.C380707UserProperties.username, userData.C380707UserProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); InventoryInstance.newMarcBibRecord(); QuickMarcEditor.updateExistingField(testData.tags.tagLDR, testData.LDRValues.validLDRvalue); @@ -82,7 +83,7 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { }); it('C380704 Creating a new "MARC bib" record with valid LDR 06, 07 values. (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - cy.login(users.C380704UserProperties.username, users.C380704UserProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.login(userData.C380704UserProperties.username, userData.C380704UserProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); for (let i = 0; i < testData.LDRValues.validLDR07Values.length; i++) { const updatedLDRvalue = `${testData.LDRValues.validLDRvalue.substring(0, 6)}${testData.LDRValues.validLDR06Values[i]}${testData.LDRValues.validLDR07Values[i]}${testData.LDRValues.validLDRvalue.substring(8)}`; @@ -96,7 +97,6 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { QuickMarcEditor.check008FieldContent(); QuickMarcEditor.updateExistingField(testData.tags.tagLDR, updatedLDRvalue); QuickMarcEditor.checkSubfieldsPresenceInTag008(); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 6cefc8d0f4..826daa1599 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -37,6 +37,7 @@ const calloutDelete008Error = Callout('Record cannot be saved without 008 field' const calloutAfterSaveAndCloseNewRecord = Callout('Record created.'); const closeButton = Button({ icon: 'times' }); const validRecord = InventoryInstance.validOCLC; +const validNewMarBibLDR = '00000naa\\a2200000uu\\4500'; const specRetInputNamesHoldings008 = ['records[3].content.Spec ret[0]', 'records[3].content.Spec ret[1]', 'records[3].content.Spec ret[2]']; @@ -746,5 +747,29 @@ export default { checkPaneheaderContains(text) { cy.expect(PaneHeader({ text: (including(text)) }).exists()); + }, + + waitAndCheckFirstBibRecordCreated(marcBibTitle = `Test_Bib_Creation_${getRandomPostfix()}`, timeOutSeconds = 120) { + let timeCounter = 0; + function checkBib() { + cy.okapiRequest({ path: 'instance-storage/instances', + searchParams: { 'query': `(title all "${marcBibTitle}")` }, + isDefaultSearchParamsRequired : false }).then(({ body }) => { + if (body.instances[0] || timeCounter >= timeOutSeconds) { + cy.expect(body.instances[0].title).equals(marcBibTitle); + } else { + // wait 1 second before retrying request + cy.wait(1000); + checkBib(); + timeCounter++; + } + }); + } + InventoryInstance.newMarcBibRecord(); + this.updateExistingField('245', `$a ${marcBibTitle}`); + this.updateExistingField('LDR', validNewMarBibLDR); + this.pressSaveAndClose(); + cy.expect(calloutAfterSaveAndClose.exists()); + checkBib(); } }; From a26738506e9522dfe9c977b457bbbdd097ece976 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:34:23 +0500 Subject: [PATCH 023/437] FAT-4934/C369084 (#1456) * added test C369084 * small change * did some change in after hook --- ...e_two_marc_bib_linked_marc_authority.cy.js | 185 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC369084.mrc | 1 + cypress/fixtures/marcBibFileForC369084.mrc | 1 + .../marcAuthority/marcAuthoritiesDelete.js | 15 +- interactors/modal.js | 1 + 5 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC369084.mrc create mode 100644 cypress/fixtures/marcBibFileForC369084.mrc diff --git a/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js b/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js new file mode 100644 index 0000000000..0cc67ed1ad --- /dev/null +++ b/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js @@ -0,0 +1,185 @@ +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 MarcAuthoritiesDelete from '../../support/fragments/marcAuthority/marcAuthoritiesDelete'; + +describe('MARC -> MARC Authority', () => { + const testData = { + marcValue: 'Chin, Staceyann, 1972-', + markedValue: 'Chin, Staceyann,', + searchOption: 'Personal name', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC369084.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 2, + }, + { + marc: 'marcAuthFileForC369084.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 2, + } + ]; + + let createdAuthorityIDs = []; + + const linkingTagForFirstMarcBib = [ + { + rowIndex: 17, + value: 'Chin, Staceyann, 1972-', + tag: 100 + }, + { + rowIndex: 28, + value: 'Chin, Staceyann, 1972-', + tag: 600 + }, + ]; + + const linkingTagForSecondMarcBib = [ + { + rowIndex: 11, + value: 'Chin, Staceyann, 1972-', + tag: 100 + }, + { + rowIndex: 19, + value: 'Feminist poetry', + tag: 650 + }, + ]; + + const twoMarcBibsToLink = [ + { + marcBibRecord: 'The other side of paradise : a memoir / Staceyann Chin.', + linkingFields: linkingTagForFirstMarcBib + }, + { + marcBibRecord: 'Crossfire : a litany for survival : poems 1998-2019 / Staceyann Chin', + linkingFields: linkingTagForSecondMarcBib + }, + ]; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordDelete.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.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(); + twoMarcBibsToLink.forEach(marcBib => { + InventoryInstance.searchByTitle(marcBib.marcBibRecord); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + marcBib.linkingFields.forEach(linking => { + QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(linking.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.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); + for (let i = 0; i < 2; i++) { + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[i]) + } + MarcAuthority.deleteViaAPI(createdAuthorityIDs[2]); + + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + for (let i = 0; i < 2; i++) { + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + } + }); + + it('C369084 Delete authorized "MARC Authority" record that has two linked field in different "MARC Bib" records (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.switchToBrowse(); + MarcAuthorities.searchByParameter(testData.searchOption, testData.marcValue); + + MarcAuthorities.selectTitle(testData.marcValue); + MarcAuthorities.checkRecordDetailPageMarkedValue(testData.markedValue); + MarcAuthoritiesDelete.clickDeleteButton(); + MarcAuthoritiesDelete.checkDeleteModal(); + MarcAuthoritiesDelete.checkDeleteModalMessage(`Are you sure you want to permanently delete the authority record: ${testData.marcValue} ? If you proceed with deletion, then 2 linked bibliographic records will retain authorized value and will become uncontrolled.`) + MarcAuthoritiesDelete.clickCancelButton(); + + MarcAuthoritiesDelete.clickDeleteButton(); + MarcAuthoritiesDelete.checkDeleteModal(); + MarcAuthoritiesDelete.checkDeleteModalMessage(`Are you sure you want to permanently delete the authority record: ${testData.marcValue} ? If you proceed with deletion, then 2 linked bibliographic records will retain authorized value and will become uncontrolled.`) + MarcAuthoritiesDelete.confirmDelete(); + MarcAuthoritiesDelete.checkAfterDeletion(testData.marcValue); + + cy.visit(TopMenu.inventoryPath) + InventoryInstance.searchByTitle(twoMarcBibsToLink[1].marcBibRecord); + InventoryInstances.selectInstance(); + InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane('Contributor'); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane('Subject'); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(11, '100', '1', '\\', '$a Chin, Staceyann, $d 1972- $e Author $e Narrator $0 id.loc.gov/authorities/names/n2008052404 $1 http://viaf.org/viaf/24074052'); + QuickMarcEditor.verifyTagFieldAfterLinking(19, '650', '\\', '0', '$a Feminist poetry', '', '$0 id.loc.gov/authorities/subjects/sh85047755', ''); + QuickMarcEditor.checkLinkButtonExist('100'); + + QuickMarcEditor.closeEditorPane(); + InventoryInstance.searchByTitle(twoMarcBibsToLink[0].marcBibRecord); + InventoryInstances.selectInstance(); + InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane('Contributor'); + InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane('Subject'); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(17, '100', '1', '\\', '$a Chin, Staceyann, $d 1972- $e author. $0 id.loc.gov/authorities/names/n2008052404'); + QuickMarcEditor.verifyTagFieldAfterUnlinking(28, '600', '1', '0', '$a Chin, Staceyann, $d 1972- $x Childhood and youth. $0 id.loc.gov/authorities/names/n2008052404'); + QuickMarcEditor.pressCancel(); + + InventoryInstance.viewSource(); + InventoryInstance.checkAbsenceOfAuthorityIconInMarcViewPane(); + }); +}); diff --git a/cypress/fixtures/marcAuthFileForC369084.mrc b/cypress/fixtures/marcAuthFileForC369084.mrc new file mode 100644 index 0000000000..a6d7cd1fef --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC369084.mrc @@ -0,0 +1 @@ +00407cz a2200169n 4500001000800000005001700008008004100025010001700066035002100083035001500104040001800119150002000137550001400157906001800171952003300189953001500222469947220120323073631.0860211 | anannbabn |a ana  ash 85047755  a(DLC)sh 85047755 a(DLC)46157 aDLCcDLCdDLC aFeminist poetry wgaPoetry t9007ufk04v0 a0 bib. records to be changed axx00btd1401031cz a2200241n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139053001700160100002800177370004400205372004100249374002700290375001100317377000800328670013700336670009300473670021400566953000900780761350820170217073826.0080801n| azannaabn |n aaa  an 2008052404 a(OCoLC)oca07838205 aDLCbengerdacDLCdDLCdInU f1972-12-252edtf 0aPR9265.9.C531 aChin, Staceyann,d1972- aJamaicaeBrooklyn (New York, N.Y.)2naf aSpoken word poetryaGay rights2lcsh aPoetsaActivists2lcsh afemale aeng aThe other side of paradise, 2009:bt.p. (Staceyann Chin) dataview (b. Dec. 25, 1972; spoken word poet and gay activist from Jamaica) awww.staceyannchin.com, Aug. 1, 2008b(resident of New York City and a Jamaican national) aWikipedia, 16 Feb. 2017b(Staceyann Chin; b. 25 Dec. 1972 in Jamaica; spoken-word poet, performing artist, and LGBT rights activist; is of Chinese-Jamaican and Afro-Jamaican descent; now lives in Brooklyn, NY) alh45 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC369084.mrc b/cypress/fixtures/marcBibFileForC369084.mrc new file mode 100644 index 0000000000..1331ce17c2 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC369084.mrc @@ -0,0 +1 @@ +03429cam a2200685 i 4500001001400000008004100014005001700055010001700072035002400089040015000113019001400263020003100277020002800308035003900336037008700375042000800462043001200470050002700482082001500509100003700524245006200561250004400623264003700667264001100704300002300715336002600738337002800764338002700792500003900819500069700858600005001555600005601605650004801661650004101709650004301750650004901793650005801842650005401900650005201954650004602006600005402052650004902106650003702155650004902192650004702241650005502288651003902343648002002382655001802402655004702420655004302467655002802510655002802538938003602566938004102602029002202643029001802665994001402683948004602697in00000005299090625t20102009nyu 000 0aeng c20221216142016.5 a 2008034022 a(OCoLC)ocn419817766 aBTCTAbengerdacBTCTAdNYPdGCBdMBBdBDXdCGPdOCLCAdXFFdCUTdFDAdOCLCQdSFRdOCLCAdOCLCFdOSUdJDPdOCLdOCLCOdOCLCAdOCLCQdOCLCOdOCLCQ a657008258 a9780743292917q(paperback) a074329291Xq(paperback) a(OCoLC)419817766z(OCoLC)657008258 bSimon & Schuster, Order Dept 100 Front st, Riverside, NJ, USA, 08075nSAN 200-2442 apcc anwjm--- 4aPR9265.9.C53bO73 201004a818/.62221 aChin, Staceyann,d1972-eauthor.14aThe other side of paradise :ba memoir /cStaceyann Chin. aFirst Scribner trade paperback edition. 1aNew York, NY :bScribner,c2010. 4c©2009 a282 pages ;c22 cm atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier a"February 2010"--Title page verso. aNo one knew Staceyann's mother was pregnant until a dangerously small baby was born on the floor of her grandmother's house in Jamaica on Christmas Day. Staceyann's mother did not want her, and her father was not present. No one, except her grandmother, thought Staceyann would survive. It was her grandmother who nurtured and protected and provided for Staceyann and her older brother in the early years. But when the three were separated, Staceyann was thrust, alone, into an unfamiliar and dysfunctional home in Paradise, Jamaica. There, she faced far greater troubles than absent parents. So, armed with a fierce determination, she discovered a way to break out of this unforgiving world.10aChin, Staceyann,d1972-xChildhood and youth.10aChin, Staceyann,d1972-xHomes and hauntszJamaica. 0aAuthors, Jamaicany21st centuryvBiography. 0aLesbian authorszJamaicavBiography. 0aLesbian activistszJamaicavBiography. 0aRacially mixed childrenzJamaicavBiography. 6aEÌcrivains jamaïquainsy21e sieÌ€clevBiographies. 6aEÌcrivaines lesbienneszJamaïquevBiographies. 6aActivistes lesbienneszJamaïquevBiographies. 6aEnfants meÌtiszJamaïquevBiographies.17aChin, Staceyann,d1972-2fast0(OCoLC)fst01924329 7aAuthors, Jamaican.2fast0(OCoLC)fst00822143 7aHomes.2fast0(OCoLC)fst01353235 7aLesbian activists.2fast0(OCoLC)fst00996453 7aLesbian authors.2fast0(OCoLC)fst00996461 7aRacially mixed children.2fast0(OCoLC)fst01086590 7aJamaica.2fast0(OCoLC)fst01211575 7a2000-20992fast 2aAutobiography 7aAutobiographies.2fast0(OCoLC)fst01919894 7aBiographies.2fast0(OCoLC)fst01919896 7aAutobiographies.2lcgft 7aAutobiographies.2rvmgf aBrodartbBRODn10360425c$16.00 aBaker and TaylorbBTCPnBK00084485081 aAU@b0000458315091 aNZ1b13816211 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 145 OTHER HOLDINGS01739cam a2200325Ii 41y00010009000000050017000090080041000260030004000670400028000710200015000990200031001140350022001450500027001670820014001941000126002082450109003342640049004433000027004923360068005193370068005873380065006555200205007206500072009256550074009977000124010717000020011959030009012159280086012249270103013101194806420191023111031.6191004s2019 ilua 000 p eng dICU aCOObengerdacCOOdUOK a1642590258 a9781642590258q(paperback) a(OCoLC)1122747273 4aPR9265.9.C53bC76 2019 4a811.62231 aChin, Staceyann,d1972-eAuthoreNarrator0http://id.loc.gov/authorities/names/n20080524041http://viaf.org/viaf/2407405210aCrossfire :ba litany for survival : poems 1998-2019 /cStaceyann Chin ; foreword by Jacqueline Woodson. 1aChicago, Illinois :bHaymarket Books,c2019. axi, 208 pages ;c23 cm atext2rdacontent0http://id.loc.gov/vocabulary/contentTypes/txt aunmediated2rdamedia0http://id.loc.gov/vocabulary/mediaTypes/n avolume2rdacarrier0http://id.loc.gov/vocabulary/carriers/nc a"Crossfire collects world-renowned lesbian poet and spoken-word artist Staceyann Chin's empowering, feminist-LGBTQ-Caribbean, activism-driven poetry for the first time in a single book."-- Back cover. 0aFeminist poetry.0http://id.loc.gov/authorities/subjects/sh85047755 7aPoetry.2lcgft0http://id.loc.gov/authorities/genreForms/gf20140264811 aWoodson, Jacqueline,ewriter of foreword.0http://id.loc.gov/authorities/names/n882347001http://viaf.org/viaf/791171201 aChin, Staceyann aHeVa tLibrary of Congress classificationaPR9265.9.C53 C76 2019lJRLcJRL-Geni11444263 tLibrary of Congress classificationaPR9265.9.C53 C76 2019lJRLcJRL-GeneHESMb116492753i10165013 \ No newline at end of file diff --git a/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js b/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js index 76d1bbcd3e..05eaf271ad 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js +++ b/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js @@ -5,6 +5,7 @@ const deleteButton = DropdownMenu().find(Button('Delete')); const deleteConfirmModal = Modal({ id: 'confirm-delete-note' }); const deleteConfirmModalHeader = Heading({ id: 'confirm-delete-note-label' }); const confirmDeleteButton = deleteConfirmModal.find(Button('Delete')); +const confirmCancelButton = deleteConfirmModal.find(Button('Cancel')); const searchResults = PaneContent({ id: 'authority-search-results-pane-content' }); const searchResultPane = Section({ id: 'marc-view-pane' }); @@ -19,11 +20,23 @@ export default { checkDeleteModal() { cy.expect([ deleteConfirmModalHeader.exists(), - deleteConfirmModal.find(Button('Cancel')).exists(), + confirmCancelButton.exists(), confirmDeleteButton.exists(), ]); }, + checkDeleteModalMessage(message) { + cy.expect(deleteConfirmModal.has({ message: message })); + }, + + clickCancelButton() { + cy.do(confirmCancelButton.click()); + cy.expect([ + deleteConfirmModal.absent(), + actionsButton.exists() + ]); + }, + confirmDelete() { cy.do(confirmDeleteButton.click()); }, diff --git a/interactors/modal.js b/interactors/modal.js index 8ab9cdacd3..4478109f1e 100644 --- a/interactors/modal.js +++ b/interactors/modal.js @@ -10,6 +10,7 @@ export default HTML.extend('modal') title, id: (el) => el.getAttribute('id'), content: (el) => el.textContent, + message: (el) => el.querySelector('[class^=modalContent]').textContent, }) .actions({ dismiss: (interactor) => interactor.find(Button({ ariaLabel: 'Dismiss modal' })).click(), From 847c2311a4563832690f0d0b724bd4596f2c9c24 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Tue, 8 Aug 2023 13:17:25 +0300 Subject: [PATCH 024/437] Ideyalabs master (#1461) IdeyaLabs tests --- .../cannot-view-export-manager.cy.js | 2 +- cypress/e2e/ideyalabs/checkin.cy.js | 84 +++++++ cypress/e2e/ideyalabs/marc_authority.cy.js | 174 +++++++++++++++ .../add-and-assign-contact.cy.js | 53 +++++ .../add-tags-to-organization.cy.js | 46 ++++ .../assign-categories-to-contact.cy.js | 52 +++++ .../organizations/create-new-categories.cy.js | 9 +- .../organizations/delete-contact.cy.js | 48 ++++ .../organizations/delete-organization.cy.js | 42 ++++ .../filter-organizations-by-status.cy.js | 46 ++++ .../filter-organizations-by-tags.cy.js | 33 +++ .../make-existing-organization-vendor.cy.js | 43 ++++ .../search-alternate-organization.cy.js | 44 ++++ cypress/e2e/ideyalabs/serviceshift.cy.js | 180 +++++++++++++++ cypress/e2e/ideyalabs/users.cy.js | 114 ++++++++++ cypress/support/checkin.js | 9 +- .../check-in-actions/checkInActions.js | 63 +++++- .../fragments/circulation-log/searchPane.js | 86 ++++--- .../fragments/inventory/inventoryInstance.js | 31 ++- .../inventory/inventorySearchAndFilter.js | 210 ++++++++++++------ .../marcAuthority/MarcAuthorityBrowse.js | 32 +-- .../marcAuthority/marcAuthorities.js | 22 +- .../marcAuthority/marcAuthoritiesDelete.js | 7 + .../fragments/marcAuthority/marcAuthority.js | 9 + cypress/support/fragments/users/users.js | 148 ++++++++++-- .../fragments/users/usersSearchPane.js | 12 + cypress/support/ideyaLabs/checkinitems.js | 135 +++++++++++ cypress/support/ideyaLabs/serviceshift.js | 26 +++ 28 files changed, 1594 insertions(+), 166 deletions(-) create mode 100644 cypress/e2e/ideyalabs/checkin.cy.js create mode 100644 cypress/e2e/ideyalabs/marc_authority.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/add-and-assign-contact.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/add-tags-to-organization.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/assign-categories-to-contact.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/delete-contact.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/delete-organization.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/filter-organizations-by-status.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/filter-organizations-by-tags.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/make-existing-organization-vendor.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/search-alternate-organization.cy.js create mode 100644 cypress/e2e/ideyalabs/serviceshift.cy.js create mode 100644 cypress/e2e/ideyalabs/users.cy.js create mode 100644 cypress/support/ideyaLabs/checkinitems.js create mode 100644 cypress/support/ideyaLabs/serviceshift.js diff --git a/cypress/e2e/export-manager/cannot-view-export-manager.cy.js b/cypress/e2e/export-manager/cannot-view-export-manager.cy.js index 101a1f422a..b7f93e30a6 100644 --- a/cypress/e2e/export-manager/cannot-view-export-manager.cy.js +++ b/cypress/e2e/export-manager/cannot-view-export-manager.cy.js @@ -11,7 +11,7 @@ describe('export manager', () => { before('create user', () => { cy.createTempUser([]) .then(userProperties => { - user = userProperties + user = userProperties; cy.login(user.username, user.password); }); }); diff --git a/cypress/e2e/ideyalabs/checkin.cy.js b/cypress/e2e/ideyalabs/checkin.cy.js new file mode 100644 index 0000000000..933b060c9b --- /dev/null +++ b/cypress/e2e/ideyalabs/checkin.cy.js @@ -0,0 +1,84 @@ +import checkInItems from '../../support/ideyaLabs/checkInItems'; +import serviceShift from '../../support/ideyaLabs/serviceshift'; +import testTypes from '../../support/dictionary/testTypes'; +import checkInActions from '../../support/fragments/check-in-actions/checkInActions'; +import searchPane from '../../support/fragments/circulation-log/searchPane'; +import topMenu from '../../support/fragments/topMenu'; + +const testData = { + itemA: '14367843', + itemB: '17276636', + itemC: '123321', + itemD: '65656565', + numberOfPiecesItemA: '1', + numberOfPiecesItemB: '2', + description: 'pieces count', +}; + +describe.skip('servicepoints shift', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C589 Check in items at service points for effective location (vega)', { tags: [testTypes.ideaLabsTests] }, () => { + serviceShift.servicePointsOne(); + cy.visit(topMenu.inventoryPath); + cy.visit(topMenu.checkInPath); + checkInActions.checkInItem(testData.itemA); + checkInItems.checkModal(); + serviceShift.servicePointsTwo(); + cy.visit(topMenu.checkInPath); + checkInActions.checkInItem(testData.itemB); + checkInItems.checkModal(); + }); + + it('C9194 Check in: confirm check in for item status (vega)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.circulationLogPath); + checkInItems.declaredItem(); + cy.visit(topMenu.inventoryPath); + checkInItems.withdrawn(); + cy.visit(topMenu.inventoryPath); + checkInItems.lostAndPaid(); + }); + + it('C17137 - Filter circulation log by renewed through override (firebird)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.circulationLogPath); + searchPane.checkBarcode(); + }); + + it('C590 Check in: multipiece items (vega)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.checkInPath); + checkInItems.checkIn(testData.itemA); + checkInActions.openItemDetails(testData.itemA); + checkInActions.editItemDetails(testData.numberOfPiecesItemA, '', ''); + cy.visit(topMenu.checkInPath); + checkInItems.cancelCheckInMultipleItem(testData.itemB); + checkInItems.checkIn(testData.itemB); + checkInActions.openItemDetails(testData.itemB); + checkInActions.editItemDetails( + testData.numberOfPiecesItemA, + '', + testData.description + ); + cy.visit(topMenu.checkInPath); + checkInItems.checkInMultipleItem(testData.itemB); + checkInItems.checkIn(testData.itemC); + checkInActions.openItemDetails(testData.itemC); + checkInActions.editItemDetails( + testData.numberOfPiecesItemB, + testData.numberOfPiecesItemA, + testData.description + ); + cy.visit(topMenu.checkInPath); + checkInItems.checkInMultipleItem(testData.itemC); + checkInItems.checkIn(testData.itemD); + checkInActions.openItemDetails(testData.itemD); + checkInActions.editItemDetails( + '', + testData.numberOfPiecesItemA, + testData.description + ); + cy.visit(topMenu.checkInPath); + checkInItems.checkInMultipleItem(testData.itemD); + }); +}); diff --git a/cypress/e2e/ideyalabs/marc_authority.cy.js b/cypress/e2e/ideyalabs/marc_authority.cy.js new file mode 100644 index 0000000000..d6669465e8 --- /dev/null +++ b/cypress/e2e/ideyalabs/marc_authority.cy.js @@ -0,0 +1,174 @@ +import marc from '../../support/a_ideyalabs/marc'; +import testTypes from '../../support/dictionary/testTypes'; +import inventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import inventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import marcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import marcAuthoritiesDelete from '../../support/fragments/marcAuthority/marcAuthoritiesDelete'; +import marcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +import topMenu from '../../support/fragments/topMenu'; + +const testData = { + source: 'MARC', + searchOption: 'Keyword', + authority650FieldValue: 'Speaking Oratory debating', + searchHoldingOption: 'Keyword (title, contributor, identifier, HRID, UUID)', + holdingValue: 'The !!!Kung of Nyae Nyae / Lorna Marshall.', + record: 'Gibbons, Boyd', + accordion: 'Subject', + marcRecord: 'Beatles', + tag: { + tag650: '650', + }, + derive: { + searchOption: 'Personal name', + authority700FieldValue: 'Gibbons, Boyd', + tag700: '700', + rowIndex: 1, + accordion: 'Contributor', + content: ' ', + }, +}; + +describe.skip('Feature MARC Authority', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C375070 Link the ""650"" of ""MARC Bib"" field with ""150"" field of ""MARC Authority"" record. (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultByRowIndex( + testData.derive.rowIndex + ); + inventoryInstance.editMarcBibliographicRecord(); + inventoryInstance.verifyAndClickLinkIcon(testData.tag.tag650); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.clickReset(); + inventoryInstance.searchResults(testData.authority650FieldValue); + marcAuthorities.clickLinkButton(); + marcAuthority.checkLinkingAuthority650(); + marc.saveAndClose(); + inventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane( + testData.accordion + ); + inventoryInstance.viewSource(); + marcAuthorities.closeMarcViewPane(); + inventoryInstance.editMarcBibliographicRecord(); + inventoryInstance.verifyAndClickUnlinkIcon(testData.tag.tag650); + marc.popupUnlinkButton(); + marc.saveAndClose(); + inventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane( + testData.accordion + ); + inventoryInstance.viewSource(); + marcAuthorities.checkFieldAndContentExistence( + testData.tag650, + `‡a ${testData.authority650FieldValue}` + ); + } + ); + + it( + 'C365602 Derive | Unlink ""MARC Bibliographic"" field from ""MARC Authority"" record and use the ""Save & close"" button in deriving window. (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultByRowIndex( + testData.derive.rowIndex + ); + inventoryInstance.editMarcBibliographicRecord(); + + const unlinkButton = inventoryInstance.verifyUnlinkIcon( + testData.derive.tag700 + ); + if (unlinkButton) { + inventoryInstance.verifyAndClickLinkIcon(testData.derive.tag700); + inventoryInstance.verifySearchOptions(); + marcAuthorities.clickReset(); + marcAuthorities.searchBy( + testData.derive.searchOption, + testData.derive.authority700FieldValue + ); + marcAuthorities.clickLinkButton(); + marcAuthority.checkLinkingAuthority700(); + marc.saveAndClose(); + } else { + marc.closeEditMarc(); + } + inventoryInstance.deriveNewMarcBibRecord(); + marc.keepLinkingButton(); + inventoryInstance.verifyAndClickUnlinkIcon(testData.derive.tag700); + marc.popupUnlinkButton(); + marc.saveAndClose(); + inventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane( + testData.derive.accordion + ); + inventoryInstance.editMarcBibliographicRecord(); + inventoryInstance.verifyLinkIcon(testData.derive.tag700); + } + ); + + it( + 'C380755 Link of empty MARC Bib field with ""MARC Authority"" record (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultByRowIndex( + testData.derive.rowIndex + ); + inventoryInstance.editMarcBibliographicRecord(); + inventoryInstance.verifyAndClickUnlinkIcon(testData.derive.tag700); + marc.popupUnlinkButton(); + inventoryInstance.verifyAndClickLinkIcon(testData.derive.tag700); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySelectMarcAuthorityModal(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.derive.searchOption, + testData.derive.authority700FieldValue + ); + marcAuthorities.clickLinkButton(); + marcAuthority.checkLinkingAuthority700(); + marc.saveAndClose(); + inventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane( + testData.derive.accordion + ); + } + ); + + it( + 'C376987 User can print ""MARC authority"" record (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.marcAuthorities); + marcAuthorities.searchBeats(testData.marcRecord); + marcAuthorities.clickActionsButton(); + inventoryInstance.selectRecord(); + marcAuthoritiesDelete.clickprintButton(); + cy.exec('java -jar sikuli_ide.jar -r printer.sikuli'); + } + ); + + it( + 'C388651 ""008"" field updated when valid LDR 06-07 combinations entered when editing ""MARC bib"" record ( Spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultByRowIndex( + testData.derive.rowIndex + ); + inventoryInstance.editMarcBibliographicRecord(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/add-and-assign-contact.cy.js b/cypress/e2e/ideyalabs/organizations/add-and-assign-contact.cy.js new file mode 100644 index 0000000000..67b62b6dd7 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/add-and-assign-contact.cy.js @@ -0,0 +1,53 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const organizationName = `AutoTest_${getRandomPostfix()}`; +const organizationCode = getRandomStringCode(6); + +const newOrganization = { + status: 'Active', + name: organizationName, + code: organizationCode, +}; + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +const addContactPeople = { + firstName: getRandomStringCode(5), + lastName: getRandomStringCode(4), +}; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C725 Add new contact and assign to an organization record (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.searchByParameters( + searchByCode.dropdown, + searchByCode.code + ); + organizations.selectOrganization(newOrganization.name); + organizations.editOrganization(); + organizations.addNewContact(addContactPeople); + organizations.closeDetailsPane(); + organizations.addContactToOrganization(addContactPeople); + organizations.verifySavedContactToOrganization( + `${addContactPeople.lastName}, ${addContactPeople.firstName}` + ); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/add-tags-to-organization.cy.js b/cypress/e2e/ideyalabs/organizations/add-tags-to-organization.cy.js new file mode 100644 index 0000000000..140a1af6e9 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/add-tags-to-organization.cy.js @@ -0,0 +1,46 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const organizationName = `AutoTest_${getRandomPostfix()}`; +const organizationCode = getRandomStringCode(6); + +const newOrganization = { + status: 'Active', + name: organizationName, + code: organizationCode, +}; + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C6710 Add tags to an Organization record (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.selectActiveStatus(); + organizations.searchByParameters( + searchByCode.dropdown, + searchByCode.code + ); + organizations.selectOrganization(newOrganization.name); + organizations.organizationTagDetails(); + organizations.addTag(); + organizations.tagsPane(); + organizations.verifyTagCount(); + organizations.resetFilters(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/assign-categories-to-contact.cy.js b/cypress/e2e/ideyalabs/organizations/assign-categories-to-contact.cy.js new file mode 100644 index 0000000000..c2d05b8179 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/assign-categories-to-contact.cy.js @@ -0,0 +1,52 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const organizationName = `AutoTest_${getRandomPostfix()}`; +const organizationCode = getRandomStringCode(6); + +const newOrganization = { + status: 'Active', + name: organizationName, + code: organizationCode, +}; + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +const addContactPeople = { + firstName: getRandomStringCode(5), + lastName: getRandomStringCode(4), +}; +const addCategory = 'claim'; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C732 Assign categories to contact person (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.searchByParameters( + searchByCode.dropdown, + searchByCode.code + ); + organizations.selectOrganization(newOrganization.name); + organizations.editOrganization(); + organizations.openContactPeopleSection(); + organizations.selectContact(addContactPeople); + organizations.editOrganization(); + organizations.selectAndVerifyCategories(addCategory); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js index c061d16a53..a2b0ebdd2b 100644 --- a/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js +++ b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js @@ -1,11 +1,10 @@ -import DevTeams from '../../../support/dictionary/devTeams'; -import TestTypes from '../../../support/dictionary/testTypes'; +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'; +import { randomFourDigitNumber } from '../../../support/utils/stringTools'; -const categoryName = `Test${getFourDigitRandomNumber()}`; +const categoryName = `Test${randomFourDigitNumber()}`; describe.skip('Settings', () => { before('Login to Folio', () => { @@ -14,7 +13,7 @@ describe.skip('Settings', () => { it( 'C731 Create new categories (thunderjet)', - { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(SettingsMenu.organizationsPath); Organizations.addNewCategory(categoryName); diff --git a/cypress/e2e/ideyalabs/organizations/delete-contact.cy.js b/cypress/e2e/ideyalabs/organizations/delete-contact.cy.js new file mode 100644 index 0000000000..2fa47693ab --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/delete-contact.cy.js @@ -0,0 +1,48 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const organizationName = `AutoTest_${getRandomPostfix()}`; +const organizationCode = getRandomStringCode(6); + +const newOrganization = { + status: 'Active', + name: organizationName, + code: organizationCode, +}; + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C729 Delete a contact person (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.searchByParameters( + searchByCode.dropdown, + searchByCode.code + ); + organizations.selectOrganization(newOrganization.name); + organizations.editOrganization(); + organizations.openContactPeopleSection(); + organizations.selectContact(addContactPeople); + organizations.deleteContact(); + organizations.verifyDeletedContact(); + organizations.closeDetailsPane(); + } + ); + +}); diff --git a/cypress/e2e/ideyalabs/organizations/delete-organization.cy.js b/cypress/e2e/ideyalabs/organizations/delete-organization.cy.js new file mode 100644 index 0000000000..e20679d06d --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/delete-organization.cy.js @@ -0,0 +1,42 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const organizationName = `AutoTest_${getRandomPostfix()}`; +const organizationCode = getRandomStringCode(6); + +const newOrganization = { + status: 'Active', + name: organizationName, + code: organizationCode, +}; + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C674 Delete existing organization record (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.searchByParameters( + searchByCode.dropdown, + searchByCode.code + ); + organizations.selectOrganization(newOrganization.name); + organizations.deleteOrganization(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/filter-organizations-by-status.cy.js b/cypress/e2e/ideyalabs/organizations/filter-organizations-by-status.cy.js new file mode 100644 index 0000000000..daa4fec6c6 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/filter-organizations-by-status.cy.js @@ -0,0 +1,46 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; + +const organizationCode = getRandomStringCode(6); + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +const organizationStatus = { + active: 'Active', + inActive: 'Inactive', + pending: 'Pending', +}; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C728 Filter organizations by status (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.selectActiveStatus(); + organizations.checkSearchResults({ name: organizationStatus.active }); + organizations.resetFilters(); + organizations.selectInActiveStatus(); + organizations.checkSearchResults({ name: organizationStatus.inActive }); + organizations.resetFilters(); + organizations.selectPendingStatus(); + organizations.checkZeroSearchResultsHeader({ + name: organizationStatus.pending, + }); + organizations.resetFilters(); + organizations.verifyResetFilters(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/filter-organizations-by-tags.cy.js b/cypress/e2e/ideyalabs/organizations/filter-organizations-by-tags.cy.js new file mode 100644 index 0000000000..7ed00479d5 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/filter-organizations-by-tags.cy.js @@ -0,0 +1,33 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; + +const organizationCode = getRandomStringCode(6); + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +const tags = '&'; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C6711 Filter Organizations by tags (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.tagFilter(tags); + organizations.checkOrganizationFilter(); + organizations.resetFilters(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/make-existing-organization-vendor.cy.js b/cypress/e2e/ideyalabs/organizations/make-existing-organization-vendor.cy.js new file mode 100644 index 0000000000..a02660c992 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/make-existing-organization-vendor.cy.js @@ -0,0 +1,43 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const organizationName = `AutoTest_${getRandomPostfix()}`; +const organizationCode = getRandomStringCode(6); + +const newOrganization = { + status: 'Active', + name: organizationName, + code: organizationCode, +}; + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C730 Make existing organization a Vendor (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + organizations.selectNoInIsVendor(); + organizations.selectOrganization(newOrganization.name); + organizations.editOrganization(); + organizations.selectVendor(); + organizations.verifyVendorExists(); + organizations.closeDetailsPane(); + organizations.resetFilters(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/search-alternate-organization.cy.js b/cypress/e2e/ideyalabs/organizations/search-alternate-organization.cy.js new file mode 100644 index 0000000000..ed9e3ffb44 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/search-alternate-organization.cy.js @@ -0,0 +1,44 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import organizations from '../../../support/fragments/organizations/organizations'; +import topMenu from '../../../support/fragments/topMenu'; +import getRandomStringCode from '../../../support/utils/genereteTextCode'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const organizationName = `AutoTest_${getRandomPostfix()}`; +const organizationCode = getRandomStringCode(6); + +const newOrganization = { + status: 'Active', + name: organizationName, + code: organizationCode, +}; + +const searchByCode = { + dropdown: 'Code', + code: organizationCode, +}; + +describe.skip('ui-organizations: Organizations creation', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Verifying deleted test data', () => { + organizations.searchByParameters(searchByCode.dropdown, searchByCode.code); + organizations.checkZeroSearchResultsHeader(); + }); + + it( + 'C677 Search an alternate organization name (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.organizationsPath); + organizations.createOrganizationViaUi(newOrganization); + organizations.searchByParameters( + searchByCode.dropdown, + searchByCode.code + ); + organizations.checkOrganizationNameSearchResults(newOrganization.code); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/serviceshift.cy.js b/cypress/e2e/ideyalabs/serviceshift.cy.js new file mode 100644 index 0000000000..a5dbec83bb --- /dev/null +++ b/cypress/e2e/ideyalabs/serviceshift.cy.js @@ -0,0 +1,180 @@ +import uuid from 'uuid'; +import { ITEM_STATUS_NAMES } from '../../support/constants'; +import TestTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +import TopMenu from '../../support/fragments/topMenu'; +import generateItemBarcode from '../../support/utils/generateItemBarcode'; +import getRandomPostfix from '../../support/utils/stringTools'; +import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; +import SwitchServicePoint from '../../support/fragments/servicePoint/switchServicePoint'; +import InTransit from '../../support/fragments/checkin/modals/inTransit'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import permissions from '../../support/dictionary/permissions'; +import UserEdit from '../../support/fragments/users/userEdit'; +import Users from '../../support/fragments/users/users'; +import checkInActions from '../../support/fragments/check-in-actions/checkInActions'; + +describe('Check In - Actions', () => { + const userData = {}; + const testData = { + servicePointS: ServicePoints.getDefaultServicePointWithPickUpLocation( + 'S', + uuid() + ), + servicePointS1: ServicePoints.getDefaultServicePointWithPickUpLocation( + 'S1', + uuid() + ), + }; + const itemData = { + barcode: generateItemBarcode() + 10, + title: `Instance_${getRandomPostfix()}`, + }; + const itemData1 = { + barcode: generateItemBarcode(), + title: `Instance_${getRandomPostfix()}`, + }; + + before('Preconditions', () => { + cy.getAdminToken() + .then(() => { + ServicePoints.createViaApi(testData.servicePointS); + ServicePoints.createViaApi(testData.servicePointS1); + testData.defaultLocation = Location.getDefaultLocation( + testData.servicePointS.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.createLoanType({ + name: `type_${getRandomPostfix()}`, + }).then((loanType) => { + testData.loanTypeId = loanType.id; + }); + cy.getMaterialTypes({ limit: 1 }).then((materialTypes) => { + testData.materialTypeId = materialTypes.id; + itemData.materialType = + materialTypes.name[0].toUpperCase() + materialTypes.name.slice(1); + }); + }) + .then(() => { + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId: testData.instanceTypeId, + title: itemData.title, + }, + holdings: [ + { + holdingsTypeId: testData.holdingTypeId, + permanentLocationId: testData.defaultLocation.id, + }, + ], + items: [ + { + barcode: itemData.barcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: testData.loanTypeId }, + materialType: { id: testData.materialTypeId }, + }, + { + barcode: itemData1.barcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: testData.loanTypeId }, + materialType: { id: testData.materialTypeId }, + }, + ], + }).then((specialInstanceIds) => { + itemData.instanceId = specialInstanceIds.instanceId; + itemData.holdingId = specialInstanceIds.holdingIds[0].id; + itemData.itemId = specialInstanceIds.holdingIds[0].itemIds; + }); + }); + + cy.createTempUser([ + permissions.checkinAll.gui, + permissions.uiRequestsView.gui, + permissions.inventoryAll.gui, + permissions.uiInventoryViewInstances.gui, + permissions.uiInventoryViewCreateEditHoldings.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiInventoryViewCreateEditItems.gui, + ]) + .then((userProperties) => { + userData.username = userProperties.username; + userData.password = userProperties.password; + userData.userId = userProperties.userId; + userData.barcode = userProperties.barcode; + }) + .then(() => { + UserEdit.addServicePointsViaApi( + [testData.servicePointS.id, testData.servicePointS1.id], + userData.userId, + testData.servicePointS.id + ); + cy.login(userData.username, userData.password); + }); + }); + + after('Deleting created entities', () => { + CheckInActions.checkinItemViaApi({ + itemBarcode: itemData.barcode, + servicePointId: testData.servicePointS.id, + checkInDate: new Date().toISOString(), + }); + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [ + testData.servicePointS.id, + testData.servicePointS1.id, + ]); + ServicePoints.deleteViaApi(testData.servicePointS.id); + ServicePoints.deleteViaApi(testData.servicePointS1.id); + Users.deleteViaApi(userData.userId); + cy.deleteItemViaApi(itemData.itemId[0]); + cy.deleteItemViaApi(itemData.itemId[1]); + cy.deleteHoldingRecordViaApi(itemData.holdingId); + InventoryInstance.deleteInstanceViaApi(itemData.instanceId); + Location.deleteViaApiIncludingInstitutionCampusLibrary( + testData.defaultLocation.institutionId, + testData.defaultLocation.campusId, + testData.defaultLocation.libraryId, + testData.defaultLocation.id + ); + cy.deleteLoanType(testData.loanTypeId); + }); + it( + 'C7148 Check In: item with at least one open request (vega)', + { tags: [TestTypes.criticalPath, devTeams.vega] }, + () => { + cy.visit(TopMenu.checkInPath); + CheckInActions.waitLoading(); + SwitchServicePoint.switchServicePoint(testData.servicePointS.name); + SwitchServicePoint.checkIsServicePointSwitched( + testData.servicePointS.name + ); + CheckInActions.checkInItemGui(itemData.barcode); + checkInActions.openItemDetails(); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItemGui(itemData.barcode); + checkInActions.verifyCheckIn(); + + cy.visit(TopMenu.checkInPath); + CheckInActions.waitLoading(); + SwitchServicePoint.switchServicePoint(testData.servicePointS1.name); + CheckInActions.checkInItemGui(itemData1.barcode); + InTransit.unselectCheckboxPrintSlip(); + InTransit.closeModal(); + checkInActions.openItemDetails(); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItemGui(itemData1.barcode); + checkInActions.verifyCheckIn(); + InTransit.unselectCheckboxPrintSlip(); + InTransit.closeModal(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/users.cy.js b/cypress/e2e/ideyalabs/users.cy.js new file mode 100644 index 0000000000..bc61340c72 --- /dev/null +++ b/cypress/e2e/ideyalabs/users.cy.js @@ -0,0 +1,114 @@ +import ledgers from '../../support/fragments/finance/ledgers/ledgers'; +import topMenu from '../../support/fragments/topMenu'; +import users from '../../support/fragments/users/users'; +import usersSearchPane from '../../support/fragments/users/usersSearchPane'; +import getRandomPostfix, { randomFourDigitNumber } from '../../support/utils/stringTools'; +import testTypes from '../../support/dictionary/testTypes'; + +const barcodeNumber = getRandomPostfix(); + +const userOne = { + patronGroup: 'A1A1', + barcode: barcodeNumber, + userName: `AutotestUser_${getRandomPostfix()}`, + personal: { + lastName: 'User', + firstName: 'Delete', + email: `dan${randomFourDigitNumber}@yopmail.com`, + }, +}; + +const userTwo = { + patronGroup: 'A1A1', + barcode: barcodeNumber, + userName: `AutotestUser_${getRandomPostfix()}`, + personal: { + lastName: 'User', + firstName: 'Delete', + email: `dan${randomFourDigitNumber}@yopmail.com`, + }, +}; + +const userThree = { + patronGroup: 'A1A1', + barcode: `678${randomFourDigitNumber}`, + userName: `Mann${randomFourDigitNumber}`, + personal: { + lastName: 'Script', + firstName: 'Auto', + email: `dan${randomFourDigitNumber}@yopmail.com`, + middleName: 'Test', + preferredFirstName: 'Dan', + }, +}; + +const deleteData = { + name: 'User Delete', + selectName: 'User, Delete', + lastName: 'Script', + selectLastName: 'Script Test', +}; + +const verifyData = { + verifyLastNameOnUserDetailsPane: 'Script', + verifyPreferredfirstnameOnUserDetailsPane: 'Dan', + verifyFirstNameOnUserDetailsPane: 'Auto', + verifyMiddleNameOnUserDetailsPane: 'Test', + verifyClearFirstNameDetailsPane: 'No value set-' +}; + +describe.skip('create a users', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(topMenu.usersPath); + }); + + after(() => { + usersSearchPane.searchByLastName(deleteData.lastName); + usersSearchPane.selectUsersFromList(deleteData.selectLastName); + users.deleteUser(); + users.checkZeroSearchResultsHeader(); + }); + + it('C421 Create: new user; required: contact info, email, phone, external system ID, address (Prokopovych)', { tags: [testTypes.ideaLabsTests] }, () => { + users.createViaUi(userOne); + cy.visit(topMenu.usersPath); + users.createViaUi(userTwo); + users.assertion(); + ledgers.closeOpenedPage(); + users.closeWithoutSavingButton(); + usersSearchPane.searchByKeywords(deleteData.name); + usersSearchPane.selectUsersFromList(deleteData.selectName); + users.deleteUser(); + users.checkZeroSearchResultsHeader(); + }); + + it('C11096 Add Preferred first name and confirm its display in the User record View and Edit screens (Volaris)', { tags: [testTypes.ideaLabsTests] }, () => { + users.createData(userThree); + users.verifyPreferredfirstnameOnUserDetailsPane( + verifyData.verifyPreferredfirstnameOnUserDetailsPane + ); + users.verifyLastNameOnUserDetailsPane( + verifyData.verifyLastNameOnUserDetailsPane + ); + users.verifyMiddleNameOnUserDetailsPane( + verifyData.verifyMiddleNameOnUserDetailsPane + ); + users.editButton(); + users.clearTextField(); + users.saveButton(); + users.verifyLastNameOnUserDetailsPane( + verifyData.verifyLastNameOnUserDetailsPane + ); + users.verifyMiddleNameOnUserDetailsPane( + verifyData.verifyMiddleNameOnUserDetailsPane + ); + users.verifyFirstNameOnUserDetailsPane( + verifyData.verifyFirstNameOnUserDetailsPane + ); + users.editButton(); + users.clearTextFieldFirstName(); + users.saveButton(); + users.verifyFirstNameOnUserDetailsPane(verifyData.verifyClearFirstNameDetailsPane); + }); +}); diff --git a/cypress/support/checkin.js b/cypress/support/checkin.js index 10cd363587..675eaae4e0 100644 --- a/cypress/support/checkin.js +++ b/cypress/support/checkin.js @@ -1,11 +1,6 @@ -import { - Button, - Modal, - MultiColumnList, - TextField, -} from '../../interactors'; +import { Button, Modal, MultiColumnList, TextField } from '../../interactors'; -Cypress.Commands.add('checkInItem', barcode => { +Cypress.Commands.add('checkInItem', (barcode) => { cy.do([ TextField('Item ID').fillIn(barcode), Button('Enter').click(), diff --git a/cypress/support/fragments/check-in-actions/checkInActions.js b/cypress/support/fragments/check-in-actions/checkInActions.js index 1165cf6572..572dcb01fd 100644 --- a/cypress/support/fragments/check-in-actions/checkInActions.js +++ b/cypress/support/fragments/check-in-actions/checkInActions.js @@ -13,7 +13,6 @@ import { } from '../../../../interactors'; import { REQUEST_METHOD } from '../../constants'; import { getLongDelay } from '../../utils/cypressTools'; -import ItemRecordView from '../inventory/item/itemRecordView'; const loanDetailsButton = Button('Loan details'); const patronDetailsButton = Button('Patron details'); @@ -28,10 +27,16 @@ const addItemButton = Button({ id: 'clickable-add-item' }); const availableActionsButton = Button({ id: 'available-actions-button-0' }); const confirmModal = Modal('Confirm multipiece check in'); const checkInButtonInModal = confirmModal.find(Button('Check in')); -const endSessionButton = Button('End session'); +const endSessionButton = Button({ id: 'clickable-end-session' }); const feeFineDetailsButton = Button('Fee/fine details'); const feeFinePane = PaneContent({ id: 'pane-account-action-history-content' }); - +const pieces = TextField({ id:'additem_numberofpieces' }); +const numberOfPieces = TextField({ name:'numberOfPieces' }); +const numberOfMissingPieces = TextField({ name:'numberOfMissingPieces' }); +const descriptionOfmissingPieces = TextField({ name:'missingPieces' }); +const actionsButton = Button('Actions'); +const editButton = Button('Edit'); +const closeButton = Button({ icon: 'times' }); const actionsButtons = { loanDetails: loanDetailsButton, patronDetails: patronDetailsButton, @@ -41,12 +46,11 @@ const actionsButtons = { printTransitSlip: printTransitSlipButton, printHoldSlip: printHoldSlipButton, }; - +const itemAnumberOfPieces = '2'; const waitLoading = () => { cy.expect(TextField({ name: 'item.barcode' }).exists()); cy.expect(Button('End session').exists()); }; - const checkInItemGui = (barcode) => { return cy.do([itemBarcodeField.exists(), itemBarcodeField.fillIn(barcode), @@ -59,7 +63,26 @@ export default { cy.expect(itemBarcodeField.exists()); cy.expect(Button('End session').exists()); }, - + clickonitem() { + cy.do(closeButton.click()); + }, + editItemDetails: (pieces, missingPieces, missingPiecesDescription) => { + cy.do([ + actionsButton.click(), + editButton.click(), + numberOfPieces.click(), + numberOfPieces.fillIn(pieces), + numberOfMissingPieces.click(), + numberOfMissingPieces.fillIn(missingPieces), + descriptionOfmissingPieces.click(), + descriptionOfmissingPieces.fillIn(missingPiecesDescription), + Button('Save & close').click(), + ]); + }, + endSession() { + cy.do(endSessionButton.click()); + // cy.expect(section('No items have been entered yet.').exists()) + }, checkInItem:(barcode) => { waitLoading(); cy.intercept('/inventory/items?*').as('getItems'); @@ -68,6 +91,10 @@ export default { cy.wait('@getItems', getLongDelay()); cy.wait(1000); }, + verifyCheckIn() { + cy.expect(checkInButtonInModal.exists()); + cy.do(checkInButtonInModal.click()); + }, checkInItemGui, getSessionIdAfterCheckInItem:(barcode) => { cy.intercept('/inventory/items?*').as('getItems'); @@ -80,6 +107,7 @@ export default { confirmCheckInLostItem:() => { cy.do(Button('Confirm').click()); }, + openItemRecordInInventory:(status) => { cy.expect(MultiColumnListRow({ indexRow: 'row-0' }).find(HTML(including(status))).exists()); cy.do(availableActionsButton.click()); @@ -89,6 +117,7 @@ export default { cy.wait('@getTags', getLongDelay()); ItemRecordView.waitLoading(); }, + checkActionsMenuOptions: (optionsToCheck = ['loanDetails', 'patronDetails', 'itemDetails', 'newFeeFine']) => { cy.expect(availableActionsButton.exists()); cy.do(availableActionsButton.click()); @@ -97,9 +126,11 @@ export default { }); cy.do(availableActionsButton.click()); }, + openCheckInPane: () => { cy.do(checkInButton.click()); }, + openLoanDetails: (username) => { cy.do([ availableActionsButton.click(), @@ -108,6 +139,7 @@ export default { cy.expect(Pane(including(username)).exists()); cy.expect(Pane(including('Loan details')).exists()); }, + openPatronDetails: (username) => { cy.do([ availableActionsButton.click(), @@ -115,6 +147,7 @@ export default { ]); cy.expect(Pane({ title: including(username) }).exists()); }, + openItemDetails: (itemBarcode) => { cy.do([ availableActionsButton.click(), @@ -122,6 +155,18 @@ export default { ]); cy.expect(Pane(including(itemBarcode)).exists()); }, + + openItemDetails2: () => { + cy.do([ + availableActionsButton.click(), + itemDetailsButton.click(), + Button('Actions').click(), + Button('Edit').click(), + pieces.fillIn(itemAnumberOfPieces), + Button('Save & close').click(), + ]); + }, + openRequestDetails: (itemBarcode) => { cy.do([ availableActionsButton.click(), @@ -130,6 +175,7 @@ export default { cy.expect(Pane(including('Request Detail')).exists()); cy.expect(HTML(including(itemBarcode)).exists()); }, + openNewfeefinesPane: () => { cy.do([ availableActionsButton.click(), @@ -137,6 +183,7 @@ export default { ]); cy.expect(Modal(including('New fee/fine')).exists()); }, + checkinItemViaApi: (body) => { return cy.okapiRequest({ method: REQUEST_METHOD.POST, @@ -148,15 +195,18 @@ export default { isDefaultSearchParamsRequired: false }); }, + confirmMultipleItemsCheckin(barcode) { cy.do(checkInButtonInModal.click()); cy.expect(MultiColumnList({ id:'list-items-checked-in' }).find(HTML(including(barcode))).exists()); }, + verifyLastCheckInItem(itemBarcode) { return cy.expect(MultiColumnListRow({ indexRow: 'row-0' }) .find(MultiColumnListCell({ content: including(itemBarcode) })) .exists()); }, + endCheckInSession:() => { cy.do(endSessionButton.click()); cy.intercept('/circulation/end-patron-action-session').as('end-patron-session'); @@ -164,6 +214,7 @@ export default { cy.wrap(xhr.response.statusCode).should('eq', 204); }); }, + checkFeeFinesDetails(billedAmount, instanceBarcode, loanPolicyName, OverdueFinePolicyName, LostItemFeePolicyName) { cy.do(availableActionsButton.click()); cy.do(feeFineDetailsButton.click()); diff --git a/cypress/support/fragments/circulation-log/searchPane.js b/cypress/support/fragments/circulation-log/searchPane.js index c8341629ee..25023ceab4 100644 --- a/cypress/support/fragments/circulation-log/searchPane.js +++ b/cypress/support/fragments/circulation-log/searchPane.js @@ -2,15 +2,15 @@ import { matching } from 'bigtest'; import { Accordion, Button, + Checkbox, + Dropdown, + DropdownMenu, MultiColumnListCell, MultiColumnListRow, - including, - TextField, + MultiSelect, Pane, - Dropdown, - DropdownMenu, - Checkbox, - MultiSelect + TextField, + including, } from '../../../../interactors'; import DateTools from '../../utils/dateTools'; import SearchResults from './searchResults'; @@ -19,18 +19,20 @@ import Users from '../users/users'; import ItemRecordView from '../inventory/item/itemRecordView'; import TopMenuNavigation from '../topMenuNavigation'; -const dropdownButton = MultiColumnListRow({ rowIndexInParent: 'row-0' }).find(Dropdown()).find(Button()); +const dropdownButton = MultiColumnListRow({ rowIndexInParent: 'row-0' }) + .find(Dropdown()) + .find(Button()); const actionsButton = Button('Actions'); -const servicePointField = MultiSelect({ ariaLabelledby: 'accordion-toggle-button-servicePointId' }); - - -// TODO: will rework to interactor when we get section id -function clickApplyMainFilter() { - cy.get('[class^="button-"][type="submit"]').first().click(); -} - +const servicePointField = MultiSelect({ + ariaLabelledby: 'accordion-toggle-button-servicePointId', +}); +const data = '4502015'; export default { + // TODO: will rework to interactor when we get section id + clickApplyMainFilter() { + cy.get('[class^="button-"][type="submit"]').first().click(); + }, waitLoading() { cy.expect(Pane('Circulation log').exists()); }, @@ -39,6 +41,7 @@ export default { cy.do([ Accordion({ id: 'loan' }).clickHeader(), Checkbox({ id: 'clickable-filter-loan-checked-out' }).click() + //,cy.do(TextField({ name: 'itemBarcode' }).fillIn(data)), ]); }, @@ -48,23 +51,23 @@ export default { searchByItemBarcode(barcode) { cy.do(TextField({ name: 'itemBarcode' }).fillIn(barcode)); - clickApplyMainFilter(); + this.clickApplyMainFilter(); }, searchByUserBarcode(barcode) { cy.do(TextField({ name: 'userBarcode' }).fillIn(barcode)); - clickApplyMainFilter(); + this.clickApplyMainFilter(); }, searchByDescription(desc) { cy.do(TextField({ name: 'description' }).fillIn(desc)); - clickApplyMainFilter(); + this.clickApplyMainFilter(); }, searchByChangedDueDate() { cy.do([ Accordion({ id: 'loan' }).clickHeader(), - Checkbox({ id: 'clickable-filter-loan-changed-due-date' }).click() + Checkbox({ id: 'clickable-filter-loan-changed-due-date' }).click(), ]); }, @@ -74,18 +77,41 @@ export default { servicePointField.choose(servicePoint), ]); }, + checkBarcode() { + cy.expect(Pane({ title: 'Circulation log' }).exists()); + cy.do([ + Accordion({ id: 'loan' }).clickHeader(), + Checkbox({ + id: 'clickable-filter-loan-renewed-through-override', + }).click(), + Button('Reset all').click(), + TextField({ name: 'itemBarcode' }).fillIn('1040'), + ]), + cy.get('[class^="button-"][type="submit"]').first().click(); + cy.expect(MultiColumnListRow().exists()); + }, + + checkElementText: () => { + cy.do([ + Checkbox({ + id: 'clickable-filter-loan-renewed-through-override', + }).click(), + TextField({ name: 'itemBarcode' }).fillIn(data), + ]); + this.clickApplyMainFilter(); + }, searchByClaimedReturned() { cy.do([ Accordion({ id: 'loan' }).clickHeader(), - Checkbox({ id: 'clickable-filter-loan-claimed-returned' }).click() + Checkbox({ id: 'clickable-filter-loan-claimed-returned' }).click(), ]); }, searchByMarkedAsMissing() { cy.do([ Accordion({ id: 'loan' }).clickHeader(), - Checkbox({ id: 'clickable-filter-loan-marked-as-missing' }).click() + Checkbox({ id: 'clickable-filter-loan-marked-as-missing' }).click(), ]); }, @@ -93,7 +119,7 @@ export default { // accordion = 'loan', 'notice', 'fee', 'request' cy.do([ Accordion({ id: accordion }).clickHeader(), - Checkbox(checkboxOption).click() + Checkbox(checkboxOption).click(), ]); }, @@ -103,7 +129,6 @@ export default { verifyResultCells(verifyDate = false) { const dateRegEx = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; - function getResultRowByRowNumber(rowNumber) { return { userBarcode: MultiColumnListCell({ row: rowNumber, columnIndex: 0, content: matching(/\d|/) }), @@ -118,10 +143,9 @@ export default { } // TODO: rework with interactor (now we don't have interactor for this) - return cy.get('#circulation-log-list').then(element => { + return cy.get('#circulation-log-list').then((element) => { // only 30 records shows on every page const resultCount = element.attr('data-total-count') > 29 ? 29 : element.attr('data-total-count'); - // verify every string in result table for (let i = 0; i < resultCount; i++) { const resultRow = getResultRowByRowNumber(i); @@ -133,7 +157,7 @@ export default { if (verifyDate) { cy.do( - resultRow.date.perform(el => { + resultRow.date.perform((el) => { const actualDate = new Date(el.textContent); const lastWeek = DateTools.getLastWeekDateObj(); const today = new Date(); @@ -174,10 +198,7 @@ export default { }, goToUserDetails() { - cy.do([ - dropdownButton.click(), - DropdownMenu().find(Button()).click() - ]); + cy.do([dropdownButton.click(), DropdownMenu().find(Button()).click()]); }, userDetailIsOpen() { @@ -185,10 +206,7 @@ export default { }, exportResults() { - cy.do([ - actionsButton.click(), - Button('Export results (CSV)').click(), - ]); + cy.do([actionsButton.click(), Button('Export results (CSV)').click()]); }, checkExportResultIsUnavailable() { diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 84044cd409..2cb50b0f2c 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -116,6 +116,7 @@ const newMarcBibButton = Button({ id: 'clickable-newmarcrecord' }); const quickMarcPaneHeader = PaneHeader({ id: 'paneHeaderquick-marc-editor-pane' }); const detailsPaneContent = PaneContent({ id: 'pane-instancedetails-content' }); const administrativeDataAccordion = Accordion('Administrative data'); +const unlinkIconButton = Button({ icon: 'unlink' }); const validOCLC = { id:'176116217', // TODO: hardcoded count related with interactors getters issue. Redesign to cy.then(QuickMarkEditor().rowsCount()).then(rowsCount => {...} @@ -237,11 +238,31 @@ export default { cy.expect(section.find(HTML(including('FOLIO'))).absent()); }, + verifyUnlinkIcon(tag) { + // Waiter needed for the link to be loaded properly. + cy.expect(QuickMarcEditorRow({ tagValue: tag }).find(unlinkIconButton).exists()); + }, + + verifyLinkIcon(tag) { + // Waiter needed for the link to be loaded properly. + cy.expect(QuickMarcEditorRow({ tagValue: tag }).find(linkIconButton).exists()); + }, + goToEditMARCBiblRecord:() => { cy.do(actionsButton.click()); cy.do(editMARCBibRecordButton.click()); }, + selectTopRecord() { + cy.do(MultiColumnListRow({ index: 0 }).find(MultiColumnListCell({ columnIndex: 1 })).find(Button()).click()); + }, + + deriveNewMarcBibRecord:() => { + cy.do(actionsButton.click()); + cy.do(deriveNewMarcBibRecord.click()); + cy.expect(QuickMarcEditor().exists()); + }, + viewSource: () => { cy.do(actionsButton.click()); cy.do(viewSourceButton.click()); @@ -256,7 +277,7 @@ export default { cy.expect([ quickMarcEditorPane.exists(), quickMarcPaneHeader.has({ text: including('new') }), - ]) + ]); }, checkInstanceTitle(title) { @@ -304,6 +325,12 @@ export default { }); }, + verifyAndClickUnlinkIcon(tag) { + // Waiter needed for the link to be loaded properly. + cy.wait(1000); + cy.do(QuickMarcEditorRow({ tagValue: tag }).find(unlinkIconButton).click()); + }, + clickViewAuthorityIconDisplayedInInstanceDetailsPane(accordion) { cy.wrap(Accordion(accordion).find(Link()).href()).as('link'); cy.get('@link').then((link) => { @@ -600,6 +627,7 @@ export default { InventoryInstanceSelectInstanceModal.selectInstance(); InventoryInstancesMovement.move(); }, + moveHoldingsToAnotherInstanceByItemTitle: (holdingName, title) => { cy.do(actionsButton.click()); cy.do(moveHoldingsToAnotherInstanceButton.click()); @@ -608,6 +636,7 @@ export default { InventoryInstanceSelectInstanceModal.selectInstance(); InventoryInstancesMovement.moveFromMultiple(holdingName, title); }, + checkAddItem:(holdingsRecordId) => { cy.expect(section.find(Section({ id:holdingsRecordId })) .find(Button({ id: `clickable-new-item-${holdingsRecordId}` })) diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index b367f5c77f..80faaff16a 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -1,30 +1,31 @@ -import uuid from 'uuid'; import { HTML, including } from '@interactors/html'; +import uuid from 'uuid'; import { - MultiColumnList, - MultiColumnListCell, - MultiColumnListHeader, - Pane, Accordion, - Checkbox, - TextField, Button, - SearchField, - Select, + Checkbox, + DropdownMenu, Form, - TextInput, KeyValue, - Section, + MultiColumnList, + MultiColumnListCell, + MultiColumnListHeader, + MultiColumnListRow, MultiSelect, MultiSelectOption, - MultiColumnListRow, - DropdownMenu + Pane, + SearchField, + Section, + Select, + Spinner, + TextField, + TextInput } from '../../../../interactors'; -import InventoryActions from './inventoryActions'; -import InventoryInstances from './inventoryInstances'; -import logsViewAll from '../data_import/logs/logsViewAll'; import DateTools from '../../utils/dateTools'; +import logsViewAll from '../data_import/logs/logsViewAll'; import Helper from '../finance/financeHelper'; +import InventoryActions from './inventoryActions'; +import InventoryInstances from './inventoryInstances'; const searchAndFilterSection = Pane({ id: 'browse-inventory-filters-pane' }); const effectiveLocationInput = Accordion({ id: 'effectiveLocation' }); @@ -34,11 +35,15 @@ const keywordInput = TextField({ id: 'input-inventory-search' }); const searchButton = Button({ type: 'submit' }); const searchTextField = TextField('Search '); const inventorySearchAndFilter = TextInput({ id: 'input-inventory-search' }); -const inventorySearchAndFilterInput = Select({ id: 'input-inventory-search-qindex' }); +const inventorySearchAndFilterInput = Select({ + id: 'input-inventory-search-qindex', +}); const browseSearchAndFilterInput = Select({ id: 'input-record-search-qindex' }); const resetAllButton = Button({ id: 'clickable-reset-all' }); const resetAllBtn = Button('Reset all'); -const navigationInstancesButton = Button({ id: 'segment-navigation-instances' }); +const navigationInstancesButton = Button({ + id: 'segment-navigation-instances', +}); const paneFilterSection = Section({ id: 'pane-filter' }); const paneResultsSection = Section({ id: 'pane-results' }); const instanceDetailsSection = Section({ id: 'pane-instancedetails' }); @@ -46,11 +51,14 @@ const instancesTagsSection = Section({ id: 'instancesTags' }); const tagsPane = Pane('Tags'); const tagsButton = Button({ id: 'clickable-show-tags' }); const tagsAccordionButton = instancesTagsSection.find(Button('Tags')); -const emptyResultsMessage = 'Choose a filter or enter a search query to show results.'; +const emptyResultsMessage = + 'Choose a filter or enter a search query to show results.'; const browseButton = Button({ id: 'mode-navigation-browse' }); const viewHoldingButton = Button('View holdings'); -const statisticalCodeAccordion = Accordion({ id:'itemsStatisticalCodeIds' }); -const holdingsPermanentLocationAccordion = Accordion({ id:'holdingsPermanentLocation' }); +const statisticalCodeAccordion = Accordion({ id: 'itemsStatisticalCodeIds' }); +const holdingsPermanentLocationAccordion = Accordion({ + id: 'holdingsPermanentLocation', +}); const callNumberBrowsePane = Pane({ title: 'Browse inventory' }); const actionsButton = Button('Actions'); const editInstanceButton = Button('Edit instance'); @@ -62,7 +70,8 @@ const instancesList = paneResultsSection.find(MultiColumnList({ id: 'list-invent const searchInstanceByHRID = (id) => { cy.do([ Select({ id: 'input-inventory-search-qindex' }).choose('Instance HRID'), - TextField({ id: 'input-inventory-search' }).fillIn(id) + TextField({ id: 'input-inventory-search' }).fillIn(id), + searchButton.click(), ]); cy.wait(1000); cy.do(searchButton.click()); @@ -73,7 +82,7 @@ const searchHoldingsByHRID = (hrid) => { cy.do([ Select({ id: 'input-inventory-search-qindex' }).choose('Holdings HRID'), TextField({ id: 'input-inventory-search' }).fillIn(hrid), - searchButton.click() + searchButton.click(), ]); InventoryInstances.waitLoading(); }; @@ -81,7 +90,7 @@ const searchHoldingsByHRID = (hrid) => { const searchInstanceByTitle = (title) => { cy.do([ TextField({ id: 'input-inventory-search' }).fillIn(title), - searchButton.click() + searchButton.click(), ]); InventoryInstances.waitLoading(); }; @@ -122,13 +131,19 @@ const getInstanceHRID = () => { const checkInstanceDetails = () => { // when creating mapping profile we choose status cataloged date as today // in inventory, it will be in YYYY-MM-DD format - const expectedCatalogedDate = DateTools.getFormattedDate({ date: new Date() }); + const expectedCatalogedDate = DateTools.getFormattedDate({ + date: new Date(), + }); // when creating mapping profile we choose instance status term as "Batch Loaded" // in inventory, this will be "batch" for status code and "Batch Loaded" for status term const expectedStatusTerm = 'Batch Loaded'; const expectedStatusCode = 'batch'; - cy.do(Pane({ id:'pane-results' }).find(MultiColumnListCell({ row: 0, columnIndex: 1 })).click()); + cy.do( + Pane({ id: 'pane-results' }) + .find(MultiColumnListCell({ row: 0, columnIndex: 1 })) + .click() + ); const catalogedDate = KeyValue('Cataloged date'); const instanceStatusTerm = KeyValue('Instance status term'); const instanceStatusCode = KeyValue('Instance status code'); @@ -145,17 +160,29 @@ export default { getInstanceHRID, checkInstanceDetails, getAllSearchResults: () => MultiColumnList(), - getSearchResult: (row = 0, col = 0) => paneResultsSection.find(MultiColumnListCell({ 'row': row, 'columnIndex': col })), + getSearchResult: (row = 0, col = 0) => paneResultsSection.find( + MultiColumnListCell({ row, columnIndex: col }) + ), waitLoading: () => cy.expect([Form().find(inventorySearchAndFilter).exists()]), browseCallNumberIsAbsent: () => cy.expect(HTML('Browse call numbers').absent()), browseSubjectIsAbsent: () => cy.expect(HTML('Browse subjects').absent()), effectiveLocation: { - mainLibrary: { id: 'clickable-filter-effectiveLocation-main-library' } + mainLibrary: { id: 'clickable-filter-effectiveLocation-main-library' }, + }, + selectSearchResultByRowIndex(indexRow) { + cy.do(this.getSearchResult(indexRow, 0).click()); + // must wait page render + cy.wait(2000); + }, + selectSearchResultByRowIndex(indexRow) { + cy.expect(Spinner().absent()); + cy.do(this.getSearchResult(indexRow, 0).click()); + cy.expect(Spinner().absent()); }, language: { - eng: { id: 'clickable-filter-language-english' } + eng: { id: 'clickable-filter-language-english' }, }, selectResultCheckboxes(count) { @@ -171,11 +198,16 @@ export default { // must wait page render cy.wait(2000); }, + clickSearchResultItem(indexRow = 8) { + cy.do(this.getSearchResult(indexRow, 0).click()); + }, byEffectiveLocation(values) { return cy.do([ effectiveLocationInput.clickHeader(), - effectiveLocationInput.find(Checkbox(values ?? this.effectiveLocation.mainLibrary)).click() + effectiveLocationInput + .find(Checkbox(values ?? this.effectiveLocation.mainLibrary)) + .click(), ]); }, @@ -183,22 +215,20 @@ export default { // lang: language object. Example: language.eng return cy.do([ languageInput.clickHeader(), - languageInput.find(Checkbox(lang ?? this.language.eng)).click() + languageInput.find(Checkbox(lang ?? this.language.eng)).click(), ]); }, bySource(source) { cy.do([ sourceAccordion.clickHeader(), - sourceAccordion.find(Checkbox(source)).click()]); + sourceAccordion.find(Checkbox(source)).click(), + ]); cy.expect(MultiColumnListRow().exists()); }, byKeywords(kw = '*') { - cy.do([ - keywordInput.fillIn(kw), - searchButton.click(), - ]); + cy.do([keywordInput.fillIn(kw), searchButton.click()]); cy.expect(MultiColumnListRow().exists()); }, @@ -207,7 +237,7 @@ export default { // cypress can't draw selected option without wait // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); - cy.do(Select('Search field index').choose('Call numbers (all)')); + cy.do(Select('Search field index').choose('Call numbers')); cy.expect(effectiveLocationInput.exists()); }, @@ -254,7 +284,7 @@ export default { verifyBrowseOptions() { cy.do(browseSearchAndFilterInput.click()); cy.expect([ - browseSearchAndFilterInput.has({ content: including('Call numbers (all)') }), + browseSearchAndFilterInput.has({ content: including('Call numbers') }), browseSearchAndFilterInput.has({ content: including('Contributors') }), browseSearchAndFilterInput.has({ content: including('Subjects') }), ]); @@ -273,15 +303,25 @@ export default { verifyCallNumberBrowseEmptyPane() { cy.expect(callNumberBrowsePane.exists()); - cy.expect(callNumberBrowsePane.has({ subtitle: 'Enter search criteria to start browsing' })); - cy.expect(HTML(including('Browse for results entering a query or choosing a filter.')).exists()); + cy.expect( + callNumberBrowsePane.has({ + subtitle: 'Enter search criteria to start browsing', + }) + ); + cy.expect( + HTML( + including('Browse for results entering a query or choosing a filter.') + ).exists() + ); }, verifyCallNumberBrowseNotEmptyPane() { cy.expect([ callNumberBrowsePane.exists(), Pane({ subtitle: 'Enter search criteria to start browsing' }).absent(), - HTML(including('Browse for results entering a query or choosing a filter.')).absent() + HTML( + including('Browse for results entering a query or choosing a filter.') + ).absent(), ]); }, @@ -293,7 +333,8 @@ export default { cy.expect( callNumberBrowsePane .find(MultiColumnList({ id: 'browse-results-list-browseSubjects' })) - .find(MultiColumnListRow({ indexRow: 'row-0' })).exists() + .find(MultiColumnListRow({ indexRow: 'row-0' })) + .exists() ); }, @@ -301,7 +342,8 @@ export default { cy.expect( callNumberBrowsePane .find(MultiColumnList({ id: 'browse-results-list-callNumbers' })) - .find(MultiColumnListCell(item)).exists() + .find(MultiColumnListCell(item)) + .exists() ); }, @@ -327,12 +369,18 @@ export default { getUUIDsFromRequest(req) { const expectedUUIDs = []; - req.response.body.ids.forEach((elem) => { expectedUUIDs.push(elem.id); }); + req.response.body.ids.forEach((elem) => { + expectedUUIDs.push(elem.id); + }); return expectedUUIDs; }, verifySelectedRecords(selected) { - cy.expect(Pane('Inventory').is({ subtitle: including(`records found${selected} records selected`) })); + cy.expect( + Pane('Inventory').is({ + subtitle: including(`records found${selected} records selected`), + }) + ); }, searchByParameter: (parameter, value) => { @@ -346,18 +394,24 @@ export default { switchToInstance: () => cy.do(navigationInstancesButton.click()), instanceTabIsDefault() { - cy.do(navigationInstancesButton.perform(element => { - expect(element.classList[2]).to.include('primary'); - })); + cy.do( + navigationInstancesButton.perform((element) => { + expect(element.classList[2]).to.include('primary'); + }) + ); }, browseSubjectsSearch(searchString = 'test123') { cy.do([ browseButton.click(), TextField({ id: 'input-record-search' }).fillIn(searchString), - searchButton.click() + searchButton.click(), ]); - cy.expect(Pane({ id: 'browse-inventory-results-pane' }).find(MultiColumnListHeader()).exists()); + cy.expect( + Pane({ id: 'browse-inventory-results-pane' }) + .find(MultiColumnListHeader()) + .exists() + ); }, verifySearchResult: (cellContent) => cy.expect(MultiColumnListCell({ content: cellContent }).exists()), @@ -373,7 +427,8 @@ export default { query: `(identifiers.value="${identifier}" or isbn="${identifier}") sortby title`, }, isDefaultSearchParamsRequired: false, - }).then(({ body: { instances } }) => { + }) + .then(({ body: { instances } }) => { return instances; }); }, @@ -386,10 +441,11 @@ export default { searchParams: { limit, highlightMatch: true, - query: `(subjects="${subject}") sortby title` + query: `(subjects="${subject}") sortby title`, }, isDefaultSearchParamsRequired: false, - }).then(({ body: { instances } }) => { + }) + .then(({ body: { instances } }) => { return instances; }); }, @@ -407,10 +463,8 @@ export default { checkContributorRequest() { cy.intercept('GET', '/search/instances?*').as('getInstances'); - this.clickSearch(); - - cy.wait('@getInstances').then(interception => { + cy.wait('@getInstances').then((interception) => { // checking that request contains '=' after 'contributors.name' expect(interception.request.url).to.include('contributors.name%3D'); }); @@ -433,7 +487,11 @@ export default { }, checkContributorsColumResult(cellContent) { - cy.expect(MultiColumnList({ id: 'list-inventory' }).find(MultiColumnListCell(including(cellContent))).exists()); + cy.expect( + MultiColumnList({ id: 'list-inventory' }) + .find(MultiColumnListCell(including(cellContent))) + .exists() + ); }, checkMissingSearchResult(cellContent) { @@ -449,13 +507,15 @@ export default { cy.do([ tagsAccordionButton.click(), instancesTagsSection.find(TextField()).fillIn(tag), - instancesTagsSection.find(Checkbox(tag)).click() + instancesTagsSection.find(Checkbox(tag)).click(), ]); }, resetAllAndVerifyNoResultsAppear() { cy.do(resetAllButton.click()); - cy.expect(paneResultsSection.find(HTML(including(emptyResultsMessage))).exists()); + cy.expect( + paneResultsSection.find(HTML(including(emptyResultsMessage))).exists() + ); }, closeInstanceDetailPane() { @@ -508,7 +568,9 @@ export default { verifyShelvingOrder(val) { cy.get('#input-inventory-search-qindex').then((elem) => { - expect(elem.text()).to.include('Effective call number (item), shelving order'); + expect(elem.text()).to.include( + 'Effective call number (item), shelving order' + ); }); cy.expect(inventorySearchAndFilter.has({ value: val })); }, @@ -525,24 +587,29 @@ export default { instanceTypeId: null, }; - return cy.getInstanceTypes({ limit: 1 }) - .then(instanceTypes => { + return cy + .getInstanceTypes({ limit: 1 }) + .then((instanceTypes) => { instanceData.instanceTypeId = instanceTypes[0].id; - }).then(() => { + }) + .then(() => { cy.createInstance({ instance: { instanceId: instanceData.instanceId, instanceTypeId: instanceData.instanceTypeId, title: instanceData.instanceTitle, - } + }, }); - }).then(() => ({ instanceData })); + }) + .then(() => ({ instanceData })); }, - selectViewHoldings:() => cy.do(viewHoldingButton.click()), + selectViewHoldings: () => cy.do(viewHoldingButton.click()), - filterItemByStatisticalCode:(code) => { - cy.do(Button({ id:'accordion-toggle-button-itemsStatisticalCodeIds' }).click()); + filterItemByStatisticalCode: (code) => { + cy.do( + Button({ id: 'accordion-toggle-button-itemsStatisticalCodeIds' }).click() + ); // need to wait until data will be loaded cy.wait(1000); cy.do(statisticalCodeAccordion.find(TextField()).fillIn(code)); @@ -555,7 +622,7 @@ export default { browseSearch(searchValue) { cy.do([ TextField({ id: 'input-record-search' }).fillIn(searchValue), - searchButton.click() + searchButton.click(), ]); }, @@ -578,13 +645,14 @@ export default { cy.do(Button({ id:'accordion-toggle-button-holdingsPermanentLocation' }).click()); // need to wait until data will be loaded cy.wait(1000); - cy.do(holdingsPermanentLocationAccordion.find(TextField()).fillIn(location)); + cy.do( + holdingsPermanentLocationAccordion.find(TextField()).fillIn(location) + ); // need to wait until data will be loaded cy.wait(1000); holdingsPermanentLocationAccordion.find(TextField()).click(); cy.do(holdingsPermanentLocationAccordion.find(Checkbox(location)).click()); }, - checkRowsCount:(expectedRowsCount) => { cy.expect([ instancesList.find(MultiColumnListRow({ index: expectedRowsCount - 1 })).exists(), diff --git a/cypress/support/fragments/marcAuthority/MarcAuthorityBrowse.js b/cypress/support/fragments/marcAuthority/MarcAuthorityBrowse.js index 83a9572aaf..4255e11b04 100644 --- a/cypress/support/fragments/marcAuthority/MarcAuthorityBrowse.js +++ b/cypress/support/fragments/marcAuthority/MarcAuthorityBrowse.js @@ -45,7 +45,7 @@ export default { searchBy:(searchOption, value) => { cy.do(searchInput.fillIn(value)); - cy.expect(searchInput.has({ value: value })); + cy.expect(searchInput.has({ value })); cy.do(browseSearchAndFilterInput.choose(searchOption)); cy.get('#textarea-authorities-search-qindex').then((elem) => { expect(elem.text()).to.include(searchOption); @@ -55,7 +55,7 @@ export default { }, searchByChangingParameter(searchOption, value) { - cy.expect(searchInput.has({ value: value })); + cy.expect(searchInput.has({ value })); // Waiter required for the search option to be loaded. cy.wait(500); cy.do(browseSearchAndFilterInput.choose(searchOption)); @@ -71,7 +71,7 @@ export default { expect(elem.text()).to.include(searchOption); }); cy.do(searchInput.fillIn(value)); - cy.expect(searchInput.has({ value: value })); + cy.expect(searchInput.has({ value })); cy.expect(enabledSearchButton.exists()); cy.do(searchButton.click()); }, @@ -106,34 +106,34 @@ export default { checkResultWithValue(auth, value) { cy.expect([ - MultiColumnListCell({content: auth}).exists(), - MultiColumnListCell({content: value}).exists(), + MultiColumnListCell({ content: auth }).exists(), + MultiColumnListCell({ content: value }).exists(), ]); }, checkResultWithValueA(valueA, auth, valueAuth, ref, valueRef) { cy.expect([ - MultiColumnListCell({content: `${valueA} would be here`}).exists(), - MultiColumnListCell({content: auth}).exists(), - MultiColumnListCell({content: valueAuth}).exists(), - MultiColumnListCell({content: ref}).exists(), - MultiColumnListCell({content: valueRef}).exists(), + MultiColumnListCell({ content: `${valueA} would be here` }).exists(), + MultiColumnListCell({ content: auth }).exists(), + MultiColumnListCell({ content: valueAuth }).exists(), + MultiColumnListCell({ content: ref }).exists(), + MultiColumnListCell({ content: valueRef }).exists(), ]); }, checkResultWithValueB(auth, valueAuth, ref, valueRef) { cy.expect([ - MultiColumnListCell({content: auth}).exists(), - MultiColumnListCell({content: valueAuth}).exists(), - MultiColumnListCell({content: ref}).exists(), - MultiColumnListCell({content: valueRef}).exists(), + MultiColumnListCell({ content: auth }).exists(), + MultiColumnListCell({ content: valueAuth }).exists(), + MultiColumnListCell({ content: ref }).exists(), + MultiColumnListCell({ content: valueRef }).exists(), ]); }, checkHeadingReference: (headingReference) => { cy.expect([ - rootSection.find(MultiColumnListRow({ rowIndexInParent: `row-0` })).find(MultiColumnListCell({ content: `${headingReference}\xa0would be here` })), - rootSection.find(MultiColumnListRow({ rowIndexInParent: `row-1` })).find(MultiColumnListCell({ content: headingReference })), + rootSection.find(MultiColumnListRow({ rowIndexInParent: 'row-0' })).find(MultiColumnListCell({ content: `${headingReference}\xa0would be here` })), + rootSection.find(MultiColumnListRow({ rowIndexInParent: 'row-1' })).find(MultiColumnListCell({ content: headingReference })), ]); }, }; diff --git a/cypress/support/fragments/marcAuthority/marcAuthorities.js b/cypress/support/fragments/marcAuthority/marcAuthorities.js index fd1a0910b0..e923bd44c7 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthorities.js +++ b/cypress/support/fragments/marcAuthority/marcAuthorities.js @@ -1,4 +1,4 @@ -import { MultiColumnList, Modal, TextField, Callout, MultiSelect, MultiSelectOption, QuickMarcEditorRow, Pane, PaneContent, PaneHeader, Select, Section, HTML, including, Button, MultiColumnListCell, MultiColumnListRow, SearchField, Accordion, Checkbox, ColumnHeader, AdvancedSearchRow, Link } from '../../../../interactors'; +import { Accordion, AdvancedSearchRow, Button, Callout, Checkbox, ColumnHeader, HTML, Link, Modal, MultiColumnList, MultiColumnListCell, MultiColumnListRow, MultiSelect, MultiSelectOption, Pane, PaneContent, PaneHeader, QuickMarcEditorRow, SearchField, Section, Select, TextField, including } from '../../../../interactors'; const rootSection = Section({ id: 'authority-search-results-pane' }); const authoritiesList = rootSection.find(MultiColumnList({ id: 'authority-result-list' })); @@ -51,6 +51,18 @@ export default { cy.do(searchNav.click()); }, + searchBeats(value) { + cy.do((SearchField({ id: 'textarea-authorities-search' })).fillIn(value)); + cy.do((Button({ id: 'submit-authorities-search' })).click()); + }, + + checkFieldTagExists: () => { + cy.expect([ + editorSection.exists(), + QuickMarcEditorRow({ tagValue: '625' }).exists() + ]); + }, + fillReportModal: (today, tomorrow) => { cy.do([ fromDate.fillIn(today), @@ -98,14 +110,14 @@ export default { }, clickOnNumberOfTitlesLink(columnIndex, linkValue) { - cy.wrap(MultiColumnListCell({columnIndex: columnIndex, content: linkValue }).find(Link()).href()).as('link'); + cy.wrap(MultiColumnListCell({ columnIndex, content: linkValue }).find(Link()).href()).as('link'); cy.get('@link').then((link) => { cy.visit(link); }); }, verifyNumberOfTitles(columnIndex, linkValue) { - cy.expect(MultiColumnListCell({columnIndex: columnIndex, content: linkValue }).find(Link()).exists()); + cy.expect(MultiColumnListCell({ columnIndex, content: linkValue }).find(Link()).exists()); }, verifyFirstValueSaveSuccess(successMsg, txt) { @@ -281,11 +293,11 @@ export default { clickAccordionAndCheckResultList(accordion, record) { cy.do(Accordion(accordion).clickHeader()); - cy.expect(MultiColumnListCell({ content: including(record) }).exists()) + cy.expect(MultiColumnListCell({ content: including(record) }).exists()); }, chooseAuthoritySourceOption: (option) => { - cy.do(MultiSelect({ ariaLabelledby: 'sourceFileId-multiselect-label' }).select([including(option)])); + cy.do(MultiSelect({ ariaLabelledby: 'sourceFileId-multiselect-label' }).select([including(option)])); }, clickActionsButton() { diff --git a/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js b/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js index 05eaf271ad..044d1b302e 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js +++ b/cypress/support/fragments/marcAuthority/marcAuthoritiesDelete.js @@ -2,6 +2,7 @@ import { MultiColumnListCell, including, Button, PaneHeader, DropdownMenu, Headi const actionsButton = PaneHeader({ id: 'paneHeadermarc-view-pane' }).find(Button('Actions')); const deleteButton = DropdownMenu().find(Button('Delete')); +const printButton = DropdownMenu().find(Button('Print')); const deleteConfirmModal = Modal({ id: 'confirm-delete-note' }); const deleteConfirmModalHeader = Heading({ id: 'confirm-delete-note-label' }); const confirmDeleteButton = deleteConfirmModal.find(Button('Delete')); @@ -24,6 +25,12 @@ export default { confirmDeleteButton.exists(), ]); }, + clickprintButton() { + cy.do([ + actionsButton.click(), + printButton.click(), + ]); + }, checkDeleteModalMessage(message) { cy.expect(deleteConfirmModal.has({ message: message })); diff --git a/cypress/support/fragments/marcAuthority/marcAuthority.js b/cypress/support/fragments/marcAuthority/marcAuthority.js index a338a44138..b49ff44bb6 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthority.js +++ b/cypress/support/fragments/marcAuthority/marcAuthority.js @@ -95,6 +95,15 @@ export default { QuickMarcEditorRow({ index: rowIndex + 1 }).find(TextArea({ name: `records[${rowIndex + 1}].content` })).fillIn(content), ]); }, + checkLinkingAuthority650: () => { + cy.expect(buttonLink.exists()); + cy.expect(Callout('Field 650 has been linked to a MARC authority record.').exists()); + }, + + checkLinkingAuthority700: () => { + cy.expect(buttonLink.exists()); + cy.expect(Callout('Field 700 has been linked to a MARC authority record.').exists()); + }, changeField: (tag, content) => { cy.do([ QuickMarcEditorRow({ tagValue: tag }).find(TextArea()).fillIn(content), diff --git a/cypress/support/fragments/users/users.js b/cypress/support/fragments/users/users.js index f83ed6b0a3..19d4402af1 100644 --- a/cypress/support/fragments/users/users.js +++ b/cypress/support/fragments/users/users.js @@ -1,19 +1,30 @@ import { including } from '@interactors/html'; -import getRandomPostfix from '../../utils/stringTools'; import { + Accordion, Button, - Select, - TextField, - Pane, Dropdown, - MultiColumnListCell, KeyValue, - Accordion, + MultiColumnListCell, + Pane, + PaneHeader, + Section, + Select, + TextField, } from '../../../../interactors'; +import getRandomPostfix from '../../utils/stringTools'; const userDetailsPane = Pane({ id: 'pane-userdetails' }); const contactInformationAccordion = Accordion('Contact information'); -const defaultUserName = `AutotestUser${getRandomPostfix()}`; +const defaultUserName = `AutotestUser_${getRandomPostfix()}`; +const editButton = Button('Edit'); +const barCode = TextField('Barcode'); +const deleteUser = Button({ id: 'clickable-checkdeleteuser' }); +const closeWithoutSavingButton = Button({ id: 'clickable-cancel-editing-confirmation-cancel' }); +const deleteYesButton = Button({ id: 'delete-user-button' }); +// As we checking number of search results value but we dont have intaractor to get value so using xpath for this method +const zeroResultsFoundText = '0 records found'; +const numberOfSearchResultsHeader = '//p[@id="paneHeaderusers-search-results-pane-subtitle"]'; + const defaultUser = { username: defaultUserName, active: true, @@ -28,12 +39,11 @@ const defaultUser = { }, // should be defined patronGroup: undefined, - departments: [] + departments: [], }; export default { defaultUser, - createViaApi: (user) => cy.okapiRequest({ method: 'POST', path: 'users', @@ -46,10 +56,10 @@ export default { firstName : response.body.personal.firstName, middleName : response.body.personal.middleName })), - deleteViaApi:(userId) => cy.okapiRequest({ + deleteViaApi: (userId) => cy.okapiRequest({ method: 'DELETE', path: `bl-users/by-id/${userId}`, - isDefaultSearchParamsRequired : false + isDefaultSearchParamsRequired: false, }), createViaUi: (userData) => { @@ -67,6 +77,36 @@ export default { }); }, + assertion: () => { + cy.do(barCode.has({ error: 'This barcode has already been taken' })); + }, + + closeWithoutSavingButton: () => { + cy.do([closeWithoutSavingButton.click()]); + }, + + createData: (userData) => { + return cy.do([ + Dropdown('Actions').find(Button()).click(), + Button({ id: 'clickable-newuser' }).click(), + TextField({ id: 'adduser_lastname' }).fillIn(userData.personal.lastName), + TextField({ id: 'adduser_middlename' }).fillIn( + userData.personal.middleName + ), + TextField({ id: 'adduser_firstname' }).fillIn( + userData.personal.firstName + ), + Select({ id: 'adduser_group' }).choose(userData.patronGroup), + TextField({ name: 'barcode' }).fillIn(userData.barcode), + TextField({ name: 'username' }).fillIn(userData.userName), + TextField({ id: 'adduser_email' }).fillIn(userData.personal.email), + TextField({ id: 'adduser_preferredname' }).fillIn( + userData.personal.preferredFirstName + ), + Button({ id: 'clickable-save' }).click(), + ]); + }, + checkIsUserCreated: (userData) => { cy.expect(Pane(userData.personal.lastName).exists()); }, @@ -80,34 +120,102 @@ export default { checkPatronIsNotBlocked: (userId) => { cy.intercept(`/automated-patron-blocks/${userId}`).as('patronBlockStatus'); - cy.wait('@patronBlockStatus', { timeout: 10000 }).then(xhr => { + cy.wait('@patronBlockStatus', { timeout: 10000 }).then((xhr) => { cy.wrap(xhr.response.body.automatedPatronBlocks.length).should('eq', 0); - cy.expect(TextField({ value:'Patron has block(s) in place' }).absent()); + cy.expect(TextField({ value: 'Patron has block(s) in place' }).absent()); }); }, verifyFirstNameOnUserDetailsPane(firstName) { - cy.expect(userDetailsPane.find(KeyValue('First name')).has({ value: `${firstName}` })); + cy.expect( + userDetailsPane + .find(KeyValue('First name')) + .has({ value: `${firstName}` }) + ); + }, + + verifyLastNameOnUserDetailsPane(lastName) { + cy.expect( + userDetailsPane.find(KeyValue('Last name')).has({ value: `${lastName}` }) + ); }, verifyMiddleNameOnUserDetailsPane(middleName) { - cy.expect(userDetailsPane.find(KeyValue('Middle name')).has({ value: `${middleName}` })); + cy.expect( + userDetailsPane + .find(KeyValue('Middle name')) + .has({ value: `${middleName}` }) + ); + }, + + verifyPreferredfirstnameOnUserDetailsPane(Preferredfirstname) { + cy.expect( + userDetailsPane + .find(KeyValue('Preferred first name')) + .has({ value: `${Preferredfirstname}` }) + ); }, verifyPatronGroupOnUserDetailsPane(patronGroup) { - cy.expect(userDetailsPane.find(KeyValue('Patron group')).has({ value: `${patronGroup}` })); + cy.expect( + userDetailsPane + .find(KeyValue('Patron group')) + .has({ value: `${patronGroup}` }) + ); }, verifyEmailDomainOnUserDetailsPane(emailDomain) { cy.do(contactInformationAccordion.clickHeader()); - cy.expect(userDetailsPane.find(KeyValue('Email')).has({ value: including(`@${emailDomain}`) })); + cy.expect( + userDetailsPane + .find(KeyValue('Email')) + .has({ value: including(`@${emailDomain}`) }) + ); }, verifyExpirationDateOnUserDetailsPane(expirationDate) { - cy.expect(userDetailsPane.find(KeyValue('Expiration date')).has({ value: `${expirationDate}` })); + cy.expect( + userDetailsPane + .find(KeyValue('Expiration date')) + .has({ value: `${expirationDate}` }) + ); }, - verifyCustomFieldOnUserDetailsPane(name, text) { - cy.expect(userDetailsPane.find(KeyValue(name)).has({ value: text })); + clearTextField() { + cy.do(TextField({ id: 'adduser_preferredname' }).clear()); + }, + + clearTextFieldFirstName() { + cy.do(TextField({ id: 'adduser_firstname' }).clear()); + }, + + deleteUser: () => { + cy.do([ + Section({ id: 'pane-userdetails' }) + .find(PaneHeader({ id: 'paneHeaderpane-userdetails' })) + .find(Button('Actions')) + .click(), + deleteUser.click(), + deleteYesButton.click() + ]); + }, + + saveButton() { + cy.do([Button({ id: 'clickable-save' }).click()]); + }, + + editButton: () => { + cy.do([ + Section({ id: 'pane-userdetails' }) + .find(PaneHeader({ id: 'paneHeaderpane-userdetails' })) + .find(Button('Actions')) + .click(), + editButton.click(), + ]); + }, + checkZeroSearchResultsHeader: () => { + cy.xpath(numberOfSearchResultsHeader) + .should('be.visible') + .and('have.text', zeroResultsFoundText); }, }; diff --git a/cypress/support/fragments/users/usersSearchPane.js b/cypress/support/fragments/users/usersSearchPane.js index 3b9a438d3d..a832ea9e87 100644 --- a/cypress/support/fragments/users/usersSearchPane.js +++ b/cypress/support/fragments/users/usersSearchPane.js @@ -55,6 +55,14 @@ export default { ]); waitClick(); }, + searchByLastName(lastName) { + cy.do([ + Select({ id: 'input-user-search-qindex' }).choose('Last name'), + TextField({ id: 'input-user-search' }).fillIn(lastName), + Button({ id: 'submit-user-search' }).click() + ]); + waitClick(); + }, selectFirstUser: (userName) => { cy.expect(Spinner().absent()); @@ -65,6 +73,10 @@ export default { selectUserFromList: (userName) => { cy.do(Pane({ id: 'users-search-results-pane' }).find(MultiColumnListCell(userName)).click()); }, + + selectUsersFromList: (userName) => { + cy.do(Pane({ id: 'users-search-results-pane' }).find(Link(userName)).click()); + }, openUser(userId) { return cy.do(Link({ href: including(userId) }).click()); diff --git a/cypress/support/ideyaLabs/checkinitems.js b/cypress/support/ideyaLabs/checkinitems.js new file mode 100644 index 0000000000..a740c99ed4 --- /dev/null +++ b/cypress/support/ideyaLabs/checkinitems.js @@ -0,0 +1,135 @@ +import { + Button, + Checkbox, + Modal, + MultiColumnListCell, + Select, + Selection, + SelectionOption, + Spinner, + TextField, +} from '../../../interactors'; +import checkInActions from '../fragments/check-in-actions/checkInActions'; +import inventorySearchAndFilter from '../fragments/inventory/inventorySearchAndFilter'; +import topMenu from '../fragments/topMenu'; +import serviceShift from './serviceshift'; + +const itemStatusSearchField = TextField('itemStatus-field'); +const itemBarcode = '58485788'; +const date = '2023-07-21'; + +export default { + clickOnItem() { + cy.do(items).click(); + }, + + checkModal() { + cy.expect(Modal({ id: 'multipiece-modal' }).exists()); + cy.do(Modal({ id: 'multipiece-modal' }).find(Button('Check in')).click()); + }, + + createInstance() { + cy.do([ + Button('Actions').click(), + Button('New').click(), + TextField({ id: 'input_instance_title' }).fillIn('test'), + Select({ id: 'select_instance_type' }).choose('other'), + Button('Save & close').click(), + ]); + cy.expect(Button({ id: 'clickable-new-holdings-record' }).exists()); + }, + + createItem(barcode) { + cy.do([ + Button('Date created').click(), + TextField({ name: 'startDate' }).fillIn(date), + TextField({ name: 'endDate' }).fillIn(date), + Button('Apply').click(), + ]); + inventorySearchAndFilter.clickSearchResultItem(); + cy.expect(Button({ id: 'clickable-new-holdings-record' }).exists()); + cy.do([ + Button({ id: 'clickable-new-holdings-record' }).click(), + Selection('Permanent*').open(), + SelectionOption('acq admin (acq,admin) ').click(), + Button('Save & close').click(), + cy.expect(Button('Add item').exists()), + ]); + cy.expect(Button('Holdings: acq admin >').exists()); + cy.do([ + Button('Add item').click(), + TextField({ id: 'additem_barcode' }).fillIn(barcode), + Select('Material type*').choose('book'), + Select('Permanent loan type*').choose('10 years'), + ]); + cy.expect(Button('Save & close').exists()); + cy.do(Button('Save & close').click()); + cy.expect(Button('Holdings: acq admin >').exists()); + }, + + declaredItem() { + cy.do(Button({ id: 'accordion-toggle-button-loan' }).click()); + cy.do([Checkbox({ id: 'clickable-filter-loan-declared-lost' }).click()]); + cy.wrap(MultiColumnListCell({ row: 0, columnIndex: 1 }).text()).as( + 'barcode' + ); + cy.get('@barcode').then((val) => { + cy.visit(topMenu.checkInPath); + checkInActions.checkInItem(val); + serviceShift.clickClose(); + }); + }, + + withdrawn() { + inventorySearchAndFilter.switchToItem(); + cy.do(Button({ id: 'accordion-toggle-button-itemStatus' }).click()); + cy.expect([Spinner().exists(), Checkbox('Available').exists()]); + cy.do([ + itemStatusSearchField.click(), + itemStatusSearchField.fillIn('withdrawn'), + ]); + cy.do([Checkbox({ id: 'clickable-filter-itemStatus-withdrawn' }).click()]); + inventorySearchAndFilter.clickSearchResultItem(); + cy.visit(topMenu.checkInPath); + checkInActions.checkInItem(itemBarcode); + serviceShift.clickClose(); + }, + + lostAndPaid() { + inventorySearchAndFilter.switchToItem(); + cy.do(Button({ id: 'accordion-toggle-button-itemStatus' }).click()); + cy.expect([Spinner().exists(), Checkbox('Available').exists()]); + cy.expect(Checkbox('Available').exists()); + cy.do([ + itemStatusSearchField.click(), + itemStatusSearchField.fillIn('lost and'), + ]); + cy.do([ + Checkbox({ id: 'clickable-filter-itemStatus-lost-and-paid' }).click(), + ]); + inventorySearchAndFilter.selectSearchResultItem(); + cy.visit(topMenu.checkInPath); + checkInActions.checkInItem(itemBarcode); + serviceShift.clickClose(); + }, + + checkIn: (barcode) => { + cy.do([TextField('Item ID').fillIn(barcode), Button('Enter').click()]); + }, + + checkInMultipleItem: (barcode) => { + cy.do([ + TextField('Item ID').fillIn(barcode), + Button('Enter').click(), + Modal('Confirm multipiece check in').find(Button('Check in')).click(), + ]); + }, + + cancelCheckInMultipleItem: (barcode) => { + cy.do([ + TextField('Item ID').fillIn(barcode), + Button('Enter').click(), + Button('Cancel').click(), + ]); + }, +}; diff --git a/cypress/support/ideyaLabs/serviceshift.js b/cypress/support/ideyaLabs/serviceshift.js new file mode 100644 index 0000000000..f43378a3a8 --- /dev/null +++ b/cypress/support/ideyaLabs/serviceshift.js @@ -0,0 +1,26 @@ +import { Button } from '../../../interactors'; + +const profile = Button({ ariaLabel: 'My profile' }); +const times = Button({ icon: 'times' }); + +export default { + servicePointsOne() { + cy.do(profile.click()); + cy.do(Button({ id: 'service-points-clickable-menuItem0' }).click()); + cy.do(Button({ id: 'service-point-btn-3' }).click()); + }, + + servicePointsTwo() { + cy.do(profile.click()); + cy.do(Button({ id: 'service-points-clickable-menuItem0' }).click()); + cy.do(Button({ id: 'service-point-btn-5' }).click()); + }, + + clickApplyMainFilter() { + cy.get('[class^="Button-"][type="submit"]').first().click(); + }, + + clickClose: () => { + cy.do([times.click()]); + }, +}; From 9086d953d3b75424fcb3d864059d916deb5ed45f Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 9 Aug 2023 12:06:50 +0500 Subject: [PATCH 025/437] =?UTF-8?q?=C3=A4dded=20test=20C358994=20(#1462)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modify-marc-file-of-deleted-user.cy.js | 104 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC358994.mrc | 1 + cypress/support/dictionary/permissions.js | 2 + cypress/support/fragments/users/users.js | 5 + 4 files changed, 112 insertions(+) create mode 100644 cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC358994.mrc diff --git a/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js new file mode 100644 index 0000000000..e7820a29cb --- /dev/null +++ b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js @@ -0,0 +1,104 @@ +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 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 UsersSearchPane from '../../support/fragments/users/usersSearchPane'; + +describe('MARC -> MARC Authority', () => { + const testData = { + searchOption: 'Keyword', + marcValue: 'Cartoons & Comics', + valueForUpdate: '$a Cartoons & Animations', + valueAfterUpdate: 'Cartoons & Animations', + calloutMessage: 'Record has been updated.', + } + + const user = {}; + + const marcFiles = [ + { + marc: 'marcAuthFileForC358994.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1, + } + ]; + + const createdAuthorityIDs = []; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + ]).then(createdUserProperties => { + user.userAProperties = createdUserProperties; + + marcFiles.forEach(marcFile => { + cy.login(user.userAProperties.username, user.userAProperties.password, { 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.createTempUser([ + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiUsersCheckTransactions.gui, + Permissions.uiUsersDelete.gui, + Permissions.uiUserEdit.gui, + Permissions.uiUsersView.gui, + ]).then(createdUserProperties => { + user.userBProperties = createdUserProperties; + + cy.login(user.userBProperties.username, user.userBProperties.password, { path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading}); + }); + }); + + after('Deleting created user', () => { + Users.deleteViaApi(user.userBProperties.userId); + MarcAuthority.deleteViaAPI(createdAuthorityIDs[0]); + + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + }); + + it('C358994 Verify that user has access to "quickMARC" when user who imported MARC record has been deleted (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + UsersSearchPane.searchByUsername(user.userAProperties.username); + UsersSearchPane.openUser(user.userAProperties.username); + Users.deleteUser(); + Users.successMessageAfterDeletion(`User ${user.userAProperties.username}, testPermFirst testMiddleName deleted successfully.`) + + cy.visit(TopMenu.marcAuthorities); + MarcAuthorities.searchBy(testData.searchOption, testData.marcValue); + MarcAuthorities.selectTitle(testData.marcValue); + MarcAuthority.edit(); + QuickMarcEditor.updateExistingFieldContent(7, testData.valueForUpdate); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkCallout(testData.calloutMessage); + MarcAuthorities.checkRecordDetailPageMarkedValue(testData.valueAfterUpdate); + }); +}); diff --git a/cypress/fixtures/marcAuthFileForC358994.mrc b/cypress/fixtures/marcAuthFileForC358994.mrc new file mode 100644 index 0000000000..949898dbce --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC358994.mrc @@ -0,0 +1 @@ +00531cz a2200205n 4500001000800000005001700008008004100025010001700066035002300083040002500106130002200131430003000153430002400183643002400207644001100231645001100242646001100253670005200264953000900316103569220081219072118.0831017n| acaabaaan |a ana  an 83700634  a(OCoLC)oca01040186 aDLCbengcDLCdOCoLC 0aCartoons & Comics 0aReihe "Cartoons & Comics" 0aCartoons und Comics aZürichbEdition C af5DLC at5DLC as5DLC aGrasso, M. Sati(e)risches, 1982:bp. 1 of cover aec29 \ No newline at end of file diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 1540f18774..1c891be544 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -94,6 +94,8 @@ export default { uiUserCreate: { internal: 'ui-users.create', gui: 'Users: Create users' }, uiUsersCreate: { internal: 'ui-users.create', gui: 'Users: Can create new user' }, uiUserEdit: { internal: 'ui-users.edit', gui: 'Users: Can edit user profile' }, + uiUsersDelete: { internal: 'ui-users.delete', gui: 'Users: Can delete user profile if user does not have any open transactions' }, + uiUsersCheckTransactions: { internal: 'ui-users.opentransactions', gui: 'Users: Can check open transactions' }, uiUserAccounts: { internal: 'ui-users.accounts', gui: 'Fee/Fine History: Can create, edit and remove accounts' }, uiUsersViewLoans: { internal: 'ui-users.loans.view', gui: 'Users: User loans view' }, uiUserLoansAnonymize: { internal: 'ui-users.loans.anonymize', gui: 'Users: User loans anonymize' }, diff --git a/cypress/support/fragments/users/users.js b/cypress/support/fragments/users/users.js index 19d4402af1..858a080d76 100644 --- a/cypress/support/fragments/users/users.js +++ b/cypress/support/fragments/users/users.js @@ -10,6 +10,7 @@ import { Section, Select, TextField, + Callout, } from '../../../../interactors'; import getRandomPostfix from '../../utils/stringTools'; @@ -200,6 +201,10 @@ export default { ]); }, + successMessageAfterDeletion(message) { + cy.expect(Callout(message).exists()); + }, + saveButton() { cy.do([Button({ id: 'clickable-save' }).click()]); }, From ea2fc9a53895701582c48187c82af9377b1f1b1a Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Wed, 9 Aug 2023 11:05:30 +0300 Subject: [PATCH 026/437] Implementing of FAT-1336 (#1402) * Implementing of FAT-1336 * Implementing of FAT-1336 --- ...invoice-with-multiple-xpense-classes.cy.js | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 cypress/e2e/invoices/pay-invoice-with-multiple-xpense-classes.cy.js diff --git a/cypress/e2e/invoices/pay-invoice-with-multiple-xpense-classes.cy.js b/cypress/e2e/invoices/pay-invoice-with-multiple-xpense-classes.cy.js new file mode 100644 index 0000000000..06d91cae36 --- /dev/null +++ b/cypress/e2e/invoices/pay-invoice-with-multiple-xpense-classes.cy.js @@ -0,0 +1,122 @@ +import permissions from '../../support/dictionary/permissions'; +import testType from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +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'; +import NewOrder from '../../support/fragments/orders/newOrder'; +import Orders from '../../support/fragments/orders/orders'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import Organizations from '../../support/fragments/organizations/organizations'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import NewInvoice from '../../support/fragments/invoices/newInvoice'; +import Invoices from '../../support/fragments/invoices/invoices'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import NewExpenceClass from '../../support/fragments/settings/finance/newExpenseClass'; +import SettingsFinance from '../../support/fragments/settings/finance/settingsFinance'; +import SettingsMenu from '../../support/fragments/settingsMenu'; + +describe('Invoices', () => { + const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const defaultFund = { ...Funds.defaultUiFund }; + const firstOrder = { ...NewOrder.defaultOneTimeOrder, + approved: true, + reEncumber: true }; + const firstExpenseClass = { ...NewExpenceClass.defaultUiBatchGroup }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const allocatedQuantity = '100'; + let user; + let firstOrderNumber; + let servicePointId; + let location; + + before(() => { + cy.getAdminToken(); + cy.loginAsAdmin(); + cy.visit(SettingsMenu.expenseClassesPath); + SettingsFinance.createNewExpenseClass(firstExpenseClass); + + 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.visit(TopMenu.fundPath); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.addBudget(allocatedQuantity); + Funds.editBudget(); + Funds.addExpensesClass(firstExpenseClass.name); + }); + }); + }); + + 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'; + firstOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(firstOrder, true).then(secondOrderResponse => { + firstOrder.id = secondOrderResponse.id; + firstOrderNumber = secondOrderResponse.poNumber; + Orders.checkCreatedOrder(firstOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '40', '1', '40', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + }); + // Need to wait, while data will be loaded + cy.visit(TopMenu.ordersPath); + }); + + cy.createTempUser([ + permissions.uiFinanceExecuteFiscalYearRollover.gui, + permissions.uiFinanceViewFiscalYear.gui, + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiFinanceViewLedger.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.ledgerPath, waiter: Ledgers.waitForLedgerDetailsLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C15859 Pay an invoice with multiple "Expense classes" assigned to it (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLineFromPol(firstOrderNumber); + Invoices.approveInvoice(); + Invoices.payInvoice(); + }); +}); From 630953a2341c6a74b20997a721fb79e7519fab44 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Wed, 9 Aug 2023 11:16:31 +0300 Subject: [PATCH 027/437] fix for ideyalab (#1465) --- cypress/e2e/ideyalabs/checkin.cy.js | 2 +- cypress/e2e/ideyalabs/marc_authority.cy.js | 49 ++++++++++++---------- cypress/support/ideyaLabs/marc.js | 6 +-- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/cypress/e2e/ideyalabs/checkin.cy.js b/cypress/e2e/ideyalabs/checkin.cy.js index 933b060c9b..8cb289a0d0 100644 --- a/cypress/e2e/ideyalabs/checkin.cy.js +++ b/cypress/e2e/ideyalabs/checkin.cy.js @@ -1,4 +1,4 @@ -import checkInItems from '../../support/ideyaLabs/checkInItems'; +import checkInItems from '../../support/ideyaLabs/checkinitems'; import serviceShift from '../../support/ideyaLabs/serviceshift'; import testTypes from '../../support/dictionary/testTypes'; import checkInActions from '../../support/fragments/check-in-actions/checkInActions'; diff --git a/cypress/e2e/ideyalabs/marc_authority.cy.js b/cypress/e2e/ideyalabs/marc_authority.cy.js index d6669465e8..896b459677 100644 --- a/cypress/e2e/ideyalabs/marc_authority.cy.js +++ b/cypress/e2e/ideyalabs/marc_authority.cy.js @@ -1,4 +1,4 @@ -import marc from '../../support/a_ideyalabs/marc'; +import marc from '../../support/ideyaLabs/marc'; import testTypes from '../../support/dictionary/testTypes'; import inventoryInstance from '../../support/fragments/inventory/inventoryInstance'; import inventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; @@ -7,29 +7,30 @@ import marcAuthoritiesDelete from '../../support/fragments/marcAuthority/marcAut import marcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; import topMenu from '../../support/fragments/topMenu'; -const testData = { - source: 'MARC', - searchOption: 'Keyword', - authority650FieldValue: 'Speaking Oratory debating', - searchHoldingOption: 'Keyword (title, contributor, identifier, HRID, UUID)', - holdingValue: 'The !!!Kung of Nyae Nyae / Lorna Marshall.', - record: 'Gibbons, Boyd', - accordion: 'Subject', - marcRecord: 'Beatles', - tag: { - tag650: '650', - }, - derive: { - searchOption: 'Personal name', - authority700FieldValue: 'Gibbons, Boyd', - tag700: '700', - rowIndex: 1, - accordion: 'Contributor', - content: ' ', - }, -}; - describe.skip('Feature MARC Authority', () => { + + const testData = { + source: 'MARC', + searchOption: 'Keyword', + authority650FieldValue: 'Speaking Oratory debating', + searchHoldingOption: 'Keyword (title, contributor, identifier, HRID, UUID)', + holdingValue: 'The !!!Kung of Nyae Nyae / Lorna Marshall.', + record: 'Gibbons, Boyd', + accordion: 'Subject', + marcRecord: 'Beatles', + tag: { + tag650: '650', + }, + derive: { + searchOption: 'Personal name', + authority700FieldValue: 'Gibbons, Boyd', + tag700: '700', + rowIndex: 1, + accordion: 'Contributor', + content: ' ', + }, + }; + before('Login', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); @@ -171,4 +172,6 @@ describe.skip('Feature MARC Authority', () => { inventoryInstance.editMarcBibliographicRecord(); } ); + }); + diff --git a/cypress/support/ideyaLabs/marc.js b/cypress/support/ideyaLabs/marc.js index f7395e1429..3bb5e75e33 100644 --- a/cypress/support/ideyaLabs/marc.js +++ b/cypress/support/ideyaLabs/marc.js @@ -42,9 +42,9 @@ const saveButton = Button('Save'); const verifyCustomLabel = Section({ id: 'resourceShowCustomLabels' }); const RandomValue = Math.floor(Math.random() * 2); const packageId = null; -cy.intercept(`eholdings/packages/${packageId}/resources?**`).as( - 'getTitles' -); +//cy.intercept(`eholdings/packages/${packageId}/resources?**`).as( +// 'getTitles' +//); export default { openCreatedHoldingView: () => { From d4a8089823fc4f42efcd203f5a32e5d285b4c2b7 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:10:43 +0300 Subject: [PATCH 028/437] Implementing of FAT-1364 (#1350) --- cypress/e2e/orders/check-duplicate-POL.cy.js | 111 +++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 cypress/e2e/orders/check-duplicate-POL.cy.js diff --git a/cypress/e2e/orders/check-duplicate-POL.cy.js b/cypress/e2e/orders/check-duplicate-POL.cy.js new file mode 100644 index 0000000000..338a8c1ac0 --- /dev/null +++ b/cypress/e2e/orders/check-duplicate-POL.cy.js @@ -0,0 +1,111 @@ +import permissions from '../../support/dictionary/permissions'; +import devTeams from '../../support/dictionary/devTeams'; +import TopMenu from '../../support/fragments/topMenu'; +import Orders from '../../support/fragments/orders/orders'; +import TestTypes from '../../support/dictionary/testTypes'; +import Users from '../../support/fragments/users/users'; +import NewOrder from '../../support/fragments/orders/newOrder'; +import Organizations from '../../support/fragments/organizations/organizations'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import getRandomPostfix from '../../support/utils/stringTools'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import InteractorsTools from '../../support/utils/interactorsTools'; + +describe('Orders', () => { + const order = { ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ] + }; + let user; + let location; + let servicePointId; + let orderNumber; + + before(() => { + cy.getAdminToken(); + + ServicePoints.getViaApi() + .then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) + .then(res => { + location = res; + }); + }); + Organizations.createOrganizationViaApi(organization) + .then(organizationsResponse => { + organization.id = organizationsResponse; + order.vendor = organizationsResponse; + }); + cy.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(); + Orders.openOrder(); + }); + + cy.createTempUser([ + permissions.uiOrdersCreate.gui, + permissions.uiOrdersView.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersDelete.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + }); + }); + + after(() => { + cy.loginAsAdmin({ path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + Orders.unOpenOrder(orderNumber); + // Need to wait until the order is opened before deleting it + cy.wait(2000); + Orders.deleteOrderViaApi(order.id); + + Organizations.deleteOrganizationViaApi(organization.id); + NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + location.institutionId, + location.campusId, + location.libraryId, + location.id + ); + Users.deleteViaApi(user.userId); + }); + + it('C347860: Check duplicate POL (thunderjet)', { tags: [TestTypes.criticalPath, devTeams.thunderjet] }, () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + Orders.duplicateOrder(); + InteractorsTools.checkCalloutMessage('The purchase order was successfully duplicated'); + Orders.checkDuplicatedOrder(organization.name, `${user.username}, testPermFirst testMiddleName`); + Orders.deleteOrderViaActions(); + }); +}); From ee05491c061bad850564e885c67e545028cc8d60 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:33:45 +0500 Subject: [PATCH 029/437] fix in browse call numbers (#1466) --- .../support/fragments/inventory/inventorySearchAndFilter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 80faaff16a..a92f14020d 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -237,7 +237,7 @@ export default { // cypress can't draw selected option without wait // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(1000); - cy.do(Select('Search field index').choose('Call numbers')); + cy.do(Select('Search field index').choose('Call numbers (all)')); cy.expect(effectiveLocationInput.exists()); }, @@ -284,7 +284,7 @@ export default { verifyBrowseOptions() { cy.do(browseSearchAndFilterInput.click()); cy.expect([ - browseSearchAndFilterInput.has({ content: including('Call numbers') }), + browseSearchAndFilterInput.has({ content: including('Call numbers (all)') }), browseSearchAndFilterInput.has({ content: including('Contributors') }), browseSearchAndFilterInput.has({ content: including('Subjects') }), ]); From b2bd5114619a28f373043bd9a33f0a61b706659c Mon Sep 17 00:00:00 2001 From: nayimovag Date: Wed, 9 Aug 2023 21:09:19 +0500 Subject: [PATCH 030/437] FAT-7210 (#1468) --- .../csv/bulk-edit-csv-external-ids.cy.js | 1 + .../csv/bulk-edit-csv-ids-uploading.cy.js | 1 + .../csv/bulk-edit-csv-invalid-date.cy.js | 1 + .../csv/bulk-edit-csv-user-barcodes.cy.js | 1 + ...k-edit-csv-user-new-bulk-edit-button.cy.js | 9 +- ...t-csv-user-records-confirmation-page.cy.js | 1 + .../csv/bulk-edit-csv-usernames.cy.js | 1 + ...ulk-edit-csv-users-ids-label-cleanup.cy.js | 1 + .../csv/bulk-edit-csv-users-ids.cy.js | 3 +- .../bulk-edit-in-app-correct-user.cy.js | 186 +++++++++--------- ...lk-edit-in-app-different-identifiers.cy.js | 3 +- .../in-app/bulk-edit-in-app-elements.cy.js | 34 +--- .../in-app/bulk-edit-in-app-former-ids.cy.js | 1 + ...t-in-app-holdings-effective-location.cy.js | 118 +++++------ ...it-in-app-holdings-electronic-access.cy.js | 124 ++++++------ ...-edit-in-app-holdings-instance-hrids.cy.js | 108 +++++----- .../bulk-edit-in-app-holdings-source.cy.js | 82 ++++---- .../in-app/bulk-edit-in-app-holdings.cy.js | 38 +++- ...it-in-app-item-barcodes-less-than-10.cy.js | 75 +++---- .../bulk-edit-in-app-item-barcodes.cy.js | 1 + ...-edit-in-app-item-effective-location.cy.js | 94 ++++----- .../in-app/bulk-edit-in-app-item-hrids.cy.js | 73 +++---- ...lk-edit-in-app-items-matched-records.cy.js | 69 +++++++ ...bulk-edit-in-app-items-with-deleting.cy.js | 1 + .../bulk-edit-in-app-items-with-nulls.cy.js | 1 + .../in-app/bulk-edit-in-app-items.cy.js | 1 + .../bulk-edit-in-app-location-filter.cy.js | 1 + .../in-app/bulk-edit-in-app-navigation.cy.js | 2 +- .../bulk-edit-in-app-several-holdings.cy.js | 1 + ...bulk-edit-in-app-user-barcodes-error.cy.js | 3 +- .../bulk-edit-in-app-user-barcodes.cy.js | 3 +- ...ulk-edit-in-app-user-expiration-date.cy.js | 2 +- .../in-app/bulk-edit-in-app-user-forms.cy.js | 3 +- .../bulk-edit-in-app-user-line-break.cy.js | 116 +++++------ .../bulk-edit-in-app-user-uuids-view.cy.js | 72 +++++++ .../in-app/bulk-edit-in-app-user-uuids.cy.js | 35 +--- .../bulk-edit-logs-csv-users-barcodes.cy.js | 2 +- .../csv/bulk-edit-logs-csv-users-valid.cy.js | 2 +- ...-edit-logs-csv-users-view-permission.cy.js | 24 +++ .../logs/csv/bulk-edit-logs-csv-users.cy.js | 4 +- .../bulk-edit-logs-in-app-holdings.cy.js | 1 + ...-suppressed-holdings-false-items-not.cy.js | 4 +- ...bulk-edit-logs-in-app-users-barcodes.cy.js | 2 +- .../bulk-edit-logs-in-app-users-uuids.cy.js | 2 +- .../bulk-edit-all-permissions.cy.js | 13 +- ...-edit-csv-export-manager-permissions.cy.js | 74 +++---- ...sv-in-app-export-manager-permissions.cy.js | 107 +++++----- .../bulk-edit-csv-permissions.cy.js | 2 +- .../bulk-edit-csv-query-permissions.cy.js | 17 +- ...bulk-edit-export-manager-permissions.cy.js | 114 +++++------ ...it-in-app-export-manager-permissions.cy.js | 80 ++++---- .../bulk-edit-in-app-permissions.cy.js | 2 +- .../bulk-edit-in-app-query-permissions.cy.js | 19 +- ...n-app-query-tab-holdings-permissions.cy.js | 96 ++++----- ...t-in-app-query-tab-items-permissions.cy.js | 96 ++++----- ...it-try-to-upload-without-permissions.cy.js | 15 +- .../bulk-edit-without-permissions.cy.js | 4 +- .../bulk-edit/bulk-edit-search-pane.js | 28 ++- cypress/support/fragments/users/users.js | 4 + 59 files changed, 1083 insertions(+), 895 deletions(-) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-matched-records.cy.js create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-view.cy.js diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js index 6d2b3a97c6..9c864d41f5 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js @@ -21,6 +21,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js index f64336726a..e014c87235 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js @@ -20,6 +20,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; 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 7955114d79..6d1b1b7e95 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 @@ -20,6 +20,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js index 4424d227ca..6536e806ae 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js @@ -18,6 +18,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUsersView.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js index ef00995348..59db9f66fd 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js @@ -23,7 +23,8 @@ describe('bulk-edit', () => { before('create test data', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, - permissions.bulkEditCsvEdit.gui + permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; @@ -61,8 +62,6 @@ describe('bulk-edit', () => { TopMenuNavigation.navigateToApp('Bulk edit'); BulkEditSearchPane.verifyBulkEditPaneItems(); BulkEditSearchPane.usersRadioIsDisabled(false); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); BulkEditSearchPane.verifyDefaultFilterState(); }); @@ -78,8 +77,6 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyDragNDropUsersBarcodesArea(); BulkEditSearchPane.usersRadioIsDisabled(false); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); BulkEditSearchPane.uploadFile(userBarcodesFileName); @@ -99,8 +96,6 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyChangedResults(newUsername); BulkEditSearchPane.verifyDragNDropUsersUUIDsArea(); BulkEditSearchPane.usersRadioIsDisabled(false); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); BulkEditSearchPane.verifyActionsAfterChangingRecords(); }); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js index d0647f1bd0..78a0fa07a2 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js @@ -21,6 +21,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js index 17e05baa68..192e68c93a 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js @@ -19,6 +19,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; 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 3af3a48100..35f272ab56 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 @@ -20,6 +20,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js index 543901c534..245c5584c9 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js @@ -20,6 +20,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; @@ -62,7 +63,7 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyChangedResults(newName); }); - it('C357034 Verify elements of the bulk edit app -- CSV app (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C357034 Verify elements of the bulk edit app -- Local app (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.clickToBulkEditMainButton(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js index 8662b58737..3561b1a96c 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js @@ -20,106 +20,108 @@ const item = { instanceId: '', }; -describe('Bulk Edit - Items', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - permissions.inventoryAll.gui, - ], 'faculty') - .then(userProperties => { - user1 = userProperties; - cy.login(user1.username, user1.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + ], 'faculty') + .then(userProperties => { + user1 = userProperties; + cy.login(user1.username, user1.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + }); + cy.createTempUser([ + permissions.bulkEditUpdateRecords.gui, + permissions.uiUserEdit.gui, + ], 'faculty') + .then(userProperties => { + user2 = userProperties; }); - }); - cy.createTempUser([ - permissions.bulkEditUpdateRecords.gui, - permissions.uiUsersView.gui, - ], 'faculty') - .then(userProperties => { - user2 = userProperties; - }); - - item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); - cy.getInstance({ limit: 1, expandAll: true, query: `"items.barcode"=="${item.itemBarcode}"` }) - .then((instance) => { - item.itemId = instance.items[0].id; - }) - .then(() => { - FileManager.createFile(`cypress/fixtures/${validItemUUIDsFileName}`, item.itemId); - FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, `${user1.barcode}\n${user2.barcode}`); - }); - }); - after('delete test data', () => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); - Users.deleteViaApi(user1.userId); - Users.deleteViaApi(user2.userId); - FileManager.deleteFile(`cypress/fixtures/${validItemUUIDsFileName}`); - FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); - }); + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getInstance({ limit: 1, expandAll: true, query: `"items.barcode"=="${item.itemBarcode}"` }) + .then((instance) => { + item.itemId = instance.items[0].id; + }) + .then(() => { + FileManager.createFile(`cypress/fixtures/${validItemUUIDsFileName}`, item.itemId); + FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, `${user1.barcode}\n${user2.barcode}`); + }); + }); - it('C380393 Verify that bulk edit jobs run by correct user (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkItemsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Item UUIDs'); + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + Users.deleteViaApi(user1.userId); + Users.deleteViaApi(user2.userId); + FileManager.deleteFile(`cypress/fixtures/${validItemUUIDsFileName}`); + FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); + }); - cy.intercept('/bulk-operations/*').as('fileUpload'); - BulkEditSearchPane.uploadFile(validItemUUIDsFileName); - cy.wait('@fileUpload', getLongDelay()) - .then((res) => { - expect(res.response.body.userId).to.eq(user1.userId); - }); - BulkEditSearchPane.waitFileUploading(); + it('C380393 Verify that bulk edit jobs run by correct user (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item UUIDs'); - const newLocation = 'Online'; - BulkEditActions.openActions(); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.replaceTemporaryLocation(newLocation, 'item', 0); - cy.intercept('/bulk-operations/*').as('confirmChanges'); - BulkEditActions.confirmChanges(); - cy.wait('@confirmChanges', getLongDelay()) - .then((res) => { - expect(res.response.body.userId).to.eq(user1.userId); - }); - cy.intercept('/bulk-operations/*').as('commitChanges'); - BulkEditActions.commitChanges(); - BulkEditSearchPane.waitFileUploading(); - cy.wait('@commitChanges', getLongDelay()) - .then((res) => { - expect(res.response.body.userId).to.eq(user1.userId); - }); + cy.intercept('/bulk-operations/*').as('fileUpload'); + BulkEditSearchPane.uploadFile(validItemUUIDsFileName); + cy.wait('@fileUpload', getLongDelay()) + .then((res) => { + expect(res.response.body.userId).to.eq(user1.userId); + }); + BulkEditSearchPane.waitFileUploading(); - cy.login(user2.username, user2.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading - }); - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); + const newLocation = 'Online'; + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.replaceTemporaryLocation(newLocation, 'item', 0); + cy.intercept('/bulk-operations/*').as('confirmChanges'); + BulkEditActions.confirmChanges(); + cy.wait('@confirmChanges', getLongDelay()) + .then((res) => { + expect(res.response.body.userId).to.eq(user1.userId); + }); + cy.intercept('/bulk-operations/*').as('commitChanges'); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + cy.wait('@commitChanges', getLongDelay()) + .then((res) => { + expect(res.response.body.userId).to.eq(user1.userId); + }); - cy.intercept('/bulk-operations/*').as('fileUpload2'); - BulkEditSearchPane.uploadFile(userBarcodesFileName); - cy.wait('@fileUpload2', getLongDelay()) - .then((res) => { - expect(res.response.body.userId).to.eq(user2.userId); + cy.login(user2.username, user2.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading }); - BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditActions.openActions(); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.fillPatronGroup('staff (Staff Member)'); - cy.intercept('/bulk-operations/*').as('confirmChanges2'); - BulkEditActions.confirmChanges(); - cy.wait('@confirmChanges2', getLongDelay()) - .then((res) => { - expect(res.response.body.userId).to.eq(user2.userId); - }); - BulkEditActions.commitChanges(); - cy.intercept('/bulk-operations/*').as('commitChanges2'); - BulkEditSearchPane.waitFileUploading(); - cy.wait('@commitChanges2', getLongDelay()) - .then((res) => { - expect(res.response.body.userId).to.eq(user2.userId); - }); + cy.intercept('/bulk-operations/*').as('fileUpload2'); + BulkEditSearchPane.uploadFile(userBarcodesFileName); + cy.wait('@fileUpload2', getLongDelay()) + .then((res) => { + expect(res.response.body.userId).to.eq(user2.userId); + }); + BulkEditSearchPane.waitFileUploading(); + + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.fillPatronGroup('staff (Staff Member)'); + cy.intercept('/bulk-operations/*').as('confirmChanges2'); + BulkEditActions.confirmChanges(); + cy.wait('@confirmChanges2', getLongDelay()) + .then((res) => { + expect(res.response.body.userId).to.eq(user2.userId); + }); + BulkEditActions.commitChanges(); + cy.intercept('/bulk-operations/*').as('commitChanges2'); + BulkEditSearchPane.waitFileUploading(); + cy.wait('@commitChanges2', getLongDelay()) + .then((res) => { + expect(res.response.body.userId).to.eq(user2.userId); + }); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-different-identifiers.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-different-identifiers.cy.js index abe20e7140..1e365ec758 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-different-identifiers.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-different-identifiers.cy.js @@ -27,7 +27,7 @@ describe('bulk-edit', () => { before('create test data', () => { cy.createTempUser([ permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditHoldings.gui ]) .then(userProperties => { user = userProperties; @@ -59,6 +59,7 @@ describe('bulk-edit', () => { FileManager.deleteFile(`cypress/fixtures/${invalidItemBarcodesFileName}`); }); + // has to pass after UIBULKED-321 it('C360119 Verify that different Holdings identifiers are supported for Bulk edit (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.checkHoldingsRadio(); BulkEditSearchPane.selectRecordIdentifier('Holdings HRIDs'); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js index ef581398e5..0874d3ea66 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js @@ -21,8 +21,8 @@ describe('bulk-edit', () => { describe('in-app approach', () => { before('create test data', () => { cy.createTempUser([ - permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui ]) .then(userProperties => { user = userProperties; @@ -135,37 +135,5 @@ describe('bulk-edit', () => { BulkEditSearchPane.clickToBulkEditMainButton(); BulkEditSearchPane.verifyDefaultFilterState(); }); - - it('C360089 Verify "Inventory - holdings" option on "Bulk edit" app (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - BulkEditSearchPane.checkHoldingsRadio(); - BulkEditSearchPane.verifyHoldingIdentifiers(); - - [ - { - identifier: 'Holdings UUIDs', - label: 'Select a file with holdings UUIDs', - pageText: 'Drag and drop or choose file with holdings UUIDs', - }, - { - identifier: 'Holdings HRIDs', - label: 'Select a file with holdings HRIDs', - pageText: 'Drag and drop or choose file with holdings HRIDs', - }, - { - identifier: 'Instance HRIDs', - label: 'Select a file with instance HRIDs', - pageText: 'Drag and drop or choose file with instance HRIDs', - }, - { - identifier: 'Item barcodes', - label: 'Select a file with item barcode', - pageText: 'Drag and drop or choose file with item barcode', - }, - ].forEach(checker => { - BulkEditSearchPane.selectRecordIdentifier(checker.identifier); - BulkEditSearchPane.verifyInputLabel(checker.label); - BulkEditSearchPane.verifyInputLabel(checker.pageText); - }); - }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-former-ids.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-former-ids.cy.js index ee7fe6e369..25ca8d0a89 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-former-ids.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-former-ids.cy.js @@ -25,6 +25,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-effective-location.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-effective-location.cy.js index b1f12dda4e..508ea8abd3 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-effective-location.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-effective-location.cy.js @@ -22,72 +22,74 @@ const item = { }; const holdingUUIDsFileName = `holdingUUIDs_${getRandomPostfix()}.csv`; -describe('Bulk Edit - Holdings', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - permissions.inventoryAll.gui, - ]) - .then(userProperties => { - user = userProperties; +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + ]) + .then(userProperties => { + user = userProperties; - item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); - cy.getHoldings({ - limit: 1, - query: `"instanceId"="${item.instanceId}"` - }) - .then(holdings => { - item.holdingUUID = holdings[0].id; - item.holdingHRID = holdings[0].hrid; - FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, item.holdingUUID); - }); + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getHoldings({ + limit: 1, + query: `"instanceId"="${item.instanceId}"` + }) + .then(holdings => { + item.holdingUUID = holdings[0].id; + item.holdingHRID = holdings[0].hrid; + FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, item.holdingUUID); + }); - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); }); - }); - }); + }); - after('delete test data', () => { - cy.deleteHoldingRecordViaApi(item.holdingUUID); - InventoryInstance.deleteInstanceViaApi(item.instanceId); - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); - }); + after('delete test data', () => { + cy.deleteHoldingRecordViaApi(item.holdingUUID); + InventoryInstance.deleteInstanceViaApi(item.instanceId); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); + }); - it('C380547 Verify updating Holdings "Effective location" in case of updating Holdings "Temporary location" (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkHoldingsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); - BulkEditSearchPane.verifyDragNDropHoldingsUUIDsArea(); - BulkEditSearchPane.uploadFile(holdingUUIDsFileName); - BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Effective location'); + it('C380547 Verify updating Holdings "Effective location" in case of updating Holdings "Temporary location" (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); + BulkEditSearchPane.verifyDragNDropHoldingsUUIDsArea(); + BulkEditSearchPane.uploadFile(holdingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Effective location'); - BulkEditActions.openInAppStartBulkEditFrom(); - const newLocation = 'Online'; - BulkEditActions.replaceTemporaryLocation(newLocation, 'holdings'); - BulkEditActions.confirmChanges(); + BulkEditActions.openInAppStartBulkEditFrom(); + const newLocation = 'Online'; + BulkEditActions.replaceTemporaryLocation(newLocation, 'holdings'); + BulkEditActions.confirmChanges(); - BulkEditActions.commitChanges(); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyChangesUnderColumns('Temporary location', newLocation); - BulkEditSearchPane.verifyChangesUnderColumns('Effective location', newLocation); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Temporary location', newLocation); + BulkEditSearchPane.verifyChangesUnderColumns('Effective location', newLocation); - // Delete items because only holdings with no items have field "Effective location" in Inventory - cy.getInstance({ limit: 1, expandAll: true, query: `"items.barcode"=="${item.itemBarcode}"` }) - .then((instance) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteItemViaApi(instance.items[1].id); - }); + // Delete items because only holdings with no items have field "Effective location" in Inventory + cy.getInstance({ limit: 1, expandAll: true, query: `"items.barcode"=="${item.itemBarcode}"` }) + .then((instance) => { + cy.deleteItemViaApi(instance.items[0].id); + cy.deleteItemViaApi(instance.items[1].id); + }); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.switchToHoldings(); - InventorySearchAndFilter.searchHoldingsByHRID(item.holdingHRID); - InventorySearchAndFilter.selectViewHoldings(); - HoldingsRecordView.checkTemporaryLocation(newLocation); - HoldingsRecordView.checkEffectiveLocation(newLocation); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.searchHoldingsByHRID(item.holdingHRID); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.checkTemporaryLocation(newLocation); + HoldingsRecordView.checkEffectiveLocation(newLocation); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access.cy.js index bf4aa226a6..7f63d28254 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access.cy.js @@ -25,75 +25,77 @@ const item = { }; const calloutMessage = `The URL relationship term ${newRelationshipName} was successfully deleted`; -describe('Bulk Edit - Holdings', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - permissions.inventoryAll.gui, - permissions.uiCreateEditDeleteURL.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: SettingsMenu.urlRelationshipPath, - waiter: UrlRelationship.waitloading - }); - - const instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); - cy.getHoldings({ limit: 1, query: `"instanceId"="${instanceId}"` }) - .then(holdings => { - holdingsHRID = holdings[0].hrid; - FileManager.createFile(`cypress/fixtures/${holdingsHRIDFileName}`, holdingsHRID); +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + permissions.uiCreateEditDeleteURL.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: SettingsMenu.urlRelationshipPath, + waiter: UrlRelationship.waitloading }); - }); - }); - after('delete test data', () => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); - FileManager.deleteFile(`cypress/fixtures/${holdingsHRIDFileName}`); - Users.deleteViaApi(user.userId); - }); + const instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getHoldings({ limit: 1, query: `"instanceId"="${instanceId}"` }) + .then(holdings => { + holdingsHRID = holdings[0].hrid; + FileManager.createFile(`cypress/fixtures/${holdingsHRIDFileName}`, holdingsHRID); + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${holdingsHRIDFileName}`); + Users.deleteViaApi(user.userId); + }); - it('C367977 Verify Bulk edit Holdings records with non-existent Electronic access Relationship type ID (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - UrlRelationship.createNewRelationship(newRelationshipName); - UrlRelationship.verifyElectronicAccessNameOnTable(newRelationshipName); + it('C367977 Verify Bulk edit Holdings records with non-existent Electronic access Relationship type ID (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + UrlRelationship.createNewRelationship(newRelationshipName); + UrlRelationship.verifyElectronicAccessNameOnTable(newRelationshipName); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.switchToHoldings(); - InventorySearchAndFilter.bySource('FOLIO'); - InventorySearchAndFilter.searchHoldingsByHRID(holdingsHRID); - InventorySearchAndFilter.selectViewHoldings(); - HoldingsRecordView.edit(); - HoldingsRecordView.addElectronicAccess(newRelationshipName); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.bySource('FOLIO'); + InventorySearchAndFilter.searchHoldingsByHRID(holdingsHRID); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.edit(); + HoldingsRecordView.addElectronicAccess(newRelationshipName); - cy.visit(SettingsMenu.urlRelationshipPath); - UrlRelationship.deleteUrlRelationship(newRelationshipName); - InteractorsTools.checkCalloutMessage(calloutMessage); + cy.visit(SettingsMenu.urlRelationshipPath); + UrlRelationship.deleteUrlRelationship(newRelationshipName); + InteractorsTools.checkCalloutMessage(calloutMessage); - cy.visit(TopMenu.bulkEditPath); - BulkEditSearchPane.checkHoldingsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Holdings HRIDs'); - BulkEditSearchPane.uploadFile(holdingsHRIDFileName); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyMatchedResults(holdingsHRID); - BulkEditSearchPane.verifyReasonForError('Electronic access relationship not found by id='); + cy.visit(TopMenu.bulkEditPath); + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings HRIDs'); + BulkEditSearchPane.uploadFile(holdingsHRIDFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(holdingsHRID); + BulkEditSearchPane.verifyReasonForError('Electronic access relationship not found by id='); - const tempLocation = 'Online (E)'; + const tempLocation = 'Online (E)'; - BulkEditActions.openActions(); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.replaceTemporaryLocation(tempLocation, 'holdings'); - BulkEditActions.confirmChanges(); - BulkEditActions.commitChanges(); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyChangedResults(holdingsHRID); + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.replaceTemporaryLocation(tempLocation, 'holdings'); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangedResults(holdingsHRID); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.switchToHoldings(); - InventorySearchAndFilter.searchByParameter('Holdings HRID', holdingsHRID); - InventorySearchAndFilter.selectSearchResultItem(); - InventorySearchAndFilter.selectViewHoldings(); - InventoryInstance.verifyHoldingsTemporaryLocation('Online'); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.searchByParameter('Holdings HRID', holdingsHRID); + InventorySearchAndFilter.selectSearchResultItem(); + InventorySearchAndFilter.selectViewHoldings(); + InventoryInstance.verifyHoldingsTemporaryLocation('Online'); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-instance-hrids.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-instance-hrids.cy.js index f48eed7ac6..e871b4e8fa 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-instance-hrids.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-instance-hrids.cy.js @@ -22,63 +22,65 @@ const item = { instanceHRID: '' }; -describe('Bulk Edit - Holdings', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - permissions.inventoryAll.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading - }); - - const instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); - cy.getInstanceById(instanceId) - .then((instance) => { - item.instanceHRID = instance.hrid; - FileManager.createFile(`cypress/fixtures/${instanceHRIDFileName}`, item.instanceHRID); +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading }); - cy.getHoldings({ limit: 1, query: `"instanceId"="${instanceId}"` }) - .then(holdings => { - cy.getLocations({ limit: 1, query: `id="${holdings[0].permanentLocationId}"` }) - .then(location => { permanentLocation = location.name; }); - }) - .then(() => { - InventorySearchAndFilter.switchToHoldings(); - InventorySearchAndFilter.byKeywords(item.instanceName); - InventoryInstance.openHoldingView(); - HoldingsRecordView.edit(); - HoldingsRecordEdit.clearTemporaryLocation(); - HoldingsRecordEdit.saveAndClose(); - cy.visit(TopMenu.bulkEditPath); - }); - }); - }); - after('delete test data', () => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); - FileManager.deleteFile(`cypress/fixtures/${instanceHRIDFileName}`); - Users.deleteViaApi(user.userId); - }); + const instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getInstanceById(instanceId) + .then((instance) => { + item.instanceHRID = instance.hrid; + FileManager.createFile(`cypress/fixtures/${instanceHRIDFileName}`, item.instanceHRID); + }); + cy.getHoldings({ limit: 1, query: `"instanceId"="${instanceId}"` }) + .then(holdings => { + cy.getLocations({ limit: 1, query: `id="${holdings[0].permanentLocationId}"` }) + .then(location => { permanentLocation = location.name; }); + }) + .then(() => { + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.byKeywords(item.instanceName); + InventoryInstance.openHoldingView(); + HoldingsRecordView.edit(); + HoldingsRecordEdit.clearTemporaryLocation(); + HoldingsRecordEdit.saveAndClose(); + cy.visit(TopMenu.bulkEditPath); + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${instanceHRIDFileName}`); + Users.deleteViaApi(user.userId); + }); - it('C380576 Verify that Holdings records are displayed in the Errors with "No change in value required" reason if no changes were made (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkHoldingsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Instance HRIDs'); - BulkEditSearchPane.uploadFile(instanceHRIDFileName); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyMatchedResults(permanentLocation); + it('C380576 Verify that Holdings records are displayed in the Errors with "No change in value required" reason if no changes were made (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Instance HRIDs'); + BulkEditSearchPane.uploadFile(instanceHRIDFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(permanentLocation); - BulkEditActions.openActions(); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.replacePermanentLocation(permanentLocation, 'holdings'); - BulkEditActions.confirmChanges(); - BulkEditActions.commitChanges(); - BulkEditSearchPane.waitFileUploading(); + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.replacePermanentLocation(permanentLocation, 'holdings'); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyReasonForError('No change in value required'); + BulkEditSearchPane.verifyReasonForError('No change in value required'); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-source.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-source.cy.js index 12cc995aa6..358c7816fb 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-source.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-source.cy.js @@ -19,49 +19,51 @@ const item = { }; describe('bulk-edit', () => { - 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.createInstanceMARCSourceViaApi(item.instanceName, item.itemBarcode); - cy.getHoldings({ - limit: 1, - query: `"instanceId"="${instanceId}"` - }) - .then(holdings => { - uuid = holdings[0].id; - FileManager.createFile(`cypress/fixtures/${validHoldingUUIDsFileName}`, uuid); + 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 }); - }); - }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); - FileManager.deleteFile(`cypress/fixtures/${validHoldingUUIDsFileName}`); - }); + const instanceId = InventoryInstances.createInstanceMARCSourceViaApi(item.instanceName, item.itemBarcode); + cy.getHoldings({ + limit: 1, + query: `"instanceId"="${instanceId}"` + }) + .then(holdings => { + uuid = holdings[0].id; + FileManager.createFile(`cypress/fixtures/${validHoldingUUIDsFileName}`, uuid); + }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${validHoldingUUIDsFileName}`); + }); - it('C365125 Verify that User CANNOT bulk edit Holdings that have source "MARC" (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkHoldingsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); - BulkEditSearchPane.verifyDragNDropHoldingsUUIDsArea(); - BulkEditSearchPane.uploadFile(validHoldingUUIDsFileName); - BulkEditSearchPane.waitFileUploading(); + it('C365125 Verify that User CANNOT bulk edit Holdings that have source "MARC" (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); + BulkEditSearchPane.verifyDragNDropHoldingsUUIDsArea(); + BulkEditSearchPane.uploadFile(validHoldingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.replacePermanentLocation(location, 'holdings'); - BulkEditActions.confirmChanges(); - BulkEditActions.commitChanges(); - BulkEditSearchPane.verifyNonMatchedResults('Holdings records that have source "MARC" cannot be changed'); + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.replacePermanentLocation(location, 'holdings'); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + BulkEditSearchPane.verifyNonMatchedResults('Holdings records that have source "MARC" cannot be changed'); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings.cy.js index 5edc40d88c..707cd17129 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings.cy.js @@ -7,7 +7,6 @@ import testTypes from '../../../support/dictionary/testTypes'; import devTeams from '../../../support/dictionary/devTeams'; 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 Users from '../../../support/fragments/users/users'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; @@ -17,7 +16,6 @@ let hrid; const itemBarcode = getRandomPostfix(); const validHoldingUUIDsFileName = `validHoldingUUIDs_${getRandomPostfix()}.csv`; const validHoldingHRIDsFileName = `validHoldingHRIDs_${getRandomPostfix()}.csv`; -const matchedRecordsFileName = `Matched-Records-${validHoldingUUIDsFileName}`; const item = { instanceName: `testBulkEdit_${getRandomPostfix()}`, itemBarcode1: itemBarcode, @@ -30,6 +28,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditHoldings.gui, ]) .then(userProperties => { user = userProperties; @@ -61,20 +60,39 @@ describe('bulk-edit', () => { InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode1); FileManager.deleteFile(`cypress/fixtures/${validHoldingUUIDsFileName}`); FileManager.deleteFile(`cypress/fixtures/${validHoldingHRIDsFileName}`); - FileManager.deleteFileFromDownloadsByMask(`*${matchedRecordsFileName}`); }); afterEach('open new bulk edit', () => { cy.visit(TopMenu.bulkEditPath); }); - it('C357052 Verify Downloaded matched records if identifiers return more than one item (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - BulkEditSearchPane.uploadFile(validHoldingUUIDsFileName); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyMatchedResults(hrid); - - BulkEditActions.downloadMatchedResults(); - BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileName}`, [hrid], 'hrid'); + it('C360089 Verify "Inventory - holdings" option on "Bulk edit" app (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + [ + { + identifier: 'Holdings UUIDs', + label: 'Select a file with holdings UUIDs', + pageText: 'Drag and drop or choose file with holdings UUIDs', + }, + { + identifier: 'Holdings HRIDs', + label: 'Select a file with holdings HRIDs', + pageText: 'Drag and drop or choose file with holdings HRIDs', + }, + { + identifier: 'Instance HRIDs', + label: 'Select a file with instance HRIDs', + pageText: 'Drag and drop or choose file with instance HRIDs', + }, + { + identifier: 'Item barcodes', + label: 'Select a file with item barcode', + pageText: 'Drag and drop or choose file with item barcode', + }, + ].forEach(checker => { + BulkEditSearchPane.selectRecordIdentifier(checker.identifier); + BulkEditSearchPane.verifyInputLabel(checker.label); + BulkEditSearchPane.verifyInputLabel(checker.pageText); + }); }); it('C356810 Verify uploading file with holdings UUIDs (firebird)', { tags: [testTypes.smoke, devTeams.firebird], retries: 1 }, () => { diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes-less-than-10.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes-less-than-10.cy.js index 41d1072dea..b0b7a8e07d 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes-less-than-10.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes-less-than-10.cy.js @@ -25,48 +25,51 @@ const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`; const matchedRecordsFileName = `*Matched-Records-${itemBarcodesFileName}`; let fileContent = ''; -describe('Bulk Edit - Items', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading - }); +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + + items.forEach(item => { + fileContent += `${item.itemBarcode}\n`; + InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + }); - items.forEach(item => { - fileContent += `${item.itemBarcode}\n`; - InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, fileContent); }); + }); - FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, fileContent); + after('delete test data', () => { + items.forEach(item => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); }); - }); - - after('delete test data', () => { - items.forEach(item => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); }); - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); - FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); - }); - it('C358942 Verify that number of records matched for file with less than 10 item barcodes (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkItemsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Item barcode'); - BulkEditSearchPane.uploadFile(itemBarcodesFileName); - BulkEditSearchPane.waitFileUploading(); - items.forEach(item => { - BulkEditSearchPane.verifySpecificItemsMatched(item.itemBarcode); - }); - BulkEditActions.downloadMatchedResults(); + it('C358942 Verify that number of records matched for file with less than 10 item barcodes (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item barcode'); + BulkEditSearchPane.uploadFile(itemBarcodesFileName); + BulkEditSearchPane.waitFileUploading(); + items.forEach(item => { + BulkEditSearchPane.verifySpecificItemsMatched(item.itemBarcode); + }); + BulkEditActions.downloadMatchedResults(); - const values = BulkEditFiles.getValuesFromCSVFile(fileContent); - BulkEditFiles.verifyMatchedResultFileContent(matchedRecordsFileName, values, 'barcode', true); + const values = BulkEditFiles.getValuesFromCSVFile(fileContent); + BulkEditFiles.verifyMatchedResultFileContent(matchedRecordsFileName, values, 'barcode', true); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes.cy.js index 2aaefb2569..c3184387a6 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-barcodes.cy.js @@ -31,6 +31,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-effective-location.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-effective-location.cy.js index 93a9cc3f10..cea9f3a14b 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-effective-location.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-effective-location.cy.js @@ -19,58 +19,60 @@ const item = { const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`; const newLocation = 'Online'; -describe('Bulk Edit - Items', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - permissions.inventoryAll.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading - }); +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); - InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); - FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, item.itemBarcode); - }); - }); + InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, item.itemBarcode); + }); + }); - after('delete test data', () => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); - }); + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); + }); - it('C380559 Verify updating Item "Effective location" in case of clearing Item "Temporary location" and updating Item "Permanent location" (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkItemsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Item barcode'); + it('C380559 Verify updating Item "Effective location" in case of clearing Item "Temporary location" and updating Item "Permanent location" (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item barcode'); - BulkEditSearchPane.uploadFile(itemBarcodesFileName); - BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Item permanent location', 'Item temporary location'); + BulkEditSearchPane.uploadFile(itemBarcodesFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Item permanent location', 'Item temporary location'); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.clearTemporaryLocation(); - BulkEditActions.addNewBulkEditFilterString(); - BulkEditActions.replacePermanentLocation(newLocation, 'item', 1); - BulkEditActions.confirmChanges(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.clearTemporaryLocation(); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.replacePermanentLocation(newLocation, 'item', 1); + BulkEditActions.confirmChanges(); - BulkEditActions.commitChanges(); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyChangesUnderColumns('Item permanent location', newLocation); - BulkEditSearchPane.verifyChangesUnderColumns('Item temporary location', ''); - BulkEditSearchPane.verifyChangesUnderColumns('Item effective location', newLocation); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Item permanent location', newLocation); + BulkEditSearchPane.verifyChangesUnderColumns('Item temporary location', ''); + BulkEditSearchPane.verifyChangesUnderColumns('Item effective location', newLocation); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); - ItemRecordView.waitLoading(); - ItemRecordView.verifyPermanentLocation(newLocation); - ItemRecordView.verifyTemporaryLocation('-'); - ItemRecordView.verifyEffectiveLocation(newLocation); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.verifyPermanentLocation(newLocation); + ItemRecordView.verifyTemporaryLocation('-'); + ItemRecordView.verifyEffectiveLocation(newLocation); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-hrids.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-hrids.cy.js index 49627ff75d..2a99e29213 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-hrids.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-hrids.cy.js @@ -18,45 +18,48 @@ const item = { hrid: '', }; -describe('Bulk Edit - Items', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading - }); - InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); - cy.getItems({ limit: 1, expandAll: true, query: `"barcode"=="${item.barcode}"` }) - .then((res) => { - item.hrid = res.hrid; - FileManager.createFile(`cypress/fixtures/${itemHRIDsFileName}`, item.hrid); +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading }); - }); - }); + InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); + cy.getItems({ limit: 1, expandAll: true, query: `"barcode"=="${item.barcode}"` }) + .then((res) => { + item.hrid = res.hrid; + FileManager.createFile(`cypress/fixtures/${itemHRIDsFileName}`, item.hrid); + }); + }); + }); - after('delete test data', () => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${itemHRIDsFileName}`); - }); + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${itemHRIDsFileName}`); + }); - it('C353622 Verify uploading file with Item HRIDs (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkItemsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Item HRIDs'); + it('C353622 Verify uploading file with Item HRIDs (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item HRIDs'); - BulkEditSearchPane.uploadFile(itemHRIDsFileName); - BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.uploadFile(itemHRIDsFileName); + BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.replaceItemStatus('Intellectual item'); - BulkEditActions.confirmChanges(); - BulkEditActions.commitChanges(); - BulkEditSearchPane.waitFileUploading(); + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.replaceItemStatus('Intellectual item'); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-matched-records.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-matched-records.cy.js new file mode 100644 index 0000000000..f323a9a2df --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-matched-records.cy.js @@ -0,0 +1,69 @@ +import TopMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import devTeams from '../../../support/dictionary/devTeams'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import FileManager from '../../../support/utils/fileManager'; +import Users from '../../../support/fragments/users/users'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditFiles from '../../../support/fragments/bulk-edit/bulk-edit-files'; + +let user; +let hrid; +const item = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; +const validHoldingUUIDsFileName = `validHoldingUUIDs_${getRandomPostfix()}.csv`; +const matchedRecordsFileName = `Matched-Records-${validHoldingUUIDsFileName}`; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.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({ + limit: 1, + query: `"instanceId"="${instanceId}"` + }) + .then(holdings => { + hrid = holdings[0].hrid; + FileManager.createFile(`cypress/fixtures/${validHoldingUUIDsFileName}`, holdings[0].id); + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${validHoldingUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask(`*${matchedRecordsFileName}`); + }); + + // TODO actually check the list of items in matched file + it('C357052 Verify Downloaded matched records if identifiers return more than one item (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); + + BulkEditSearchPane.uploadFile(validHoldingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(hrid); + + BulkEditActions.downloadMatchedResults(); + BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileName}`, [hrid], 'hrid'); + }); + }); +}); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-deleting.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-deleting.cy.js index 685e3a5fa8..abab3386ac 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-deleting.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-deleting.cy.js @@ -27,6 +27,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-nulls.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-nulls.cy.js index d27fdfd93a..49429a0739 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-nulls.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-with-nulls.cy.js @@ -23,6 +23,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js index c392f5689a..05c3795e2d 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js @@ -28,6 +28,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-location-filter.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-location-filter.cy.js index 334dfd783f..b731583114 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-location-filter.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-location-filter.cy.js @@ -22,6 +22,7 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js index cf3b950b93..92b964f185 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js @@ -21,7 +21,7 @@ describe('bulk-edit', () => { permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, permissions.bulkEditUpdateRecords.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui, ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js index 61d3aa5acd..86bac57bf2 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js @@ -33,6 +33,7 @@ describe('bulk-edit', { retries: 2 }, () => { cy.createTempUser([ permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditHoldings.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js index da2be7d8cf..76d6fb62bd 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js @@ -17,11 +17,12 @@ describe('bulk-edit', () => { before('create test data', () => { cy.createTempUser([ permissions.bulkEditUpdateRecords.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui ], 'faculty') .then(userProperties => { user = userProperties; cy.login(user.username, user.password, { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading }); + FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, user.barcode); FileManager.createFile(`cypress/fixtures/${userBarcodesFileNameWithDuplicates}`, `${user.barcode}\r\n${user.barcode}\r\n${getRandomPostfix()}`); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js index 644fcd97fd..7bfe48e3bf 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js @@ -17,7 +17,8 @@ describe('bulk-edit', () => { describe('in-app approach', () => { before('create test data', () => { cy.createTempUser([ - permissions.bulkEditUpdateRecords.gui + permissions.bulkEditUpdateRecords.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-expiration-date.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-expiration-date.cy.js index 588f9e24fb..78fced4e7a 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-expiration-date.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-expiration-date.cy.js @@ -19,7 +19,7 @@ describe('bulk-edit', () => { before('create test data', () => { cy.createTempUser([ permissions.bulkEditUpdateRecords.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-forms.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-forms.cy.js index 87ca99a679..3ecf63a92a 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-forms.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-forms.cy.js @@ -16,7 +16,8 @@ describe('bulk-edit', () => { describe('in-app approach', () => { before('create test data', () => { cy.createTempUser([ - permissions.bulkEditUpdateRecords.gui + permissions.bulkEditUpdateRecords.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-line-break.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-line-break.cy.js index 88713e23a7..558f0f7ff5 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-line-break.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-line-break.cy.js @@ -22,72 +22,74 @@ const matchedRecordsFileName = `*-Matched-Records-${userBarcodesFileName}`; const changedRecordsFileName = `*-Changed-Records-${userBarcodesFileName}`; const previewFileName = `*-Updates-Preview-${userBarcodesFileName}`; -describe('Bulk Edit-- Users - in app approach', () => { - before('create test data', () => { - for (let i = 0; i < 10; i++) { - cy.createTempUser([], 'staff') - .then(userProperties => { - testUsers.push(userProperties); - testUsersBarcodes.push(userProperties.barcode); - FileManager.appendFile(`cypress/fixtures/${userBarcodesFileName}`, `${userProperties.barcode}\n`); - }); - } +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + for (let i = 0; i < 10; i++) { + cy.createTempUser([], 'staff') + .then(userProperties => { + testUsers.push(userProperties); + testUsersBarcodes.push(userProperties.barcode); + FileManager.appendFile(`cypress/fixtures/${userBarcodesFileName}`, `${userProperties.barcode}\n`); + }); + } - cy.createTempUser([ - permissions.bulkEditUpdateRecords.gui, - permissions.uiUsersView.gui, - ]).then(userProperties => { user = userProperties; }) - .then(() => { - cy.loginAsAdmin({ path: SettingsMenu.customFieldsPath, waiter: CustomFields.waitLoading }); - CustomFields.addTextAreaCustomField(customFieldName); - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByKeywords(testUsersBarcodes[0]); - UserEdit.addCustomField(customFieldName, customFieldText); + cy.createTempUser([ + permissions.bulkEditUpdateRecords.gui, + permissions.uiUserEdit.gui, + ]).then(userProperties => { user = userProperties; }) + .then(() => { + cy.loginAsAdmin({ path: SettingsMenu.customFieldsPath, waiter: CustomFields.waitLoading }); + CustomFields.addTextAreaCustomField(customFieldName); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords(testUsersBarcodes[0]); + UserEdit.addCustomField(customFieldName, customFieldText); - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); }); - }); - }); + }); - after('delete test data', () => { - FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); - testUsers.forEach(testUser => Users.deleteViaApi(testUser.userId)); - Users.deleteViaApi(user.userId); - FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName, changedRecordsFileName, previewFileName); - }); + after('delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); + testUsers.forEach(testUser => Users.deleteViaApi(testUser.userId)); + Users.deleteViaApi(user.userId); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName, changedRecordsFileName, previewFileName); + }); - it('C399098 Verify Previews for the number of Users records if the record has field with line break (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.checkUsersRadio(); - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.verifyDragNDropUsersBarcodesArea(); + it('C399098 Verify Previews for the number of Users records if the record has field with line break (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); + BulkEditSearchPane.verifyDragNDropUsersBarcodesArea(); - BulkEditSearchPane.uploadFile(userBarcodesFileName); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyMatchedResults(...testUsersBarcodes); - BulkEditActions.downloadMatchedResults(); - BulkEditSearchPane.changeShowColumnCheckbox('Custom fields'); - BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditSearchPane.uploadFile(userBarcodesFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(...testUsersBarcodes); + BulkEditActions.downloadMatchedResults(); + BulkEditSearchPane.changeShowColumnCheckbox('Custom fields'); + BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.fillPatronGroup('faculty (Faculty Member)'); - BulkEditActions.confirmChanges(); - BulkEditActions.verifyAreYouSureForm(testUsersBarcodes.length, 'faculty'); - BulkEditActions.downloadPreview(); - BulkEditActions.commitChanges(); - BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditActions.downloadChangedCSV(); + BulkEditActions.fillPatronGroup('faculty (Faculty Member)'); + BulkEditActions.confirmChanges(); + BulkEditActions.verifyAreYouSureForm(testUsersBarcodes.length, 'faculty'); + BulkEditActions.downloadPreview(); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); - BulkEditSearchPane.verifyChangedResults(...testUsersBarcodes); - BulkEditSearchPane.verifyChangesUnderColumns('Custom fields', `${customFieldName}:${customFieldText}`); + BulkEditSearchPane.verifyChangedResults(...testUsersBarcodes); + BulkEditSearchPane.verifyChangesUnderColumns('Custom fields', `${customFieldName}:${customFieldText}`); - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByKeywords(testUsersBarcodes[0]); - Users.verifyPatronGroupOnUserDetailsPane('faculty'); - Users.verifyCustomFieldOnUserDetailsPane(customFieldName, customFieldText); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords(testUsersBarcodes[0]); + Users.verifyPatronGroupOnUserDetailsPane('faculty'); + Users.verifyCustomFieldOnUserDetailsPane(customFieldName, customFieldText); - cy.loginAsAdmin({ path: SettingsMenu.customFieldsPath, waiter: CustomFields.waitLoading }); - CustomFields.deleteCustomField(customFieldName); + cy.loginAsAdmin({ path: SettingsMenu.customFieldsPath, waiter: CustomFields.waitLoading }); + CustomFields.deleteCustomField(customFieldName); + }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-view.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-view.cy.js new file mode 100644 index 0000000000..2d92885a6a --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-view.cy.js @@ -0,0 +1,72 @@ +import TopMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import devTeams from '../../../support/dictionary/devTeams'; +import Users from '../../../support/fragments/users/users'; + +let user; +const userUUIDsFileName = `userUUIDs_${getRandomPostfix()}.csv`; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditUpdateRecords.gui, + permissions.uiUsersView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading }); + FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); + }); + }); + + beforeEach('select User', () => { + BulkEditSearchPane.checkUsersRadio(); + }); + + after('delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); + Users.deleteViaApi(user.userId); + }); + + afterEach('open new bulk-edit form', () => { + cy.visit(TopMenu.bulkEditPath); + }); + + it('C357578 Verify "In app - Edit user records" permission (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.verifyUsersUpdatePermission(); + BulkEditSearchPane.verifyRecordIdentifierItems(); + BulkEditSearchPane.verifyDragNDropUpdateUsersArea(); + + BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); + BulkEditSearchPane.verifyDragNDropUsersBarcodesArea(); + + BulkEditSearchPane.selectRecordIdentifier('External IDs'); + BulkEditSearchPane.verifyDragNDropExternalIDsArea(); + + BulkEditSearchPane.selectRecordIdentifier('Usernames'); + BulkEditSearchPane.verifyDragNDropUsernamesArea(); + }); + + it('C359197 Verify that User can change the columns in the "Preview of record matched" (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { + BulkEditSearchPane.verifyDragNDropUsersUUIDsArea(); + BulkEditSearchPane.uploadFile(userUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(user.username); + + BulkEditSearchPane.verifyActionsAfterConductedCSVUploading(false); + BulkEditSearchPane.verifyUserBarcodesResultAccordion(); + BulkEditSearchPane.verifyUsersActionShowColumns(); + + BulkEditSearchPane.changeShowColumnCheckbox('Last name'); + BulkEditSearchPane.verifyResultColumTitlesDoNotInclude('Last name'); + + BulkEditSearchPane.changeShowColumnCheckbox('Email'); + BulkEditSearchPane.verifyResultColumTitles('Email'); + }); + }); +}); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids.cy.js index a0ede0cfef..166ba5bfe1 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids.cy.js @@ -18,7 +18,8 @@ describe('bulk-edit', () => { describe('in-app approach', () => { before('create test data', () => { cy.createTempUser([ - permissions.bulkEditUpdateRecords.gui + permissions.bulkEditUpdateRecords.gui, + permissions.uiUserEdit.gui ]) .then(userProperties => { user = userProperties; @@ -54,21 +55,6 @@ describe('bulk-edit', () => { BulkEditActions.verifyBulkEditForm(); }); - it('C357578 Verify "In app - Update user records" permission (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - BulkEditSearchPane.verifyUsersUpdatePermission(); - BulkEditSearchPane.verifyRecordIdentifierItems(); - BulkEditSearchPane.verifyDragNDropUpdateUsersArea(); - - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.verifyDragNDropUsersBarcodesArea(); - - BulkEditSearchPane.selectRecordIdentifier('External IDs'); - BulkEditSearchPane.verifyDragNDropExternalIDsArea(); - - BulkEditSearchPane.selectRecordIdentifier('Usernames'); - BulkEditSearchPane.verifyDragNDropUsernamesArea(); - }); - it('C357987 Verify Users Patron group bulk edit -- in app approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); @@ -161,22 +147,5 @@ describe('bulk-edit', () => { BulkEditActions.verifySuccessBanner(1); BulkEditSearchPane.verifyChangedResults(user.username); }); - - it('C359197 Verify that User can change the columns in the "Preview of record matched" (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { - BulkEditSearchPane.verifyDragNDropUsersUUIDsArea(); - BulkEditSearchPane.uploadFile(userUUIDsFileName); - BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyMatchedResults(user.username); - - BulkEditSearchPane.verifyActionsAfterConductedCSVUploading(false); - BulkEditSearchPane.verifyUserBarcodesResultAccordion(); - BulkEditSearchPane.verifyUsersActionShowColumns(); - - BulkEditSearchPane.changeShowColumnCheckbox('Last name'); - BulkEditSearchPane.verifyResultColumTitlesDoNotInclude('Last name'); - - BulkEditSearchPane.changeShowColumnCheckbox('Email'); - BulkEditSearchPane.verifyResultColumTitles('Email'); - }); }); }); diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js index 65f1c5dbcf..f3b12bc6ea 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js @@ -38,7 +38,7 @@ describe('Bulk Edit - Logs', () => { permissions.bulkEditLogsView.gui, permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui, ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-valid.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-valid.cy.js index 0284d28624..3ca2555111 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-valid.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-valid.cy.js @@ -28,7 +28,7 @@ describe('Bulk Edit - Logs', () => { permissions.bulkEditLogsView.gui, permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui, ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js index cebc48901e..e53131e00b 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js @@ -7,6 +7,9 @@ import testTypes from '../../../../support/dictionary/testTypes'; import getRandomPostfix from '../../../../support/utils/stringTools'; import FileManager from '../../../../support/utils/fileManager'; import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-actions'; +import UsersSearchPane from '../../../../support/fragments/users/usersSearchPane'; +import UserEdit from '../../../../support/fragments/users/userEdit'; +import UsersCard from '../../../../support/fragments/users/usersCard'; let user; const newName = `testName_${getRandomPostfix()}`; @@ -21,6 +24,7 @@ describe('Bulk Edit - Logs', () => { permissions.bulkEditLogsView.gui, permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, + permissions.uiUserEdit.gui, ]) .then(userProperties => { user = userProperties; @@ -57,6 +61,26 @@ describe('Bulk Edit - Logs', () => { BulkEditActions.openActions(); BulkEditActions.downloadChangedCSV(); + + cy.loginAsAdmin({ path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading }); + UsersSearchPane.searchByUsername(user.username); + UsersSearchPane.openUser(user.username); + UserEdit.addPermissions([ + permissions.uiUserEdit.gui + ]); + UserEdit.saveAndClose(); + cy.pause(); + UsersCard.verifyPermissions([ + permissions.bulkEditLogsView.gui, + permissions.bulkEditCsvView.gui, + permissions.bulkEditCsvEdit.gui, + ]); + + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + BulkEditSearchPane.openLogsSearch(); BulkEditSearchPane.verifyLogsPane(); BulkEditSearchPane.checkUsersCheckbox(); diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js index 4500e0dba3..0e1139f221 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js @@ -26,7 +26,7 @@ describe('Bulk Edit - Logs', () => { permissions.bulkEditLogsView.gui, permissions.bulkEditCsvView.gui, permissions.bulkEditCsvEdit.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui, ]) .then(userProperties => { user = userProperties; @@ -45,7 +45,7 @@ describe('Bulk Edit - Logs', () => { FileManager.deleteFileFromDownloadsByMask(userUUIDsFileName, `*${matchedRecordsFileName}`, changedRecordsFileName, previewOfProposedChangesFileName.first, previewOfProposedChangesFileName.second, updatedRecordsFileName); }); - it('C375217 Verify generated Logs files for Users CSV (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C375217 Verify generated Logs files for Users Local (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); BulkEditSearchPane.waitLoading(); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js index 890df4258c..fa0fea8f8f 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js @@ -20,6 +20,7 @@ describe('Bulk Edit - Logs', () => { permissions.bulkEditLogsView.gui, permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js index fdce8519f4..766c268a7e 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js @@ -14,6 +14,7 @@ import InventorySearchAndFilter from '../../../../support/fragments/inventory/in import ItemRecordView from '../../../../support/fragments/inventory/item/itemRecordView'; import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation'; import InstanceRecordView from '../../../../support/fragments/inventory/instanceRecordView'; +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); @@ -107,7 +108,8 @@ describe('Bulk Edit - Logs', () => { BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, [item.instanceHRID], 'instanceHrid', true); TopMenuNavigation.navigateToApp('Inventory'); - InventorySearchAndFilter.searchInstanceByHRID(item.instanceHRID); + InventoryInstance.searchByTitle(item.instanceName); + InventoryInstances.selectInstance(); InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); TopMenuNavigation.navigateToApp('Inventory'); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-barcodes.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-barcodes.cy.js index bf172d0497..5e192a59ea 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-barcodes.cy.js @@ -29,7 +29,7 @@ describe('Bulk Edit - Logs', () => { cy.createTempUser([ permissions.bulkEditLogsView.gui, permissions.bulkEditUpdateRecords.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui, ]) .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js index 313ff054ff..29264d79d2 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js @@ -31,7 +31,7 @@ describe('Bulk Edit - Logs', () => { cy.createTempUser([ permissions.bulkEditLogsView.gui, permissions.bulkEditUpdateRecords.gui, - permissions.uiUsersView.gui, + permissions.uiUserEdit.gui, ], 'staff') .then(userProperties => { user = userProperties; diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-all-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-all-permissions.cy.js index 9d35327090..b56df1767b 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-all-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-all-permissions.cy.js @@ -3,7 +3,7 @@ import testTypes from '../../../support/dictionary/testTypes'; import permissions from '../../../support/dictionary/permissions'; import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; import devTeams from '../../../support/dictionary/devTeams'; -import users from '../../../support/fragments/users/users'; +import Users from '../../../support/fragments/users/users'; let user; let userCircAndLogsPermissions; @@ -16,6 +16,8 @@ describe('bulk-edit', () => { permissions.bulkEditCsvEdit.gui, permissions.bulkEditView.gui, permissions.bulkEditEdit.gui, + permissions.uiUsersView.gui, + permissions.uiInventoryViewInstances.gui ]) .then(userProperties => { user = userProperties; @@ -39,8 +41,8 @@ describe('bulk-edit', () => { }); after('delete test data', () => { - users.deleteViaApi(user.userId); - users.deleteViaApi(userCircAndLogsPermissions.userId); + Users.deleteViaApi(user.userId); + Users.deleteViaApi(userCircAndLogsPermissions.userId); }); it('C360090 Verify switching between Inventory record types radio buttons (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { @@ -66,7 +68,10 @@ describe('bulk-edit', () => { }); it('C347870 Verify that user with Bulk Edit: View and Edit permission can start bulk editing (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { - cy.visit(TopMenu.bulkEditPath); + cy.login(userCircAndLogsPermissions.username, userCircAndLogsPermissions.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); BulkEditSearchPane.actionsIsAbsent(); BulkEditSearchPane.isDragAndDropAreaDisabled(true); }); 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 5f1b590cfd..76e4a020ab 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 @@ -14,45 +14,47 @@ let user; const userUUIDsFileName = `userUUIDs_${getRandomPostfix()}.csv`; const matchedRecordsFileName = `*Matched-Records-${userUUIDsFileName}`; -describe('Permissions Bulk Edit', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditCsvView.gui, - permissions.bulkEditCsvEdit.gui, - permissions.bulkEditEdit.gui, - permissions.bulkEditView.gui, - permissions.uiUsersView.gui, - permissions.exportManagerAll.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading +describe('bulk-edit', () => { + describe('permissions', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditCsvView.gui, + permissions.bulkEditCsvEdit.gui, + permissions.bulkEditEdit.gui, + permissions.bulkEditView.gui, + permissions.uiUsersView.gui, + permissions.exportManagerAll.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + }) + .then(() => { + FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); + BulkEditSearchPane.uploadFile(userUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + cy.visit(TopMenu.exportManagerPath); }); - }) - .then(() => { - FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); - BulkEditSearchPane.checkUsersRadio(); - BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); - BulkEditSearchPane.uploadFile(userUUIDsFileName); - BulkEditSearchPane.waitFileUploading(); - cy.visit(TopMenu.exportManagerPath); - }); - }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); - FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); + }); - 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); - ExportManagerSearchPane.clickJobIdInThirdPane(); + 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); + ExportManagerSearchPane.clickJobIdInThirdPane(); - BulkEditFiles.verifyMatchedResultFileContent(matchedRecordsFileName, [user.userId], 'userId', true); + BulkEditFiles.verifyMatchedResultFileContent(matchedRecordsFileName, [user.userId], 'userId', true); + }); }); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-in-app-export-manager-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-in-app-export-manager-permissions.cy.js index 970ca6c762..f0e8fed359 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-in-app-export-manager-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-in-app-export-manager-permissions.cy.js @@ -21,61 +21,64 @@ const item = { const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`; const itemMatchedRecordsFileName = `*Matched-Records-${itemBarcodesFileName}`; -describe('Permissions Bulk Edit', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditCsvView.gui, - permissions.bulkEditCsvEdit.gui, - permissions.bulkEditEdit.gui, - permissions.bulkEditView.gui, - permissions.uiUsersView.gui, - permissions.exportManagerAll.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading - }); - }) - .then(() => { - FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); - BulkEditSearchPane.checkUsersRadio(); - BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); - BulkEditSearchPane.uploadFile(userUUIDsFileName); - BulkEditSearchPane.waitFileUploading(); - }) - .then(() => { - cy.visit(TopMenu.bulkEditPath); - InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); - FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, item.itemBarcode); - BulkEditSearchPane.checkItemsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Item barcode'); +describe('bulk-edit', () => { + describe('permissions', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditCsvView.gui, + permissions.bulkEditCsvEdit.gui, + permissions.bulkEditEdit.gui, + permissions.bulkEditView.gui, + permissions.uiUsersView.gui, + permissions.exportManagerAll.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + }) + .then(() => { + FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); + BulkEditSearchPane.uploadFile(userUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + }) + .then(() => { + cy.visit(TopMenu.bulkEditPath); + InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, item.itemBarcode); + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item barcode'); - BulkEditSearchPane.uploadFile(itemBarcodesFileName); - BulkEditSearchPane.waitFileUploading(); - cy.visit(TopMenu.exportManagerPath); - }); - }); + BulkEditSearchPane.uploadFile(itemBarcodesFileName); + BulkEditSearchPane.waitFileUploading(); + cy.visit(TopMenu.exportManagerPath); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); - FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); - FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); - FileManager.deleteFileFromDownloadsByMask(itemMatchedRecordsFileName, userMatchedRecordsFileName); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); + FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask(itemMatchedRecordsFileName, userMatchedRecordsFileName); + }); - it('C353972 Verify that user can view data in Export Manager(CSV and In-app approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - ExportManagerSearchPane.waitLoading(); - ExportManagerSearchPane.searchByBulkEdit(); - ExportManagerSearchPane.verifyJobAmount(user.username, 2); - ExportManagerSearchPane.selectJobByIndex(user.username, 0); - ExportManagerSearchPane.clickJobIdInThirdPane(); - BulkEditFiles.verifyMatchedResultFileContent(itemMatchedRecordsFileName, [item.itemBarcode], 'barcode', true); + it('C353972 Verify that user can view data in Export Manager(CSV and In-app approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + ExportManagerSearchPane.waitLoading(); + ExportManagerSearchPane.searchByBulkEdit(); + ExportManagerSearchPane.verifyJobAmount(user.username, 2); + ExportManagerSearchPane.selectJobByIndex(user.username, 0); + ExportManagerSearchPane.clickJobIdInThirdPane(); + BulkEditFiles.verifyMatchedResultFileContent(itemMatchedRecordsFileName, [item.itemBarcode], 'barcode', true); - ExportManagerSearchPane.selectJobByIndex(user.username, 1); - ExportManagerSearchPane.clickJobIdInThirdPane(); - BulkEditFiles.verifyMatchedResultFileContent(userMatchedRecordsFileName, [user.userId], 'userId', true); + ExportManagerSearchPane.selectJobByIndex(user.username, 1); + ExportManagerSearchPane.clickJobIdInThirdPane(); + BulkEditFiles.verifyMatchedResultFileContent(userMatchedRecordsFileName, [user.userId], 'userId', true); + }); }); }); 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 4456bc85c1..d25caccd08 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 @@ -29,7 +29,7 @@ describe('bulk-edit', () => { users.deleteViaApi(userWithCsvViewPermission.userId); }); - it('C350903 Verify "Bulk Edit: CSV - View" permissions (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C350903 Verify "Bulk Edit: Local - View user records" permissions (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { cy.login(userWithCsvViewPermission.username, userWithCsvViewPermission.password); cy.visit(TopMenu.bulkEditPath); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js index 24334d48d5..dbfdf3f3b6 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js @@ -41,20 +41,15 @@ describe('bulk-edit', () => { Users.deleteViaApi(userWithProfileView.userId); }); - it('C366072 Verify Bulk edit elements in the left pane -- Users CSV & In app (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C366072 Verify Bulk edit elements in the left pane -- Users Local & In app (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); - BulkEditSearchPane.usersRadioIsDisabled(false); - BulkEditSearchPane.isUsersRadioChecked(); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); + BulkEditSearchPane.verifyRecordIdentifierEmpty(); BulkEditSearchPane.isDragAndDropAreaDisabled(true); BulkEditSearchPane.openQuerySearch(); BulkEditSearchPane.verifySpecificTabHighlighted('Query'); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); + BulkEditSearchPane.verifyRecordTypesEmpty(); BulkEditSearchPane.isBuildQueryButtonDisabled(true); // Need to wait for verification to complete @@ -67,15 +62,11 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); BulkEditSearchPane.usersRadioIsDisabled(false); BulkEditSearchPane.isUsersRadioChecked(); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); BulkEditSearchPane.isDragAndDropAreaDisabled(true); BulkEditSearchPane.openQuerySearch(); BulkEditSearchPane.verifySpecificTabHighlighted('Query'); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); + BulkEditSearchPane.usersRadioIsDisabled(false); BulkEditSearchPane.isBuildQueryButtonDisabled(false); BulkEditSearchPane.clickBuildQueryButton(); 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 8257bd39a7..23eff8dce8 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 @@ -18,67 +18,69 @@ let user; const userUUIDsFileName = `userUUIDs_${getRandomPostfix()}.csv`; const matchedRecordsFileName = `*Matched-Records-${userUUIDsFileName}`; -describe('Permissions Bulk Edit', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditCsvView.gui, - permissions.bulkEditCsvEdit.gui, - permissions.uiUsersView.gui, - permissions.uiUsersPermissions.gui, - permissions.uiUserEdit.gui, - permissions.exportManagerAll.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading +describe('bulk-edit', () => { + describe('permissions', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditCsvView.gui, + permissions.bulkEditCsvEdit.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiUserEdit.gui, + permissions.exportManagerAll.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + }) + .then(() => { + FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); + BulkEditSearchPane.uploadFile(userUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); }); - }) - .then(() => { - FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); - BulkEditSearchPane.checkUsersRadio(); - BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); - BulkEditSearchPane.uploadFile(userUUIDsFileName); - BulkEditSearchPane.waitFileUploading(); - }); - }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); - FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); + }); - it('C353978 Verify that user can view data in Export Manager based on permissions (Negative) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - cy.visit(TopMenu.exportManagerPath); - ExportManagerSearchPane.searchByBulkEdit(); - ExportManagerSearchPane.selectJob(user.username); - ExportManagerSearchPane.clickJobIdInThirdPane(); + it('C353978 Verify that user can view data in Export Manager based on permissions (Negative) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + cy.visit(TopMenu.exportManagerPath); + ExportManagerSearchPane.searchByBulkEdit(); + ExportManagerSearchPane.selectJob(user.username); + ExportManagerSearchPane.clickJobIdInThirdPane(); - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByUsername(user.username); - UsersSearchPane.waitLoading(); - UserEdit.addPermissions([ - permissions.bulkEditCsvView.gui, - permissions.bulkEditCsvEdit.gui, - permissions.uiUsersView.gui, - permissions.uiUsersPermissions.gui, - permissions.uiUserEdit.gui, - ]); - UserEdit.saveAndClose(); - UserEdit.addPermissions([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - ]); - UserEdit.saveAndClose(); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByUsername(user.username); + UsersSearchPane.waitLoading(); + UserEdit.addPermissions([ + permissions.bulkEditCsvView.gui, + permissions.bulkEditCsvEdit.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiUserEdit.gui, + ]); + UserEdit.saveAndClose(); + UserEdit.addPermissions([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + ]); + UserEdit.saveAndClose(); - cy.login(user.username, user.password, { - path: TopMenu.exportManagerPath, - waiter: ExportManagerSearchPane.waitLoading + cy.login(user.username, user.password, { + path: TopMenu.exportManagerPath, + waiter: ExportManagerSearchPane.waitLoading + }); + ExportManagerSearchPane.searchByBulkEdit(); + ExportManagerSearchPane.selectJob(user.username); + ExportManagerSearchPane.verifyJobIdInThirdPaneHasNoLink(); }); - ExportManagerSearchPane.searchByBulkEdit(); - ExportManagerSearchPane.selectJob(user.username); - ExportManagerSearchPane.verifyJobIdInThirdPaneHasNoLink(); }); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-export-manager-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-export-manager-permissions.cy.js index 7a9128a624..14f614d369 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-export-manager-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-export-manager-permissions.cy.js @@ -18,47 +18,49 @@ const item = { const itemBarcodesFileName = `itemBarcodesFileName${getRandomPostfix()}.csv`; const matchedRecordsFileName = `*Matched-Records-${itemBarcodesFileName}`; -describe('Permissions Bulk Edit', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditCsvView.gui, - permissions.bulkEditCsvEdit.gui, - permissions.bulkEditEdit.gui, - permissions.bulkEditCsvView.gui, - permissions.uiUsersView.gui, - permissions.uiUserEdit.gui, - permissions.inventoryAll.gui, - permissions.exportManagerAll.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading +describe('bulk-edit', () => { + describe('permissions', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditCsvView.gui, + permissions.bulkEditCsvEdit.gui, + permissions.bulkEditEdit.gui, + permissions.bulkEditCsvView.gui, + permissions.uiUsersView.gui, + permissions.uiUserEdit.gui, + permissions.inventoryAll.gui, + permissions.exportManagerAll.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); + FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, item.itemBarcode); + }) + .then(() => { + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item barcode'); + BulkEditSearchPane.uploadFile(itemBarcodesFileName); + BulkEditSearchPane.waitFileUploading(); }); - item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); - FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, item.itemBarcode); - }) - .then(() => { - BulkEditSearchPane.checkItemsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Item barcode'); - BulkEditSearchPane.uploadFile(itemBarcodesFileName); - BulkEditSearchPane.waitFileUploading(); - }); - }); + }); - after('delete test data', () => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); - FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); - }); + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); + }); - it('C353971 Verify that user can view data in Export Manager based on permissions (In-app approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - cy.visit(TopMenu.exportManagerPath); - ExportManagerSearchPane.searchByBulkEdit(); - ExportManagerSearchPane.selectJob(user.username); - ExportManagerSearchPane.clickJobIdInThirdPane(); - BulkEditFiles.verifyMatchedResultFileContent(matchedRecordsFileName, [item.itemBarcode], 'barcode', true); + it('C353971 Verify that user can view data in Export Manager based on permissions (In-app approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + cy.visit(TopMenu.exportManagerPath); + ExportManagerSearchPane.searchByBulkEdit(); + ExportManagerSearchPane.selectJob(user.username); + ExportManagerSearchPane.clickJobIdInThirdPane(); + BulkEditFiles.verifyMatchedResultFileContent(matchedRecordsFileName, [item.itemBarcode], 'barcode', true); + }); }); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-permissions.cy.js index 7aed423034..8866448bf4 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-permissions.cy.js @@ -20,7 +20,7 @@ describe('bulk-edit', () => { users.deleteViaApi(userWithInAppViewPermission.userId); }); - it('C350936 Verify "Bulk edit: in app - view" permissions (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C350936 Verify "Bulk Edit: In app - View inventory records" permissions (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { cy.login(userWithInAppViewPermission.username, userWithInAppViewPermission.password); cy.visit(TopMenu.bulkEditPath); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js index eaa6b33b07..99afa7ead3 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js @@ -41,17 +41,13 @@ describe('bulk-edit', () => { it('C366073 Verify Bulk edit elements in the left pane --In app (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(false); - BulkEditSearchPane.isItemsRadioChecked(); - BulkEditSearchPane.itemsHoldingsIsDisabled(false); + BulkEditSearchPane.verifyRecordTypesEmpty(); + BulkEditSearchPane.verifyRecordIdentifierEmpty(); BulkEditSearchPane.isDragAndDropAreaDisabled(true); BulkEditSearchPane.openQuerySearch(); BulkEditSearchPane.verifySpecificTabHighlighted('Query'); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); + BulkEditSearchPane.verifyRecordTypesEmpty(); BulkEditSearchPane.isBuildQueryButtonDisabled(true); // Need to wait for verification to complete @@ -62,17 +58,16 @@ describe('bulk-edit', () => { }); BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); - BulkEditSearchPane.usersRadioIsDisabled(true); BulkEditSearchPane.itemsRadioIsDisabled(false); BulkEditSearchPane.isItemsRadioChecked(); - BulkEditSearchPane.itemsHoldingsIsDisabled(false); + BulkEditSearchPane.holdingsRadioIsDisabled(false); BulkEditSearchPane.isDragAndDropAreaDisabled(true); BulkEditSearchPane.openQuerySearch(); BulkEditSearchPane.verifySpecificTabHighlighted('Query'); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); + BulkEditSearchPane.itemsRadioIsDisabled(false); + BulkEditSearchPane.isItemsRadioChecked(); + BulkEditSearchPane.holdingsRadioIsDisabled(false); BulkEditSearchPane.isBuildQueryButtonDisabled(false); BulkEditSearchPane.clickBuildQueryButton(); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-holdings-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-holdings-permissions.cy.js index b0924fbf8e..3d73b5e53a 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-holdings-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-holdings-permissions.cy.js @@ -6,58 +6,66 @@ import Users from '../../../support/fragments/users/users'; import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; import UserEdit from '../../../support/fragments/users/userEdit'; +import UsersCard from '../../../support/fragments/users/usersCard'; let user; -describe('Permissions Bulk Edit', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - permissions.inventoryCRUDHoldings.gui, - permissions.uiUsersView.gui, - permissions.uiUsersPermissions.gui, - permissions.uiUserEdit.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading +describe('bulk-edit', () => { + describe('permissions', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryCRUDHoldings.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiUserEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); }); - }); - }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + }); - it('C376992 Verify Query tab permissions (In app holdings) (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier'); - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Query', 'Logs'); + it('C376992 Verify Query tab permissions (In app holdings) (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier'); + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Query', 'Logs'); - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByUsername(user.username); - UsersSearchPane.openUser(user.username); - // Add bulkEditQueryView permission and remove next three - UserEdit.addPermissions([ - permissions.bulkEditQueryView.gui, - permissions.uiUsersView.gui, - permissions.uiUsersPermissions.gui, - permissions.uiUserEdit.gui, - ]); - UserEdit.saveAndClose(); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByUsername(user.username); + UsersSearchPane.openUser(user.username); + // Add bulkEditQueryView permission and remove next three + UserEdit.addPermissions([ + permissions.bulkEditQueryView.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiUserEdit.gui, + ]); + UserEdit.saveAndClose(); + UsersCard.verifyPermissions([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryCRUDHoldings.gui, + permissions.bulkEditQueryView.gui, + ]); - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); + BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Logs'); + BulkEditSearchPane.openQuerySearch(); + BulkEditSearchPane.itemsRadioIsDisabled(false); + BulkEditSearchPane.holdingsRadioIsDisabled(false); }); - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); - BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Logs'); - BulkEditSearchPane.openQuerySearch(); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(false); }); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-items-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-items-permissions.cy.js index b5e0d459ef..98a665a15d 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-items-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-tab-items-permissions.cy.js @@ -6,58 +6,66 @@ import Users from '../../../support/fragments/users/users'; import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; import UserEdit from '../../../support/fragments/users/userEdit'; +import UsersCard from '../../../support/fragments/users/usersCard'; let user; -describe('Permissions Bulk Edit', () => { - before('create test data', () => { - cy.createTempUser([ - permissions.bulkEditView.gui, - permissions.bulkEditEdit.gui, - permissions.uiInventoryViewCreateEditItems.gui, - permissions.uiUsersView.gui, - permissions.uiUsersPermissions.gui, - permissions.uiUserEdit.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading +describe('bulk-edit', () => { + describe('permissions', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiUserEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); }); - }); - }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + }); - it('C376991 Verify Query tab permissions (In app items) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier'); - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Query', 'Logs'); + it('C376991 Verify Query tab permissions (In app items) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier'); + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Query', 'Logs'); - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByUsername(user.username); - UsersSearchPane.openUser(user.username); - // Add bulkEditQueryView permission and remove next three - UserEdit.addPermissions([ - permissions.bulkEditQueryView.gui, - permissions.uiUsersView.gui, - permissions.uiUsersPermissions.gui, - permissions.uiUserEdit.gui, - ]); - UserEdit.saveAndClose(); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByUsername(user.username); + UsersSearchPane.openUser(user.username); + // Add bulkEditQueryView permission and remove next three + UserEdit.addPermissions([ + permissions.bulkEditQueryView.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiUserEdit.gui, + ]); + UserEdit.saveAndClose(); + UsersCard.verifyPermissions([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui, + permissions.bulkEditQueryView.gui, + ]); - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); + BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); + BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Logs'); + BulkEditSearchPane.openQuerySearch(); + BulkEditSearchPane.itemsRadioIsDisabled(false); + BulkEditSearchPane.holdingsRadioIsDisabled(false); }); - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); - BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); - BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Logs'); - BulkEditSearchPane.openQuerySearch(); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(false); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); }); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-try-to-upload-without-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-try-to-upload-without-permissions.cy.js index c2dcf3afab..5197d1615d 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-try-to-upload-without-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-try-to-upload-without-permissions.cy.js @@ -28,14 +28,10 @@ describe('bulk-edit', () => { cy.createTempUser([ permissions.bulkEditCsvView.gui, permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui ]) .then(userProperties => { user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.bulkEditPath, - waiter: BulkEditSearchPane.waitLoading - }); - let fileContent = ''; items.forEach(item => { item.secondBarcode = 'secondBarcode_' + item.itemBarcode; @@ -61,9 +57,7 @@ describe('bulk-edit', () => { FileManager.deleteFileFromDownloadsByMask(changedRecordsFileName); }); - it('C388491 Verify that User with "Bulk Edit: (CSV) View" and "Bulk Edit: In app - Edit" permissions CAN\'T edit user records (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { - BulkEditSearchPane.isUsersRadioChecked(); - BulkEditSearchPane.verifyRecordIdentifierDisabled(); + it('C388491 Verify that User with "Bulk Edit: Local View" and "Bulk Edit: In app - Edit inventory" permissions CAN\'T edit user records (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { BulkEditSearchPane.verifyItemIdentifiersDefaultState(); BulkEditSearchPane.selectRecordIdentifier('Item barcode'); BulkEditSearchPane.uploadFile(itemBarcodesFileName); @@ -84,8 +78,9 @@ describe('bulk-edit', () => { BulkEditActions.downloadChangedCSV(); TopMenuNavigation.navigateToApp('Bulk edit'); - BulkEditSearchPane.isUsersRadioChecked(); - BulkEditSearchPane.verifyRecordIdentifierDisabled(); + BulkEditSearchPane.itemsRadioIsDisabled(false); + BulkEditSearchPane.holdingsRadioIsDisabled(false); + BulkEditSearchPane.verifyRadioHidden('Users'); }); }); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-without-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-without-permissions.cy.js index 33dab6e918..745231a96f 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-without-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-without-permissions.cy.js @@ -49,9 +49,7 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Logs'); BulkEditSearchPane.openQuerySearch(); - BulkEditSearchPane.usersRadioIsDisabled(true); - BulkEditSearchPane.itemsRadioIsDisabled(true); - BulkEditSearchPane.itemsHoldingsIsDisabled(true); + BulkEditSearchPane.verifyRecordTypesEmpty(); }); }); }); 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 7c9e543b71..5a55499934 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -135,6 +135,16 @@ export default { ]); }, + verifyRecordIdentifierEmpty() { + cy.expect(recordIdentifierDropdown.find(HTML('')).exists()); + }, + + verifyRecordTypesEmpty() { + cy.expect([ + recordTypesAccordion.find(HTML('')).exists(), + ]); + }, + verifyRecordIdentifierItems() { this.checkUsersRadio(); cy.expect([ @@ -380,7 +390,9 @@ export default { verifyCsvViewPermission() { cy.expect([ - radioItems.has({ disabled: true }), + usersRadio.absent(), + itemsRadio.absent(), + holdingsRadio.absent(), recordIdentifierDropdown.has({ disabled: true }), fileButton.has({ disabled: true }), actions.absent() @@ -389,7 +401,8 @@ export default { verifyUsersUpdatePermission() { cy.expect([ - radioItems.has({ disabled: true }), + itemsRadio.absent(), + holdingsRadio.absent(), recordIdentifierDropdown.has({ disabled: false }), fileButton.has({ disabled: true }), actions.absent(), @@ -398,7 +411,9 @@ export default { verifyInAppViewPermission() { cy.expect([ - radioItems.has({ disabled: false }), + usersRadio.absent(), + itemsRadio.absent(), + holdingsRadio.absent(), recordIdentifierDropdown.has({ disabled: true }), fileButton.has({ disabled: true }), actions.absent() @@ -469,7 +484,7 @@ export default { cy.do(usersCheckbox.click()); }, - itemsHoldingsIsDisabled(isDisabled) { + holdingsRadioIsDisabled(isDisabled) { cy.expect(holdingsRadio.has({ disabled: isDisabled })); }, @@ -477,6 +492,10 @@ export default { cy.expect(holdingsRadio.has({ checked: true })); }, + verifyRadioHidden(name) { + cy.expect(RadioButton(name).absent()); + }, + uploadFile(fileName) { cy.do(fileButton.has({ disabled: false })); cy.get('input[type=file]').attachFile(fileName, { allowEmpty: true }); @@ -564,7 +583,6 @@ export default { cy.do(actions.click()); cy.expect([ Button('Download matched records (CSV)').exists(), - startBulkEditLocalButton.exists(), DropdownMenu().find(HTML('Show columns')).exists(), ]); if (errors) { diff --git a/cypress/support/fragments/users/users.js b/cypress/support/fragments/users/users.js index 858a080d76..a5f994cc64 100644 --- a/cypress/support/fragments/users/users.js +++ b/cypress/support/fragments/users/users.js @@ -182,6 +182,10 @@ export default { ); }, + verifyCustomFieldOnUserDetailsPane(name, text) { + cy.expect(userDetailsPane.find(KeyValue(name)).has({ value: text })); + }, + clearTextField() { cy.do(TextField({ id: 'adduser_preferredname' }).clear()); }, From 9f660d40c12d5933e24303a46f5548c299afd5c5 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Wed, 9 Aug 2023 21:17:32 +0300 Subject: [PATCH 031/437] FAT-5112-C375173 (#1464) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-5112: initial implementation * FAT-5112: issues fixed --- .../marc-authority-edit-linked.cy.js | 118 ++++++++++++++---- cypress/fixtures/marcAuthFileC375173.mrc | 1 + cypress/fixtures/marcBibFileC375173.mrc | 1 + cypress/support/fragments/quickMarcEditor.js | 19 +++ 4 files changed, 114 insertions(+), 25 deletions(-) create mode 100644 cypress/fixtures/marcAuthFileC375173.mrc create mode 100644 cypress/fixtures/marcBibFileC375173.mrc 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 8531b1c5e1..afea570264 100644 --- a/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js @@ -12,19 +12,27 @@ import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthoriti import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import { JOB_STATUS_NAMES } from '../../support/constants'; describe('MARC Authority -> Edit linked Authority record', () => { const testData = { tag001: '001', tag010: '010', + tag035: '035', + tag046: '046', tag100: '100', tag155: '155', + tag600: '600', tag655: '655', tag700: '700', + tag952: '952', subfieldZValue: 'n12345', updatedSubfieldZValue: 'n12345678910', updated155FieldValue: 'Drama C374159 cinema', updated010FieldValue: 'gf20140262973741590', + updated100FieldValue: '$a Clovio, Giulio, $d 1498-1578 TEST', + updated046FieldValue: '$f 1498 $g 1578 $2 edtf TEST', + updatedTagName: '03', autoUpdateUserName: 'Automated linking update', subjectAccordion: 'Subject', authorityIconText: 'Linked to MARC authority' @@ -43,6 +51,12 @@ describe('MARC Authority -> Edit linked Authority record', () => { jobProfileToRun: 'Default - Create instance and SRS MARC Bib', instanceTitle: 'Titanic / written and directed by James Cameron. C374159' }, + { + marc: 'marcBibFileC375173.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + instanceTitle: 'C375173 Farnese book of hours : MS M.69 of the Pierpont Morgan Library New York / commentary, William M. Voelkle, Ivan Golub.' + }, { marc: 'marcAuthFileC376596.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, @@ -57,7 +71,16 @@ describe('MARC Authority -> Edit linked Authority record', () => { authorityHeading: 'Drama C374159', authority010FieldValue: 'gf2014026297374159', authority555FieldValue: 'Literature C374159' - } + }, + { + marc: 'marcAuthFileC375173.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C375173 Clovio, Giulio, 1498-1578', + authority001FieldValue: 'n83073672375173', + authority035FieldValue: '(OCoLC)oca00955395', + authority952FieldValue: '$a RETRO' + }, ]; const createdRecordIDs = []; @@ -79,7 +102,7 @@ describe('MARC Authority -> Edit linked Authority record', () => { JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(marcFile.fileName); - Logs.checkStatusOfJobProfile('Completed'); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); Logs.openFileDetails(marcFile.fileName); Logs.getCreatedItemsID().then(link => { createdRecordIDs.push(link.split('/')[5]); @@ -95,9 +118,8 @@ describe('MARC Authority -> Edit linked Authority record', () => { InventoryInstance.verifyAndClickLinkIcon(testData.tag700); MarcAuthorities.switchToSearch(); InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(marcFiles[2].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[2].authority010FieldValue}`); + InventoryInstance.searchResults(marcFiles[3].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[3].authority010FieldValue}`); InventoryInstance.clickLinkButton(); QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag700); QuickMarcEditor.pressSaveAndClose(); @@ -109,13 +131,26 @@ describe('MARC Authority -> Edit linked Authority record', () => { InventoryInstance.verifyAndClickLinkIcon(testData.tag655); MarcAuthorities.switchToSearch(); InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(marcFiles[3].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[3].authority010FieldValue}`); + InventoryInstance.searchResults(marcFiles[4].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[4].authority010FieldValue}`); InventoryInstance.clickLinkButton(); QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag655); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); + + InventoryInstance.searchByTitle(createdRecordIDs[2]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag600); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(marcFiles[5].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag001, marcFiles[5].authority001FieldValue); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag600); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); }); }); }); @@ -127,47 +162,41 @@ describe('MARC Authority -> Edit linked Authority record', () => { after('Deleting user, data', () => { Users.deleteViaApi(testData.userProperties.userId); createdRecordIDs.forEach((id, index) => { - if (index > 1) MarcAuthority.deleteViaAPI(id); + if (index > 2) 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('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); + MarcAuthorities.searchBy('Keyword', marcFiles[3].authorityHeading); + MarcAuthorities.selectTitle(marcFiles[3].authorityHeading); MarcAuthority.edit(); - QuickMarcEditor.checkContent(`$a ${marcFiles[2].authority010FieldValue}`, 4); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue} $z ${testData.subfieldZValue}`); + QuickMarcEditor.checkContent(`$a ${marcFiles[3].authority010FieldValue}`, 4); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[3].authority010FieldValue} $z ${testData.subfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[3].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[3].authority010FieldValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - MarcAuthorities.searchBy('Keyword', marcFiles[2].authorityHeading); + MarcAuthorities.searchBy('Keyword', marcFiles[3].authorityHeading); MarcAuthorities.verifyNumberOfTitles(4, '1'); MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.verifyTagFieldAfterLinking(60, testData.tag700, '0', '\\', - `$a ${marcFiles[2].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[2].authority010FieldValue}`, ''); + `$a ${marcFiles[3].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[3].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); + MarcAuthorities.searchBy('Keyword', marcFiles[4].authority555FieldValue); + MarcAuthorities.selectTitle(marcFiles[4].authority555FieldValue); MarcAuthority.edit(); QuickMarcEditor.updateExistingField(testData.tag155, `$a ${testData.updated155FieldValue}`); QuickMarcEditor.checkButtonsEnabled(); @@ -188,5 +217,44 @@ describe('MARC Authority -> Edit linked Authority record', () => { QuickMarcEditor.checkPaneheaderContains(`Source: ${testData.autoUpdateUserName}`); QuickMarcEditor.verifyTagFieldAfterLinking(52, '655', '\\', '7', `$a ${testData.updated155FieldValue}`, '', `$0 id.loc.gov/authorities/genreForms/${testData.updated010FieldValue}`, '$2 fast'); }); + + it('C375173 Save linked "MARC authority" record with deleted fields and edited "1XX" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[5].authorityHeading); + MarcAuthorities.selectTitle(marcFiles[5].authorityHeading); + MarcAuthority.edit(); + // wait untill record is fully loaded + cy.wait(1500); + QuickMarcEditor.updateExistingField(testData.tag100, testData.updated100FieldValue); + QuickMarcEditor.updateExistingTagValue(5, testData.updatedTagName); + QuickMarcEditor.checkContent(testData.updated100FieldValue, 8); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.deleteFieldAndCheck(5, testData.updatedTagName); + QuickMarcEditor.afterDeleteNotification(testData.updatedTagName); + QuickMarcEditor.clickSaveAndCloseThenCheck(1); + QuickMarcEditor.clickRestoreDeletedField(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent('$a ' + marcFiles[5].authority035FieldValue, 5); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); + QuickMarcEditor.updateExistingTagValue(5, testData.tag035); + QuickMarcEditor.updateExistingField(testData.tag046, testData.updated046FieldValue); + QuickMarcEditor.deleteFieldAndCheck(7, testData.tag046); + QuickMarcEditor.afterDeleteNotification(testData.tag046); + QuickMarcEditor.clickSaveAndCloseThenCheck(1); + QuickMarcEditor.clickRestoreDeletedField(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent(testData.updated046FieldValue, 7); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); + QuickMarcEditor.deleteFieldAndCheck(18, testData.tag952); + QuickMarcEditor.afterDeleteNotification(testData.tag952); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.checkDeleteModal(1); + QuickMarcEditor.clickRestoreDeletedField(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent(marcFiles[5].authority952FieldValue, 18); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); + }); }); diff --git a/cypress/fixtures/marcAuthFileC375173.mrc b/cypress/fixtures/marcAuthFileC375173.mrc new file mode 100644 index 0000000000..b947bd669f --- /dev/null +++ b/cypress/fixtures/marcAuthFileC375173.mrc @@ -0,0 +1 @@ +00784cz a2200253n 4500001001600000005001700016008004100033010001300074035002300087040003500110046002100145100003900166400004400205400002100249400002400270400001800294400002000312670005500332670003800387670003500425670004500460952001000505953001500515n8307367237517320160120102906.0830616n| azannaabn |a aaa  a63943573 a(OCoLC)oca00955395 aDLCbengcDLCdOCoLCdDLcerda f1498g15782edtf1 aC375173 Clovio, Giulio,d1498-15781 wnnaaClovio, Giorgio Giulio,d1498-15781 aKlovicÌ, Julije1 aKlovio, Juraj Julio1 aClovio, Julio1 aKlovicÌ, Juraj aHis The Farnese hours, 1976:bp. 2 (Giulio Clovio) aThieme-Beckerb(Clovio, D. Julio) aEncic. ital.b(Clovio, Giulio) aGrande encic. Vallardib(Clovio, Giulio) aRETRO axx00bfg10 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC375173.mrc b/cypress/fixtures/marcBibFileC375173.mrc new file mode 100644 index 0000000000..622b6db54e --- /dev/null +++ b/cypress/fixtures/marcBibFileC375173.mrc @@ -0,0 +1 @@ +02964cam a2200637Ia 4500001001100000003000400011005001700015008004100032020001500073020001800088035002000106040008000126041001300206043002100219049000900240050002200249110002100271240003200292245013200324260005800456300007500514336002600589337002800615338002700643500012700670500017600797504004100973546004801014600003201062610006501094610004701159630001901206630004501225650006901270650006501339650003301404650003501437650008601472650004601558650007801604650008201682650007101764651004301835651005801878655004301936655004201979655004902021655005302070700002402123700001702147700003702164700004502201700003202246710002902278730001902307in10394342ICU20160104120509.6060622s2003 au ah b 000 0 lat d a3201018007 a9783201018005 a(OCoLC)70161005 aINDbengcINDdINDdOCLCGdMNJdOCLCAdXIIdOCLCFdOCLCOdOCLCQdOCLdOCLCO0 alataeng ae-it---an-us-ny aCGUA14aND3363b.F35 20032 aCatholic Church.10aBook of hours (Ms. Farnese)10aC375173 Farnese book of hours :bMS M.69 of the Pierpont Morgan Library New York /ccommentary, William M. Voelkle, Ivan Golub. aGraz :bAkademische Druck-u. Verlagsanstalt,c©2003. a[228], 220 pages :billustrations (chiefly color), facsimiles ;c18 cm atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aFull-color facsimile reproduction of the manuscript New York, Pierpont Morgan Library, M.69, with accompanying commentary. aThe Farnese Hours, executed in Rome for Alessandro Cardinal Farnese, were decorated by the illuminator Giulio Clovio from 1537 to 1546. The scribe was Francesco Monterchi. aIncludes bibliographical references. aManuscript in Latin; commentary in English.10aClovio, Giulio,d1498-1578.20aCatholic ChurchvPrayers and devotionsvEarly works to 1800.27aCatholic Church.2fast0(OCoLC)fst0053172000aFarnese hours.07aFarnese hours.2fast0(OCoLC)fst01367007 0aIllumination of books and manuscripts, RenaissancezItalyzRome. 0aIllumination of books and manuscripts, ItalianzItalyzRome. 0aBooks of hourszItalyzRome. 0aBooks of hoursxIllustrations. 0aManuscripts, Latin (Medieval and modern)zNew York (State)zNew YorkvFacsimiles. 7aBooks of hours.2fast0(OCoLC)fst00836484 7aIllumination of books and manuscripts, Italian.2fast0(OCoLC)fst00967315 7aIllumination of books and manuscripts, Renaissance.2fast0(OCoLC)fst00967343 7aManuscripts, Latin (Medieval and modern)2fast0(OCoLC)fst01008399 7aItalyzRome.2fast0(OCoLC)fst01204500 7aNew York (State)zNew York.2fast0(OCoLC)fst01204333 7aEarly works.2fast0(OCoLC)fst01411636 7aFacsimiles.2fast0(OCoLC)fst01411642 7aIllustrated works.2fast0(OCoLC)fst01423873 7aPrayers and devotions.2fast0(OCoLC)fst014239091 aVoelkle, William M.1 aGolub, Ivan.1 aFarnese, Alessandro,d1520-1589.1 aMonterchi, Francesco,dactive 1535-1546.1 aClovio, Giulio,d1498-1578.2 aPierpont Morgan Library.0 aFarnese hours. \ No newline at end of file diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 826daa1599..4d4f97f53a 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -749,6 +749,25 @@ export default { cy.expect(PaneHeader({ text: (including(text)) }).exists()); }, + checkUpdateLinkedBibModalAbsent() { + cy.expect(updateLinkedBibFieldsModal.absent()); + }, + + checkDeleteModal(fieldsCount) { + cy.expect([ + confirmationModal.exists(), + confirmationModal.has({ content: including(`By selecting Continue with save, then ${fieldsCount} field(s) will be deleted and this record will be updated. Are you sure you want to continue?`) }), + continueWithSaveButton.exists(), + restoreDeletedFieldsBtn.exists(), + ]); + }, + + checkDeleteModalClosed() { + cy.expect(confirmationModal.absent()); + }, + + clickSaveAndKeepEditingButton() { cy.do(saveAndKeepEditingBtn.click()); }, + waitAndCheckFirstBibRecordCreated(marcBibTitle = `Test_Bib_Creation_${getRandomPostfix()}`, timeOutSeconds = 120) { let timeCounter = 0; function checkBib() { From ad1922d64351a9e62358a9ea68e8e8bb1878e43e Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Thu, 10 Aug 2023 11:30:50 +0500 Subject: [PATCH 032/437] fixed bugs (#1470) --- .../permission-sets/create-new-permission-set.cy.js | 3 ++- cypress/support/fragments/settings/users/permissionSets.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js b/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js index 11b011aea8..7ebb1d3e58 100644 --- a/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js +++ b/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js @@ -3,12 +3,13 @@ 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 permissions from '../../../support/dictionary/permissions'; describe('Permission Sets', () => { const newPermissionSet = { name: getTestEntityValue('NewPermissionSet'), description: getTestEntityValue('NewPermissionSetDescription'), - permissions: ['Agreements: Delete agreements'], + permissions: [permissions.uiUsersView.gui], }; before('Preconditions', () => { diff --git a/cypress/support/fragments/settings/users/permissionSets.js b/cypress/support/fragments/settings/users/permissionSets.js index 6bff650bb0..4507258d49 100644 --- a/cypress/support/fragments/settings/users/permissionSets.js +++ b/cypress/support/fragments/settings/users/permissionSets.js @@ -47,6 +47,7 @@ export default { generalInformation.find(KeyValue('Permission set name', { value: values.name })).exists(), generalInformation.find(KeyValue('Description', { value: values.description })).exists(), ]); + cy.do(Button({ id: 'accordion-toggle-button-assignedPermissions' }).click()); cy.wrap(values.permissions).each((permission) => { cy.expect(Section({ id: 'assignedPermissions' }).find(ListItem(permission)).exists()); }); From 9e1660f04ad8534cb51901733fc76506308565f8 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Thu, 10 Aug 2023 11:40:09 +0500 Subject: [PATCH 033/437] added C375248 (#1471) --- .../add-notice-token.cy.js} | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) rename cypress/e2e/{recieve-notice/add-discovery-display-name-as-notice-token.cy.js => staff-slips/add-notice-token.cy.js} (73%) diff --git a/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js b/cypress/e2e/staff-slips/add-notice-token.cy.js similarity index 73% rename from cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js rename to cypress/e2e/staff-slips/add-notice-token.cy.js index c47c1a41fa..d86a675e67 100644 --- a/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js +++ b/cypress/e2e/staff-slips/add-notice-token.cy.js @@ -1,4 +1,3 @@ -import uuid from 'uuid'; import devTeams from '../../support/dictionary/devTeams'; import permissions from '../../support/dictionary/permissions'; import { getTestEntityValue } from '../../support/utils/stringTools'; @@ -9,23 +8,21 @@ 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; + let servicePointId; + const testData = {}; 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); + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }).then((servicePoints) => { + servicePointId = servicePoints[0].id; + }); NoticePolicyTemplate.createViaApi('Loan').then((noticeTemplateResp) => { testData.noticeTemplateBody = noticeTemplateResp.body; }); @@ -36,9 +33,9 @@ describe('Patron Notices', () => { (userProperties) => { userData = userProperties; UserEdit.addServicePointViaApi( - testData.userServicePoint.id, + servicePointId, userData.userId, - testData.userServicePoint.id + servicePointId ); cy.login(userData.username, userData.password, { path: SettingsMenu.circulationPatronNoticeTemplatesPath, @@ -50,19 +47,24 @@ describe('Patron Notices', () => { }); 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( + 'C375248 Add "user.preferredFirstName" as staff slip token in Settings', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + NewNoticePolicyTemplate.editTemplate(testData.noticeTemplateBody.name); + NewNoticePolicyTemplate.clearBody(); + NewNoticePolicyTemplate.addToken('user.preferredFirstName'); + NewNoticePolicyTemplate.saveAndClose(); + NewNoticePolicyTemplate.waitLoading(); + NoticePolicyTemplate.checkPreview('Paul'); + } + ); + it( 'C387434 Add "Discovery display name" as notice token in Settings', { tags: [TestTypes.criticalPath, devTeams.volaris] }, From 11c9291f274662735c8bd5338e0979d197d9373c Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Thu, 10 Aug 2023 10:49:05 +0300 Subject: [PATCH 034/437] skipped serviceshift test (#1472) --- cypress/e2e/ideyalabs/serviceshift.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/ideyalabs/serviceshift.cy.js b/cypress/e2e/ideyalabs/serviceshift.cy.js index a5dbec83bb..0737763e56 100644 --- a/cypress/e2e/ideyalabs/serviceshift.cy.js +++ b/cypress/e2e/ideyalabs/serviceshift.cy.js @@ -17,7 +17,7 @@ import UserEdit from '../../support/fragments/users/userEdit'; import Users from '../../support/fragments/users/users'; import checkInActions from '../../support/fragments/check-in-actions/checkInActions'; -describe('Check In - Actions', () => { +describe.skip('Check In - Actions', () => { const userData = {}; const testData = { servicePointS: ServicePoints.getDefaultServicePointWithPickUpLocation( From 69d808716d1bc8aaccc997194d5bf1d902d71d37 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:58:18 +0300 Subject: [PATCH 035/437] Implementing of FAT-5068 (#1467) * Implementing of FAT-5068 * Implementing of FAT-5068 * Implementing of FAT-5068 * Implementing of FAT-5068 --- ...iving-includes-order-closed-statuses.cy.js | 47 ++-- ...tem-statuses-are-set-to-status-other.cy.js | 211 ++++++++++++++++++ .../fragments/inventory/inventoryInstance.js | 10 +- .../inventory/inventoryItem/itemActions.js | 1 + cypress/support/fragments/orders/orders.js | 2 +- .../support/fragments/receiving/receiving.js | 2 +- .../servicePoint/switchServicePoint.js | 1 + 7 files changed, 235 insertions(+), 39 deletions(-) create mode 100644 cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js diff --git a/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js b/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js index 28486cb47a..4d83b4bc31 100644 --- a/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js +++ b/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js @@ -9,7 +9,6 @@ import Orders from '../../support/fragments/orders/orders'; import Receiving from '../../support/fragments/receiving/receiving'; import TopMenu from '../../support/fragments/topMenu'; import Helper from '../../support/fragments/finance/financeHelper'; -import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; import Organizations from '../../support/fragments/organizations/organizations'; import NewOrganization from '../../support/fragments/organizations/newOrganization'; import OrderLines from '../../support/fragments/orders/orderLines'; @@ -23,7 +22,6 @@ import SwitchServicePoint from '../../support/fragments/servicePoint/switchServi import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; import Checkout from '../../support/fragments/checkout/checkout'; import { ITEM_STATUS_NAMES } from '../../support/constants'; -// import Users from '../../support/fragments/users/users'; describe('orders: Receiving and Check-in', () => { const order = { @@ -88,37 +86,37 @@ describe('orders: Receiving and Check-in', () => { OrderLines.openInstance(); InventoryInstance.openHoldingsAccordion(location.name); // Need to wait,while instance will be loaded - cy.wait(3000); - InventoryInstance.openItemByBarcodeAndIndex('No barcode', 'row-0', 10); + cy.wait(5000); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); ItemActions.edit(); ItemRecordEdit.addBarcode(barcodeForFirstItem); ItemRecordEdit.save(); // Need to wait,while instance will be saved - cy.wait(3000); + cy.wait(5000); ItemActions.closeItem(); InventoryInstance.openHoldingsAccordion(location.name); - InventoryInstance.openItemByBarcodeAndIndex('No barcode', 'row-1', 10); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); ItemActions.edit(); ItemRecordEdit.addBarcode(barcodeForSecondItem); ItemRecordEdit.save(); // Need to wait,while instance will be saved - cy.wait(3000); + cy.wait(5000); ItemActions.closeItem(); InventoryInstance.openHoldingsAccordion(location.name); - InventoryInstance.openItemByBarcodeAndIndex('No barcode', 'row-2', 10); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); ItemActions.edit(); ItemRecordEdit.addBarcode(barcodeForThirdItem); ItemRecordEdit.save(); // Need to wait,while instance will be saved - cy.wait(3000); + cy.wait(5000); ItemActions.closeItem(); InventoryInstance.openHoldingsAccordion(location.name); - InventoryInstance.openItemByBarcodeAndIndex('No barcode', 'row-3', 10); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); ItemActions.edit(); ItemRecordEdit.addBarcode(barcodeForFourItem); ItemRecordEdit.save(); // Need to wait,while instance will be saved - cy.wait(3000); + cy.wait(5000); ItemActions.closeItem(); }); @@ -176,14 +174,6 @@ describe('orders: Receiving and Check-in', () => { Organizations.deleteOrganizationViaApi(organization.id); // TODO: Need to find solution to delete all data, becouse now i cant delete location and user - // NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - // location.institutionId, - // location.campusId, - // location.libraryId, - // location.id - // ); - - // Users.deleteViaApi(user.userId); }); it('C368044 Item statuses set to something other than "Order closed" or "On order" are NOT changed to "In process" upon receiving (items for receiving includes "Order closed" statuses) (thunderjet)', { tags: [testType.smoke, devTeams.thunderjet] }, () => { @@ -193,20 +183,19 @@ describe('orders: Receiving and Check-in', () => { Receiving.receiveAll(); Receiving.clickOnInstance(); InventoryInstance.openHoldingsAccordion(location.name); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.searchByParameter('Barcode', barcodeForFirstItem); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForFirstItem); ItemRecordView.checkItemDetails(location.name, barcodeForFirstItem, ITEM_STATUS_NAMES.AVAILABLE); ItemActions.closeItem(); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.searchByParameter('Barcode', barcodeForSecondItem); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForSecondItem); ItemRecordView.checkItemDetails(location.name, barcodeForSecondItem, ITEM_STATUS_NAMES.AVAILABLE); ItemActions.closeItem(); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.searchByParameter('Barcode', barcodeForThirdItem); - ItemRecordView.checkItemDetails(location.name, barcodeForThirdItem, 'In process'); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForFourItem); + ItemRecordView.checkItemDetails(location.name, barcodeForFourItem, ITEM_STATUS_NAMES.IN_PROCESS); ItemActions.closeItem(); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.searchByParameter('Barcode', barcodeForFourItem); - ItemRecordView.checkItemDetails(location.name, barcodeForFourItem, 'In process'); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForThirdItem); + ItemRecordView.checkItemDetails(location.name, barcodeForThirdItem, ITEM_STATUS_NAMES.IN_PROCESS); }); }); diff --git a/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js new file mode 100644 index 0000000000..ea5d63dd51 --- /dev/null +++ b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js @@ -0,0 +1,211 @@ +import permissions from '../../../support/dictionary/permissions'; +import devTeams from '../../../support/dictionary/devTeams'; +import testType from '../../../support/dictionary/testTypes'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import Orders from '../../../support/fragments/orders/orders'; +import Receiving from '../../../support/fragments/receiving/receiving'; +import TopMenu from '../../../support/fragments/topMenu'; +import Helper from '../../../support/fragments/finance/financeHelper'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../../support/fragments/settings/tenant/locations/newLocation'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; +import ItemRecordEdit from '../../../support/fragments/inventory/item/itemRecordEdit'; +import SwitchServicePoint from '../../../support/fragments/servicePoint/switchServicePoint'; +import CheckInActions from '../../../support/fragments/check-in-actions/checkInActions'; +import { ITEM_STATUS_NAMES } from '../../../support/constants'; + +describe('orders: Receiving and Check-in', () => { + const order = { + ...NewOrder.defaultOneTimeOrder, + approved: true, + }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + } + ] + }; + const barcodeForFirstItem = `1${Helper.getRandomBarcode()}`; + const barcodeForSecondItem = `2${Helper.getRandomBarcode()}`; + const barcodeForThirdItem = `3${Helper.getRandomBarcode()}`; + const barcodeForFourItem = `4${Helper.getRandomBarcode()}`; + const barcodeForFifthItem = `5${Helper.getRandomBarcode()}`; + const barcodeForSixthItem = `6${Helper.getRandomBarcode()}`; + const barcodeForSeventhItem = `7${Helper.getRandomBarcode()}`; + + let orderNumber; + let circ2LocationServicePoint; + let circ1LocationServicePoint; + let location; + + before(() => { + cy.getAdminToken(); + + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) + .then((servicePoints) => { + circ2LocationServicePoint = servicePoints[0]; + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }) + .then((servicePointsResponse) => { + circ1LocationServicePoint = servicePointsResponse[0]; + NewLocation.createViaApi(NewLocation.getDefaultLocation(circ2LocationServicePoint.id)) + .then((locationResponse) => { + location = locationResponse; + Organizations.createOrganizationViaApi(organization) + .then(organizationsResponse => { + organization.id = organizationsResponse; + order.vendor = organizationsResponse; + }); + + cy.loginAsAdmin({ path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + cy.createOrderApi(order) + .then((response) => { + orderNumber = response.body.poNumber; + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); + OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', locationResponse.institutionId, '7'); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + OrderLines.selectPOLInOrder(0); + OrderLines.openInstance(); + InventoryInstance.openHoldingsAccordion(location.name); + // Need to wait,while instance will be loaded + cy.wait(5000); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForFirstItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForSecondItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForThirdItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForFourItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForFifthItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForSixthItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForSeventhItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + }); + + cy.visit(TopMenu.checkInPath); + SwitchServicePoint.switchServicePoint(circ2LocationServicePoint.name); + SwitchServicePoint.checkIsServicePointSwitched(circ2LocationServicePoint.name); + // Need to wait,while Checkin page will be loaded in same location + cy.wait(2000); + CheckInActions.checkInItemGui(barcodeForFirstItem); + cy.wait(2000); + CheckInActions.checkInItemGui(barcodeForSecondItem); + SwitchServicePoint.switchServicePoint(circ1LocationServicePoint.name); + SwitchServicePoint.checkIsServicePointSwitched(circ1LocationServicePoint.name); + // Need to wait,while Checkin page will be loaded in same location + cy.wait(2000); + CheckInActions.checkInItemGui(barcodeForThirdItem); + cy.wait(2000); + CheckInActions.checkInItemGui(barcodeForFourItem); + }); + }); + }); + + cy.createTempUser([ + permissions.uiInventoryViewInstances.gui, + permissions.uiReceivingViewEditCreate.gui, + + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.receivingPath, waiter: Receiving.waitLoading }); + }); + }); + + // // TODO: Need to find solution to delete all data, becouse now i cant delete location and user + + it('C367971 Item statuses are set to status other than "Order closed" or "On order" and are NOT changed to "In process" upon receiving (items for receiving includes "On order" statuses) (thunderjet)', { tags: [testType.smoke, devTeams.thunderjet] }, () => { + Orders.searchByParameter('PO number', orderNumber); + Receiving.selectLinkFromResultsList(); + Receiving.receiveFromExpectedSectionWithClosePOL(); + Receiving.receiveAll(); + Receiving.clickOnInstance(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForFirstItem); + ItemRecordView.checkItemDetails(location.name, barcodeForFirstItem, ITEM_STATUS_NAMES.AVAILABLE); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForSecondItem); + ItemRecordView.checkItemDetails(location.name, barcodeForSecondItem, ITEM_STATUS_NAMES.AVAILABLE); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForThirdItem); + ItemRecordView.checkItemDetails(location.name, barcodeForThirdItem, `${ITEM_STATUS_NAMES.IN_TRANSIT} to Circ Desk 2`); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForFourItem); + ItemRecordView.checkItemDetails(location.name, barcodeForFourItem, `${ITEM_STATUS_NAMES.IN_TRANSIT} to Circ Desk 2`); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForSixthItem); + ItemRecordView.checkItemDetails(location.name, barcodeForSixthItem, ITEM_STATUS_NAMES.IN_PROCESS); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(location.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForSeventhItem); + ItemRecordView.checkItemDetails(location.name, barcodeForSeventhItem, ITEM_STATUS_NAMES.IN_PROCESS); + }); +}); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 2cb50b0f2c..52d7d2a863 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -815,14 +815,8 @@ export default { cy.expect(MultiColumnListCell({ content: barcode }).exists()); }, - openItemByBarcodeAndIndex: (barcode, indexRowNumber, rowCountInList) => { - cy.do([ - Button('Collapse all').click(), - Button('Acquisition').click(), - MultiColumnList({ columnCount: rowCountInList }) - .find(MultiColumnListRow({ indexRow: indexRowNumber })) - .find(Link(barcode)).click() - ]); + openItemByBarcodeAndIndex: (barcode) => { + cy.get('[class^="mclCell-"]').contains(barcode).eq(0).click(); }, verifyCellsContent: (...content) => { diff --git a/cypress/support/fragments/inventory/inventoryItem/itemActions.js b/cypress/support/fragments/inventory/inventoryItem/itemActions.js index 58ed3d8856..279762fb19 100644 --- a/cypress/support/fragments/inventory/inventoryItem/itemActions.js +++ b/cypress/support/fragments/inventory/inventoryItem/itemActions.js @@ -11,6 +11,7 @@ export default { confirmMarkAsMissing, cancelMarkAsMissing, edit() { + cy.wait(5000); openActions(); cy.do(Button('Edit').click()); }, diff --git a/cypress/support/fragments/orders/orders.js b/cypress/support/fragments/orders/orders.js index e7174e7c4e..9937459156 100644 --- a/cypress/support/fragments/orders/orders.js +++ b/cypress/support/fragments/orders/orders.js @@ -59,7 +59,7 @@ export default { searchForm.selectIndex(parameter), searchForm.fillIn(value) ]); - cy.wait(1000); + cy.wait(2000); cy.do(Button('Search').click()); }, waitLoading() { diff --git a/cypress/support/fragments/receiving/receiving.js b/cypress/support/fragments/receiving/receiving.js index ec4d4b20b5..d8f87290e9 100644 --- a/cypress/support/fragments/receiving/receiving.js +++ b/cypress/support/fragments/receiving/receiving.js @@ -203,7 +203,7 @@ export default { cy.do([ Section({ id: 'expected' }).find(actionsButton).click(), receiveButton.click(), - Button('Continue').click() + // Button('Continue').click() ]); }, diff --git a/cypress/support/fragments/servicePoint/switchServicePoint.js b/cypress/support/fragments/servicePoint/switchServicePoint.js index 18f7d62da5..92e4ab3826 100644 --- a/cypress/support/fragments/servicePoint/switchServicePoint.js +++ b/cypress/support/fragments/servicePoint/switchServicePoint.js @@ -19,6 +19,7 @@ export default { }, switchServicePoint:(servicePoint) => { + cy.wait(5000); cy.do([ Dropdown('My profile').open(), Button('Switch service point').click() From beb02a565faf8fe059018c2015d453e6f1688dad Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Fri, 11 Aug 2023 14:24:15 +0300 Subject: [PATCH 036/437] Fat 7398 (#1474) * changed OCLC authentication number * added deleting target profile * deleted waiter * added waiter * changed function * uncommented code --- ...es-does-not-duplicate-control-fields.cy.js | 10 ++++++---- ...n-incoming-records-not-deleted-scen1.cy.js | 10 ++++++---- ...n-incoming-records-not-deleted-scen2.cy.js | 8 ++++---- ...record-import-with-running-large-job.cy.js | 8 ++++---- ...-after-editing-marc-bib-in-quickMarc.cy.js | 6 +++--- ...holdings-records-Instancesource-marc.cy.js | 6 ++++-- .../e2e/inventory/marc-bibliographic.cy.js | 3 ++- cypress/e2e/inventory/moving-items.cy.js | 5 +++-- .../import-by-oclc-source-folio.cy.js | 10 ++++------ .../single-record-import/import-by-oclc.cy.js | 3 ++- ...ls-menu-for-multiple-target-profiles.cy.js | 20 +++++++++++-------- ...rt-create-for-single-target-profiles.cy.js | 3 ++- ...enu-for-single-target-profile-update.cy.js | 9 ++++++--- .../e2e/quickmark/instance-quickmark.cy.js | 3 ++- .../fragments/inventory/inventoryInstance.js | 5 +++-- .../fragments/inventory/inventoryInstances.js | 2 -- .../inventory/inventorySearchAndFilter.js | 10 ---------- .../integrations/z39.50TargetProfiles.js | 2 +- 18 files changed, 64 insertions(+), 59 deletions(-) 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 dfeaf42d37..eae62c91ee 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 @@ -4,7 +4,6 @@ import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import Z3950TargetProfiles from '../../../support/fragments/settings/inventory/integrations/z39.50TargetProfiles'; -import InventoryActions from '../../../support/fragments/inventory/inventoryActions'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Logs from '../../../support/fragments/data_import/logs/logs'; import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll'; @@ -17,6 +16,7 @@ describe('ui-data-import', () => { let user; let instanceHrid; const oclcNumber = '42980246'; + const OCLCAuthentication = '100481406/PAOLF'; const field005 = '20230427101124.9'; const field035 = '‡a (OCoLC)ocm42980246'; const notDuplicatedFieldsContent = { @@ -36,7 +36,7 @@ describe('ui-data-import', () => { .then(userProperties => { user = userProperties; - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); cy.login(user.username, user.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); }); @@ -52,7 +52,7 @@ describe('ui-data-import', () => { it('C347618 Overlaying with single record import creates does not duplicate control fields (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - InventoryActions.import(oclcNumber); + InventoryInstances.importWithOclc(oclcNumber); InventoryInstance.checkCalloutMessage(`Record ${oclcNumber} created. Results may take a few moments to become visible in Inventory`); cy.visit(TopMenu.dataImportPath); Logs.openViewAllLogs(); @@ -64,8 +64,10 @@ describe('ui-data-import', () => { instanceHrid = initialInstanceHrId; InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.importWithOclc(oclcNumber); + InventoryInstance.overlayWithOclc(oclcNumber); InventoryInstance.checkCalloutMessage(`Record ${oclcNumber} updated. Results may take a few moments to become visible in Inventory`); InventoryInstance.viewSource(); InventoryViewSource.verifyRecordNotContainsDuplicatedContent(field035, 2); 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 1f1f2b11f4..c8e47a8767 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 @@ -22,7 +22,7 @@ describe('ui-data-import', () => { let instanceHrid = null; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; const protectedField = '856'; - const authentication = '100473910/PAOLF'; + const OCLCAuthentication = '100481406/PAOLF'; const oclcForChanging = '466478385'; const imported856Field = 'Notice et cote du catalogue de la BibliotheÌ€que nationale de France ‡u http://catalogue.bnf.fr/ark:/12148/cb371881758'; @@ -93,11 +93,13 @@ describe('ui-data-import', () => { cy.visit(SettingsMenu.targetProfilesPath); Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(authentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(authentication); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); InventoryInstance.editMarcBibliographicRecord(); InventoryEditMarcRecord.deleteField(29); InventoryEditMarcRecord.saveAndClose(); @@ -105,7 +107,7 @@ describe('ui-data-import', () => { InventoryInstance.checkElectronicAccess(); InventoryInstance.startOverlaySourceBibRecord(); InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); - InventoryInstance.importWithOclc(oclcForChanging); + InventoryInstance.overlayWithOclc(oclcForChanging); InventoryInstance.checkCalloutMessage(`Record ${oclcForChanging} updated. Results may take a few moments to become visible in Inventory`); InventoryInstance.viewSource(); InventoryViewSource.contains(`${protectedField}\t`); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js index 9073e02259..41662a1a94 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js @@ -15,7 +15,7 @@ import { TARGET_PROFILE_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { let user = null; - const authentication = '100473910/PAOLF'; + const OCLCAuthentication = '100481406/PAOLF'; const oclcForImport = '19257462'; const initialFields = { first580field: '‡a Merged with: Journal of the Chemical Society. Perkin transactions I; Journal of the Chemical Society. Perkin transactions II; and Journal of the Chemical Society. Dalton transactions, to form: Perkin 1; Perkin 2; and Dalton (Cambridge, England).', @@ -87,8 +87,8 @@ describe('ui-data-import', () => { cy.visit(SettingsMenu.targetProfilesPath); Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(authentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(authentication); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); cy.visit(TopMenu.inventoryPath); InventoryInstances.importWithOclc(oclcForImport); @@ -108,7 +108,7 @@ describe('ui-data-import', () => { // overlay source bibliographic record InventoryInstance.startOverlaySourceBibRecord(); InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); - InventoryInstance.importWithOclc(oclcForImport); + InventoryInstance.overlayWithOclc(oclcForImport); InventoryInstance.checkCalloutMessage(`Record ${oclcForImport} updated. Results may take a few moments to become visible in Inventory`); // need to wait because after the import the data in the instance is displayed for a long time diff --git a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js index c522e41493..ccaba3d9bf 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js @@ -16,7 +16,7 @@ import { TARGET_PROFILE_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { let user = {}; - const authentication = '100473910/PAOLF'; + const OCLCAuthentication = '100481406/PAOLF'; const fileName = `C356824autotestFile.${getRandomPostfix()}.mrc`; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; const oclcForImport = '912958093'; @@ -58,8 +58,8 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { cy.visit(SettingsMenu.targetProfilesPath); Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(authentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(authentication); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); // import a file cy.visit(TopMenu.dataImportPath); @@ -77,7 +77,7 @@ describe('ui-data-import', () => { InventoryInstances.importWithOclc(oclcForImport); InventoryInstance.startOverlaySourceBibRecord(); InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); - InventoryInstance.importWithOclc(oclcForUpdating); + InventoryInstance.overlayWithOclc(oclcForUpdating); InventoryInstance.checkCalloutMessage(`Record ${oclcForUpdating} updated. Results may take a few moments to become visible in Inventory`); // check instance is updated 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 837bb139fd..9445968235 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 @@ -36,7 +36,7 @@ describe('ui-data-import', () => { let user = null; let instanceHrid; const marcFieldProtectionId = []; - const authentication = '100473910/PAOLF'; + const OCLCAuthentication = '100481406/PAOLF'; const protectedFields = { firstField: '*', secondField: '920' @@ -109,8 +109,8 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { cy.visit(SettingsMenu.targetProfilesPath); Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(authentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(authentication); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); MarcFieldProtection.createMarcFieldProtectionViaApi({ indicator1: '*', 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 6ac35ef8e5..27e1c09050 100644 --- a/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js +++ b/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js @@ -11,9 +11,11 @@ import DevTeams from '../../../support/dictionary/devTeams'; import Z3950TargetProfiles from '../../../support/fragments/settings/inventory/integrations/z39.50TargetProfiles'; describe('Manage holding records with MARC source', { retries: 2 }, () => { + const OCLCAuthentication = '100481406/PAOLF'; + before(() => { cy.getAdminToken().then(() => { - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); }); }); @@ -32,7 +34,7 @@ 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. + // TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. HoldingsRecordView.close(); InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); diff --git a/cypress/e2e/inventory/marc-bibliographic.cy.js b/cypress/e2e/inventory/marc-bibliographic.cy.js index 58ae0ec9e6..4fee815f01 100644 --- a/cypress/e2e/inventory/marc-bibliographic.cy.js +++ b/cypress/e2e/inventory/marc-bibliographic.cy.js @@ -13,10 +13,11 @@ import Z3950TargetProfiles from '../../support/fragments/settings/inventory/inte describe('MARC -> MARC Bibliographic', () => { const testData = {}; + const OCLCAuthentication = '100481406/PAOLF'; before(() => { cy.getAdminToken().then(() => { - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); }); cy.createTempUser([ diff --git a/cypress/e2e/inventory/moving-items.cy.js b/cypress/e2e/inventory/moving-items.cy.js index b4d11200ec..6d83c1329c 100644 --- a/cypress/e2e/inventory/moving-items.cy.js +++ b/cypress/e2e/inventory/moving-items.cy.js @@ -22,6 +22,7 @@ import { ITEM_STATUS_NAMES } from '../../support/constants'; describe('ui-inventory: moving items', { retries: 2 }, () => { const successCalloutMessage = '1 item has been successfully moved.'; + const OCLCAuthentication = '100481406/PAOLF'; let userId; let firstHolding = ''; let secondHolding = ''; @@ -29,7 +30,7 @@ describe('ui-inventory: moving items', { retries: 2 }, () => { before(() => { cy.getAdminToken().then(() => { - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); }); }); @@ -145,7 +146,7 @@ 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. + // TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. HoldingsRecordView.close(); InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js index 44de3e5234..3b1889aeb5 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js @@ -13,6 +13,7 @@ import { INSTANCE_SOURCE_NAMES } from '../../../support/constants'; let user; let instanceRecord; +const OCLCAuthentication = '100481406/PAOLF'; const oclcRecordData = { title: 'Cooking Light Soups & Stew [electronic resource].', language: 'English', @@ -31,7 +32,7 @@ describe('ui-inventory: import by OCLC', () => { before('create test data', () => { cy.getAdminToken() .then(() => { - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); InventorySearchAndFilter.createInstanceViaApi() .then(({ instanceData }) => { instanceRecord = instanceData; @@ -63,12 +64,9 @@ describe('ui-inventory: import by OCLC', () => { InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceRecord.instanceTitle); InventorySearchAndFilter.selectSearchResultItem(); InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.importWithOclc(oclcRecordData.oclc); + InventoryInstance.overlayWithOclc(oclcRecordData.oclc); InventoryInstance.checkCalloutMessage(`Record ${oclcRecordData.oclc} updated. Results may take a few moments to become visible in Inventory`); - - // need to wait because after the import the data in the instance is displayed for a long time - // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(10000); + cy.reload(); InventoryInstance.waitInstanceRecordViewOpened(oclcRecordData.title); InventoryInstance.verifyLastUpdatedDate(); InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js index d175b5cda8..0f658ef57c 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js @@ -11,6 +11,7 @@ import DevTeams from '../../../support/dictionary/devTeams'; let user; const oclc = '1007797324'; +const OCLCAuthentication = '100481406/PAOLF'; describe('ui-inventory: import by OCLC', () => { before('create user', () => { @@ -24,7 +25,7 @@ describe('ui-inventory: import by OCLC', () => { user = userProperties; cy.login(user.username, user.password); - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); }); }); diff --git a/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js b/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js index 6a3b95ecf9..262ef836c1 100644 --- a/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js +++ b/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js @@ -22,14 +22,15 @@ describe('ui-inventory', () => { let user; let instanceHRID; let profileId; + const OCLCAuthentication = '100481406/PAOLF'; const fileName = `C375126 autotestFile.${getRandomPostfix()}.mrc`; - const targetProfileName = `C375126 autotest profile${getRandomPostfix()}`; - const defaultTargetProfileName = 'OCLC WorldCat'; + const newTargetProfileName = `C375126 autotest profile${getRandomPostfix()}`; + const OCLCWorldCatTargetProfileName = 'OCLC WorldCat'; const profileForOverlay = 'Inventory Single Record - Default Update Instance (Default)'; const targetProfile = { name: 'OCLC WorldCat', url: 'zcat.oclc.org/OLUCWorldCat', - authentification: '100473910/PAOLF', + authentification: OCLCAuthentication, externalId: '@attr 1=1211 $identifier', internalId: '999ff$i' }; @@ -47,8 +48,8 @@ describe('ui-inventory', () => { InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHRID = initialInstanceHrId; }); - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); - Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(targetProfileName) + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); + Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(newTargetProfileName) .then(initialId => { profileId = initialId; }); cy.visit(SettingsMenu.targetProfilesPath); Z3950TargetProfiles.openTargetProfile(); @@ -85,6 +86,7 @@ describe('ui-inventory', () => { after('delete test data', () => { Users.deleteViaApi(user.userId); + Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) .then((instance) => { InventoryInstance.deleteInstanceViaApi(instance.id); @@ -94,16 +96,18 @@ describe('ui-inventory', () => { it('C375126 Verify the modal window for ISRI In inventory instance details menu for multiple target profiles (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); InventoryInstance.startOverlaySourceBibRecord(); ReImportModal.verifyModalWithSeveralTargetProfiles(); - ReImportModal.verifyExternalTargetField(targetProfileName); - ReImportModal.selectExternalTarget(defaultTargetProfileName); + ReImportModal.verifyExternalTargetField(newTargetProfileName); + ReImportModal.selectExternalTarget(OCLCWorldCatTargetProfileName); ReImportModal.selectTheProfileToBeUsedToOverlayTheCurrentData(profileForOverlay); ReImportModal.fillEnterTheTargetIdentifier(testIdentifier); ReImportModal.import(); // need to wait because after the import the data in the instance is displayed for a long time // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(10000); + cy.wait(7000); InteractorsTools.checkCalloutMessage(successCalloutMessage); InstanceRecordView.verifyIsInstanceOpened(instanceTitle); }); diff --git a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js index f826638fc6..2ca636c8c6 100644 --- a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js +++ b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js @@ -13,6 +13,7 @@ import SingleRecordImportModal from '../../../support/fragments/inventory/single describe('ui-inventory', () => { let user; let instanceHRID; + const OCLCAuthentication = '100481406/PAOLF'; const profileForImport = 'Inventory Single Record - Default Create Instance (Default)'; const testIdentifier = '1234567'; const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; @@ -26,7 +27,7 @@ describe('ui-inventory', () => { .then(userProperties => { user = userProperties; - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); cy.login(user.username, user.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); diff --git a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js index 2096fbf19f..36f938e47d 100644 --- a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js +++ b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js @@ -21,13 +21,14 @@ import ReImportModal from '../../../support/fragments/inventory/reImportModal'; describe('ui-inventory', () => { let user; let instanceHRID; + const OCLCAuthentication = '100481406/PAOLF'; const profileForImport = 'Inventory Single Record - Default Update Instance (Default)'; const fileName = `C375146autotestFile.${getRandomPostfix()}.mrc`; const targetIdentifier = '1234567'; const targetProfile = { name: 'OCLC WorldCat', url: 'zcat.oclc.org/OLUCWorldCat', - authentification: '100473910/PAOLF', + authentification: OCLCAuthentication, externalId: '@attr 1=1211 $identifier', internalId: '999ff$i' }; @@ -45,7 +46,7 @@ describe('ui-inventory', () => { InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHRID = initialInstanceHrId; }); - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); cy.visit(SettingsMenu.targetProfilesPath); Z3950TargetProfiles.openTargetProfile(); ViewTargetProfile.verifyTargetProfileForm( @@ -81,6 +82,8 @@ describe('ui-inventory', () => { it('C375146 Verify the modal window for ISRI In inventory instance details menu for single target profile (update) (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); InventoryInstance.startOverlaySourceBibRecord(); ReImportModal.verifyModalWithOneTargetProfile(); ReImportModal.verifySelectTheProfileToBeUsedToOverlayTheCurrentDataField(profileForImport); @@ -89,7 +92,7 @@ describe('ui-inventory', () => { ReImportModal.import(); // need to wait because after the import the data in the instance is displayed for a long time // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(10000); + cy.wait(7000); InteractorsTools.checkCalloutMessage(successCalloutMessage); InstanceRecordView.verifyIsInstanceOpened(instanceTitle); }); diff --git a/cypress/e2e/quickmark/instance-quickmark.cy.js b/cypress/e2e/quickmark/instance-quickmark.cy.js index 9c7aa14c4d..b19fd6e6ec 100644 --- a/cypress/e2e/quickmark/instance-quickmark.cy.js +++ b/cypress/e2e/quickmark/instance-quickmark.cy.js @@ -14,10 +14,11 @@ import InventoryInstances from '../../support/fragments/inventory/inventoryInsta describe('Manage inventory Bib records with quickMarc editor', () => { let userId; + const OCLCAuthentication = '100481406/PAOLF'; before(() => { cy.getAdminToken().then(() => { - Z3950TargetProfiles.changeOclcWorldCatValueViaApi('100473910/PAOLF'); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); }); }); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 52d7d2a863..cdceb0d5ac 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -209,7 +209,7 @@ const checkInstanceNotes = (noteType, noteContent) => { }; const waitInstanceRecordViewOpened = (title) => { - cy.expect(Pane({ id:'pane-instancedetails' }).exists()); + cy.expect(instanceDetailsPane.exists()); cy.expect(Pane({ titleLabel: including(title) }).exists()); }; @@ -775,7 +775,8 @@ export default { singleOverlaySourceBibRecordModalIsPresented:() => cy.expect(singleRecordImportModal.exists()), - importWithOclc:(oclc) => { + overlayWithOclc:(oclc) => { + cy.do(Select({ name:'selectedJobProfileId' }).choose('Inventory Single Record - Default Update Instance (Default)')); cy.do(singleRecordImportModal.find(TextField({ name:'externalIdentifier' })).fillIn(oclc)); cy.do(singleRecordImportModal.find(Button('Import')).click()); }, diff --git a/cypress/support/fragments/inventory/inventoryInstances.js b/cypress/support/fragments/inventory/inventoryInstances.js index 9bdc98f208..354b699664 100644 --- a/cypress/support/fragments/inventory/inventoryInstances.js +++ b/cypress/support/fragments/inventory/inventoryInstances.js @@ -51,8 +51,6 @@ export default { cy.expect(rootSection.find(HTML(including('Loading…'))).absent()); cy.expect(or(inventoriesList.exists()), rootSection.find(HTML(including('No results found'))).exists()); - // need to wait until list to be formed - cy.wait(2500); }, selectInstance: (rowNumber = 0) => { diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index a92f14020d..01817d147a 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -170,16 +170,6 @@ export default { effectiveLocation: { mainLibrary: { id: 'clickable-filter-effectiveLocation-main-library' }, }, - selectSearchResultByRowIndex(indexRow) { - cy.do(this.getSearchResult(indexRow, 0).click()); - // must wait page render - cy.wait(2000); - }, - selectSearchResultByRowIndex(indexRow) { - cy.expect(Spinner().absent()); - cy.do(this.getSearchResult(indexRow, 0).click()); - cy.expect(Spinner().absent()); - }, language: { eng: { id: 'clickable-filter-language-english' }, diff --git a/cypress/support/fragments/settings/inventory/integrations/z39.50TargetProfiles.js b/cypress/support/fragments/settings/inventory/integrations/z39.50TargetProfiles.js index 53e3fa54f2..de7a054749 100644 --- a/cypress/support/fragments/settings/inventory/integrations/z39.50TargetProfiles.js +++ b/cypress/support/fragments/settings/inventory/integrations/z39.50TargetProfiles.js @@ -253,7 +253,7 @@ export default { body: { name, url:'zcat.oclc.org/OLUCWorldCat', - authentication:'100473910/PAOLF', + authentication:'100481406/PAOLF', externalIdQueryMap:'@attr 1=1211 $identifier', internalIdEmbedPath:'999ff$i', createJobProfileId:defaultCreateInstanceJobProfileId, From ca7c4650e72e8a47eec9b8dab09c99b4e6590d12 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Fri, 11 Aug 2023 16:33:33 +0500 Subject: [PATCH 037/437] FAT-1411 (#1473) --- cypress/e2e/inventory/moving-holdings.cy.js | 2 +- .../e2e/inventory/moving-items-remote.cy.js | 84 +++++++++++++++++++ .../fragments/inventory/inventoryInstance.js | 4 + 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/inventory/moving-items-remote.cy.js diff --git a/cypress/e2e/inventory/moving-holdings.cy.js b/cypress/e2e/inventory/moving-holdings.cy.js index 33c706fef2..0c86cf6c29 100644 --- a/cypress/e2e/inventory/moving-holdings.cy.js +++ b/cypress/e2e/inventory/moving-holdings.cy.js @@ -81,7 +81,7 @@ describe('inventory', () => { Users.deleteViaApi(userId); }); - it('C15187 Move some items with in a holdings record to another holdings associated with another instance', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C15187 Move some items with in a holdings record to another holdings associated with another instance (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Barcode', item.barcode); InventorySearchAndFilter.selectSearchResultItem(); diff --git a/cypress/e2e/inventory/moving-items-remote.cy.js b/cypress/e2e/inventory/moving-items-remote.cy.js new file mode 100644 index 0000000000..ce65bc0e12 --- /dev/null +++ b/cypress/e2e/inventory/moving-items-remote.cy.js @@ -0,0 +1,84 @@ +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 InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import Users from '../../support/fragments/users/users'; +import TopMenu from '../../support/fragments/topMenu'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import InteractorsTools from '../../support/utils/interactorsTools'; +import InventoryInstancesMovement from '../../support/fragments/inventory/holdingsMove/inventoryInstancesMovement'; +import InventoryHoldings from '../../support/fragments/inventory/holdings/inventoryHoldings'; +import ItemRecordView from '../../support/fragments/inventory/item/itemRecordView'; + +let user; +const item = { + instanceName: `instanceName-${getRandomPostfix()}`, + barcode: `barcode-${getRandomPostfix()}`, + firstLocationId: '53cf956f-c1df-410b-8bea-27f712cca7c0', + secondLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87', + firstLocationName: 'Annex', + secondLocationName: 'Popular Reading Collection', +}; +const successCalloutMessage = 'Item has been successfully moved in FOLIO. To complete removing this item from remote storage, run an exception report or communicate this directly to your remote storage location.'; + +describe('inventory', () => { + before('create test data', () => { + let holdingSources; + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.uiInventoryMoveItems.gui, + permissions.remoteStorageCRUD.gui + ]) + .then(userProperties => { + user = userProperties; + cy.getLocations({ limit: 2 }); + cy.getHoldingTypes({ limit: 2 }); + InventoryHoldings.getHoldingSources({ limit: 2 }) + .then(holdingsSourcesResponse => { + holdingSources = holdingsSourcesResponse; + }) + .then(() => { + item.holdings = [ + { + holdingsTypeId: Cypress.env('holdingsTypes')[0].id, + permanentLocationId: item.firstLocationId, + sourceId: holdingSources[0].id, + }, + { + holdingsTypeId: Cypress.env('holdingsTypes')[1].id, + permanentLocationId: item.secondLocationId, + sourceId: holdingSources[1].id, + }]; + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode, null, '1', '2', 'test_number_1', item.holdings); + }); + + cy.login(user.username, user.password, { + path: TopMenu.inventoryPath, + waiter: InventorySearchAndFilter.waitLoading + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + Users.deleteViaApi(user.userId); + }); + + it('C163927 Move an item with remote effective location from remote storage locations to non-remote storage holding', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.barcode); + InventorySearchAndFilter.selectSearchResultItem(); + ItemRecordView.closeDetailView(); + InventoryInstance.openMoveItemsWithinAnInstance(); + + InventoryInstance.moveItemToAnotherHolding(item.firstLocationName, item.secondLocationName); + InventoryInstance.confirmOrCancel('Continue'); + InteractorsTools.checkCalloutMessage(successCalloutMessage); + InventoryInstancesMovement.verifyHoldingsMoved(item.secondLocationName, '1'); + + InventoryInstance.moveItemToAnotherHolding(item.firstLocationName, item.secondLocationName); + InventoryInstance.confirmOrCancel('Cancel'); + }); +}); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index cdceb0d5ac..4149e07ae1 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -603,6 +603,10 @@ export default { ]); }, + confirmOrCancel(action) { + cy.do(Modal('Confirm move').find(Button(action)).click()); + }, + returnItemToFirstHolding(firstHoldingName, secondHoldingName) { this.openHoldings(firstHoldingName, secondHoldingName); From 439a0063bcfb4993585cf04ae4fe9ecd598abd2e Mon Sep 17 00:00:00 2001 From: nayimovag Date: Fri, 11 Aug 2023 16:41:52 +0500 Subject: [PATCH 038/437] Fat 1412 (#1475) --- .../inventory/moving-items-non-remote.cy.js | 96 +++++++++++++++++++ .../e2e/inventory/moving-items-remote.cy.js | 6 +- 2 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/inventory/moving-items-non-remote.cy.js diff --git a/cypress/e2e/inventory/moving-items-non-remote.cy.js b/cypress/e2e/inventory/moving-items-non-remote.cy.js new file mode 100644 index 0000000000..130f276995 --- /dev/null +++ b/cypress/e2e/inventory/moving-items-non-remote.cy.js @@ -0,0 +1,96 @@ +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 InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import Users from '../../support/fragments/users/users'; +import TopMenu from '../../support/fragments/topMenu'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import InteractorsTools from '../../support/utils/interactorsTools'; +import InventoryInstancesMovement from '../../support/fragments/inventory/holdingsMove/inventoryInstancesMovement'; +import InventoryHoldings from '../../support/fragments/inventory/holdings/inventoryHoldings'; +import ItemRecordView from '../../support/fragments/inventory/item/itemRecordView'; +import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; + +let user; +const item = { + instanceName: `instanceName-${getRandomPostfix()}`, + barcode: `barcode-${getRandomPostfix()}`, + // Remote location + firstLocationId: '53cf956f-c1df-410b-8bea-27f712cca7c0', + firstLocationName: 'Annex', + // Non-remote location + secondLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87', + secondLocationName: 'Popular Reading Collection', +}; +const successCalloutMessage = 'Item has been successfully moved in FOLIO. To complete removing this item from remote storage, run an exception report or communicate this directly to your remote storage location.'; + +describe('inventory', () => { + before('create test data', () => { + let holdingSources; + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.uiInventoryMoveItems.gui, + permissions.remoteStorageCRUD.gui + ]) + .then(userProperties => { + user = userProperties; + cy.getLocations({ limit: 2 }); + cy.getHoldingTypes({ limit: 2 }); + InventoryHoldings.getHoldingSources({ limit: 2 }) + .then(holdingsSourcesResponse => { + holdingSources = holdingsSourcesResponse; + }) + .then(() => { + item.holdings = [ + { + holdingsTypeId: Cypress.env('holdingsTypes')[0].id, + permanentLocationId: item.firstLocationId, + sourceId: holdingSources[0].id, + }, + { + holdingsTypeId: Cypress.env('holdingsTypes')[1].id, + permanentLocationId: item.secondLocationId, + sourceId: holdingSources[1].id, + }]; + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode, null, '1', '2', 'test_number_1', item.holdings); + }).then(() => { + // Update item with non-remote effective location + cy.getItems({ query: `"barcode"=="${item.barcode}"` }) + .then(res => { + const itemData = res; + itemData.effectiveLocation.id = item.secondLocationId; + itemData.effectiveLocation.name = item.secondLocationName; + ItemActions.editItemViaApi(itemData); + }); + }).then(() => { + cy.login(user.username, user.password, { + path: TopMenu.inventoryPath, + waiter: InventorySearchAndFilter.waitLoading + }); + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + Users.deleteViaApi(user.userId); + }); + + it('C191169 Move item with non remote effective location to a non remote holding (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.barcode); + InventorySearchAndFilter.selectSearchResultItem(); + ItemRecordView.closeDetailView(); + InventoryInstance.openMoveItemsWithinAnInstance(); + + InventoryInstance.moveItemToAnotherHolding(item.firstLocationName, item.secondLocationName); + InventoryInstance.confirmOrCancel('Continue'); + InteractorsTools.checkCalloutMessage(successCalloutMessage); + InventoryInstancesMovement.verifyHoldingsMoved(item.secondLocationName, '1'); + + InventoryInstance.moveItemToAnotherHolding(item.firstLocationName, item.secondLocationName); + InventoryInstance.confirmOrCancel('Cancel'); + }); +}); diff --git a/cypress/e2e/inventory/moving-items-remote.cy.js b/cypress/e2e/inventory/moving-items-remote.cy.js index ce65bc0e12..d27871764d 100644 --- a/cypress/e2e/inventory/moving-items-remote.cy.js +++ b/cypress/e2e/inventory/moving-items-remote.cy.js @@ -16,9 +16,11 @@ let user; const item = { instanceName: `instanceName-${getRandomPostfix()}`, barcode: `barcode-${getRandomPostfix()}`, + // Remote location firstLocationId: '53cf956f-c1df-410b-8bea-27f712cca7c0', - secondLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87', firstLocationName: 'Annex', + // Non-remote location + secondLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87', secondLocationName: 'Popular Reading Collection', }; const successCalloutMessage = 'Item has been successfully moved in FOLIO. To complete removing this item from remote storage, run an exception report or communicate this directly to your remote storage location.'; @@ -66,7 +68,7 @@ describe('inventory', () => { Users.deleteViaApi(user.userId); }); - it('C163927 Move an item with remote effective location from remote storage locations to non-remote storage holding', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C163927 Move an item with remote effective location from remote storage locations to non-remote storage holding (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Barcode', item.barcode); InventorySearchAndFilter.selectSearchResultItem(); From 8fa2cf0f187990026017f9efecd57719701be1cb Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:51:28 +0500 Subject: [PATCH 039/437] FAT-7402/Fixed tests with OCLC authentication issue (#1476) * fixed tests with OCLC authentication issue * small fix in holding records actions --- .../holdings/holdings-records-Instancesource-marc.cy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 27e1c09050..595fe75ffc 100644 --- a/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js +++ b/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js @@ -32,11 +32,11 @@ describe('Manage holding records with MARC source', { retries: 2 }, () => { cy.wait(10000); HoldingsRecordView.getId().then(initialHoldindsRecordId => { 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. + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. HoldingsRecordView.close(); InventoryInstance.openHoldingView(); + HoldingsRecordView.checkActionsMenuOptionsInMarcSource(); + HoldingsRecordView.tryToDelete(); HoldingsRecordView.viewSource(); InventoryViewSource.close(); HoldingsRecordView.editInQuickMarc(); From 28c16b24a4df0ddedac9410dc5c79776c0f67db6 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Fri, 11 Aug 2023 19:42:02 +0300 Subject: [PATCH 040/437] FAT-7372-C400610 (#1469) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7372: precondition added * FAT-7372: test implemented * FAT-7372: methods updated * FAT-7372: moved items to const --- .../search/advanced-search-in-inventory.cy.js | 81 ++++++++++++ cypress/fixtures/marcBibFileC400610.mrc | 1 + .../fragments/inventory/inventoryInstances.js | 120 +++++++++++++++++- interactors/advanced-search-inventory.js | 36 ++++++ 4 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js create mode 100644 cypress/fixtures/marcBibFileC400610.mrc create mode 100644 interactors/advanced-search-inventory.js diff --git a/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js b/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js new file mode 100644 index 0000000000..4b37c36b39 --- /dev/null +++ b/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js @@ -0,0 +1,81 @@ +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 InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import { JOB_STATUS_NAMES } from '../../../support/constants'; + +describe('Inventory -> Advanced search', () => { + const testData = { + advSearchOption: 'Advanced search', + expectedSearchResult: 'The Beatles in mono. Adv search 001' + }; + const createdRecordIDs = []; + + const marcFiles = [ + { + marc: 'marcBibFileC400610.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numberOfRecords: 2 + } + ]; + + before('Creating data', () => { + 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]); + }); + } + }); + }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + + after('Deleting data', () => { + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach(id => { + InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C400610 Search Instances using advanced search with "AND" operator (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstances.clickAdvSearchButton(); + InventoryInstances.checkAdvSearchInstancesModalFields(0); + InventoryInstances.checkAdvSearchInstancesModalFields(1); + InventoryInstances.checkAdvSearchInstancesModalFields(2); + InventoryInstances.checkAdvSearchInstancesModalFields(3); + InventoryInstances.checkAdvSearchInstancesModalFields(4); + InventoryInstances.checkAdvSearchInstancesModalFields(5); + InventoryInstances.fillAdvSearchRow(0, 'The Beatles Adv search keyword', 'Starts with', 'Keyword (title, contributor, identifier, HRID, UUID)'); + InventoryInstances.checkAdvSearchModalValues(0, 'The Beatles Adv search keyword', 'Starts with', 'Keyword (title, contributor, identifier, HRID, UUID)'); + InventoryInstances.fillAdvSearchRow(1, 'Rock music Adv search subj 001', 'Exact phrase', 'Subject', 'AND'); + InventoryInstances.checkAdvSearchModalValues(1, 'Rock music Adv search subj 001', 'Exact phrase', 'Subject', 'AND'); + InventoryInstances.clickSearchBtnInAdvSearchModal(); + InventoryInstances.checkAdvSearchModalAbsence(); + InventoryInstances.verifySelectedSearchOption(testData.advSearchOption); + InventorySearchAndFilter.verifySearchResult(testData.expectedSearchResult); + InventorySearchAndFilter.checkRowsCount(1); + }); +}); diff --git a/cypress/fixtures/marcBibFileC400610.mrc b/cypress/fixtures/marcBibFileC400610.mrc new file mode 100644 index 0000000000..410062a933 --- /dev/null +++ b/cypress/fixtures/marcBibFileC400610.mrc @@ -0,0 +1 @@ +17096cjm a2201585 a 4500001001500000007001500015007001500030008004100045005001700086010001700103024002900120028004700149028005800196028005800254028005800312028005800370028004700428028005300475028005000528028007900578028006200657028006300719028005900782028005900841028006400900028006200964028006201026033002301088033002301111035002101134035001201155040012501167042001401292050002801306082001801334110003901352245004001391260005901431300005701490336003701547337002301584338003101607388002701638500017501665500001601840500002601856500034301882511007702225518002402302500002402326500001902350500008002369500014802449505082002597505084503417505081304262505083105075505081805906505081806724505082207542505079208364505071309156505173409869505197711603650003513580650003013615650003613645650006213681650004213743648002013785655005213805655004513857655004213902655002313944655002613967655003313993700003514026700002114061700003314082700001814115700002214133700002814155700002914183700003114212700002214243700002214265700003014287700002214317700001914339700001814358700001814376700003414394700002014428700003014448700002214478700002214500700002514522700003014547700001914577700002714596700001714623700002114640700001814661700002014679700003114699700002014730700002914750700001714779700002114796700001814817700001814835700001914853700002214872700003314894700003514927710002114962710002514983710002615008710002415034710003215058710003215090710003215122710003215154710002015186710002715206710002415233710005315257710003615310710002315346740001815369902002315387948002815410948002915438948004315467nin00009335276sd fmngnnmmneesd fsngnnmmnee090922r20091963enkmunn dfi n eng d20221112072442.2 a 20116161923 a5099969945120q(box set)00a5099969945120bApple Corps Ltd.q(box set)00a5099969945229bApple Corps Ltd. $q (Please please me)00a5099969945328bApple Corps Ltd. $q (With the Beatles)00a5099969945427bApple Corps Ltd. $q (Hard day's night)00a5099969945526bApple Corps Ltd. $q (Beatles for sale)00a5099969945625bApple Corps Ltd. $q (Help!)00a5099969945724bApple Corps Ltd. $q (Rubber soul)00a5099969945823bApple Corps Ltd. $q (Revolver)00a5099969945922bApple Corps Ltd. $q (Sgt. Pepper's Lonely Hearts Club Band)00a5099969946028bApple Corps Ltd. $q (Magical mystery tour)00a5099968495725bApple Corps Ltd. $q (The Beatles, 2 CD set)00a5099969946127bApple Corps Ltd. $q (The Beatles, CD 1)00a5099969946226bApple Corps Ltd. $q (The Beatles, CD 2)00a5099968495824bApple Corps Ltd. $q (Mono masters, 2 CD set)00a5099969946325bApple Corps Ltd. $q (Mono masters, disc 1)00a5099969946424bApple Corps Ltd. $q (Mono masters, disc 2)2 a1962----a1968----20a1962----a1968---- a(OCoLC)436228315 a6881317 aINObengcDLCdINOdUMCdCPLdRBNdNUIdOHRRHdBDXdTEFdOCLCFdWOSdWAUdOCLdOCLCQdOCLCOdOCLdOCLCQdEMUdOCLCOdCOO alccopycat14aM1741.18.B42bB436 200904a782.421662232 aThe Beatles Adv search keyword 00114aThe Beatles in mono. Adv search 001 a[London] :bApple Corps Ltd. :bEMI Records,câ„—2009. a13 audio discs :bdigital, mono, stereo ;c4 3/4 in. aperformed musicbprm2rdacontent aaudiobs2rdamedia aaudio discbsd2rdacarrier1 aNineteen sixties2lcsh aApple Corps Ltd.: 5099969945120 (5099969945229--5099969945922, 5099969946028, 5099968495725 (5099969946127--5099969946226), 5099968495824 (5099969946325--5099969946424)). aRock music. aTitle from container. a"The complete mono recordings. 185 songs ... all 10 original mono albums ... packaged in miniature vinyl sleeves that faithfully recreate the original LP releases down to the finest detail ... also includes a double-CD collection of all The Beatles non-album and EP tracks ... in mono including four mixes unique to this package"--Insert.0 aThe Beatles (John Lennon, George Harrison, Paul McCartney, Ringo Starr). aRecorded 1962-1970. aReissues 1963-1970. aCompact discs. aDiscs 5-6 include the mono. mix and original 1965 stereo. mix of each song. aProgram notes by Kevin Howlett ([44] p. : ill.) inserted in container; some individual slipcases reproduce original container notes and lyrics.00gDisc 1,tPlease please me.tI saw her standing there /rPaul McCartney, John Lennong(2:55) ;tMisery /rPaul McCartney, John Lennong(1:50) ;tAnna (Go to him) /rArthur Alexanderg(2:57) ;tChains /rGerry Goffin, Carole Kingg(2:26) ;tBoys /rLuther Dixon, Wes Farrellg(2:27) ;tAsk me why /rPaul McCartney, John Lennong(2:27) ;tPlease please me /rPaul McCartney, John Lennong(2:03) ;tLove me do /rPaul McCartney, John Lennong(2:22) ;tP.S.I love you /rPaul McCartney, John Lennong(2:05) ;tBaby it's you /rMack David, Barney Williams, Burt Bacharachg(2:38) ;tDo you want to know a secret /rPaul McCartney, John Lennong(1:59) ;tA taste of honey /rBobby Scott, Ric Marlowg(2:05) ;tThere's a place /rPaul McCartney, John Lennong(1:52) ;tTwist and shout /rPhil Medley, Bert Russellg(2:33).00gDisc 2,tWith the Beatles.tIt won't be long /rJohn Lennon, Paul McCartneyg(2:13) ;tAll I've got to do /rJohn Lennon, Paul McCartneyg(2:04) ;tAll my loving /rJohn Lennon, Paul McCartneyg(2:09) ;tDon't bother me /rGeorge Harrisong(2:29) ;tLittle child /rJohn Lennon, Paul McCartneyg(1:48) ;tTill there was you /rMeredith Wilsong(2:16) ;tPlease Mr. Postman /rGeorgia Dobbin, William Garrett, Fred Garman, Brianbertg(2:36) ;tRoll over Beethoven /rChuck Berryg(2:47) ;tHold me tight /rJohn Lennon, Paul McCartneyg(2:32) ;tYou really got a hold on me /rSmokey Robinsong(3:02) ;tI wanna be your man /rJohn Lennon, Paul McCartneyg(1:58) ;tDevil in her heart /rRichard Drapking(2:27) ;tNot a second time /rJohn Lennon, Paul McCartneyg(2:08) ;tMoney (that's what I want) /rJanie Bradford, Berry Gordyg(2:47).00gDisc 3,tA hard day's night.tA hard day's night /rJohn Lennon, Paul McCartneyg(2:32) ;tI should have known better /rJohn Lennon, Paul McCartneyg(2:44) ;tIf I fell /rJohn Lennon, Paul McCartneyg(2:22) ;tI'm happy just to dance with you /rJohn Lennon, Paul McCartneyg(1:58) ;tAnd I love her /rJohn Lennon, Paul McCartneyg(2:31) ;tTell me why /rJohn Lennon, Paul McCartneyg(2:10) ;tCan't buy me love /rJohn Lennon, Paul McCartneyg(2:14) ;tAny time at all /rJohn Lennon, Paul McCartneyg(2:13) ;tI'll cry instead /rJohn Lennon, Paul McCartneyg(1:47) ;tThings we said today /rJohn Lennon, Paul McCartneyg(2:38) ;tWhen I get home /rJohn Lennon, Paul McCartneyg(2:18) ;tYou can't do that /rJohn Lennon, Paul McCartneyg(2:37) ;tI'll be back /rJohn Lennon, Paul McCartneyg(2:20).00gDisc 4,tBeatles for sale.tNo reply /rJohn Lennon, Paul McCartneyg(2:17) ;tI'm a loser /rJohn Lennon, Paul McCartneyg(2:33) ;tBaby's in black /rJohn Lennon, Paul McCartneyg(2:07) ;tRock and roll music /rChuck Berryg(2:33) ;tI'll follow the sun /rJohn Lennon, Paul McCartneyg(1:51) ;tMr. Moonlight /rRoy Lee Johnsong(2:37) ;tKansas City /rJerry Leiber, Mike Stoller/tHey-Hey-Hey-Hey! /rRichard Pennimang(2:33) ;tEight days a week /rJohn Lennon, Paul McCartneyg(2:45) ;tWords of love /rBuddy Hollyg(2:14) ;tHoney don't /rCarl Perkinsg(2:59) ;tEvery little thing /rJohn Lennon, Paul McCartneyg(2:04) ;tI don't want to spoil the party /rJohn Lennon, Paul McCartneyg(2:36) ;tWhat you're doing /rJohn Lennon, Paul McCartneyg(2:34) ;tEverybody's trying to be my baby /rCarl Perkinsg(2:23).00gDisc 5,tHelp!tHelp! /rJohn Lennon, Paul McCartneyg(2:21) ;tThe night before /rJohn Lennon, Paul McCartneyg(2:36) ;tYou've got to hide your love away /rJohn Lennon, Paul McCartneyg(2:11) ;tI need you /rGeorge Harrisong(2:31) ;tAnother girl /rJohn Lennon, Paul McCartneyg(2:08) ;tYou're going to lose that girl /rJohn Lennon, Paul McCartneyg(2:20) ;tTicket to ride /rJohn Lennon, Paul McCartneyg(3:12) ;tAct naturally /rVoni Morrison, Johnny Russellg(2:33) ;tIt's only love /rJohn Lennon, Paul McCartneyg(1:58) ;tYou like me too much /rGeorge Harrisong(2:38) ;tTell me what you see /rJohn Lennon, Paul McCartneyg(2:39) ;tI've just seen a face /rJohn Lennon, Paul McCartneyg(2:07) ;tYesterday /rJohn Lennon, Paul McCartneyg(2:07) ;tDizzy Miss Lizzy /rLarry Williamsg(2:54).00gDisc 6,tRubber soul.tDrive my car /rJohn Lennon, Paul McCartneyg(2:30) ;tNorwegian wood (This bird has flown) /rJohn Lennon, Paul McCartneyg(2:05) ;tYou won't see me /rJohn Lennon, Paul McCartneyg(3:22) ;tNowhere man /rJohn Lennon, Paul McCartneyg(2:44) ;tThink for yourself /rGeorge Harrisong(2:19) ;tThe word /rJohn Lennon, Paul McCartneyg(2:43) ;tMichelle /rJohn Lennon, Paul McCartneyg(2:42) ;tWhat goes on /rJohn Lennon, Paul McCartney, Richard Starkeyg(2:50) ;tGirl /rJohn Lennon, Paul McCartneyg(2:33) ;tI'm looking through you /rJohn Lennon, Paul McCartneyg(2:27) ;tIn my life /rJohn Lennon, Paul McCartneyg(2:27) ;tWait /rJohn Lennon, Paul McCartneyg(2:16) ;tIf I needed someone /rGeorge Harrisong(2:23) ;tRun for your life /rJohn Lennon, Paul McCartneyg(2:18).00gDisc 7,tRevolver.tTaxman /rGeorge Harrisong(2:39) ;tEleanor Rigby /rJohn Lennon, Paul McCartneyg(2:07) ;tI'm only sleeping /rJohn Lennon, Paul McCartneyg(3:01) ;tLove you to /rGeorge Harrisong(3:01) ;tHere, there, and everywhere /rJohn Lennon, Paul McCartneyg(2:25) ;tYellow submarine /rJohn Lennon, Paul McCartneyg(2:40) ;tShe said she said /rJohn Lennon, Paul McCartneyg(2:37) ;tGood day sunshine /rJohn Lennon, Paul McCartneyg(2:09) ;tAnd your bird can sing /rJohn Lennon, Paul McCartneyg(2:01) ;tFor no one /rJohn Lennon, Paul McCartneyg(2:01) ;tDoctor Robert /rJohn Lennon, Paul McCartneyg(2:01) ;tI want to tell you /rGeorge Harrisong(2:29) ;tGot to get you into my life /rJohn Lennon, Paul McCartneyg(2:37) ;tTomorrow never knows /rJohn Lennon, Paul McCartneyg(2:57).00gDisc 8,tSgt. Pepper's Lonely Hearts Club Band.tSgt. Pepper's Lonely Hearts Club Band /rPaul McCartneyg(2:02) ;tWith a little help from my friends /rJohn Lennon, Paul McCartneyg(2:44) ;tLucy in the sky with diamonds /rJohn Lennong(3:28) ;tGetting better /rPaul McCartneyg(2:47) ;tFixing a hole /rPaul McCartneyg(2:36) ;tShe's leaving home /rPaul McCartney, John Lennong(3:35) ;tBeing for the benefit of Mr. Kite! /rJohn Lennong(2:37) ;tWithin you without you /rGeorge Harrisong(5:05) ;tWhen I'm sixty-four /rPaul McCartneyg(2:37) ;tLovely Rita /rPaul McCartneyg(2:42) ;tGood morning good morning /rJohn Lennong(2:41) ;tSgt. Pepper's Lonely Hearts Club Band (reprise) /rPaul McCartneyg(1:18) ;tA day in the life /rJohn Lennon, Paul McCartneyg(5:33).80gDisc 9,tMagical mystery tour.tMagical mystery tour /rJohn Lennon, Paul McCartneyg(2:48) ;tThe fool on the hill /rJohn Lennon, Paul McCartneyg(3:00) ;tFlying /rJohn Lennon, Paul McCartney, George Harrison, Ringo Starrg(2:16) ;tBlue Jay Way /rGeorge Harrisong(3:50) ;tYour mother should know /rJohn Lennon, Paul McCartneyg(2:33) ;tI am the walrus /rJohn Lennon, Paul McCartneyg(4:35) ;tHello, goodbye /rJohn Lennon, Paul McCartneyg(3:24) ;tStrawberry fields forever /rJohn Lennon, Paul McCartneyg(4:05) ;tPenny Lane /rJohn Lennon, Paul McCartneyg(2:57) ;tBaby, you're a rich man /rJohn Lennon, Paul McCartneyg(3:07) ;tAll you need is love /rJohn Lennon, Paul McCartneyg(3:57).00gDiscs 10-11,tThe Beatles.tBack in the U.S.S.R. /rJohn Lennon, Paul McCartneyg(2:43) ;tDear Prudence /rJohn Lennon, Paul McCartneyg(3:56) ;tGlass onion /rJohn Lennon, Paul McCartneyg(2:17) ;tOb-la-di, ob-la-da /rJohn Lennon, Paul McCartneyg(3:08) ;tWild honey pie /rJohn Lennon, Paul McCartneyg(0:52) ;tThe continuing story of Bungalow Bill /rJohn Lennon, Paul McCartneyg(3:14) ;tWhile my guitar gently weeps /rGeorge Harrisong(4:45) ;tHappiness is a warm gun /rJohn Lennon, Paul McCartneyg(2:43) ;tMartha my dear /rJohn Lennon, Paul McCartneyg(2:28) ;tI'm so tired /rJohn Lennon, Paul McCartneyg(2:03) ;tBlackbird /rJohn Lennon, Paul McCartneyg(2:18) ;tPiggies /rGeorge Harrisong(2:04) ;tRocky Raccoon /rJohn Lennon, Paul McCartneyg(3:32) ;tDon't pass me by /rRingo Starrg(3:50) ;tWhy don't we do it in the road? /rJohn Lennon, Paul McCartneyg(1:41) ;tI will /rJohn Lennon, Paul McCartneyg(1:46) ;tJulia /rJohn Lennon, Paul McCartneyg(2:54) ;tBirthday /rJohn Lennon, Paul McCartneyg(2:42) ;tYer blues /rJohn Lennon, Paul McCartneyg(4:01) ;tMother Nature's son /rJohn Lennon, Paul McCartneyg(2:48) ;tEverybody's got something to hide except me and my monkey /rJohn Lennon, Paul McCartneyg(2:24) ;tSexy Sadie /rJohn Lennon, Paul McCartneyg(3:15) ;tHelter skelter /rJohn Lennon, Paul McCartneyg(4:29) ;tLong, long, long /rGeorge Harrisong(3:04) ;tRevolution 1 /rJohn Lennon, Paul McCartneyg(4:15) ;tHoney pie /rJohn Lennon, Paul McCartneyg(2:41) ;tSavoy truffle /rGeorge Harrisong(2:54) ;tCry baby cry /rJohn Lennon, Paul McCartneyg(3:01) ;tRevolution 9 /rJohn Lennon, Paul McCartneyg(8:22) ;tGood night /rJohn Lennon, Paul McCartneyg(3:11).00gDiscs 12-13,tMono masters.tLove me dog(original single version) /rJohn Lennon, Paul McCartneyg(2:23) ;tFrom me to you /rJohn Lennon, Paul McCartneyg(1:57) ;tThank you girl /rJohn Lennon, Paul McCartneyg(2:05) ;tShe loves you /rJohn Lennon, Paul McCartneyg(2:21) ;tI'll get you /rJohn Lennon, Paul McCartneyg(2:05) ;tI want to hold your hand /rJohn Lennon, Paul McCartneyg(2:26) ;tThis boy /rJohn Lennon, Paul McCartneyg(2:16) ;tKomm, gib mir deine Hand /rJohn Lennon, Paul McCartneyg(2:26) ;tSie liebt dich /rJohn Lennon, Paul McCartneyg(2:19) ;tLong tall Sally /rRobert Blackwell, Etotris Johnson, Little Richardg(2:03) ;tI call your name /rJohn Lennon, Paul McCartneyg(2:09) ;tSlow down /rLarry Williamsg(2:56) ;tMatchbox /rCarl Perkinsg(1:58) ;tI feel fine /rJohn Lennon, Paul McCartneyg(2:19) ;tShe's a woman /rJohn Lennon, Paul McCartneyg(3:03) ;tBad boy /rLarry Williamsg(2:20) ;tYes it is /rJohn Lennon, Paul McCartneyg(2:42) ;tI'm down /rJohn Lennon, Paul McCartneyg(2:31) ;tDay tripper /rJohn Lennon, Paul McCartneyg(2:49) ;tWe can work it out /rJohn Lennon, Paul McCartneyg(2:15) ;tPaperback writer /rJohn Lennon, Paul McCartneyg(2:18) ;tRain /rJohn Lennon, Paul McCartneyg(3:02) ;tLady Madonna /rJohn Lennon, Paul McCartneyg(2:17) ;tThe inner light /rGeorge Harrisong(2:36) ;tHey Jude /rJohn Lennon, Paul McCartneyg(7:08) ;tRevolution /rJohn Lennon, Paul McCartneyg(3:24) ;tOnly a northern song /rGeorge Harrisong(3:11) ;tAll together now /rJohn Lennon, Paul McCartneyg(3:35) ;tHey bulldog /rJohn Lennon, Paul McCartneyg(2:59) ;tIt's all too much /rGeorge Harrisong(3:18) ;tGet backg(with Billy Preston) /rJohn Lennon, Paul McCartneyg(3:49) ;tDon't let me downg(with Billy Preston) /rJohn Lennon, Paul McCartneyg(3:51) ;tAcross the universe /rJohn Lennon, Paul McCartneyg(4:19) ;tYou know my name (Look up the number) /rJohn Lennon, Paul McCartneyg(4:24). 0aRock music Adv search subj 001 0aPopular musicy1961-1970. 0aMotion picture musicvExcerpts. 7aMotion picture musicxExcerpts.2fast0(OCoLC)fst01027204 7aRock music.2fast0(OCoLC)fst01099204 7a1961-19702fast 7aMotion picture music.2fast0(OCoLC)fst01726674 7aPopular music.2fast0(OCoLC)fst01726706 7aRock music.2fast0(OCoLC)fst01726724 7aRock music.2lcgft 7aPopular music.2lcgft 7aMotion picture music.2lcgft1 aAlexander, Arthur,d1940-1993.1 aBacharach, Burt.1 aBateman, Robert,d1936-2016.1 aBerry, Chuck.1 aBlackwell, Bumps.1 aBradford, Janie,d1939-1 aDavid, Mack,d1912-1993.1 aDixon, Luther,d1931-2009.1 aDobbins, Georgia.1 aDropkin, Richard.1 aFarrell, Wes,d1939-1996.1 aGarrett, William.1 aGoffin, Gerry.1 aGordy, Berry.1 aGorman, Fred.1 aHarrison, George,d1943-2001.1 aHolland, Brian.1 aHolly, Buddy,d1936-1959.1 aJohnson, Enotris.1 aJohnson, Roy Lee.1 aKing, Carole,d1942-1 aLennon, John,d1940-1980.1 aLeiber, Jerry.0 aLittle Richard,d1932-1 aMarlow, Ric.1 aMcCartney, Paul.1 aMedley, Phil.1 aMorrison, Voni.1 aPerkins, Carl,d1932-1998.1 aPreston, Billy.1 aRobinson, Smokey,d1940-1 aBerns, Bert.1 aRussell, Johnny.1 aScott, Bobby.1 aStarr, Ringo.1 aStoller, Mike.1 aWilliams, Barney.1 aWilliams, Larry,d1935-1980.1 aWillson, Meredith,d1902-1984.2 aEMI Records Ltd.2 aApple Corps Limited.2 aCapitol Records, Inc.2 aParlophone Company.22aBeatles.tPlease please me.22aBeatles.tWith the Beatles.22aBeatles.tHard day's night.22aBeatles.tBeatles for sale.22aBeatles.tHelp!22aBeatles.tRubber soul.22aBeatles.tRevolver.22aBeatles.tSgt. Pepper's Lonely Hearts Club Band.22aBeatles.tMagical mystery tour.22aBeatles.tBeatles.02aMono masters. apfndbAustin Music1 a20100430bcdbak24elts2 a20170825bmdtls224elts2 a20170901bmdbatcheltsxdeloclcprefix02508com 2200541Mi 4500001001500000008004100015005001700056035002400073040008100097020001800178020001500196020001800211020001500229028002600244028002600270035002200296050002500318082001600343100004000359245005200399250001600451264005300467264001200520300007100532336002200603337002800625338002700653490001400680500002700694500002600721500001800747511003000765520061300795521002101408650003501429650003801464650003101502650004601533655003901579655003301618700003001651710002501681856008001706856008101786938004101867994001401908948004401922nin00009530445121004s2018 mdunnn bneng d20230117115559.6 a(OCoLC)on1037119219 aRECBCbengerdacRECBCdOCLCOdOCLCQdOCLCFdOCLCAdOCLdOCLCQdOCLCOdOCLCQ a9781428118874 a142811887X a9780788799341 a078879934702a3L175bRecorded Books02aC1433bRecorded Books a(OCoLC)1037119219 4aPS3521.E735bO5 201804a813/.542231 aKerouac, Jack,d1922-1969,eauthor.10aOn the roadh[sound recording] /cJack Kerouac. aUnabridged. 1aPrince Frederick, Md. :bRecorded Books,c[2018] 4câ„—2018 a10 audio discs (11 hr., 15 min.) :bdigital ;c4 3/4 in. +e1 book aother2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier0 aClass Set aIn container (23 cm.). aTitle from container. aCompact disc.0 aNarrated by Frank Muller. aAs he travels across 1950s America, aspiring writer Sal Paradise chronicles his escapades with the charismatic Dean Moriarty. Sal admires Dean's passion for experiencing as much as possible of life and his wild flights of poetic fancy. On the Road memorializes the author's real-life adventures with Neal Cassady and epitomizes what comes to be known as "the Beat generation." It is the novel that made Kerouac one of the most controversial and best-known writers of his time. With Frank Muller's virtuoso performance, the text flows like the road itself, an exhilarating trip for narrator and listener alike a12 years and up. 0aRock music Adv search subj 001 6aBeatniksvRomans, nouvelles, etc. 7aFICTIONxGeneral.2bisacsh 7aBeats (Persons)2fast0(OCoLC)fst00829327 7aFiction.2fast0(OCoLC)fst01423787 7aChildren's audiobooks.2lcgt1 aMuller, Frank,enarrator.2 aRecorded Books, Inc.4 3RBMediauhttp://d2cv0ie6dlin9h.cloudfront.net/3L175/3L175_image_148x230.jpg4 3recordedbooks.comuhttps://www.recordedbooks.com/title-details/9781428118874 aRecorded Books, LLCbRECCnrbcd3L175 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 1 OTHER HOLDINGS \ No newline at end of file diff --git a/cypress/support/fragments/inventory/inventoryInstances.js b/cypress/support/fragments/inventory/inventoryInstances.js index 354b699664..81ebd0b6e5 100644 --- a/cypress/support/fragments/inventory/inventoryInstances.js +++ b/cypress/support/fragments/inventory/inventoryInstances.js @@ -17,12 +17,68 @@ import inventoryNewInstance from './inventoryNewInstance'; import InventoryInstance from './inventoryInstance'; import Arrays from '../../utils/arrays'; import { ITEM_STATUS_NAMES } from '../../constants'; +import { AdvancedSearchModalInventory, AdvancedSearchRowInventory } from '../../../../interactors/advanced-search-inventory'; const rootSection = Section({ id: 'pane-results' }); const inventoriesList = rootSection.find(MultiColumnList({ id: 'list-inventory' })); const actionsButton = rootSection.find(Button('Actions')); const singleRecordImportModal = Modal('Single record import'); +const advSearchButton = Button('Advanced search'); +const advSearchModal = Modal('Advanced search'); +const buttonSearchInAdvSearchModal = advSearchModal.find(Button({ ariaLabel: 'Search', disabled: false })); +const buttonCancelInAdvSearchModal = advSearchModal.find(Button({ ariaLabel: 'Cancel', disabled: false })); +const inventorySearchAndFilterInput = Select({ id: 'input-inventory-search-qindex' }); +const advSearchOperatorSelect = Select({ label: 'Operator*' }); +const advSearchModifierSelect = Select({ label: 'Match option*' }); +const advSearchOptionSelect = Select({ label: 'Search options*' }); + +const advSearchOperators = ['AND', 'OR', 'NOT']; +const advSearchModifiers = ['Exact phrase', 'Contains all', 'Starts with']; +const advSearchModifiersValues = ['exactPhrase', 'containsAll', 'startsWith']; +const searchInstancesOptions = [ + 'Keyword (title, contributor, identifier, HRID, UUID)', + 'Contributor', + 'Title (all)', + 'Identifier (all)', + 'ISBN', + 'ISSN', + 'OCLC number, normalized', + 'Instance notes (all)', + 'Instance administrative notes', + 'Subject', + 'Effective call number (item), shelving order', + 'Instance HRID', + 'Instance UUID', + 'Authority UUID', + 'All', + 'Query search', + 'Advanced search' +]; +const searchInstancesOptionsValues = [ + 'all', + 'contributor', + 'title', + 'identifier', + 'isbn', + 'issn', + 'oclc', + 'instanceNotes', + 'instanceAdministrativeNotes', + 'subject', + 'callNumber', + 'hrid', + 'id', + 'authorityId', + 'allFields', + 'querySearch', + 'advancedSearch' +]; +const advSearchInstancesOptions = searchInstancesOptions.filter((option, index) => index <= 14); +const advSearchInstancesOptionsValues = searchInstancesOptionsValues + .map((option, index) => (index ? option : 'keyword')) + .filter((option, index) => index <= 14); + const createInstanceViaAPI = (instanceWithSpecifiedNewId) => cy.okapiRequest({ method: 'POST', path: 'inventory/instances', @@ -295,5 +351,67 @@ export default { cy.do(singleRecordImportModal.find(Button('Import')).click()); }, - verifyInstanceDetailsView:() => cy.expect(Section({ id: 'pane-instancedetails' }).exists()) + verifyInstanceDetailsView:() => cy.expect(Section({ id: 'pane-instancedetails' }).exists()), + + clickAdvSearchButton() { + cy.do(advSearchButton.click()); + cy.expect([ + AdvancedSearchModalInventory({ rowCount: 6 }).exists(), + buttonSearchInAdvSearchModal.exists(), + buttonCancelInAdvSearchModal.exists() + ]); + }, + + checkAdvSearchInstancesModalFields(rowIndex) { + if (rowIndex) { + cy.expect(AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchOperatorSelect).exists()); + advSearchOperators.forEach(operator => { + cy.expect(AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchOperatorSelect).has({ content: including(operator) })); + }); + } else { + cy.expect(AdvancedSearchRowInventory({ index: rowIndex }).has({ text: including('Search for') })); + } + cy.expect([ + AdvancedSearchRowInventory({ index: rowIndex }).find(TextField()).exists(), + AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchModifierSelect).exists(), + AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchOptionSelect).exists(), + ]); + advSearchModifiers.forEach(modifier => { + cy.expect(AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchModifierSelect).has({ content: including(modifier) })); + }); + advSearchInstancesOptions.forEach(option => { + cy.expect(AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchOptionSelect).has({ content: including(option) })); + }); + }, + + fillAdvSearchRow(rowIndex, query, modifier, option, operator) { + cy.do([ + AdvancedSearchRowInventory({ index: rowIndex }).fillQuery(query), + AdvancedSearchRowInventory({ index: rowIndex }).selectModifier(rowIndex, modifier), + AdvancedSearchRowInventory({ index: rowIndex }).selectSearchOption(rowIndex, option), + ]); + if (operator) cy.do(AdvancedSearchRowInventory({ index: rowIndex }).selectBoolean(rowIndex, operator)); + }, + + checkAdvSearchModalAbsence() { + cy.expect(advSearchModal.absent()); + }, + + checkAdvSearchModalValues: (rowIndex, query, modifier, option, operator) => { + cy.expect([ + advSearchModal.exists(), + AdvancedSearchRowInventory({ index: rowIndex }).find(TextField()).has({ value: including(query) }), + AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchModifierSelect).has({ value: advSearchModifiersValues[advSearchModifiers.indexOf(modifier)] }), + AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchOptionSelect).has({ value: advSearchInstancesOptionsValues[advSearchInstancesOptions.indexOf(option)] }), + ]); + if (operator) cy.expect(AdvancedSearchRowInventory({ index: rowIndex }).find(advSearchOperatorSelect).has({ value: operator.toLowerCase() })); + }, + + clickSearchBtnInAdvSearchModal() { + cy.do(buttonSearchInAdvSearchModal.click()); + }, + + verifySelectedSearchOption(option) { + cy.expect(inventorySearchAndFilterInput.has({ value: searchInstancesOptionsValues[searchInstancesOptions.indexOf(option)] })); + } }; diff --git a/interactors/advanced-search-inventory.js b/interactors/advanced-search-inventory.js new file mode 100644 index 0000000000..5271f9b484 --- /dev/null +++ b/interactors/advanced-search-inventory.js @@ -0,0 +1,36 @@ +import Button from './button'; +import Select from './select'; +import TextField from './text-field'; +import HTML from './baseHTML'; + +export const AdvancedSearchRowInventory = HTML.extend('advanced search row inventory') + .selector('[class*=AdvancedSearchRow-]') + .filters({ + index: el => parseInt(el.getAttribute('data-row-index'), 10), + query: el => el.querySelector('input').getAttribute('value'), + bool: el => el.querySelectorAll('select')[0].value, + modifier: el => el.querySelectorAll('select')[1].value, + option: el => el.querySelectorAll('select')[2].value, + }) + .actions({ + fillQuery: ({ find }, value) => find(TextField({ label: 'Search for' })).fillIn(value), + selectBoolean: ({ find }, rowIndex, value) => find(Select({ id: `advanced-search-bool-${rowIndex}` })) + .choose(value), + selectModifier: ({ find }, rowIndex, value) => find(Select({ id: `advanced-match-${rowIndex}` })) + .choose(value), + selectSearchOption: ({ find }, rowIndex, value) => find(Select({ id: `advanced-search-option-${rowIndex}` })).choose(value), + }); + +const rows = el => [...el.querySelectorAll('[class*=AdvancedSearchRow-]')]; + +export const AdvancedSearchModalInventory = HTML.extend('advanced search inventory') + .selector('[id=advanced-search-modal]') + .filters({ + rows, + id: (el) => el.getAttribute('id'), + rowCount: el => rows(el).length, + }) + .actions({ + cancel: ({ find }) => find(Button('Cancel')).click(), + search: ({ find }) => find(Button('Search')).click(), + }); From 48a3bac3c452bf657448418b6f77c8f705ad719f Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Mon, 14 Aug 2023 09:57:51 +0300 Subject: [PATCH 041/437] Master Fix (#1478) * Master fix * Master fix * Fix Master * Master Fix * Master Fix --------- Co-authored-by: Ostap Voitsekhovskyi --- ...iving-includes-order-closed-statuses.cy.js | 42 +---- ...tem-statuses-are-set-to-status-other.cy.js | 2 +- .../test-au-for-orders-invoices-funds.cy.js | 159 +++++++++--------- .../settings/orders/increase-pol-limit.cy.js | 1 + .../support/fragments/orders/orderLines.js | 3 +- cypress/support/fragments/orders/orders.js | 3 + .../support/fragments/receiving/receiving.js | 2 +- .../acquisitionUnits/acquisitionUnits.js | 2 + 8 files changed, 91 insertions(+), 123 deletions(-) diff --git a/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js b/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js index 4d83b4bc31..60f347d4b9 100644 --- a/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js +++ b/cypress/e2e/orders/items-for-receiving-includes-order-closed-statuses.cy.js @@ -1,5 +1,3 @@ -import moment from 'moment'; -import uuid from 'uuid'; import permissions from '../../support/dictionary/permissions'; import devTeams from '../../support/dictionary/devTeams'; import testType from '../../support/dictionary/testTypes'; @@ -20,7 +18,6 @@ import ItemActions from '../../support/fragments/inventory/inventoryItem/itemAct import ItemRecordEdit from '../../support/fragments/inventory/item/itemRecordEdit'; import SwitchServicePoint from '../../support/fragments/servicePoint/switchServicePoint'; import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; -import Checkout from '../../support/fragments/checkout/checkout'; import { ITEM_STATUS_NAMES } from '../../support/constants'; describe('orders: Receiving and Check-in', () => { @@ -51,7 +48,6 @@ describe('orders: Receiving and Check-in', () => { const barcodeForFourItem = Helper.getRandomBarcode(); let orderNumber; - let user; let effectiveLocationServicePoint; let location; @@ -77,7 +73,7 @@ describe('orders: Receiving and Check-in', () => { Orders.searchByParameter('PO number', orderNumber); Orders.selectFromResultsList(); Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 10); + OrderLines.selectRandomInstanceInTitleLookUP('*', 5); OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', locationResponse.institutionId, '4'); OrderLines.backToEditingOrder(); Orders.openOrder(); @@ -137,48 +133,16 @@ describe('orders: Receiving and Check-in', () => { ]) .then(userProperties => { - user = userProperties; cy.login(userProperties.username, userProperties.password, { path:TopMenu.receivingPath, waiter: Receiving.waitLoading }); }); }); - after(() => { - Checkout.checkoutItemViaApi({ - id: uuid(), - itemBarcode: barcodeForFirstItem, - loanDate: moment.utc().format(), - servicePointId: effectiveLocationServicePoint.id, - userBarcode: user.barcode, - }); - Checkout.checkoutItemViaApi({ - id: uuid(), - itemBarcode: barcodeForSecondItem, - loanDate: moment.utc().format(), - servicePointId: effectiveLocationServicePoint.id, - userBarcode: user.barcode, - }); - cy.loginAsAdmin({ path:TopMenu.receivingPath, waiter: Receiving.waitLoading }); - Orders.searchByParameter('PO number', orderNumber); - Receiving.selectFromResultsList(); - Receiving.unreceiveFromReceivedSection(); - cy.visit(TopMenu.ordersPath); - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(); - Orders.reOpenOrder(); - Orders.unOpenOrder(orderNumber); - OrderLines.selectPOLInOrder(0); - OrderLines.deleteOrderLine(); - // Need to wait until the order is opened before deleting it - cy.wait(2000); - Orders.deleteOrderViaApi(order.id); + // TODO: Need to find solution to delete all data, becouse now i cant delete location and user - Organizations.deleteOrganizationViaApi(organization.id); - // TODO: Need to find solution to delete all data, becouse now i cant delete location and user - }); it('C368044 Item statuses set to something other than "Order closed" or "On order" are NOT changed to "In process" upon receiving (items for receiving includes "Order closed" statuses) (thunderjet)', { tags: [testType.smoke, devTeams.thunderjet] }, () => { Orders.searchByParameter('PO number', orderNumber); - Receiving.selectFromResultsList(); + Receiving.selectLinkFromResultsList(); Receiving.receiveFromExpectedSectionWithClosePOL(); Receiving.receiveAll(); Receiving.clickOnInstance(); diff --git a/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js index ea5d63dd51..ed533c4160 100644 --- a/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js +++ b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js @@ -181,7 +181,7 @@ describe('orders: Receiving and Check-in', () => { it('C367971 Item statuses are set to status other than "Order closed" or "On order" and are NOT changed to "In process" upon receiving (items for receiving includes "On order" statuses) (thunderjet)', { tags: [testType.smoke, devTeams.thunderjet] }, () => { Orders.searchByParameter('PO number', orderNumber); Receiving.selectLinkFromResultsList(); - Receiving.receiveFromExpectedSectionWithClosePOL(); + Receiving.receiveFromExpectedSection(); Receiving.receiveAll(); Receiving.clickOnInstance(); InventoryInstance.openHoldingsAccordion(location.name); diff --git a/cypress/e2e/settings/acquisition-units/test-au-for-orders-invoices-funds.cy.js b/cypress/e2e/settings/acquisition-units/test-au-for-orders-invoices-funds.cy.js index 7e9eae1c07..8ed8ca039b 100644 --- a/cypress/e2e/settings/acquisition-units/test-au-for-orders-invoices-funds.cy.js +++ b/cypress/e2e/settings/acquisition-units/test-au-for-orders-invoices-funds.cy.js @@ -21,37 +21,36 @@ import AcquisitionUnits from '../../../support/fragments/settings/acquisitionUni import SettingsMenu from '../../../support/fragments/settingsMenu'; describe('ui-acquisition units: Acquisition Units', () => { - const defaultFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; - const defaultLedger = { ...Ledgers.defaultUiLedger }; - const defaultFund = { ...Funds.defaultUiFund }; - const defaultOrder = { ...NewOrder.defaultOneTimeOrder, - orderType: 'Ongoing', - ongoing: { isSubscription: false, manualRenewal: false }, - approved: true, - reEncumber: true }; - const organization = {...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - } - ] - }; - const invoice = { ...NewInvoice.defaultUiInvoice }; - const defaultAcquisitionUnit = { ...AcquisitionUnits.defaultAcquisitionUnit }; - const allocatedQuantity = '100'; - let effectiveLocationServicePoint; - let user; - let orderNumber; - let location; + const defaultFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const defaultFund = { ...Funds.defaultUiFund }; + const defaultOrder = { ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true, + reEncumber: true }; + const organization = { ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + } + ] }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const defaultAcquisitionUnit = { ...AcquisitionUnits.defaultAcquisitionUnit }; + const allocatedQuantity = '100'; + let effectiveLocationServicePoint; + let user; + let orderNumber; + let location; before(() => { cy.getAdminToken(); @@ -75,62 +74,62 @@ describe('ui-acquisition units: Acquisition Units', () => { }); }); }); - ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) .then((servicePoints) => { effectiveLocationServicePoint = servicePoints[0]; NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) .then((locationResponse) => { location = locationResponse; - Organizations.createOrganizationViaApi(organization) - .then(responseOrganizations => { - organization.id = responseOrganizations; - invoice.accountingCode = organization.erpCode; + Organizations.createOrganizationViaApi(organization) + .then(responseOrganizations => { + organization.id = responseOrganizations; + invoice.accountingCode = organization.erpCode; + }); + defaultOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(defaultOrder).then(orderResponse => { + defaultOrder.id = orderResponse.id; + orderNumber = orderResponse.poNumber; + Orders.checkCreatedOrder(defaultOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); + OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId, '4'); OrderLines.backToEditingOrder(); + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLineFromPol(orderNumber); + }); + }); }); - defaultOrder.vendor = organization.name; - cy.visit(TopMenu.ordersPath); - Orders.createOrderForRollover(defaultOrder).then(orderResponse => { - defaultOrder.id = orderResponse.id; - orderNumber = orderResponse.poNumber; - Orders.checkCreatedOrder(defaultOrder); - OrderLines.addPOLine(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 5); - OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId, '4'); OrderLines.backToEditingOrder(); - cy.visit(TopMenu.invoicesPath); - Invoices.createRolloverInvoice(invoice, organization.name); - Invoices.createInvoiceLineFromPol(orderNumber); - }); -}); -}); cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersDelete.gui, - permissions.uiExportOrders.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrdersAssignAcquisitionUnitsToNewOrder.gui, - permissions.uiOrdersCancelOrderLines.gui, - permissions.uiOrdersCancelPurchaseOrders.gui, - permissions.uiOrdersManageAcquisitionUnits.gui, - permissions.uiOrdersReopenPurchaseOrders.gui, - permissions.uiOrdersShowAllHiddenFields.gui, - permissions.uiOrdersUnopenpurchaseorders.gui, - permissions.uiOrdersUpdateEncumbrances.gui, - permissions.viewEditDeleteInvoiceInvoiceLine.gui, - permissions.viewEditCreateInvoiceInvoiceLine.gui, - permissions.assignAcqUnitsToNewInvoice.gui, - permissions.uiInvoicesApproveInvoices.gui, - permissions.uiInvoicesPayInvoices.gui, - permissions.invoiceSettingsAll.gui, - permissions.uiInvoicesCancelInvoices.gui, - permissions.uiInvoicesCanViewAndEditInvoicesAndInvoiceLines.gui, - permissions.uiInvoicesCanViewInvoicesAndInvoiceLines.gui, - permissions.uiInvoicesDownloadBatchFileFromInvoiceRecord.gui, - permissions.uiInvoicesExportSearchResults.gui, - permissions.uiInvoicesManageAcquisitionUnits.gui, - permissions.uiInvoicesVoucherExport.gui, - permissions.uiFinanceViewFundAndBudget.gui + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersDelete.gui, + permissions.uiExportOrders.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrdersAssignAcquisitionUnitsToNewOrder.gui, + permissions.uiOrdersCancelOrderLines.gui, + permissions.uiOrdersCancelPurchaseOrders.gui, + permissions.uiOrdersManageAcquisitionUnits.gui, + permissions.uiOrdersReopenPurchaseOrders.gui, + permissions.uiOrdersShowAllHiddenFields.gui, + permissions.uiOrdersUnopenpurchaseorders.gui, + permissions.uiOrdersUpdateEncumbrances.gui, + permissions.viewEditDeleteInvoiceInvoiceLine.gui, + permissions.viewEditCreateInvoiceInvoiceLine.gui, + permissions.assignAcqUnitsToNewInvoice.gui, + permissions.uiInvoicesApproveInvoices.gui, + permissions.uiInvoicesPayInvoices.gui, + permissions.invoiceSettingsAll.gui, + permissions.uiInvoicesCancelInvoices.gui, + permissions.uiInvoicesCanViewAndEditInvoicesAndInvoiceLines.gui, + permissions.uiInvoicesCanViewInvoicesAndInvoiceLines.gui, + permissions.uiInvoicesDownloadBatchFileFromInvoiceRecord.gui, + permissions.uiInvoicesExportSearchResults.gui, + permissions.uiInvoicesManageAcquisitionUnits.gui, + permissions.uiInvoicesVoucherExport.gui, + permissions.uiFinanceViewFundAndBudget.gui ]) .then(userProperties => { user = userProperties; @@ -166,8 +165,6 @@ describe('ui-acquisition units: Acquisition Units', () => { cy.loginAsAdmin({ path:SettingsMenu.acquisitionUnitsPath, waiter: AcquisitionUnits.waitLoading }); AcquisitionUnits.newAcquisitionUnit(); AcquisitionUnits.fillInInfo(defaultAcquisitionUnit.name); - // Need to wait,while data is load - cy.wait(2000); AcquisitionUnits.assignUser(user.username); cy.visit(TopMenu.fundPath); FinanceHelp.searchByName(defaultFund.name); diff --git a/cypress/e2e/settings/orders/increase-pol-limit.cy.js b/cypress/e2e/settings/orders/increase-pol-limit.cy.js index ed4ce97acc..ca7a660211 100644 --- a/cypress/e2e/settings/orders/increase-pol-limit.cy.js +++ b/cypress/e2e/settings/orders/increase-pol-limit.cy.js @@ -94,6 +94,7 @@ describe('orders: Settings', () => { }); it('C15497 Increase purchase order lines limit (items for receiving includes "Order closed" statuses) (thunderjet)', { tags: [testType.smoke, devTeams.thunderjet] }, () => { + SettingsOrders.setPurchaseOrderLinesLimit(5); SettingsOrders.setPurchaseOrderLinesLimit(2); cy.visit(TopMenu.ordersPath); Orders.searchByParameter('PO number', orderNumber); diff --git a/cypress/support/fragments/orders/orderLines.js b/cypress/support/fragments/orders/orderLines.js index 7b3502983c..8aca80d655 100644 --- a/cypress/support/fragments/orders/orderLines.js +++ b/cypress/support/fragments/orders/orderLines.js @@ -764,8 +764,9 @@ export default { editPOLInOrder: () => { cy.do([orderLineDetailsPane.find(paneHeaderOrderLinesDetailes.find(actionsButton)).click(), - Button('Edit').click() + Button('Edit').click() ]); + cy.wait(4000); }, deleteFundInPOL() { diff --git a/cypress/support/fragments/orders/orders.js b/cypress/support/fragments/orders/orders.js index 9937459156..c0b83bf9c7 100644 --- a/cypress/support/fragments/orders/orders.js +++ b/cypress/support/fragments/orders/orders.js @@ -289,6 +289,9 @@ export default { actionsButton.click(), newButton.click(), Button({ id: 'order-template' }).click(), + ]); + cy.wait(6000); + cy.do([ SelectionOption(templateName).click(), saveAndClose.click() ]); diff --git a/cypress/support/fragments/receiving/receiving.js b/cypress/support/fragments/receiving/receiving.js index d8f87290e9..ec4d4b20b5 100644 --- a/cypress/support/fragments/receiving/receiving.js +++ b/cypress/support/fragments/receiving/receiving.js @@ -203,7 +203,7 @@ export default { cy.do([ Section({ id: 'expected' }).find(actionsButton).click(), receiveButton.click(), - // Button('Continue').click() + Button('Continue').click() ]); }, diff --git a/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js b/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js index 40cf005218..57ad30dc55 100644 --- a/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js +++ b/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js @@ -38,6 +38,8 @@ export default { saveAUButton.click(), ]); this.assignAdmin(); + cy.wait(4000); + }, fillInAUInfo: (name) => { From fbcbe4066a383120f5d1b1bf5bdf5422864ec129 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:50:47 +0500 Subject: [PATCH 042/437] FAT-7378/C396392 (#1477) * added C396392 --- ...n-to-view-all-tags-settings-is-added.cy.js | 2 +- ...notice-duplication-works-as-expected.cy.js | 71 +++++++++++++++++++ .../e2e/staff-slips/add-notice-token.cy.js | 4 +- .../add-staff-slip-tokens-in-settings.cy.js | 6 +- cypress/e2e/users/search-by-middle-name.cy.js | 2 +- .../circulation/newNoticePolicyTemplate.js | 46 ++++++++++-- 6 files changed, 120 insertions(+), 11 deletions(-) create mode 100644 cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js 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 index 9909c88e77..8174aa3b38 100644 --- 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 @@ -60,7 +60,7 @@ describe('Permissions Tags', () => { }); it( - 'C396357 Verify that new permission to view all the Tags settings is added', + 'C396357 Verify that new permission to view all the Tags settings is added (volaris)', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { TagsGeneral.changeEnableTagsStatus('disable'); diff --git a/cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js b/cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js new file mode 100644 index 0000000000..b71032e6dd --- /dev/null +++ b/cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js @@ -0,0 +1,71 @@ +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 UserEdit from '../../support/fragments/users/userEdit'; + +describe('Patron Notices', () => { + let userData; + let servicePointId; + const testData = {}; + const newNoticeTemplateName = getTestEntityValue('newNoticePolicy'); + const patronGroup = { name: getTestEntityValue('groupNoticePolicy') }; + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }).then((servicePoints) => { + servicePointId = servicePoints[0].id; + }); + 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(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password, { + path: SettingsMenu.circulationPatronNoticeTemplatesPath, + waiter: NewNoticePolicyTemplate.waitLoading, + }); + } + ); + }); + }); + + after('Deleting created entities', () => { + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + NoticePolicyTemplate.deleteViaApi(testData.noticeTemplateBody.id); + NoticePolicyTemplate.getViaApi({ query: `name=${newNoticeTemplateName}` }).then((templateId) => { + NoticePolicyTemplate.deleteViaApi(templateId); + }); + }); + + it( + 'C396392 Verify that patron notice duplication works as expected (volaris)', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + NewNoticePolicyTemplate.openToSide({ name: testData.noticeTemplateBody.name }); + NewNoticePolicyTemplate.duplicateTemplate(); + NewNoticePolicyTemplate.verifyMetadataObjectIsVisible(); + NewNoticePolicyTemplate.verifyGeneralInformationForDuplicate(testData.noticeTemplateBody); + NewNoticePolicyTemplate.typeTemplateName(newNoticeTemplateName); + NewNoticePolicyTemplate.saveAndClose(); + NewNoticePolicyTemplate.waitLoading(); + NewNoticePolicyTemplate.checkAfterSaving({ + name: newNoticeTemplateName, + description: testData.noticeTemplateBody.description, + category: testData.noticeTemplateBody.category, + }); + } + ); +}); diff --git a/cypress/e2e/staff-slips/add-notice-token.cy.js b/cypress/e2e/staff-slips/add-notice-token.cy.js index d86a675e67..e8969f743f 100644 --- a/cypress/e2e/staff-slips/add-notice-token.cy.js +++ b/cypress/e2e/staff-slips/add-notice-token.cy.js @@ -53,7 +53,7 @@ describe('Patron Notices', () => { }); it( - 'C375248 Add "user.preferredFirstName" as staff slip token in Settings', + 'C375248 Add "user.preferredFirstName" as staff slip token in Settings (volaris)', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.editTemplate(testData.noticeTemplateBody.name); @@ -66,7 +66,7 @@ describe('Patron Notices', () => { ); it( - 'C387434 Add "Discovery display name" as notice token in Settings', + 'C387434 Add "Discovery display name" as notice token in Settings (volaris)', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.editTemplate(testData.noticeTemplateBody.name); 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 f92b46c3e5..cc40bcc6f1 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 @@ -131,7 +131,7 @@ describe('Staff slips', () => { }); it( - 'C375293 Add "requester.patronGroup" as staff slip token in Settings', + 'C375293 Add "requester.patronGroup" as staff slip token in Settings (volaris)', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { cy.visit(SettingsMenu.circulationStaffSlipsPath); @@ -145,7 +145,7 @@ describe('Staff slips', () => { ); it( - 'C387442 Add "Departments" as staff slip token in Settings', + 'C387442 Add "Departments" as staff slip token in Settings (volaris)', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { cy.visit(SettingsMenu.circulationStaffSlipsPath); @@ -159,7 +159,7 @@ describe('Staff slips', () => { ); it( - 'C388508 Verify that token "currentDateTime" is populated in the pick slip', + 'C388508 Verify that token "currentDateTime" is populated in the pick slip (volaris)', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { cy.visit(SettingsMenu.circulationStaffSlipsPath); diff --git a/cypress/e2e/users/search-by-middle-name.cy.js b/cypress/e2e/users/search-by-middle-name.cy.js index e007721120..3045f49e9b 100644 --- a/cypress/e2e/users/search-by-middle-name.cy.js +++ b/cypress/e2e/users/search-by-middle-name.cy.js @@ -71,7 +71,7 @@ describe('Users', () => { PatronGroups.deleteViaApi(patronGroup.id); }); - it('C389464 Search by middle name', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { + it('C389464 Search by middle name (volaris)', { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { UsersSearchPane.searchByKeywords(userData.middleName); Users.verifyMiddleNameOnUserDetailsPane(userData.middleName); cy.visit(TopMenu.checkOutPath); diff --git a/cypress/support/fragments/circulation/newNoticePolicyTemplate.js b/cypress/support/fragments/circulation/newNoticePolicyTemplate.js index 430d1e855d..eddd2b0596 100644 --- a/cypress/support/fragments/circulation/newNoticePolicyTemplate.js +++ b/cypress/support/fragments/circulation/newNoticePolicyTemplate.js @@ -1,6 +1,23 @@ /* eslint-disable cypress/no-unnecessary-waiting */ import getRandomPostfix from '../../utils/stringTools'; -import { Button, TextField, TextArea, KeyValue, Checkbox, Link, Heading, Select, Pane, Modal, PaneContent, NavListItem, RichEditor, including } from '../../../../interactors'; +import { + Accordion, + Button, + TextField, + TextArea, + KeyValue, + Checkbox, + Link, + Heading, + Select, + Pane, + Modal, + PaneContent, + NavListItem, + RichEditor, + including, + MetaSection, +} from '../../../../interactors'; import richTextEditor from '../../../../interactors/rich-text-editor'; import { NOTICE_CATEGORIES } from './notice-policy'; import { actionsButtons } from './newNoticePolicy'; @@ -10,8 +27,11 @@ const titles = { newTemplate: 'New patron notice template', templates: 'Patron notice templates' }; +const patronNoticeTemplatePaneContent = PaneContent({ id: 'patron-notice-template-pane-content' }); const saveButton = Button({ id: 'footer-save-entity' }); const newButton = Button({ id: 'clickable-create-entry' }); +const activeCheckbox = Checkbox({ id: 'input-patron-notice-active' }); +const categorySelect = Select({ name: 'category' }); const actionsButton = Button('Actions'); const tokenButton = Button('{ }'); const addTokenButton = Button(titles.addToken); @@ -53,11 +73,11 @@ export default { }, chooseCategory: (category) => { - cy.do(Select({ name: 'category' }).choose(category)); + cy.do(categorySelect.choose(category)); }, checkPreview: (previewText) => { - cy.do(PaneContent({ id: 'patron-notice-template-pane-content' }).find(Button('Preview')).click()); + cy.do(patronNoticeTemplatePaneContent.find(Button('Preview')).click()); cy.expect([ Modal(including('Preview of patron notice template')).exists(), Modal({ content: including(previewText) }).exists(), @@ -65,6 +85,24 @@ export default { cy.do(Button('Close').click()); }, + verifyMetadataObjectIsVisible: (creator = 'Unknown user') => { + cy.expect([ + patronNoticeTemplatePaneContent.find(Accordion({ label: 'General information' })).exists(), + patronNoticeTemplatePaneContent.find(Button('General information')).has({ ariaExpanded: 'true' }), + ]); + cy.do(patronNoticeTemplatePaneContent.find(Button(including('Record last updated'))).click()); + cy.expect(patronNoticeTemplatePaneContent.find(MetaSection({ updatedByText: including(creator) })).exists()); + }, + + verifyGeneralInformationForDuplicate: (template) => { + cy.expect([ + nameField.has({ value: template.name, error: 'A patron notice with this name already exists' }), + activeCheckbox.has({ checked: true }), + descriptionField.has({ value: template.description }), + categorySelect.has({ value: template.category }), + ]); + }, + startAdding() { return cy.do(newButton.click()); }, @@ -126,7 +164,7 @@ export default { bodyField.has({ value: '' }), Select({ id: 'input-patron-notice-subject' }).has({ value: 'Loan' }), Button({ id: 'accordion-toggle-button-email-template-form' }).has({ ariaExpanded: true }), - Checkbox({ id: 'input-patron-notice-active' }).has({ checked:'true' }), + activeCheckbox.has({ checked:'true' }), cy.get('select[name="category"]').get('option').each(($option, index) => { if (index <= 5) { expect($option).to.contain(Object.values(NOTICE_CATEGORIES)[index].name); From 853856aa6384c1afe8cf39d14030d8b21ccb4fdd Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 14 Aug 2023 12:54:00 +0300 Subject: [PATCH 043/437] Fat 7315 c350639 (#1463) * added test * added checks * added after block * deleted commented code * changed location * uncommented code --- .../see-holdings-with-1000+-items.cy.js | 93 +++++++++++++++++++ .../fragments/inventory/instanceRecordView.js | 22 ++++- .../fragments/inventory/item/itemRecordNew.js | 18 +++- 3 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/inventory/holdings/see-holdings-with-1000+-items.cy.js diff --git a/cypress/e2e/inventory/holdings/see-holdings-with-1000+-items.cy.js b/cypress/e2e/inventory/holdings/see-holdings-with-1000+-items.cy.js new file mode 100644 index 0000000000..e3e68c4a29 --- /dev/null +++ b/cypress/e2e/inventory/holdings/see-holdings-with-1000+-items.cy.js @@ -0,0 +1,93 @@ +import uuid from 'uuid'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import TopMenu from '../../../support/fragments/topMenu'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TestTypes from '../../../support/dictionary/testTypes'; +import Users from '../../../support/fragments/users/users'; +import DevTeams from '../../../support/dictionary/devTeams'; +import ItemRecordNew from '../../../support/fragments/inventory/item/itemRecordNew'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import { LOCATION_NAMES } from '../../../support/constants'; + +describe('inventory', () => { + describe('Holdings', () => { + let user; + const quantityOfItems = 1005; + const testData = { + instanceTitle: `Instance ${getRandomPostfix()}` + }; + + before('create test data', () => { + cy.getAdminToken() + .then(() => { + cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { testData.instanceTypeId = instanceTypes[0].id; }); + cy.getHoldingTypes({ limit: 1 }).then((res) => { testData.holdingTypeId = res[0].id; }); + cy.getLocations({ query: `name="${LOCATION_NAMES.MAIN_LIBRARY_UI}"` }) + .then(res => { + testData.locationId = res.id; + }); + cy.getLoanTypes({ limit: 1 }).then((res) => { + testData.loanTypeId = res[0].id; + testData.loanTypeName = res[0].name; + }); + cy.getMaterialTypes({ limit: 1 }).then((res) => { + testData.materialTypeId = res.id; + }); + }).then(() => { + InventoryInstances.createFolioInstanceViaApi({ instance: { + instanceTypeId: testData.instanceTypeId, + title: testData.instanceTitle, + }, + holdings: [{ + holdingsTypeId: testData.holdingTypeId, + permanentLocationId: testData.locationId, + }], + items: [] }); + }).then(specialInstanceIds => { + testData.testInstanceIds = specialInstanceIds; + + Array.from({ length: quantityOfItems }, () => { + return ItemRecordNew.createViaApi( + specialInstanceIds.holdingIds[0].id, + uuid(), + testData.materialTypeId, + testData.loanTypeId + ); + }); + }); + + cy.createTempUser([ + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${testData.instanceTitle}"` }) + .then((instance) => { + instance.items.forEach(el => cy.deleteItemViaApi(el.id)); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C350639: Verify the ability to see holdings with 1000+ items: CASE 1 (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', testData.instanceTitle); + InstanceRecordView.verifyInstanceRecordViewOpened(); + InstanceRecordView.verifyItemsCount(quantityOfItems, LOCATION_NAMES.MAIN_LIBRARY_UI); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); + InstanceRecordView.verifyQuantityOfItemsOnPage(quantityOfItems, testData.loanTypeName); + InstanceRecordView.clickNextPaginationButton(); + InstanceRecordView.verifyQuantityOfItemsOnPage(quantityOfItems, testData.loanTypeName); + }); + }); +}); diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index dba2f88db2..10e0b04c1e 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -2,13 +2,15 @@ import { HTML, including } from '@interactors/html'; import { KeyValue, MultiColumnList, + MultiColumnListRow, Section, MultiColumnListCell, Button, Accordion, Link, Pane, - Callout + Callout, + Badge } from '../../../../interactors'; const instanceDetailsSection = Section({ id: 'pane-instancedetails' }); @@ -149,6 +151,24 @@ export default { .exists()); }, + verifyItemsCount(itemsCount, ...holdingToBeOpened) { + cy.wait(1000); + cy.expect(Accordion({ label: including(`Holdings: ${holdingToBeOpened}`) }).find(Badge()).has({ value: itemsCount.toString() })); + }, + + verifyQuantityOfItemsOnPage(quantityOfItems, itemLoanType) { + for (let i = 0; i < 200; i++) { + cy.expect(MultiColumnList({ ariaRowCount: `${quantityOfItems} + 1` }) + .find(MultiColumnListRow({rowIndexInParent: `row-${i}`})) + .find(MultiColumnListCell({ columnIndex: 3, content: itemLoanType })) + .exists()); + } + }, + + clickNextPaginationButton() { + cy.do(Pane({ id:'pane-instancedetails' }).find(Button('Next')).click()); + }, + openHoldingView: () => { cy.do(Button('View holdings').click()); cy.expect(Button('Actions').exists()); diff --git a/cypress/support/fragments/inventory/item/itemRecordNew.js b/cypress/support/fragments/inventory/item/itemRecordNew.js index 940de7c30e..4cc08013f9 100644 --- a/cypress/support/fragments/inventory/item/itemRecordNew.js +++ b/cypress/support/fragments/inventory/item/itemRecordNew.js @@ -15,5 +15,21 @@ export default { cy.expect(saveAndCloseBtn.has({ disabled: false })); }, - save:() => cy.do(saveAndCloseBtn.click()) + save:() => cy.do(saveAndCloseBtn.click()), + + createViaApi:(holdingsId, itemBarcode, materialTypeId, permanentLoanTypeId) => { + cy.okapiRequest({ + method: 'POST', + path: 'inventory/items', + body: { + status: { name: 'Available' }, + holdingsRecordId: holdingsId, + boundWithTitles: [], + barcode: itemBarcode, + materialType: { id: materialTypeId }, + permanentLoanType: { id: permanentLoanTypeId } + }, + isDefaultSearchParamsRequired: false + }); + } }; From df289a3a1262103e8e912ee28272c533e14e1a66 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:24:49 +0500 Subject: [PATCH 044/437] added C375097 (#1481) --- ...bled-in-case-of-errors-on-my-profile.cy.js | 85 +++++++++++++++++++ cypress/support/dictionary/permissions.js | 1 + .../settings/my-profile/change-password.js | 78 +++++++++++++++++ cypress/support/utils/arrays.js | 12 ++- cypress/support/utils/generatePassword.js | 17 ++++ 5 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/permissions/save-is-disabled-in-case-of-errors-on-my-profile.cy.js create mode 100644 cypress/support/fragments/settings/my-profile/change-password.js create mode 100644 cypress/support/utils/generatePassword.js diff --git a/cypress/e2e/permissions/save-is-disabled-in-case-of-errors-on-my-profile.cy.js b/cypress/e2e/permissions/save-is-disabled-in-case-of-errors-on-my-profile.cy.js new file mode 100644 index 0000000000..d277ab7172 --- /dev/null +++ b/cypress/e2e/permissions/save-is-disabled-in-case-of-errors-on-my-profile.cy.js @@ -0,0 +1,85 @@ +import devTeams from '../../support/dictionary/devTeams'; +import permissions from '../../support/dictionary/permissions'; +import arrays from '../../support/utils/arrays'; +import { getTestEntityValue } from '../../support/utils/stringTools'; +import generatePassword from '../../support/utils/generatePassword'; +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 ChangePassword from '../../support/fragments/settings/my-profile/change-password'; + +describe('Permissions --> My Profile', () => { + let userData; + let servicePointId; + const patronGroup = { + name: getTestEntityValue('groupMyProfile'), + }; + const newPassword = generatePassword(); + const newInvalidPassword = generatePassword(); + const randomChar = arrays.getRandomElement(arrays.genCharArray('a', 'z')); + + 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.uiSettingsCanChangeLoacalPassword.gui], patronGroup.name).then( + (userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password); + } + ); + }); + }); + + after('Deleting created entities', () => { + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + }); + + it( + 'C375097 Verify that "Save" button is disabled in case of validation errors on "My profile" form (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + ChangePassword.openChangePasswordViaUserProfile(); + ChangePassword.checkInitialState(); + + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(2000); + ChangePassword.typeNewPassword(randomChar); + ChangePassword.verifyNewPasswordMessage(ChangePassword.messages.notEnoughSymbols); + ChangePassword.verifyCurrentPasswordMessage(ChangePassword.messages.enterValue); + ChangePassword.verifySaveButtonInactive(); + ChangePassword.clearAllFields(); + + ChangePassword.typeNewPassword(newPassword); + ChangePassword.typeConfirmPassword(newInvalidPassword); + ChangePassword.verifyConfirmPasswordMessage(ChangePassword.messages.mismatch); + ChangePassword.verifySaveButtonInactive(); + ChangePassword.clearAllFields(); + + ChangePassword.typeNewPassword(newPassword); + ChangePassword.typeConfirmPassword(newPassword); + ChangePassword.verifySaveButtonInactive(); + ChangePassword.clearAllFields(); + + ChangePassword.typeCurrentPassword(userData.password); + ChangePassword.verifySaveButtonInactive(); + ChangePassword.typeNewPassword(newPassword); + ChangePassword.verifySaveButtonInactive(); + ChangePassword.typeConfirmPassword(newInvalidPassword); + ChangePassword.verifyConfirmPasswordMessage(ChangePassword.messages.mismatch); + ChangePassword.verifySaveButtonInactive(); + ChangePassword.typeConfirmPassword(newPassword); + ChangePassword.saveNewPassword(); + + cy.login(userData.username, newPassword); + } + ); +}); diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 1c891be544..b4c381308c 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -230,6 +230,7 @@ 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' }, + uiSettingsCanChangeLoacalPassword: { internal: 'ui-myprofile.settings.change-password', gui: 'Settings (My profile): Can change your local password' }, // 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' }, diff --git a/cypress/support/fragments/settings/my-profile/change-password.js b/cypress/support/fragments/settings/my-profile/change-password.js new file mode 100644 index 0000000000..6d2a6f8a35 --- /dev/null +++ b/cypress/support/fragments/settings/my-profile/change-password.js @@ -0,0 +1,78 @@ +import { Pane, Dropdown, Button, TextField } from '../../../../../interactors'; + +const myProfile = Dropdown('My profile'); +const currentPasswordField = TextField('Current FOLIO password'); +const newPasswordField = TextField('New FOLIO password'); +const confirmPasswordField = TextField('Confirm FOLIO password'); +const saveButton = Button({ id: 'change-password-submit-btn' }); + +const messages = { + mismatch: 'New and confirm password does not match. Retype your password.', + enterValue: 'Please enter a value.', + notEnoughSymbols: 'The password length must be minimum 8 symbols.', +}; + +export default { + messages, + waitLoading() { + cy.expect(Pane('Change password').exists()); + }, + + openChangePasswordViaUserProfile() { + cy.do([myProfile.open(), myProfile.find(Button('Change Password')).click()]); + this.waitLoading(); + }, + + checkInitialState() { + cy.expect([ + currentPasswordField.exists(), + newPasswordField.exists(), + confirmPasswordField.exists(), + saveButton.is({ disabled: true }), + ]); + }, + + typeCurrentPassword(password) { + cy.do([currentPasswordField.fillIn(password), currentPasswordField.blur()]); + }, + + verifyCurrentPasswordMessage(message) { + cy.expect(currentPasswordField.has({ error: message })); + }, + + typeNewPassword(password) { + cy.do([newPasswordField.fillIn(password), newPasswordField.blur()]); + }, + + verifyNewPasswordMessage(message) { + cy.expect(newPasswordField.has({ error: message })); + }, + + typeConfirmPassword(password) { + cy.do([confirmPasswordField.fillIn(password), confirmPasswordField.blur()]); + }, + + verifyConfirmPasswordMessage(message) { + cy.expect(confirmPasswordField.has({ error: message })); + }, + + verifySaveButtonInactive() { + cy.expect(saveButton.is({ disabled: true })); + }, + + clearAllFields() { + cy.do([ + currentPasswordField.fillIn(' '), + currentPasswordField.clear(), + newPasswordField.fillIn(' '), + newPasswordField.clear(), + confirmPasswordField.fillIn(' '), + confirmPasswordField.clear(), + ]); + }, + + saveNewPassword() { + cy.expect(saveButton.is({ disabled: false })); + cy.do(saveButton.click()); + }, +}; diff --git a/cypress/support/utils/arrays.js b/cypress/support/utils/arrays.js index 8bd93e347b..d9a8d5bc48 100644 --- a/cypress/support/utils/arrays.js +++ b/cypress/support/utils/arrays.js @@ -2,7 +2,17 @@ export default { getRandomElement(arr) { const rand = Math.floor(Math.random() * arr.length); return arr[rand]; - } + }, + + genCharArray(charA, charZ) { + const a = []; + let i = charA.charCodeAt(0); + const j = charZ.charCodeAt(0); + for (; i <= j; ++i) { + a.push(String.fromCharCode(i)); + } + return a; + }, }; export const randomizeArray = (array) => { diff --git a/cypress/support/utils/generatePassword.js b/cypress/support/utils/generatePassword.js new file mode 100644 index 0000000000..0d131aed33 --- /dev/null +++ b/cypress/support/utils/generatePassword.js @@ -0,0 +1,17 @@ +import arrays, { randomizeArray } from './arrays'; + +export default function generatePassword(passwordLength = 8) { + let password = ''; + const allowedChars = randomizeArray([ + arrays.genCharArray('A', 'Z'), + arrays.genCharArray('a', 'z'), + arrays.genCharArray('0', '9'), + arrays.genCharArray(':', '@'), + ]); + + for (let i = 0; i < passwordLength; i++) { + const arrLen = allowedChars.length; + password += arrays.getRandomElement(allowedChars[((i % arrLen) + arrLen) % arrLen]); + } + return password; +} From 3784deff97d0e666f983f1613bb05b5b8a880e9b Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:36:25 +0300 Subject: [PATCH 045/437] Fat 7011 c400665 (#1480) * added test * renamed discribe * added the second describe to folijet tests * added after block * added deleting match profile * fixed linter issue --- .../delete-all-logs-from-landing-page.cy.js | 150 +-- ...mport-file-for-create-invoice-record.cy.js | 158 +-- .../e2e/edi-import-large-invoice-file.cy.js | 124 +- .../e2e/field-protection-overrides.cy.js | 570 ++++----- .../e2e/field-protection-settings.cy.js | 382 +++--- ...r-and-delete-import-logs-on-view-all.cy.js | 158 +-- .../e2e/match-on-holdings-856-u.cy.js | 298 ++--- .../match-on-instance-identifier-scen1.cy.js | 252 ++-- .../match-on-instance-identifier-scen2.cy.js | 250 ++-- .../match-on-pol-and-update-instance.cy.js | 430 +++---- .../e2e/match-on-pol-and-update-items.cy.js | 620 +++++----- .../e2e/match-on-vrn-and-update-items.cy.js | 412 +++---- .../mrc-import-file-for-create-items.cy.js | 220 ++-- ...mport-file-for-modify-marcBib-record.cy.js | 272 ++--- .../mrc-import-file-for-update-items.cy.js | 801 ++++++------- .../e2e/mrc-import-with-matching-001.cy.js | 226 ++-- .../e2e/mrc-import-with-matching-999ff.cy.js | 288 ++--- .../e2e/data-import/e2e/view-all-filter.cy.js | 202 ++-- cypress/e2e/data-import/e2e/view-all.cy.js | 78 +- ...ecords-with-999-ff-field-and-without.cy.js | 88 +- .../importing-marc-authority-files.cy.js | 134 ++- ...ndling-for-new-and-update-srs-record.cy.js | 410 +++---- ...-for-holdings-proceed-without-errors.cy.js | 446 +++---- ...on-and-field-mapping-create-instance.cy.js | 178 +-- .../add-subfields-to-linked-fields.cy.js | 382 +++--- ...when-job-profile-not-create-instance.cy.js | 312 ++--- ...-fields-using-update-marcbib-profile.cy.js | 494 ++++---- ...-not-processed-for-invalid-marc-bibs.cy.js | 70 +- ...it-file-and-reimport-to-update-items.cy.js | 580 ++++----- .../field-protection-modification.cy.js | 236 ++-- ...import-a-bunch-of-marc-files-at-once.cy.js | 78 +- ...stopping-running-job-and-deleting-it.cy.js | 104 +- ...-edit-derive-bib-with-minimum-fields.cy.js | 132 +- ...import-of-orders-with-pending-status.cy.js | 300 ++--- ...lectronic-resource-with-no-inventory.cy.js | 164 +-- ...-orders-other-with-instance-holdings.cy.js | 250 ++-- ...source-with-instances-holdings-items.cy.js | 296 ++--- ...orting-ebook-orders-with-open-status.cy.js | 200 ++-- .../item-update-via-match-by-status.cy.js | 492 ++++---- ...d-check-in-out-notes-from-marc-field.cy.js | 302 ++--- ...lationship-between-url-and-link-test.cy.js | 288 ++--- .../marc-bib-import-delete-linked-field.cy.js | 376 +++--- ...-update-select-fields-works-properly.cy.js | 258 ++-- .../match-on-instance-identifier-scen3.cy.js | 304 ++--- .../match-on-instance-identifier-scen4.cy.js | 298 ++--- .../match-on-location.cy.js | 632 +++++----- .../match-on-oclc-and-update-instance.cy.js | 362 +++--- ...g-on-newly-created-035-does-not-work.cy.js | 424 +++---- ...-pe-mix-with-instance-holdings-items.cy.js | 292 ++--- ...rc-import-with-999-field-and-without.cy.js | 86 +- ...critics-or-nonRoman-alphabet-records.cy.js | 214 ++-- ...tches-under-actions-in-a-job-profile.cy.js | 494 ++++---- ...es-does-not-duplicate-control-fields.cy.js | 120 +- ...n-incoming-records-not-deleted-scen1.cy.js | 174 +-- ...n-incoming-records-not-deleted-scen2.cy.js | 196 +-- ...record-import-with-running-large-job.cy.js | 140 +-- ...or-marc-indicators-in-match-profiles.cy.js | 456 +++---- .../test-remove-field-mapping-option.cy.js | 526 ++++---- .../update-controllable-subfield0.cy.js | 401 +++---- ...trolled-and-not-controlled-subfields.cy.js | 336 +++--- ...e-holdings-via-static-value-submatch.cy.js | 500 ++++---- .../updates-should-add-035-field.cy.js | 474 ++++---- ...aking-incorrect-records-into-account.cy.js | 340 +++--- ...-records-do-or-do-not-have-999-field.cy.js | 124 +- .../delete-logs-from-view-all.cy.js | 80 +- ...-discarded-error-actions-for-invoice.cy.js | 160 +-- ...instance-using-marc-to-marc-submatch.cy.js | 1060 +++++++++-------- ...t-summary-table-for-creating-actions.cy.js | 258 ++-- ...ary-table-with-create-update-actions.cy.js | 716 +++++------ ...t-summury-table-for-updating-actions.cy.js | 848 ++++++------- ...orting-of-orders-with-pending-status.cy.js | 250 ++-- ...ile-has-modify-after-instance-create.cy.js | 158 +-- ...s-for-created-imported-order-records.cy.js | 240 ++-- ...y-records-created-after-not-matching.cy.js | 336 +++--- ...not-exceed-number-of-records-in-file.cy.js | 330 ++--- ...ile-only-involves-holdings-and-items.cy.js | 806 ++++++------- ...ance-is-not-updated-due-to-non-match.cy.js | 123 ++ .../can-view-only-permission.cy.js | 88 +- .../permission-only-viewing-settings.cy.js | 148 +-- .../user-cannot-delete-import-logs.cy.js | 64 +- ...-limited-permissions-can-import-file.cy.js | 234 ++-- ...ve-mapping-profile-to-action-profile.cy.js | 94 +- ...-profile-with-associated-job-profile.cy.js | 120 +- .../edit-existing-action-profile.cy.js | 68 +- ...xisting-job-profile-adding-long-name.cy.js | 62 +- .../edit-existing-mapping-profile.cy.js | 70 +- .../edit-existing-match-profile.cy.js | 80 +- .../fund-and-expense-class-mappings.cy.js | 480 ++++---- ...elds-required-in-invoice-map-profile.cy.js | 116 +- ...-after-editing-marc-bib-in-quickMarc.cy.js | 360 +++--- ...ields-after-editing-marc-bib-outside.cy.js | 336 +++--- .../settings/view-mode-of-isri-profiles.cy.js | 121 -- .../inventory/assign-preceding-title.cy.js | 106 +- .../assing-tags-to-an-instance-record.cy.js | 82 +- ...catalogue-new-ordered-recieved-title.cy.js | 310 ++--- .../create-edit-delete-material-types.cy.js | 44 +- .../inventory/create-fast-add-record.cy.js | 140 +-- .../create-instance-with-add-new.cy.js | 34 +- .../enter-different-type-of-identifiers.cy.js | 88 +- .../filter/filter-instances-by-tags.cy.js | 72 +- .../filter/filter-items-with-status.cy.js | 4 +- .../create-holdings-as-different-user.cy.js | 100 +- .../inventory/item-status-date-updates.cy.js | 520 ++++---- ...culation-history-for-checked-in-loan.cy.js | 196 +-- ...tion-is-populated-on-duplicated-item.cy.js | 196 +-- .../e2e/inventory/keyboard-shortcuts.cy.js | 2 +- .../update-effective-location-for-item.cy.js | 152 +-- .../marking/mark-item-as-missing.cy.js | 214 ++-- .../marking/mark-item-as-withdrawn.cy.js | 222 ++-- .../create-edit-mode-for-isri-profiles.cy.js | 120 +- .../settings/view-mode-of-isri-profiles.cy.js | 123 ++ .../import-by-oclc-source-folio.cy.js | 126 +- .../single-record-import/import-by-oclc.cy.js | 70 +- ...ls-menu-for-multiple-target-profiles.cy.js | 174 +-- ...-create-for-multiple-target-profiles.cy.js | 130 +- ...rt-create-for-single-target-profiles.cy.js | 88 +- ...enu-for-single-target-profile-update.cy.js | 144 +-- .../bulk-edit/bulk-edit-search-pane.js | 2 - .../support/fragments/finance/funds/funds.js | 9 - .../fragments/finance/ledgers/ledgers.js | 3 - 120 files changed, 15486 insertions(+), 15145 deletions(-) create mode 100644 cypress/e2e/data-import/log-details/title-appeared-in-log-details-when-instance-is-not-updated-due-to-non-match.cy.js delete mode 100644 cypress/e2e/data-import/settings/view-mode-of-isri-profiles.cy.js create mode 100644 cypress/e2e/inventory/settings/view-mode-of-isri-profiles.cy.js diff --git a/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js b/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js index 0c609b08a7..a5d4a31eb8 100644 --- a/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js +++ b/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js @@ -10,87 +10,89 @@ import Users from '../../../support/fragments/users/users'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import DevTeams from '../../../support/dictionary/devTeams'; -describe('ui-data-import', () => { - let userId = null; - let fileNameToUpload = ''; - const filePathToUpload = 'oneMarcBib.mrc'; - const emptyFilePathToUpload = 'emptyMarc.mrc'; - const numberOfLogsToDelete = 2; - const numberOfLogsPerPage = 25; - const numberOfLogsToUpload = 30; - const getCalloutSuccessMessage = logsCount => `${logsCount} data import logs have been successfully deleted.`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; +describe('data-import', () => { + describe('End to end scenarios', () => { + let userId = null; + let fileNameToUpload = ''; + const filePathToUpload = 'oneMarcBib.mrc'; + const emptyFilePathToUpload = 'emptyMarc.mrc'; + const numberOfLogsToDelete = 2; + const numberOfLogsPerPage = 25; + const numberOfLogsToUpload = 30; + const getCalloutSuccessMessage = logsCount => `${logsCount} data import logs have been successfully deleted.`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui - ]) - .then(userProperties => { - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password, - { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }) - .then(() => { - DataImport.checkIsLandingPageOpened(); + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui + ]) + .then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, + { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }) + .then(() => { + DataImport.checkIsLandingPageOpened(); - new Array(numberOfLogsToUpload).fill(null).forEach((_, index) => { - // as stated in preconditions we need at least 30 logs so, - // we are uploading 29 empty files and 1 file with content to speed up uploading process - const filePath = numberOfLogsToUpload - 1 === index ? filePathToUpload : emptyFilePathToUpload; - fileNameToUpload = `C358137autotestFile.${getRandomPostfix()}.mrc`; - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.waitLoading(); - DataImport.uploadFile(filePath, fileNameToUpload); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameToUpload); - cy.wait(10000); + new Array(numberOfLogsToUpload).fill(null).forEach((_, index) => { + // as stated in preconditions we need at least 30 logs so, + // we are uploading 29 empty files and 1 file with content to speed up uploading process + const filePath = numberOfLogsToUpload - 1 === index ? filePathToUpload : emptyFilePathToUpload; + fileNameToUpload = `C358137autotestFile.${getRandomPostfix()}.mrc`; + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.waitLoading(); + DataImport.uploadFile(filePath, fileNameToUpload); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameToUpload); + cy.wait(10000); + }); }); - }); - }); + }); - after('delete test data', () => { - Logs.selectAllLogs(); - Logs.actionsButtonClick(); - Logs.deleteLogsButtonClick(); - DataImport.confirmDeleteImportLogs(); - Users.deleteViaApi(userId); - }); + after('delete test data', () => { + Logs.selectAllLogs(); + Logs.actionsButtonClick(); + Logs.deleteLogsButtonClick(); + DataImport.confirmDeleteImportLogs(); + Users.deleteViaApi(userId); + }); - it('C358137 A user can delete import logs with "Data import: Can delete import logs" permission on Landing page (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - Logs.openFileDetails(fileNameToUpload); - Logs.clickOnHotLink(); - cy.location('pathname').should('include', '/inventory/view'); - cy.visit(TopMenu.dataImportPath); + it('C358137 A user can delete import logs with "Data import: Can delete import logs" permission on Landing page (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + Logs.openFileDetails(fileNameToUpload); + Logs.clickOnHotLink(); + cy.location('pathname').should('include', '/inventory/view'); + cy.visit(TopMenu.dataImportPath); - DataImport.getLogsHrIdsFromUI(numberOfLogsToDelete).then(logsHrIdsToBeDeleted => { - // verify that user can cancel deletion of logs - DataImport.selectAllLogs(); - DataImport.verifyAllLogsCheckedStatus({ logsCount: numberOfLogsPerPage, checked: true }); - DataImport.verifyLogsPaneSubtitleExist(numberOfLogsPerPage); - DataImport.openDeleteImportLogsModal(); - DataImport.cancelDeleteImportLogs(); - DataImport.verifyAllLogsCheckedStatus({ logsCount: numberOfLogsPerPage, checked: false }); - DataImport.verifyLogsPaneSubtitleAbsent(); - DataImport.verifyDeleteLogsButtonDisabled(); + DataImport.getLogsHrIdsFromUI(numberOfLogsToDelete).then(logsHrIdsToBeDeleted => { + // verify that user can cancel deletion of logs + DataImport.selectAllLogs(); + DataImport.verifyAllLogsCheckedStatus({ logsCount: numberOfLogsPerPage, checked: true }); + DataImport.verifyLogsPaneSubtitleExist(numberOfLogsPerPage); + DataImport.openDeleteImportLogsModal(); + DataImport.cancelDeleteImportLogs(); + DataImport.verifyAllLogsCheckedStatus({ logsCount: numberOfLogsPerPage, checked: false }); + DataImport.verifyLogsPaneSubtitleAbsent(); + DataImport.verifyDeleteLogsButtonDisabled(); - // verify that user can delete logs - new Array(numberOfLogsToDelete).fill(null).forEach((_, index) => { - DataImport.selectLog(index); + // verify that user can delete logs + new Array(numberOfLogsToDelete).fill(null).forEach((_, index) => { + DataImport.selectLog(index); + }); + DataImport.verifyLogsPaneSubtitleExist(numberOfLogsToDelete); + DataImport.openActionsMenu(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + InteractorsTools.checkCalloutMessage(getCalloutSuccessMessage(numberOfLogsToDelete)); + DataImport.verifyLogsPaneSubtitleAbsent(); + DataImport.verifyDataImportLogsDeleted(logsHrIdsToBeDeleted); + DataImport.verifyDeleteLogsButtonDisabled(); + cy.reload(); + DataImport.checkMultiColumnListRowsCount(numberOfLogsPerPage); }); - DataImport.verifyLogsPaneSubtitleExist(numberOfLogsToDelete); - DataImport.openActionsMenu(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - InteractorsTools.checkCalloutMessage(getCalloutSuccessMessage(numberOfLogsToDelete)); - DataImport.verifyLogsPaneSubtitleAbsent(); - DataImport.verifyDataImportLogsDeleted(logsHrIdsToBeDeleted); - DataImport.verifyDeleteLogsButtonDisabled(); - cy.reload(); - DataImport.checkMultiColumnListRowsCount(numberOfLogsPerPage); }); - }); + }); }); diff --git a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js index a9b11614fa..b58a9d04d4 100644 --- a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js @@ -20,89 +20,91 @@ import NewFieldMappingProfile from '../../../support/fragments/data_import/mappi import InvoiceView from '../../../support/fragments/invoices/invoiceView'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - const quantityOfItems = '1'; - const fileName = `C343338autotestFile.${getRandomPostfix()}.edi`; - const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.gobi; - let user = {}; +describe('data-import', () => { + describe('End to end scenarios', () => { + const quantityOfItems = '1'; + const fileName = `C343338autotestFile.${getRandomPostfix()}.edi`; + const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.gobi; + let user = {}; - const mappingProfile = { - name:`autoTestMappingProf.${getRandomPostfix()}`, - incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, - existingRecordType:FOLIO_RECORD_TYPE.INVOICE, - description:'', - batchGroup: BATCH_GROUP.FOLIO, - organizationName: VENDOR_NAMES.GOBI, - paymentMethod: PAYMENT_METHOD.CASH - }; - const actionProfile = { - name: `autoTestActionProf.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INVOICE - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `autoTestJobProf.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT - }; + const mappingProfile = { + name:`autoTestMappingProf.${getRandomPostfix()}`, + incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, + existingRecordType:FOLIO_RECORD_TYPE.INVOICE, + description:'', + batchGroup: BATCH_GROUP.FOLIO, + organizationName: VENDOR_NAMES.GOBI, + paymentMethod: PAYMENT_METHOD.CASH + }; + const actionProfile = { + name: `autoTestActionProf.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INVOICE + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `autoTestJobProf.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT + }; - before('login', () => { - cy.createTempUser([ - permissions.dataImportUploadAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiOrganizationsView.gui, - permissions.viewEditDeleteInvoiceInvoiceLine.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + before('login', () => { + cy.createTempUser([ + permissions.dataImportUploadAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiOrganizationsView.gui, + permissions.viewEditDeleteInvoiceInvoiceLine.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); - after('delete test data', () => { - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - cy.getInvoiceIdApi({ query: `vendorInvoiceNo="${FileDetails.invoiceNumberFromEdifactFile}"` }) - .then(id => cy.deleteInvoiceFromStorageViaApi(id)); - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + cy.getInvoiceIdApi({ query: `vendorInvoiceNo="${FileDetails.invoiceNumberFromEdifactFile}"` }) + .then(id => cy.deleteInvoiceFromStorageViaApi(id)); + Users.deleteViaApi(user.userId); + }); - it('C343338 EDIFACT file import with creating of new invoice record (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // create Field mapping profile - FieldMappingProfiles.waitLoading(); - FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + it('C343338 EDIFACT file import with creating of new invoice record (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // create Field mapping profile + FieldMappingProfiles.waitLoading(); + FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); + 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 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + 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('ediFileForC343338.edi', fileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.selectJobProfile(); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkImportFile(jobProfile.profileName); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(fileName); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.invoice); - FileDetails.checkInvoiceInSummaryTable(quantityOfItems); - InvoiceView.checkInvoiceDetails(InvoiceView.vendorInvoiceNumber); - }); + // 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('ediFileForC343338.edi', fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.selectJobProfile(); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkImportFile(jobProfile.profileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(fileName); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.invoice); + FileDetails.checkInvoiceInSummaryTable(quantityOfItems); + InvoiceView.checkInvoiceDetails(InvoiceView.vendorInvoiceNumber); + }); + }); }); diff --git a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js index b4e60d87cf..8c6ae73f1f 100644 --- a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js @@ -19,72 +19,74 @@ import TopMenu from '../../../support/fragments/topMenu'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import InvoiceView from '../../../support/fragments/invoices/invoiceView'; -describe('ui-data-import', () => { - const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.harrassowitz; - const fileName = `C347615autotestFile.${getRandomPostfix()}.edi`; - const mappingProfile = { - name:`Import Large Harrassowitz Serials Invoice ${getRandomPostfix()}`, - incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, - existingRecordType:FOLIO_RECORD_TYPE.INVOICE, - description:'', - batchGroup: BATCH_GROUP.FOLIO, - organizationName: VENDOR_NAMES.HARRASSOWITZ, - paymentMethod: PAYMENT_METHOD.CASH - }; - const actionProfile = { - name: `Create Large Harrassowitz serials invoice ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INVOICE, - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `Create Large Harrassowitz serials invoice ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT - }; +describe('data-import', () => { + describe('End to end scenarios', () => { + const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.harrassowitz; + const fileName = `C347615autotestFile.${getRandomPostfix()}.edi`; + const mappingProfile = { + name:`Import Large Harrassowitz Serials Invoice ${getRandomPostfix()}`, + incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, + existingRecordType:FOLIO_RECORD_TYPE.INVOICE, + description:'', + batchGroup: BATCH_GROUP.FOLIO, + organizationName: VENDOR_NAMES.HARRASSOWITZ, + paymentMethod: PAYMENT_METHOD.CASH + }; + const actionProfile = { + name: `Create Large Harrassowitz serials invoice ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INVOICE, + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `Create Large Harrassowitz serials invoice ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT + }; - beforeEach('login', () => { - cy.loginAsAdmin(); - cy.getAdminToken(); - }); + beforeEach('login', () => { + cy.loginAsAdmin(); + cy.getAdminToken(); + }); - after('delete test data', () => { - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - }); + after('delete test data', () => { + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); - it('C347615 Import a large EDIFACT invoice file (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + it('C347615 Import a large EDIFACT invoice file (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); + 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 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + 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('ediFileForC347615.edi', fileName); - DataImport.waitFileIsUploaded(); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.selectJobProfile(); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkImportFile(jobProfile.profileName); - Logs.checkStatusOfJobProfile(); - Logs.checkQuantityRecordsInFile(Logs.quantityRecordsInInvoice.firstQuantity); - Logs.openFileDetails(fileName); - InvoiceView.checkQuantityInvoiceLinesInRecord(); + // 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('ediFileForC347615.edi', fileName); + DataImport.waitFileIsUploaded(); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.selectJobProfile(); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkImportFile(jobProfile.profileName); + Logs.checkStatusOfJobProfile(); + Logs.checkQuantityRecordsInFile(Logs.quantityRecordsInInvoice.firstQuantity); + Logs.openFileDetails(fileName); + InvoiceView.checkQuantityInvoiceLinesInRecord(); + }); }); }); 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 0c7526ccdc..4e1f832bb4 100644 --- a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js @@ -24,304 +24,306 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; -describe('ui-data-import', () => { - let firstFieldId = null; - let secondFieldId = null; - let instanceHrid = null; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - // unique file name to upload - const fileNameForCreatingInstance = `C17018autotestFileCreteInstance.${getRandomPostfix()}.mrc`; - const fileNameForProtect = `C17018 marcFileForC17018-Rev1-Protect_${getRandomPostfix()}.mrc`; - const fileNameForOverride = `C17018 marcFileForC17018-Rev2-Override_${getRandomPostfix()}.mrc`; - const editedFileNameRev1 = `marcFileForC17018-Rev1-Protect_${getRandomPostfix()}.mrc`; - const editedFileNameRev2 = `marcFileForC17018-Rev2-Override_${getRandomPostfix()}.mrc`; - const fileForEditRev1 = 'marcFileForC17018-Rev1-Protect.mrc'; - const fileForEditRev2 = 'marcFileForC17018-Rev2-Override.mrc'; - - const protectedFields = { - firstField: '020', - secondField: '514' - }; - - // notes for mapping profiles - const noteForUpdateInstanceMappingProfile = 'This note was added when the MARC Bib was updated to check field protections'; - const noteForOverrideInstanceMappingProfile = 'This note was added when the MARC Bib was updated to check field protection OVERRIDES'; - - // unique name for notes - const administrativeNote = 'This note was added when the MARC Bib was updated to check field protections'; - const instanceNote = 'This is the ORIGINAL version of the non-repeatable 514 note'; - const updatedAdministativeNote = 'This note was added when the MARC Bib was updated to check field protection OVERRIDES'; - const updatedInstanceNote = 'This is the UPDATE 2 version of the non-repeatable 514 note, which should replace the UPDATE 1 version'; - const instanceHridFromFile = 'in00000000331'; - - // resource identifiers in uploading files - const resourceIdentifiers = [ - { type: 'ISBN', value: '0866985522' }, - { type: 'ISBN', value: '9782617632537' }, - { type: 'ISBN', value: '4934691323219 (paperback)' } - ]; - const marcBibMappingProfile = { - name: `C17018 Update MARC Bib with protections.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC - }; - - const instanceMappingProfile = { - name: `C17018 Update instance 1.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE - }; - - const marcBibMappingProfileOverride = { - name: `C17018 Update MARC Bib with protection OVERRIDES.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC - }; - - const instanceMappingProfileOverride = { - name: `C17018 Update instance 2.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE - }; - - const marcBibActionProfile = { - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C17018 Update MARC Bib with protections.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - - const instanceActionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17018 Update instance 1.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - - const marcBibActionProfileOverride = { - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C17018 Update MARC Bib with protection OVERRIDES.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - - const instanceActionProfileOverride = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17018 Update MARC Bib with protection OVERRIDES.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - - const matchProfile = { profileName: `C17018 001 to 001 MARC Bib.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - existingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC }; - - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17018 Update 1: MARC Bib with protections.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - const jobProfileForOverride = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17018 Update 2: MARC Bib with protections.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - beforeEach('create test data', () => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: `"field"=="${protectedFields.firstField}"` }) - .then(list => { - if (list) { - list.forEach(({ id }) => MarcFieldProtection.deleteMarcFieldProtectionViaApi(id)); - } - }); - MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: `"field"=="${protectedFields.secondField}"` }) - .then(list => { - if (list) { - list.forEach(({ id }) => MarcFieldProtection.deleteMarcFieldProtectionViaApi(id)); - } - }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: 'a', - data: '*', - source: 'USER', - field: protectedFields.firstField - }) - .then((resp) => { - firstFieldId = resp.id; - }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field: protectedFields.secondField - }) - .then((resp) => { - secondFieldId = resp.id; - }); - }); - }); - - after('delete test data', () => { - MarcFieldProtection.deleteMarcFieldProtectionViaApi(firstFieldId); - MarcFieldProtection.deleteMarcFieldProtectionViaApi(secondFieldId); - // delete profiles - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - JobProfiles.deleteJobProfile(jobProfileForOverride.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(marcBibActionProfile.name); - ActionProfiles.deleteActionProfile(instanceActionProfile.name); - ActionProfiles.deleteActionProfile(marcBibActionProfileOverride.name); - ActionProfiles.deleteActionProfile(instanceActionProfileOverride.name); - FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfileOverride.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileOverride.name); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedFileNameRev1}`); - FileManager.deleteFile(`cypress/fixtures/${editedFileNameRev2}`); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); +describe('data-import', () => { + describe('End to end scenarios', () => { + let firstFieldId = null; + let secondFieldId = null; + let instanceHrid = null; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + // unique file name to upload + const fileNameForCreatingInstance = `C17018autotestFileCreteInstance.${getRandomPostfix()}.mrc`; + const fileNameForProtect = `C17018 marcFileForC17018-Rev1-Protect_${getRandomPostfix()}.mrc`; + const fileNameForOverride = `C17018 marcFileForC17018-Rev2-Override_${getRandomPostfix()}.mrc`; + const editedFileNameRev1 = `marcFileForC17018-Rev1-Protect_${getRandomPostfix()}.mrc`; + const editedFileNameRev2 = `marcFileForC17018-Rev2-Override_${getRandomPostfix()}.mrc`; + const fileForEditRev1 = 'marcFileForC17018-Rev1-Protect.mrc'; + const fileForEditRev2 = 'marcFileForC17018-Rev2-Override.mrc'; + + const protectedFields = { + firstField: '020', + secondField: '514' + }; + + // notes for mapping profiles + const noteForUpdateInstanceMappingProfile = 'This note was added when the MARC Bib was updated to check field protections'; + const noteForOverrideInstanceMappingProfile = 'This note was added when the MARC Bib was updated to check field protection OVERRIDES'; + + // unique name for notes + const administrativeNote = 'This note was added when the MARC Bib was updated to check field protections'; + const instanceNote = 'This is the ORIGINAL version of the non-repeatable 514 note'; + const updatedAdministativeNote = 'This note was added when the MARC Bib was updated to check field protection OVERRIDES'; + const updatedInstanceNote = 'This is the UPDATE 2 version of the non-repeatable 514 note, which should replace the UPDATE 1 version'; + const instanceHridFromFile = 'in00000000331'; + + // resource identifiers in uploading files + const resourceIdentifiers = [ + { type: 'ISBN', value: '0866985522' }, + { type: 'ISBN', value: '9782617632537' }, + { type: 'ISBN', value: '4934691323219 (paperback)' } + ]; + const marcBibMappingProfile = { + name: `C17018 Update MARC Bib with protections.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC + }; + + const instanceMappingProfile = { + name: `C17018 Update instance 1.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE + }; + + const marcBibMappingProfileOverride = { + name: `C17018 Update MARC Bib with protection OVERRIDES.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC + }; + + const instanceMappingProfileOverride = { + name: `C17018 Update instance 2.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE + }; + + const marcBibActionProfile = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C17018 Update MARC Bib with protections.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + + const instanceActionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C17018 Update instance 1.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + + const marcBibActionProfileOverride = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C17018 Update MARC Bib with protection OVERRIDES.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + + const instanceActionProfileOverride = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C17018 Update MARC Bib with protection OVERRIDES.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + + const matchProfile = { profileName: `C17018 001 to 001 MARC Bib.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + existingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC }; + + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17018 Update 1: MARC Bib with protections.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + const jobProfileForOverride = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17018 Update 2: MARC Bib with protections.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + beforeEach('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: `"field"=="${protectedFields.firstField}"` }) + .then(list => { + if (list) { + list.forEach(({ id }) => MarcFieldProtection.deleteMarcFieldProtectionViaApi(id)); + } + }); + MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: `"field"=="${protectedFields.secondField}"` }) + .then(list => { + if (list) { + list.forEach(({ id }) => MarcFieldProtection.deleteMarcFieldProtectionViaApi(id)); + } + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: 'a', + data: '*', + source: 'USER', + field: protectedFields.firstField + }) + .then((resp) => { + firstFieldId = resp.id; + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field: protectedFields.secondField + }) + .then((resp) => { + secondFieldId = resp.id; + }); + }); + }); - it('C17018 Check that field protection overrides work properly during data import (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // create Field mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfileForUpdatesMarc(marcBibMappingProfile); - FieldMappingProfileView.checkCreatedMappingProfile(marcBibMappingProfile.name, protectedFields.firstField, protectedFields.secondField); - FieldMappingProfiles.checkMappingProfilePresented(marcBibMappingProfile.name); - - FieldMappingProfiles.createMappingProfileWithNotes(instanceMappingProfile, noteForUpdateInstanceMappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfile.name); - - FieldMappingProfiles.createMappingProfileForUpdatesAndOverrideMarc(marcBibMappingProfileOverride, protectedFields.firstField, protectedFields.secondField); - FieldMappingProfileView.checkCreatedMappingProfile(marcBibMappingProfileOverride.name, protectedFields.firstField, protectedFields.secondField); - FieldMappingProfiles.checkMappingProfilePresented(marcBibMappingProfileOverride.name); - - FieldMappingProfiles.createMappingProfileWithNotes(instanceMappingProfileOverride, noteForOverrideInstanceMappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfileOverride.name); - - // create Action profiles - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(marcBibActionProfile, marcBibMappingProfile.name); - ActionProfiles.checkActionProfilePresented(marcBibActionProfile.name); - - ActionProfiles.create(instanceActionProfile, instanceMappingProfile.name); - ActionProfiles.checkActionProfilePresented(instanceActionProfile.name); - - ActionProfiles.create(marcBibActionProfileOverride, marcBibMappingProfileOverride.name); - ActionProfiles.checkActionProfilePresented(marcBibActionProfileOverride.name); - - ActionProfiles.create(instanceActionProfileOverride, instanceMappingProfileOverride.name); - ActionProfiles.checkActionProfilePresented(instanceActionProfileOverride.name); - - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create Job profiles - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForUpdate); - NewJobProfile.linkMatchAndTwoActionProfiles(matchProfile.profileName, marcBibActionProfile.name, instanceActionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); - - // need to wait until the first job profile will be created - cy.wait(2500); - JobProfiles.createJobProfile(jobProfileForOverride); - NewJobProfile.linkMatchAndTwoActionProfiles(matchProfile.profileName, marcBibActionProfileOverride.name, instanceActionProfileOverride.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForOverride.profileName); - - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC17018-BeforeOverride.mrc', fileNameForCreatingInstance); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForCreatingInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForCreatingInstance); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + after('delete test data', () => { + MarcFieldProtection.deleteMarcFieldProtectionViaApi(firstFieldId); + MarcFieldProtection.deleteMarcFieldProtectionViaApi(secondFieldId); + // delete profiles + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + JobProfiles.deleteJobProfile(jobProfileForOverride.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(marcBibActionProfile.name); + ActionProfiles.deleteActionProfile(instanceActionProfile.name); + ActionProfiles.deleteActionProfile(marcBibActionProfileOverride.name); + ActionProfiles.deleteActionProfile(instanceActionProfileOverride.name); + FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfileOverride.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileOverride.name); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedFileNameRev1}`); + FileManager.deleteFile(`cypress/fixtures/${editedFileNameRev2}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); - FileDetails.checkInstanceQuantityInSummaryTable('1', 0); - // 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]); + it('C17018 Check that field protection overrides work properly during data import (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create Field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfileForUpdatesMarc(marcBibMappingProfile); + FieldMappingProfileView.checkCreatedMappingProfile(marcBibMappingProfile.name, protectedFields.firstField, protectedFields.secondField); + FieldMappingProfiles.checkMappingProfilePresented(marcBibMappingProfile.name); - // 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); + FieldMappingProfiles.createMappingProfileWithNotes(instanceMappingProfile, noteForUpdateInstanceMappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfile.name); + + FieldMappingProfiles.createMappingProfileForUpdatesAndOverrideMarc(marcBibMappingProfileOverride, protectedFields.firstField, protectedFields.secondField); + FieldMappingProfileView.checkCreatedMappingProfile(marcBibMappingProfileOverride.name, protectedFields.firstField, protectedFields.secondField); + FieldMappingProfiles.checkMappingProfilePresented(marcBibMappingProfileOverride.name); + + FieldMappingProfiles.createMappingProfileWithNotes(instanceMappingProfileOverride, noteForOverrideInstanceMappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfileOverride.name); + + // create Action profiles + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(marcBibActionProfile, marcBibMappingProfile.name); + ActionProfiles.checkActionProfilePresented(marcBibActionProfile.name); + + ActionProfiles.create(instanceActionProfile, instanceMappingProfile.name); + ActionProfiles.checkActionProfilePresented(instanceActionProfile.name); + + ActionProfiles.create(marcBibActionProfileOverride, marcBibMappingProfileOverride.name); + ActionProfiles.checkActionProfilePresented(marcBibActionProfileOverride.name); + + ActionProfiles.create(instanceActionProfileOverride, instanceMappingProfileOverride.name); + ActionProfiles.checkActionProfilePresented(instanceActionProfileOverride.name); + + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create Job profiles + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchAndTwoActionProfiles(matchProfile.profileName, marcBibActionProfile.name, instanceActionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + + // need to wait until the first job profile will be created + cy.wait(2500); + JobProfiles.createJobProfile(jobProfileForOverride); + NewJobProfile.linkMatchAndTwoActionProfiles(matchProfile.profileName, marcBibActionProfileOverride.name, instanceActionProfileOverride.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForOverride.profileName); // 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); + DataImport.uploadFile('marcFileForC17018-BeforeOverride.mrc', fileNameForCreatingInstance); + JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForOverride); + JobProfiles.waitFileIsImported(fileNameForCreatingInstance); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForOverride); + Logs.openFileDetails(fileNameForCreatingInstance); [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + FileDetails.checkStatusInColumn(FileDetails.status.created, 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); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); + FileDetails.checkInstanceQuantityInSummaryTable('1', 0); + // 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); }); - 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 bbe2e104e8..10ea38f71d 100644 --- a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js @@ -23,205 +23,207 @@ import InventoryViewSource from '../../../support/fragments/inventory/inventoryV import FileManager from '../../../support/utils/fileManager'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; -describe('ui-data-import', () => { - const marcFieldProtected = ['507', '920']; - const marcFieldProtectionId = []; - let instanceHrid = null; - - // data from .mrc file - const dataFromField001 = 'ocn894025734'; - const dataForField500 = 'Repeatable unprotected field'; - const dataForField507 = 'Non-repeatable protected field'; - const dataForField920 = 'This field should be protected'; - // data for changing .mrc file - const updateDataForField500 = 'Repeatable unprotected field Updated'; - const updateDataForField507 = 'Non-repeatable protected field Updated'; - const updateDataForField920 = 'The previous 920 should be retained, since it is protected and repeatable, and this new 920 added.'; - // unique file names - const nameMarcFileForCreate = `C17017 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C17017 protectedFields.${getRandomPostfix()}.mrc`; - const fileNameForUpdate = `C17017 updatedProtectedFields.${getRandomPostfix()}.mrc`; - // profiles for create - const mappingProfile = { name: `C17017 autotest MappingProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE }; - - const actionProfile = { name: `C17017 autotest ActionProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE }; - - const jobProfile = { - profileName: `C17017 autotest JobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - // profiles for update - const mappingProfileUpdate = { name: `C17017 autotest update MappingProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED }; - - const actionProfileUpdate = { - name: `C17017 autotest update ActionProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)', - }; - - const matchProfile = { - profileName: `C17017 autotest MatchProf${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid - }; - - const jobProfileUpdate = { - profileName: `C17017 autotest update JobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - beforeEach('create test data', () => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - marcFieldProtected.forEach(field => { - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field - }) - .then((resp) => { - const id = resp.id; - marcFieldProtectionId.push(id); - }); +describe('data-import', () => { + describe('End to end scenarios', () => { + const marcFieldProtected = ['507', '920']; + const marcFieldProtectionId = []; + let instanceHrid = null; + + // data from .mrc file + const dataFromField001 = 'ocn894025734'; + const dataForField500 = 'Repeatable unprotected field'; + const dataForField507 = 'Non-repeatable protected field'; + const dataForField920 = 'This field should be protected'; + // data for changing .mrc file + const updateDataForField500 = 'Repeatable unprotected field Updated'; + const updateDataForField507 = 'Non-repeatable protected field Updated'; + const updateDataForField920 = 'The previous 920 should be retained, since it is protected and repeatable, and this new 920 added.'; + // unique file names + const nameMarcFileForCreate = `C17017 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C17017 protectedFields.${getRandomPostfix()}.mrc`; + const fileNameForUpdate = `C17017 updatedProtectedFields.${getRandomPostfix()}.mrc`; + // profiles for create + const mappingProfile = { name: `C17017 autotest MappingProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE }; + + const actionProfile = { name: `C17017 autotest ActionProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE }; + + const jobProfile = { + profileName: `C17017 autotest JobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + // profiles for update + const mappingProfileUpdate = { name: `C17017 autotest update MappingProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED }; + + const actionProfileUpdate = { + name: `C17017 autotest update ActionProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)', + }; + + const matchProfile = { + profileName: `C17017 autotest MatchProf${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; + + const jobProfileUpdate = { + profileName: `C17017 autotest update JobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + beforeEach('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + marcFieldProtected.forEach(field => { + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field + }) + .then((resp) => { + const id = resp.id; + marcFieldProtectionId.push(id); + }); + }); }); - }); - }); + }); + + after('delete test data', () => { + marcFieldProtectionId.forEach(field => MarcFieldProtection.deleteMarcFieldProtectionViaApi(field)); + // delete profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + JobProfiles.deleteJobProfile(jobProfileUpdate.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + ActionProfiles.deleteActionProfile(actionProfileUpdate.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileUpdate.name); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + FileManager.deleteFile(`cypress/fixtures/${fileNameForUpdate}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - after('delete test data', () => { - marcFieldProtectionId.forEach(field => MarcFieldProtection.deleteMarcFieldProtectionViaApi(field)); - // delete profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - JobProfiles.deleteJobProfile(jobProfileUpdate.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - ActionProfiles.deleteActionProfile(actionProfileUpdate.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileUpdate.name); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - FileManager.deleteFile(`cypress/fixtures/${fileNameForUpdate}`); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); + const createInstanceMappingProfileForCreate = (instanceMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); + }; + + const createInstanceMappingProfileForUpdate = (instanceMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(instanceMappingProfile.instanceStatusTerm); + NewFieldMappingProfile.addStatisticalCode('ARL (Collection stats): books - Book, print (books)', 8); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); + }; + + it('C17017 Check that field protection settings work properly during data import (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + createInstanceMappingProfileForCreate(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create action 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); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file for creating of the new instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC17017.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFileForCreate); + Logs.verifyInstanceStatus(0, 2, 'Created'); + Logs.verifyInstanceStatus(0, 3, 'Created'); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1'); + Logs.clickOnHotLink(0, 3, 'Created'); + 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] + ); }); - }); - const createInstanceMappingProfileForCreate = (instanceMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); - }; - - const createInstanceMappingProfileForUpdate = (instanceMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(instanceMappingProfile.instanceStatusTerm); - NewFieldMappingProfile.addStatisticalCode('ARL (Collection stats): books - Book, print (books)', 8); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); - }; - - it('C17017 Check that field protection settings work properly during data import (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - createInstanceMappingProfileForCreate(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - - // create action 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); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - - // upload a marc file for creating of the new instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC17017.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForCreate); - Logs.verifyInstanceStatus(0, 2, 'Created'); - Logs.verifyInstanceStatus(0, 3, 'Created'); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1'); - Logs.clickOnHotLink(0, 3, 'Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + // create mapping profile for update + cy.visit(SettingsMenu.mappingProfilePath); + createInstanceMappingProfileForUpdate(mappingProfileUpdate); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfileUpdate.name); + + // create action profile for update + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfileUpdate, mappingProfileUpdate.name); + ActionProfiles.checkActionProfilePresented(actionProfileUpdate.name); + + // create match profile for update + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + + // create job profile for update + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfileUpdate, actionProfileUpdate.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfileUpdate.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, fileNameForUpdate); + JobProfiles.searchJobProfileForImport(jobProfileUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdate); + Logs.verifyInstanceStatus(0, 2, 'Created'); + Logs.verifyInstanceStatus(0, 3, 'Updated'); + Logs.clickOnHotLink(0, 3, 'Updated'); 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] - ); + InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[1], updateDataForField920); }); - - // create mapping profile for update - cy.visit(SettingsMenu.mappingProfilePath); - createInstanceMappingProfileForUpdate(mappingProfileUpdate); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfileUpdate.name); - - // create action profile for update - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfileUpdate, mappingProfileUpdate.name); - ActionProfiles.checkActionProfilePresented(actionProfileUpdate.name); - - // create match profile for update - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - - // create job profile for update - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfileUpdate, actionProfileUpdate.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfileUpdate.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, fileNameForUpdate); - JobProfiles.searchJobProfileForImport(jobProfileUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForUpdate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForUpdate); - Logs.verifyInstanceStatus(0, 2, 'Created'); - Logs.verifyInstanceStatus(0, 3, 'Updated'); - Logs.clickOnHotLink(0, 3, 'Updated'); - InstanceRecordView.viewSource(); - - InstanceRecordView.verifySrsMarcRecord(); - InventoryViewSource.verifyFieldInMARCBibSource('500', dataForField500); - InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[0], dataForField507); - InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[1], dataForField920); - InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[1], updateDataForField920); }); }); 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 c77b831aa1..67b56163da 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 @@ -13,93 +13,95 @@ import Logs from '../../../support/fragments/data_import/logs/logs'; import TestTypes from '../../../support/dictionary/testTypes'; import { JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - const startedDate = new Date(); - const completedDate = startedDate; - // format date as YYYY-MM-DD - const formattedStart = DateTools.getFormattedDate({ date: startedDate }); - // api endpoint expects completedDate increased by 1 day - completedDate.setDate(completedDate.getDate() + 1); - let firstUser; - let secondUser; - const jobProfileId = '6eefa4c6-bbf7-4845-ad82-de7fc5abd0e3'; +describe('data-import', () => { + describe('End to end scenarios', () => { + const startedDate = new Date(); + const completedDate = startedDate; + // format date as YYYY-MM-DD + const formattedStart = DateTools.getFormattedDate({ date: startedDate }); + // api endpoint expects completedDate increased by 1 day + completedDate.setDate(completedDate.getDate() + 1); + let firstUser; + let secondUser; + const jobProfileId = '6eefa4c6-bbf7-4845-ad82-de7fc5abd0e3'; - before(() => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui - ]) - .then(userProperties => { - firstUser = userProperties; + before(() => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui + ]) + .then(userProperties => { + firstUser = userProperties; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading - }); - // 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${getRandomPostfix()}`; - - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); - } + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); + // 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${getRandomPostfix()}`; - cy.logout(); - }); + DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); + } - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui - ]) - .then(userProperties => { - secondUser = userProperties; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading + cy.logout(); }); - // Log list should contain at least 30-35 import jobs - for (let i = 0; i < 8; i++) { - const nameMarcFileForCreate = `C358136autotestFile.${getRandomPostfix()}.mrc`; - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneMarcAuthority.mrc', nameMarcFileForCreate); - // need to wait until file will be uploaded in loop - cy.wait(8000); - JobProfiles.searchJobProfileForImport('Default - Create SRS MARC Authority'); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - } - }); - }); + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui + ]) + .then(userProperties => { + secondUser = userProperties; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); + // Log list should contain at least 30-35 import jobs + for (let i = 0; i < 8; i++) { + const nameMarcFileForCreate = `C358136autotestFile.${getRandomPostfix()}.mrc`; - after(() => { - Users.deleteViaApi(firstUser.userId); - Users.deleteViaApi(secondUser.userId); - // TODO delete all created instances - }); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('oneMarcAuthority.mrc', nameMarcFileForCreate); + // need to wait until file will be uploaded in loop + cy.wait(8000); + JobProfiles.searchJobProfileForImport('Default - Create SRS MARC Authority'); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + } + }); + }); - it('C358136 A user can filter and delete import logs from the "View all" page (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - Logs.openViewAllLogs(); - LogsViewAll.viewAllIsOpened(); - LogsViewAll.filterJobsByJobProfile('Default - Create SRS MARC Authority'); - LogsViewAll.filterJobsByDate({ from: formattedStart, end: formattedStart }); + after(() => { + Users.deleteViaApi(firstUser.userId); + Users.deleteViaApi(secondUser.userId); + // TODO delete all created instances + }); - const formattedEnd = DateTools.getFormattedDate({ date: completedDate }); + it('C358136 A user can filter and delete import logs from the "View all" page (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + Logs.openViewAllLogs(); + LogsViewAll.viewAllIsOpened(); + LogsViewAll.filterJobsByJobProfile('Default - Create SRS MARC Authority'); + LogsViewAll.filterJobsByDate({ from: formattedStart, end: formattedStart }); - LogsViewAll.checkByDateAndJobProfile({ from: formattedStart, end: formattedEnd }, jobProfileId) - .then((count) => { - LogsViewAll.selectAllLogs(); - LogsViewAll.checkIsLogsSelected(count); - LogsViewAll.unmarcCheckbox(0); - LogsViewAll.checkmarkAllLogsIsRemoved(); - LogsViewAll.deleteLog(); + const formattedEnd = DateTools.getFormattedDate({ date: completedDate }); - const countOfLogsForDelete = (count - 1); - DeleteDataImportLogsModal.confirmDelete(countOfLogsForDelete); - LogsViewAll.verifyMessageOfDeleted(countOfLogsForDelete); - LogsViewAll.modalIsAbsent(); - }); - }); + LogsViewAll.checkByDateAndJobProfile({ from: formattedStart, end: formattedEnd }, jobProfileId) + .then((count) => { + LogsViewAll.selectAllLogs(); + LogsViewAll.checkIsLogsSelected(count); + LogsViewAll.unmarcCheckbox(0); + LogsViewAll.checkmarkAllLogsIsRemoved(); + LogsViewAll.deleteLog(); + + const countOfLogsForDelete = (count - 1); + DeleteDataImportLogsModal.confirmDelete(countOfLogsForDelete); + LogsViewAll.verifyMessageOfDeleted(countOfLogsForDelete); + LogsViewAll.modalIsAbsent(); + }); + }); + }); }); 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 eabbc625dc..5d0c8cf07b 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 @@ -23,164 +23,166 @@ 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'; -describe('ui-data-import', () => { - let instanceHRID = null; - const nameForCreateMarcFile = `createFile${getRandomPostfix()}.mrc`; - const nameForUpdateCreateMarcFile = `updateFile${getRandomPostfix()}.mrc`; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `createInstanceMappingProf${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `createInstanceActionProf${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `createEHoldingsMappingProf${getRandomPostfix()}`, - permanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `createEHoldingsActionProf${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `updateEHoldingsMappingProf${getRandomPostfix()}`, - callNumberType: `"${CALL_NUMBER_TYPE_NAMES.OTHER_SCHEME}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `updateEHoldingsActionProf${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - - const matchProfile = { - profileName: `autotestMatchProf${getRandomPostfix()}`, - incomingRecordFields: { - field: '856', - in1: '4', - in2: '0', - subfield: 'u' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.uri, - }; - - const createInstanceAndEHoldingsJobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `createInstanceAndEHoldingsJobProf${getRandomPostfix()}`, - }; - const updateEHoldingsJobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `updateEHoldingsJobProf${getRandomPostfix()}`, - }; - - before('login', () => { - cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - cy.getAdminToken(); - }); +describe('data-import', () => { + describe('End to end scenarios', () => { + let instanceHRID = null; + const nameForCreateMarcFile = `createFile${getRandomPostfix()}.mrc`; + const nameForUpdateCreateMarcFile = `updateFile${getRandomPostfix()}.mrc`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `createInstanceMappingProf${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `createInstanceActionProf${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `createEHoldingsMappingProf${getRandomPostfix()}`, + permanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `createEHoldingsActionProf${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `updateEHoldingsMappingProf${getRandomPostfix()}`, + callNumberType: `"${CALL_NUMBER_TYPE_NAMES.OTHER_SCHEME}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `updateEHoldingsActionProf${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + + const matchProfile = { + profileName: `autotestMatchProf${getRandomPostfix()}`, + incomingRecordFields: { + field: '856', + in1: '4', + in2: '0', + subfield: 'u' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.uri, + }; + + const createInstanceAndEHoldingsJobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `createInstanceAndEHoldingsJobProf${getRandomPostfix()}`, + }; + const updateEHoldingsJobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `updateEHoldingsJobProf${getRandomPostfix()}`, + }; + + before('login', () => { + cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + cy.getAdminToken(); + }); - after('delete test data', () => { - JobProfiles.deleteJobProfile(createInstanceAndEHoldingsJobProfile.profileName); - JobProfiles.deleteJobProfile(updateEHoldingsJobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + after('delete test data', () => { + JobProfiles.deleteJobProfile(createInstanceAndEHoldingsJobProfile.profileName); + JobProfiles.deleteJobProfile(updateEHoldingsJobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); }); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) - .then((instance) => { - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); + + const createInstanceMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillCatalogedDate('###TODAY###'); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; + + const createHoldingsMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); + NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u', '856$z'); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; + + const updateHoldingsMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.addSuppressFromDiscovery('Mark for all affected records'); + NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); + NewFieldMappingProfile.fillCallNumber('"ONLINE"'); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; + + it('C17025 Match on Holdings 856 $u (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + createInstanceMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + updateHoldingsMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); }); - }); - const createInstanceMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillCatalogedDate('###TODAY###'); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; - - const createHoldingsMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); - NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u', '856$z'); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; - - const updateHoldingsMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.addSuppressFromDiscovery('Mark for all affected records'); - NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); - NewFieldMappingProfile.fillCallNumber('"ONLINE"'); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; - - it('C17025 Match on Holdings 856 $u (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - createInstanceMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - updateHoldingsMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); - - collectionOfMappingAndActionProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(createInstanceAndEHoldingsJobProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(createInstanceAndEHoldingsJobProfile.profileName); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(createInstanceAndEHoldingsJobProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(createInstanceAndEHoldingsJobProfile.profileName); - - // need to wait until the first job profile will be created - cy.wait(2500); - JobProfiles.createJobProfile(updateEHoldingsJobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[2].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(updateEHoldingsJobProfile.profileName); - - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC17025.mrc', nameForCreateMarcFile); - JobProfiles.searchJobProfileForImport(createInstanceAndEHoldingsJobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForCreateMarcFile); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameForCreateMarcFile); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; - - InventoryInstance.openHoldingView(); - HoldingsRecordView.checkURIIsNotEmpty(); + // need to wait until the first job profile will be created + cy.wait(2500); + JobProfiles.createJobProfile(updateEHoldingsJobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[2].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(updateEHoldingsJobProfile.profileName); cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC17025.mrc', nameForUpdateCreateMarcFile); - JobProfiles.searchJobProfileForImport(updateEHoldingsJobProfile.profileName); + DataImport.uploadFile('marcFileForC17025.mrc', nameForCreateMarcFile); + JobProfiles.searchJobProfileForImport(createInstanceAndEHoldingsJobProfile.profileName); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForUpdateCreateMarcFile); - Logs.checkStatusOfJobProfile(); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); - InventoryInstance.openHoldingView(); - HoldingsRecordView.checkCallNumber('ONLINE'); + JobProfiles.waitFileIsImported(nameForCreateMarcFile); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameForCreateMarcFile); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkURIIsNotEmpty(); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC17025.mrc', nameForUpdateCreateMarcFile); + JobProfiles.searchJobProfileForImport(updateEHoldingsJobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForUpdateCreateMarcFile); + Logs.checkStatusOfJobProfile(); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkCallNumber('ONLINE'); + }); }); }); }); diff --git a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js index 90219409b7..9c2025c23a 100644 --- a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js @@ -22,139 +22,141 @@ import permissions from '../../../support/dictionary/permissions'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let userId; - const fileNameForCreateInstance = `C347828autotestFile.${getRandomPostfix()}.mrc`; - const fileNameForUpdateInstance = `C347828autotestFile.${getRandomPostfix()}.mrc`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const instanceGeneralNote = 'IDENTIFIER UPDATE 1'; - const resourceIdentifiers = [ - { type: 'UPC', value: 'ORD32671387-4' }, - { type: 'OCLC', value: '(OCoLC)84714376518561876438' }, - { type: 'Invalid UPC', value: 'ORD32671387-4' }, - { type: 'System control number', value: '(AMB)84714376518561876438' }, - ]; - const matchProfile = { - profileName: `autotestMatchProf${getRandomPostfix()}`, - incomingRecordFields: { - field: '024', - in1: '1', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: 'Identifier: UPC', - }; - const mappingProfile = { - name: `autotestMappingProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - suppressFromDiscavery: 'Mark for all affected records', - catalogedDate: '"2021-12-01"', - catalogedDateUI: '2021-12-01', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, - }; - const actionProfile = { - name: `autotestActionProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfile = { - profileName: `autotestJobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('End to end scenarios', () => { + let userId; + const fileNameForCreateInstance = `C347828autotestFile.${getRandomPostfix()}.mrc`; + const fileNameForUpdateInstance = `C347828autotestFile.${getRandomPostfix()}.mrc`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const instanceGeneralNote = 'IDENTIFIER UPDATE 1'; + const resourceIdentifiers = [ + { type: 'UPC', value: 'ORD32671387-4' }, + { type: 'OCLC', value: '(OCoLC)84714376518561876438' }, + { type: 'Invalid UPC', value: 'ORD32671387-4' }, + { type: 'System control number', value: '(AMB)84714376518561876438' }, + ]; + const matchProfile = { + profileName: `autotestMatchProf${getRandomPostfix()}`, + incomingRecordFields: { + field: '024', + in1: '1', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: 'Identifier: UPC', + }; + const mappingProfile = { + name: `autotestMappingProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + suppressFromDiscavery: 'Mark for all affected records', + catalogedDate: '"2021-12-01"', + catalogedDateUI: '2021-12-01', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, + }; + const actionProfile = { + name: `autotestActionProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfile = { + profileName: `autotestJobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui, - permissions.inventoryAll.gui, - permissions.settingsDataImportEnabled.gui, - permissions.viewEditDeleteInvoiceInvoiceLine.gui, - permissions.viewEditCreateInvoiceInvoiceLine.gui, - permissions.assignAcqUnitsToNewInvoice.gui, - permissions.invoiceSettingsAll.gui, - ]) - .then(userProperties => { - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading - }); + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui, + permissions.inventoryAll.gui, + permissions.settingsDataImportEnabled.gui, + permissions.viewEditDeleteInvoiceInvoiceLine.gui, + permissions.viewEditCreateInvoiceInvoiceLine.gui, + permissions.assignAcqUnitsToNewInvoice.gui, + permissions.invoiceSettingsAll.gui, + ]) + .then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) - .then(instances => { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) + .then(instances => { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); }); - }); - }); - }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(userId); - // delete profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - }); + after('delete test data', () => { + Users.deleteViaApi(userId); + // delete profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); - it('C347828 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 1 (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForMatchOnIdentifierForCreate.mrc', fileNameForCreateInstance); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForCreateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForCreateInstance); - Logs.clickOnHotLink(0, 3, 'Created'); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); - cy.go('back'); - Logs.clickOnHotLink(1, 3, 'Created'); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); + it('C347828 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 1 (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForMatchOnIdentifierForCreate.mrc', fileNameForCreateInstance); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForCreateInstance); + Logs.clickOnHotLink(0, 3, 'Created'); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); + cy.go('back'); + Logs.clickOnHotLink(1, 3, 'Created'); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.suppressFromDiscavery); - NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.suppressFromDiscavery); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForMatchOnIdentifierForUpdate_1.mrc', fileNameForUpdateInstance); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForUpdateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForUpdateInstance); - Logs.verifyInstanceStatus(0, 3, 'Updated'); - Logs.verifyInstanceStatus(1, 3, FileDetails.status.noAction); - Logs.clickOnHotLink(0, 3, 'Updated'); - InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); - InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); - InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); - }); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForMatchOnIdentifierForUpdate_1.mrc', fileNameForUpdateInstance); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdateInstance); + Logs.verifyInstanceStatus(0, 3, 'Updated'); + Logs.verifyInstanceStatus(1, 3, FileDetails.status.noAction); + Logs.clickOnHotLink(0, 3, 'Updated'); + InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); + InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); + InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); + }); + }); }); 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 a56bc2d8ec..46bc2f77d6 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 @@ -23,140 +23,142 @@ import InventorySearchAndFilter from '../../../support/fragments/inventory/inven import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let userId; - const filePathForCreateInstance = 'marcFileForMatchOnIdentifierForCreate.mrc'; - const filePathForUpdateInstance = 'marcFileForMatchOnIdentifierForUpdate_2.mrc'; - const fileNameForCreateInstance = `C347829autotestFile.${getRandomPostfix()}.mrc`; - const fileNameForUpdateInstance = `C347829autotestFile.${getRandomPostfix()}.mrc`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const instanceGeneralNote = 'IDENTIFIER UPDATE 2'; - const resourceIdentifiers = [ - { type: 'UPC', value: 'ORD32671387-4' }, - { type: 'OCLC', value: '(OCoLC)84714376518561876438' }, - { type: 'Invalid UPC', value: 'ORD32671387-4' }, - { type: 'System control number', value: '(AMB)84714376518561876438' }, - ]; - const matchProfile = { - profileName: `C347829autotestMatchProf${getRandomPostfix()}`, - incomingRecordFields: { - field: '024', - in1: '1', - subfield: 'z' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: 'Identifier: Invalid UPC', - }; - const mappingProfile = { - name: `C347829autotestMappingProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - staffSuppress: 'Mark for all affected records', - catalogedDate: '"2021-12-02"', - catalogedDateUI: '2021-12-02', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.CATALOGED - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C347829autotestActionProf${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C347829autotestJobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('End to end scenarios', () => { + let userId; + const filePathForCreateInstance = 'marcFileForMatchOnIdentifierForCreate.mrc'; + const filePathForUpdateInstance = 'marcFileForMatchOnIdentifierForUpdate_2.mrc'; + const fileNameForCreateInstance = `C347829autotestFile.${getRandomPostfix()}.mrc`; + const fileNameForUpdateInstance = `C347829autotestFile.${getRandomPostfix()}.mrc`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const instanceGeneralNote = 'IDENTIFIER UPDATE 2'; + const resourceIdentifiers = [ + { type: 'UPC', value: 'ORD32671387-4' }, + { type: 'OCLC', value: '(OCoLC)84714376518561876438' }, + { type: 'Invalid UPC', value: 'ORD32671387-4' }, + { type: 'System control number', value: '(AMB)84714376518561876438' }, + ]; + const matchProfile = { + profileName: `C347829autotestMatchProf${getRandomPostfix()}`, + incomingRecordFields: { + field: '024', + in1: '1', + subfield: 'z' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: 'Identifier: Invalid UPC', + }; + const mappingProfile = { + name: `C347829autotestMappingProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + staffSuppress: 'Mark for all affected records', + catalogedDate: '"2021-12-02"', + catalogedDateUI: '2021-12-02', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.CATALOGED + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C347829autotestActionProf${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C347829autotestJobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - beforeEach('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui, - permissions.inventoryAll.gui, - permissions.settingsDataImportEnabled.gui, - permissions.viewEditDeleteInvoiceInvoiceLine.gui, - permissions.viewEditCreateInvoiceInvoiceLine.gui, - permissions.assignAcqUnitsToNewInvoice.gui, - permissions.invoiceSettingsAll.gui, - permissions.remoteStorageView.gui - ]) - .then(userProperties => { - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading + beforeEach('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui, + permissions.inventoryAll.gui, + permissions.settingsDataImportEnabled.gui, + permissions.viewEditDeleteInvoiceInvoiceLine.gui, + permissions.viewEditCreateInvoiceInvoiceLine.gui, + permissions.assignAcqUnitsToNewInvoice.gui, + permissions.invoiceSettingsAll.gui, + permissions.remoteStorageView.gui + ]) + .then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); }); - }); - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) - .then(instances => { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) + .then(instances => { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); }); - }); - }); + }); - after('delete test data', () => { - // delete profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - Users.deleteViaApi(userId); - }); + after('delete test data', () => { + // delete profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Users.deleteViaApi(userId); + }); - it('C347829 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 2 (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForCreateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForCreateInstance); - Logs.clickOnHotLink(0, 3, 'Created'); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); - cy.go('back'); - Logs.clickOnHotLink(1, 3, 'Created'); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); + it('C347829 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 2 (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForCreateInstance); + Logs.clickOnHotLink(0, 3, 'Created'); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); + cy.go('back'); + Logs.clickOnHotLink(1, 3, 'Created'); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); - NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForUpdateInstance, fileNameForUpdateInstance); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForUpdateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForUpdateInstance); - Logs.verifyInstanceStatus(0, 3, FileDetails.status.noAction); - Logs.verifyInstanceStatus(1, 3, 'Updated'); - Logs.clickOnHotLink(1, 3, 'Updated'); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); - InstanceRecordView.verifyMarkAsSuppressed(); - InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); - InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForUpdateInstance, fileNameForUpdateInstance); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdateInstance); + Logs.verifyInstanceStatus(0, 3, FileDetails.status.noAction); + Logs.verifyInstanceStatus(1, 3, 'Updated'); + Logs.clickOnHotLink(1, 3, 'Updated'); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); + InstanceRecordView.verifyMarkAsSuppressed(); + InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); + InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); + }); }); }); 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 dd26d636b4..e25472d148 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 @@ -36,240 +36,242 @@ import Users from '../../../support/fragments/users/users'; import FileManager from '../../../support/utils/fileManager'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; -describe('ui-data-import', () => { - let user = null; - let orderNumber; - const itemBarcode = uuid(); - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const instanceTitle = 'South Asian texts in history : critical engagements with Sheldon Pollock. edited by Yigal Bronner, Whitney Cox, and Lawrence McCrea.'; - // unique file names - const nameMarcFileForCreate = `C350944 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C350944 marcFileForMatchOnPol.${getRandomPostfix()}.mrc`; - const marcFileName = `C350944 autotestFile.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('End to end scenarios', () => { + let user = null; + let orderNumber; + const itemBarcode = uuid(); + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const instanceTitle = 'South Asian texts in history : critical engagements with Sheldon Pollock. edited by Yigal Bronner, Whitney Cox, and Lawrence McCrea.'; + // unique file names + const nameMarcFileForCreate = `C350944 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C350944 marcFileForMatchOnPol.${getRandomPostfix()}.mrc`; + const marcFileName = `C350944 autotestFile.${getRandomPostfix()}.mrc`; - const collectionOfProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350944 Update Instance by POL match ${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - 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 ${getRandomPostfix()}`, - callNumberType: `"${CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350944 Create Holdings by POL match ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - 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 ${getRandomPostfix()}` } - } - ]; + const collectionOfProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C350944 Update Instance by POL match ${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + 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 ${getRandomPostfix()}`, + callNumberType: `"${CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C350944 Create Holdings by POL match ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + 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 ${getRandomPostfix()}` } + } + ]; - const matchProfile = { - profileName: `C350944 935 $a POL to Instance POL ${getRandomPostfix()}`, - incomingRecordFields: { - field: '935', - subfield:'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.pol - }; + const matchProfile = { + profileName: `C350944 935 $a POL to Instance POL ${getRandomPostfix()}`, + incomingRecordFields: { + field: '935', + subfield:'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.pol + }; - const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350944 Update Instance, and create Holdings, Item based on POL match ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; + const jobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `C350944 Update Instance, and create Holdings, Item based on POL match ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - const order = { ...NewOrder.defaultOneTimeOrder, - vendor: VENDOR_NAMES.GOBI, - orderType: 'One-time' }; + const order = { ...NewOrder.defaultOneTimeOrder, + vendor: VENDOR_NAMES.GOBI, + orderType: 'One-time' }; - const pol = { - title: 'Sport and sociology. Dominic Malcolm.', - acquisitionMethod: ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES.PHYSICAL_RESOURCE, - quantity: '1', - price: '20', - materialType: MATERIAL_TYPE_NAMES.BOOK, - createInventory: 'None' - }; + const pol = { + title: 'Sport and sociology. Dominic Malcolm.', + acquisitionMethod: ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES.PHYSICAL_RESOURCE, + quantity: '1', + price: '20', + materialType: MATERIAL_TYPE_NAMES.BOOK, + createInventory: 'None' + }; - before('login', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersView.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiInventoryViewCreateEditHoldings.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.uiInventoryViewCreateEditItems, - permissions.uiInventoryViewInstances.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersView.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiInventoryViewCreateEditHoldings.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiInventoryViewCreateEditItems, + permissions.uiInventoryViewInstances.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password); - cy.getAdminToken(); - }); - }); - - after('delete test data', () => { - // delete generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + cy.login(user.username, user.password); + cy.getAdminToken(); + }); }); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(orderId => { - Orders.deleteOrderViaApi(orderId[0].id); - }); - Users.deleteViaApi(user.userId); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${instanceTitle}"` }) - .then(instance => { - if (instance) { - InventoryInstance.deleteInstanceViaApi(instance.id); - } + + after('delete test data', () => { + // delete generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - }); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); + }); + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${instanceTitle}"` }) + .then(instance => { + if (instance) { + InventoryInstance.deleteInstanceViaApi(instance.id); + } + }); + }); - const createInstanceMappingProfile = (instanceMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); - NewFieldMappingProfile.fillCatalogedDate('###TODAY###'); - NewFieldMappingProfile.fillInstanceStatusTerm(); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); - }; + const createInstanceMappingProfile = (instanceMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); + NewFieldMappingProfile.fillCatalogedDate('###TODAY###'); + NewFieldMappingProfile.fillInstanceStatusTerm(); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); + }; - const createHoldingsMappingProfile = (holdingsMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); - NewFieldMappingProfile.fillHoldingsType(HOLDINGS_TYPE_NAMES.MONOGRAPH); - NewFieldMappingProfile.fillPermanentLocation('980$a'); - NewFieldMappingProfile.fillCallNumberType(holdingsMappingProfile.callNumberType); - NewFieldMappingProfile.fillCallNumber('980$b " " 980$c'); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); - }; + const createHoldingsMappingProfile = (holdingsMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); + NewFieldMappingProfile.fillHoldingsType(HOLDINGS_TYPE_NAMES.MONOGRAPH); + NewFieldMappingProfile.fillPermanentLocation('980$a'); + NewFieldMappingProfile.fillCallNumberType(holdingsMappingProfile.callNumberType); + NewFieldMappingProfile.fillCallNumber('980$b " " 980$c'); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); + }; - const createItemMappingProfile = (itemMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); - NewFieldMappingProfile.fillBarcode('981$b'); - NewFieldMappingProfile.fillCopyNumber('981$a'); - NewFieldMappingProfile.fillStatus(itemMappingProfile.status); - NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); - NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); - }; + const createItemMappingProfile = (itemMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); + NewFieldMappingProfile.fillBarcode('981$b'); + NewFieldMappingProfile.fillCopyNumber('981$a'); + NewFieldMappingProfile.fillStatus(itemMappingProfile.status); + NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); + NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); + }; - const addPolToOrder = (title, method, format, price, quantity, inventory, type) => { - OrderLines.addPOLine(); - OrderLines.fillPolByLinkTitle(title); - OrderLines.addAcquisitionMethod(method); - OrderLines.addOrderFormat(format); - OrderLines.fillPhysicalUnitPrice(price); - OrderLines.fillPhysicalUnitQuantity(quantity); - OrderLines.addCreateInventory(inventory); - OrderLines.addMaterialType(type); - OrderLines.savePol(); - }; + const addPolToOrder = (title, method, format, price, quantity, inventory, type) => { + OrderLines.addPOLine(); + OrderLines.fillPolByLinkTitle(title); + OrderLines.addAcquisitionMethod(method); + OrderLines.addOrderFormat(format); + OrderLines.fillPhysicalUnitPrice(price); + OrderLines.fillPhysicalUnitQuantity(quantity); + OrderLines.addCreateInventory(inventory); + OrderLines.addMaterialType(type); + OrderLines.savePol(); + }; - it('C350944 Match on POL and update related Instance with source MARC, create Holdings, Item records. (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - createInstanceMappingProfile(collectionOfProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[0].mappingProfile.name); - createHoldingsMappingProfile(collectionOfProfiles[1].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[1].mappingProfile.name); - createItemMappingProfile(collectionOfProfiles[2].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[2].mappingProfile.name); + it('C350944 Match on POL and update related Instance with source MARC, create Holdings, Item records. (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + createInstanceMappingProfile(collectionOfProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[0].mappingProfile.name); + createHoldingsMappingProfile(collectionOfProfiles[1].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[1].mappingProfile.name); + createItemMappingProfile(collectionOfProfiles[2].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[2].mappingProfile.name); - // create action profiles - collectionOfProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profiles + collectionOfProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndThreeActionProfiles(matchProfile.profileName, collectionOfProfiles[0].actionProfile.name, collectionOfProfiles[1].actionProfile.name, collectionOfProfiles[2].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchAndThreeActionProfiles(matchProfile.profileName, collectionOfProfiles[0].actionProfile.name, collectionOfProfiles[1].actionProfile.name, collectionOfProfiles[2].actionProfile.name); + NewJobProfile.saveAndClose(); + 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('marcFileForC350944.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.openFileDetails(nameMarcFileForCreate); - FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.created]); - FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.created, FileDetails.status.created]); + // 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('marcFileForC350944.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); + Logs.openFileDetails(nameMarcFileForCreate); + FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.created]); + FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.created, FileDetails.status.created]); - // create PO with POL - cy.visit(TopMenu.ordersPath); - Orders.createOrder(order, true).then(orderId => { - Orders.getOrdersApi({ limit: 1, query: `"id"=="${orderId}"` }) - .then(res => { - orderNumber = res[0].poNumber; - Orders.checkIsOrderCreated(orderNumber); - addPolToOrder(pol.title, pol.acquisitionMethod, pol.orderFormat, pol.price, pol.quantity, pol.createInventory, pol.materialType); - OrderLines.backToEditingOrder(); - Orders.openOrder(); + // create PO with POL + cy.visit(TopMenu.ordersPath); + Orders.createOrder(order, true).then(orderId => { + Orders.getOrdersApi({ limit: 1, query: `"id"=="${orderId}"` }) + .then(res => { + orderNumber = res[0].poNumber; + Orders.checkIsOrderCreated(orderNumber); + addPolToOrder(pol.title, pol.acquisitionMethod, pol.orderFormat, pol.price, pol.quantity, pol.createInventory, pol.materialType); + OrderLines.backToEditingOrder(); + Orders.openOrder(); - // change file using order number - DataImport.editMarcFile('marcFileForC350944.mrc', editedMarcFileName, ['test', '242451241241'], [orderNumber, itemBarcode]); - }); - }); + // change file using order number + DataImport.editMarcFile('marcFileForC350944.mrc', editedMarcFileName, ['test', '242451241241'], [orderNumber, itemBarcode]); + }); + }); - // upload .mrc file - cy.visit(TopMenu.dataImportPath); - DataImport.checkIsLandingPageOpened(); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(marcFileName); - FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.updated, FileDetails.status.created, FileDetails.status.created]); - FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.dash, FileDetails.status.noAction]); + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + DataImport.checkIsLandingPageOpened(); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(marcFileName); + FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.updated, FileDetails.status.created, FileDetails.status.created]); + FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.dash, FileDetails.status.noAction]); - FileDetails.openInstanceInInventory('Updated'); - InventoryInstance.checkIsInstanceUpdated(); - InventoryInstance.checkIsHoldingsCreated([`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`]); - InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); - InventoryInstance.checkIsItemCreated(itemBarcode); - InventoryInstance.viewSource(); - InventoryViewSource.verifyBarcodeInMARCBibSource(itemBarcode); - }); + FileDetails.openInstanceInInventory('Updated'); + InventoryInstance.checkIsInstanceUpdated(); + InventoryInstance.checkIsHoldingsCreated([`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`]); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); + InventoryInstance.checkIsItemCreated(itemBarcode); + InventoryInstance.viewSource(); + InventoryViewSource.verifyBarcodeInMARCBibSource(itemBarcode); + }); + }); }); 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 3d38e43b5d..36d0e970ad 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 @@ -43,335 +43,337 @@ import FileManager from '../../../support/utils/fileManager'; import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; -describe('ui-data-import', () => { - let firstOrderNumber; - let secondOrderNumber; - let vendorId; - let location; - let acquisitionMethodId; - let productIdTypeId; - let materialTypeId; - let user = {}; - let servicePointId; - const firstItem = { - title: 'Agrarianism and capitalism in early Georgia, 1732-1743 / Jay Jordan Butler.', - productId: '9782266111560', - quantity: '1', - price: '20', - barcode: uuid() - }; - const secondItem = { - title: 'Evolution of the Earth / Donald R. Prothero, Robert H. Dott, Jr.', - productId: '9783161484100', - quantity: '1', - price: '20' - }; - const editedMarcFileName = `C350590 marcFileForMatchOnPol.${getRandomPostfix()}.mrc`; - const collectionOfProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350590 Update Instance by POL match ${getRandomPostfix()}`, - update: true }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - 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 ${getRandomPostfix()}`, - update: true }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - 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 ${getRandomPostfix()}`, - update: true }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350590 Update Item by POL match ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; +describe('data-import', () => { + describe('End to end scenarios', () => { + let firstOrderNumber; + let secondOrderNumber; + let vendorId; + let location; + let acquisitionMethodId; + let productIdTypeId; + let materialTypeId; + let user = {}; + let servicePointId; + const firstItem = { + title: 'Agrarianism and capitalism in early Georgia, 1732-1743 / Jay Jordan Butler.', + productId: '9782266111560', + quantity: '1', + price: '20', + barcode: uuid() + }; + const secondItem = { + title: 'Evolution of the Earth / Donald R. Prothero, Robert H. Dott, Jr.', + productId: '9783161484100', + quantity: '1', + price: '20' + }; + const editedMarcFileName = `C350590 marcFileForMatchOnPol.${getRandomPostfix()}.mrc`; + const collectionOfProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C350590 Update Instance by POL match ${getRandomPostfix()}`, + update: true }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + 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 ${getRandomPostfix()}`, + update: true }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + 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 ${getRandomPostfix()}`, + update: true }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + 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 ${getRandomPostfix()}`, - incomingRecordFields: { - field: '935', - subfield:'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.pol } - }, - { - matchProfile: { profileName: `C350590 935 $a POL to Holdings POL ${getRandomPostfix()}`, - incomingRecordFields: { - field: '935', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.pol } - }, - { - matchProfile: { - profileName: `C350590 935 $a POL to Item POL ${getRandomPostfix()}`, - incomingRecordFields: { - field: '935', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.pol + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C350590 935 $a POL to Instance POL ${getRandomPostfix()}`, + incomingRecordFields: { + field: '935', + subfield:'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.pol } + }, + { + matchProfile: { profileName: `C350590 935 $a POL to Holdings POL ${getRandomPostfix()}`, + incomingRecordFields: { + field: '935', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.pol } + }, + { + matchProfile: { + profileName: `C350590 935 $a POL to Item POL ${getRandomPostfix()}`, + incomingRecordFields: { + field: '935', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.pol + } } - } - ]; + ]; - const specialJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350590 autotestJobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; + const specialJobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `C350590 autotestJobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - before('create test data', () => { - cy.createTempUser([ - permissions.uiOrdersCreate.gui, - permissions.uiOrdersView.gui, - permissions.uiOrdersEdit.gui, - permissions.uiInventoryViewCreateEditHoldings.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.uiInventoryViewCreateEditItems, - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiReceivingViewEditCreate.gui, - permissions.uiInventoryViewInstances.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, - permissions.remoteStorageView.gui - ]) - .then(userProperties => { - user = userProperties; - }) - .then(() => { - cy.getAdminToken() - .then(() => { - Organizations.getOrganizationViaApi({ query: `name="${VENDOR_NAMES.GOBI}"` }) - .then(organization => { - vendorId = organization.id; - }); - cy.getMaterialTypes({ query: 'name="book"' }) - .then(materialType => { - materialTypeId = materialType.id; - }); - cy.getAcquisitionMethodsApi({ query: `value="${ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM}"` }) - .then(params => { - acquisitionMethodId = params.body.acquisitionMethods[0].id; - }); - cy.getProductIdTypes({ query: 'name=="ISBN"' }) - .then(productIdType => { - productIdTypeId = productIdType.id; - }); - ServicePoints.getViaApi() - .then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) - .then(res => { - location = res; - }); - }); - }) - .then(() => { - cy.login(user.username, user.password, { path: TopMenu.ordersPath, waiter: Orders.waitLoading }); - }); - }); - }); + before('create test data', () => { + cy.createTempUser([ + permissions.uiOrdersCreate.gui, + permissions.uiOrdersView.gui, + permissions.uiOrdersEdit.gui, + permissions.uiInventoryViewCreateEditHoldings.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiInventoryViewCreateEditItems, + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiReceivingViewEditCreate.gui, + permissions.uiInventoryViewInstances.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, + permissions.remoteStorageView.gui + ]) + .then(userProperties => { + user = userProperties; + }) + .then(() => { + cy.getAdminToken() + .then(() => { + Organizations.getOrganizationViaApi({ query: `name="${VENDOR_NAMES.GOBI}"` }) + .then(organization => { + vendorId = organization.id; + }); + cy.getMaterialTypes({ query: 'name="book"' }) + .then(materialType => { + materialTypeId = materialType.id; + }); + cy.getAcquisitionMethodsApi({ query: `value="${ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM}"` }) + .then(params => { + acquisitionMethodId = params.body.acquisitionMethods[0].id; + }); + cy.getProductIdTypes({ query: 'name=="ISBN"' }) + .then(productIdType => { + productIdTypeId = productIdType.id; + }); + ServicePoints.getViaApi() + .then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) + .then(res => { + location = res; + }); + }); + }) + .then(() => { + cy.login(user.username, user.password, { path: TopMenu.ordersPath, waiter: Orders.waitLoading }); + }); + }); + }); - after('delete test data', () => { - const itemBarcode = Helper.getRandomBarcode(); + after('delete test data', () => { + const itemBarcode = Helper.getRandomBarcode(); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${firstOrderNumber}"` }) - .then(order => { - Orders.deleteOrderViaApi(order[0].id); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${firstOrderNumber}"` }) + .then(order => { + Orders.deleteOrderViaApi(order[0].id); + }); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${secondOrderNumber}"` }) + .then(order => { + Orders.deleteOrderViaApi(order[0].id); + }); + Users.deleteViaApi(user.userId); + // delete generated profiles + JobProfiles.deleteJobProfile(specialJobProfile.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); }); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${secondOrderNumber}"` }) - .then(order => { - Orders.deleteOrderViaApi(order[0].id); + collectionOfProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - Users.deleteViaApi(user.userId); - // delete generated profiles - JobProfiles.deleteJobProfile(specialJobProfile.profileName); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); - }); - collectionOfProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(firstItem.barcode); + cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${secondItem.title}"` }) + .then((instance) => { + const itemId = instance.items[0].id; + + cy.getItems({ query: `"id"=="${itemId}"` }) + .then((item) => { + item.barcode = itemBarcode; + ItemActions.editItemViaApi(item) + .then(() => { + CheckInActions.checkinItemViaApi({ + itemBarcode: item.barcode, + servicePointId, + checkInDate: new Date().toISOString(), + }) + .then(() => { + cy.deleteItemViaApi(itemId); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + }); + }); + NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + location.institutionId, + location.campusId, + location.libraryId, + location.id + ); }); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(firstItem.barcode); - cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${secondItem.title}"` }) - .then((instance) => { - const itemId = instance.items[0].id; - cy.getItems({ query: `"id"=="${itemId}"` }) - .then((item) => { - item.barcode = itemBarcode; - ItemActions.editItemViaApi(item) - .then(() => { - CheckInActions.checkinItemViaApi({ - itemBarcode: item.barcode, - servicePointId, - checkInDate: new Date().toISOString(), - }) - .then(() => { - cy.deleteItemViaApi(itemId); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); - }); - }); - NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - location.institutionId, - location.campusId, - location.libraryId, - location.id - ); - }); + const openOrder = (number) => { + Orders.searchByParameter('PO number', number); + Orders.selectFromResultsList(); + Orders.openOrder(); + }; - const openOrder = (number) => { - Orders.searchByParameter('PO number', number); - Orders.selectFromResultsList(); - Orders.openOrder(); - }; + const checkReceivedPiece = (number, title) => { + cy.visit(TopMenu.ordersPath); + Orders.resetFilters(); + Orders.searchByParameter('PO number', number); + Orders.selectFromResultsList(number); + OrderView.openPolDetails(title); + OrderLines.openReceiving(); + Receiving.checkIsPiecesCreated(title); + }; - const checkReceivedPiece = (number, title) => { - cy.visit(TopMenu.ordersPath); - Orders.resetFilters(); - Orders.searchByParameter('PO number', number); - Orders.selectFromResultsList(number); - OrderView.openPolDetails(title); - OrderLines.openReceiving(); - Receiving.checkIsPiecesCreated(title); - }; + it('C350590 Match on POL and update related Instance, Holdings, Item (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // create the first PO with POL + Orders.createOrderWithOrderLineViaApi(NewOrder.getDefaultOrder(vendorId), + BasicOrderLine.getDefaultOrderLine( + firstItem.quantity, + firstItem.title, + location.id, + materialTypeId, + acquisitionMethodId, + firstItem.price, + firstItem.price, + [{ + productId: firstItem.productId, + productIdType: productIdTypeId + }] + )) + .then(res => { + firstOrderNumber = res; - it('C350590 Match on POL and update related Instance, Holdings, Item (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // create the first PO with POL - Orders.createOrderWithOrderLineViaApi(NewOrder.getDefaultOrder(vendorId), - BasicOrderLine.getDefaultOrderLine( - firstItem.quantity, - firstItem.title, - location.id, - materialTypeId, - acquisitionMethodId, - firstItem.price, - firstItem.price, - [{ - productId: firstItem.productId, - productIdType: productIdTypeId - }] - )) - .then(res => { - firstOrderNumber = res; + Orders.checkIsOrderCreated(firstOrderNumber); + // open the first PO with POL + openOrder(firstOrderNumber); + OrderView.checkIsOrderOpened(ORDER_STATUSES.OPEN); + OrderView.checkIsItemsInInventoryCreated(firstItem.title, location.name); + // check receiving pieces are created + checkReceivedPiece(firstOrderNumber, firstItem.title); - Orders.checkIsOrderCreated(firstOrderNumber); - // open the first PO with POL - openOrder(firstOrderNumber); - OrderView.checkIsOrderOpened(ORDER_STATUSES.OPEN); - OrderView.checkIsItemsInInventoryCreated(firstItem.title, location.name); - // check receiving pieces are created - checkReceivedPiece(firstOrderNumber, firstItem.title); + // create second PO with POL + Orders.createOrderWithOrderLineViaApi(NewOrder.getDefaultOrder(vendorId), + BasicOrderLine.getDefaultOrderLine( + secondItem.quantity, + secondItem.title, + location.id, + materialTypeId, + acquisitionMethodId, + secondItem.price, + secondItem.price, + [{ + productId: secondItem.productId, + productIdType: productIdTypeId + }] + )) + .then(respo => { + secondOrderNumber = respo; - // create second PO with POL - Orders.createOrderWithOrderLineViaApi(NewOrder.getDefaultOrder(vendorId), - BasicOrderLine.getDefaultOrderLine( - secondItem.quantity, - secondItem.title, - location.id, - materialTypeId, - acquisitionMethodId, - secondItem.price, - secondItem.price, - [{ - productId: secondItem.productId, - productIdType: productIdTypeId - }] - )) - .then(respo => { - secondOrderNumber = respo; + cy.visit(TopMenu.ordersPath); + Orders.resetFilters(); + Orders.checkIsOrderCreated(secondOrderNumber); + // open the second PO + openOrder(secondOrderNumber); + OrderView.checkIsOrderOpened(ORDER_STATUSES.OPEN); + OrderView.checkIsItemsInInventoryCreated(secondItem.title, location.name); + // check receiving pieces are created + checkReceivedPiece(secondOrderNumber, secondItem.title); + }); - cy.visit(TopMenu.ordersPath); - Orders.resetFilters(); - Orders.checkIsOrderCreated(secondOrderNumber); - // open the second PO - openOrder(secondOrderNumber); - OrderView.checkIsOrderOpened(ORDER_STATUSES.OPEN); - OrderView.checkIsItemsInInventoryCreated(secondItem.title, location.name); - // check receiving pieces are created - checkReceivedPiece(secondOrderNumber, secondItem.title); - }); + DataImport.editMarcFile('marcFileForC350590.mrc', editedMarcFileName, ['test', '242451241247'], [firstOrderNumber, firstItem.barcode]); + }); - DataImport.editMarcFile('marcFileForC350590.mrc', editedMarcFileName, ['test', '242451241247'], [firstOrderNumber, firstItem.barcode]); + // create mapping and action profiles + collectionOfProfiles.forEach(profile => { + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfileForMatch(profile.mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(profile.mappingProfile.name); + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); }); - // create mapping and action profiles - collectionOfProfiles.forEach(profile => { - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfileForMatch(profile.mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(profile.mappingProfile.name); - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); - - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.createMatchProfile(profile.matchProfile); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.createMatchProfile(profile.matchProfile); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfilesForUpdate(specialJobProfile); - 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(); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfilesForUpdate(specialJobProfile); + 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 - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.checkIsLandingPageOpened(); - DataImport.uploadFile(editedMarcFileName); - JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(editedMarcFileName); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(editedMarcFileName); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1', 1); - FileDetails.checkHoldingsQuantityInSummaryTable('1', 1); - FileDetails.checkItemQuantityInSummaryTable('1', 1); - FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.updated, FileDetails.status.updated, FileDetails.status.updated]); - FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.dash, FileDetails.status.noAction, FileDetails.status.noAction, FileDetails.status.noAction]); + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.checkIsLandingPageOpened(); + DataImport.uploadFile(editedMarcFileName); + JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(editedMarcFileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(editedMarcFileName); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', 1); + FileDetails.checkHoldingsQuantityInSummaryTable('1', 1); + FileDetails.checkItemQuantityInSummaryTable('1', 1); + FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.updated, FileDetails.status.updated, FileDetails.status.updated]); + FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.dash, FileDetails.status.noAction, FileDetails.status.noAction, FileDetails.status.noAction]); - // check is items updated - FileDetails.openInstanceInInventory('Updated'); - InventoryInstance.checkIsInstanceUpdated(); - InventoryInstance.openHoldingView(); - HoldingsRecordView.checkHoldingsType(HOLDINGS_TYPE_NAMES.MONOGRAPH); - HoldingsRecordView.checkCallNumberType('Library of Congress classification'); - HoldingsRecordView.checkPermanentLocation(LOCATION_NAMES.MAIN_LIBRARY_UI); - HoldingsRecordView.close(); - InventoryInstance.openHoldingsAccordion(LOCATION_NAMES.MAIN_LIBRARY_UI); - InventoryInstance.openItemByBarcode(firstItem.barcode); - ItemRecordView.verifyItemStatus(ITEM_STATUS_NAMES.IN_PROCESS); - ItemRecordView.verifyEffectiveLocation(LOCATION_NAMES.MAIN_LIBRARY_UI); - ItemRecordView.closeDetailView(); - InventoryInstance.viewSource(); - InventoryViewSource.verifyBarcodeInMARCBibSource(firstItem.barcode); - }); + // check is items updated + FileDetails.openInstanceInInventory('Updated'); + InventoryInstance.checkIsInstanceUpdated(); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkHoldingsType(HOLDINGS_TYPE_NAMES.MONOGRAPH); + HoldingsRecordView.checkCallNumberType('Library of Congress classification'); + HoldingsRecordView.checkPermanentLocation(LOCATION_NAMES.MAIN_LIBRARY_UI); + HoldingsRecordView.close(); + InventoryInstance.openHoldingsAccordion(LOCATION_NAMES.MAIN_LIBRARY_UI); + InventoryInstance.openItemByBarcode(firstItem.barcode); + ItemRecordView.verifyItemStatus(ITEM_STATUS_NAMES.IN_PROCESS); + ItemRecordView.verifyEffectiveLocation(LOCATION_NAMES.MAIN_LIBRARY_UI); + ItemRecordView.closeDetailView(); + InventoryInstance.viewSource(); + InventoryViewSource.verifyBarcodeInMARCBibSource(firstItem.barcode); + }); + }); }); 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 6ece082cfa..da428545fd 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 @@ -33,228 +33,230 @@ import { ACQUISITION_METHOD_NAMES_IN_PROFILE } from '../../../support/constants'; -describe('ui-data-import', () => { - const item = { - title: 'Agrarianism and capitalism in early Georgia, 1732-1743 / Jay Jordan Butler.', - productId: `xyz${getRandomPostfix()}`, - vrn: uuid(), - vrnType: 'Vendor order reference number', - physicalUnitPrice: '20', - quantityPhysical: '1', - createInventory: 'Instance, holdings, item' - }; - const itemBarcode = uuid(); - let vendorId; - let locationId; - let acquisitionMethodId; - let productIdTypeId; - let materialTypeId; - let user = null; - let orderNumber; +describe('data-import', () => { + describe('End to end scenarios', () => { + const item = { + title: 'Agrarianism and capitalism in early Georgia, 1732-1743 / Jay Jordan Butler.', + productId: `xyz${getRandomPostfix()}`, + vrn: uuid(), + vrnType: 'Vendor order reference number', + physicalUnitPrice: '20', + quantityPhysical: '1', + createInventory: 'Instance, holdings, item' + }; + const itemBarcode = uuid(); + let vendorId; + let locationId; + let acquisitionMethodId; + let productIdTypeId; + let materialTypeId; + let user = null; + let orderNumber; - 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 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 = [ - { - name: instanceMatchProfileName, - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - }, - { - name: holdingsMatchProfileName, - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - }, - { - name: itemMatchProfileName, - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - }, - ]; - - const jobProfilesData = { - name: `C350591 Job profile ${getRandomPostfix()}`, - dataType: ACCEPTED_DATA_TYPE_NAMES.MARC, - matches: [ + const matchProfiles = [ { - matchName: instanceMatchProfileName, - actionName: instanceActionProfileName, + name: instanceMatchProfileName, + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, }, { - matchName: holdingsMatchProfileName, - actionName: holdingsActionProfileName, + name: holdingsMatchProfileName, + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, }, { - matchName: itemMatchProfileName, - actionName: itemActionProfileName, + name: itemMatchProfileName, + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, }, - ] - }; + ]; - before('create test data', () => { - cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersDelete.gui, - permissions.inventoryAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui, - permissions.uiReceivingViewEditCreate.gui, - permissions.uiInventoryViewInstances.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, - permissions.uiInventoryStorageModule.gui, - permissions.remoteStorageView.gui - ]).then(userProperties => { - user = userProperties; - }) - .then(() => { - cy.getAdminToken() - .then(() => { - Organizations.getOrganizationViaApi({ query: `name="${VENDOR_NAMES.GOBI}"` }) - .then(organization => { - vendorId = organization.id; - }); - cy.getMaterialTypes({ query: 'name="book"' }) - .then(materialType => { - materialTypeId = materialType.id; - }); - cy.getAcquisitionMethodsApi({ query: `value="${ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM}"` }) - .then(params => { - acquisitionMethodId = params.body.acquisitionMethods[0].id; - }); - cy.getProductIdTypes({ query: 'name=="ISSN"' }) - .then(productIdType => { - productIdTypeId = productIdType.id; - }); - cy.getLocations({ query: 'name="Main Library"' }) - .then(res => { - locationId = res.id; - }); - }) - .then(() => { - cy.login(user.username, user.password, { path: TopMenu.ordersPath, waiter: Orders.waitLoading }); - }); - }); - }); + const jobProfilesData = { + name: `C350591 Job profile ${getRandomPostfix()}`, + dataType: ACCEPTED_DATA_TYPE_NAMES.MARC, + matches: [ + { + matchName: instanceMatchProfileName, + actionName: instanceActionProfileName, + }, + { + matchName: holdingsMatchProfileName, + actionName: holdingsActionProfileName, + }, + { + matchName: itemMatchProfileName, + actionName: itemActionProfileName, + }, + ] + }; - after('delete test data', () => { - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(order => { - Orders.deleteOrderViaApi(order[0].id); - }); - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - // delete generated profiles - JobProfiles.deleteJobProfile(jobProfilesData.name); - MatchProfiles.deleteMatchProfile(instanceMatchProfileName); - MatchProfiles.deleteMatchProfile(holdingsMatchProfileName); - MatchProfiles.deleteMatchProfile(itemMatchProfileName); - ActionProfiles.deleteActionProfile(instanceActionProfileName); - ActionProfiles.deleteActionProfile(holdingsActionProfileName); - ActionProfiles.deleteActionProfile(itemActionProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileName); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - }); - - it('C350591 Match on VRN and update related Instance, Holdings, Item (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // create order with POL - Orders.createOrderWithOrderLineViaApi(NewOrder.getDefaultOrder(vendorId), - BasicOrderLine.getDefaultOrderLine( - item.quantityPhysical, - item.title, - locationId, - materialTypeId, - acquisitionMethodId, - item.physicalUnitPrice, - item.physicalUnitPrice, - [{ - productId: item.productId, - productIdType: productIdTypeId - }], - [{ - refNumberType: item.vrnType, - refNumber: item.vrn - }] - )) - .then(res => { - orderNumber = res; + before('create test data', () => { + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersDelete.gui, + permissions.inventoryAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui, + permissions.uiReceivingViewEditCreate.gui, + permissions.uiInventoryViewInstances.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, + permissions.uiInventoryStorageModule.gui, + permissions.remoteStorageView.gui + ]).then(userProperties => { + user = userProperties; + }) + .then(() => { + cy.getAdminToken() + .then(() => { + Organizations.getOrganizationViaApi({ query: `name="${VENDOR_NAMES.GOBI}"` }) + .then(organization => { + vendorId = organization.id; + }); + cy.getMaterialTypes({ query: 'name="book"' }) + .then(materialType => { + materialTypeId = materialType.id; + }); + cy.getAcquisitionMethodsApi({ query: `value="${ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM}"` }) + .then(params => { + acquisitionMethodId = params.body.acquisitionMethods[0].id; + }); + cy.getProductIdTypes({ query: 'name=="ISSN"' }) + .then(productIdType => { + productIdTypeId = productIdType.id; + }); + cy.getLocations({ query: 'name="Main Library"' }) + .then(res => { + locationId = res.id; + }); + }) + .then(() => { + cy.login(user.username, user.password, { path: TopMenu.ordersPath, waiter: Orders.waitLoading }); + }); + }); + }); - Orders.checkIsOrderCreated(orderNumber); - // open the first PO with POL - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - Orders.openOrder(); - OrderView.checkIsOrderOpened(ORDER_STATUSES.OPEN); - OrderView.checkIsItemsInInventoryCreated(item.title, 'Main Library'); - // check receiving pieces are created - cy.visit(TopMenu.ordersPath); - Orders.resetFilters(); - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - OrderView.openPolDetails(item.title); - OrderLines.openReceiving(); - Receiving.checkIsPiecesCreated(item.title); + after('delete test data', () => { + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(order => { + Orders.deleteOrderViaApi(order[0].id); }); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + // delete generated profiles + JobProfiles.deleteJobProfile(jobProfilesData.name); + MatchProfiles.deleteMatchProfile(instanceMatchProfileName); + MatchProfiles.deleteMatchProfile(holdingsMatchProfileName); + MatchProfiles.deleteMatchProfile(itemMatchProfileName); + ActionProfiles.deleteActionProfile(instanceActionProfileName); + ActionProfiles.deleteActionProfile(holdingsActionProfileName); + ActionProfiles.deleteActionProfile(itemActionProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileName); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + }); - DataImport.editMarcFile('marcFileForC350591.mrc', editedMarcFileName, ['14567-1', 'xyzt124245271818912626262'], [item.vrn, itemBarcode]); + it('C350591 Match on VRN and update related Instance, Holdings, Item (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // create order with POL + Orders.createOrderWithOrderLineViaApi(NewOrder.getDefaultOrder(vendorId), + BasicOrderLine.getDefaultOrderLine( + item.quantityPhysical, + item.title, + locationId, + materialTypeId, + acquisitionMethodId, + item.physicalUnitPrice, + item.physicalUnitPrice, + [{ + productId: item.productId, + productIdType: productIdTypeId + }], + [{ + refNumberType: item.vrnType, + refNumber: item.vrn + }] + )) + .then(res => { + orderNumber = res; - // create field mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - MatchOnVRN.creatMappingProfilesForInstance(instanceMappingProfileName) - .then(() => { - MatchOnVRN.creatMappingProfilesForHoldings(holdingsMappingProfileName); - }).then(() => { - MatchOnVRN.creatMappingProfilesForItem(itemMappingProfileName); - }); + Orders.checkIsOrderCreated(orderNumber); + // open the first PO with POL + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + Orders.openOrder(); + OrderView.checkIsOrderOpened(ORDER_STATUSES.OPEN); + OrderView.checkIsItemsInInventoryCreated(item.title, 'Main Library'); + // check receiving pieces are created + cy.visit(TopMenu.ordersPath); + Orders.resetFilters(); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderView.openPolDetails(item.title); + OrderLines.openReceiving(); + Receiving.checkIsPiecesCreated(item.title); + }); - // create action profiles - cy.visit(SettingsMenu.actionProfilePath); - MatchOnVRN.createActionProfileForVRN(instanceActionProfileName, 'Instance', instanceMappingProfileName); - MatchOnVRN.createActionProfileForVRN(holdingsActionProfileName, 'Holdings', holdingsMappingProfileName); - MatchOnVRN.createActionProfileForVRN(itemActionProfileName, 'Item', itemMappingProfileName); + DataImport.editMarcFile('marcFileForC350591.mrc', editedMarcFileName, ['14567-1', 'xyzt124245271818912626262'], [item.vrn, itemBarcode]); - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - MatchOnVRN.waitJSONSchemasLoad(); - matchProfiles.forEach(match => { - MatchOnVRN.createMatchProfileForVRN(match); - }); + // create field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + MatchOnVRN.creatMappingProfilesForInstance(instanceMappingProfileName) + .then(() => { + MatchOnVRN.creatMappingProfilesForHoldings(holdingsMappingProfileName); + }).then(() => { + MatchOnVRN.creatMappingProfilesForItem(itemMappingProfileName); + }); - // create job profiles - cy.visit(SettingsMenu.jobProfilePath); - MatchOnVRN.createJobProfileForVRN(jobProfilesData); + // create action profiles + cy.visit(SettingsMenu.actionProfilePath); + MatchOnVRN.createActionProfileForVRN(instanceActionProfileName, 'Instance', instanceMappingProfileName); + MatchOnVRN.createActionProfileForVRN(holdingsActionProfileName, 'Holdings', holdingsMappingProfileName); + MatchOnVRN.createActionProfileForVRN(itemActionProfileName, 'Item', itemMappingProfileName); - // import a file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.checkIsLandingPageOpened(); - DataImport.uploadFile(editedMarcFileName); - JobProfiles.searchJobProfileForImport(jobProfilesData.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(editedMarcFileName); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(editedMarcFileName); - FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.updated, FileDetails.status.updated, FileDetails.status.updated]); - FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.dash, FileDetails.status.noAction, FileDetails.status.noAction, FileDetails.status.noAction]); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchOnVRN.waitJSONSchemasLoad(); + matchProfiles.forEach(match => { + MatchOnVRN.createMatchProfileForVRN(match); + }); - // verify Instance, Holdings and Item details - MatchOnVRN.clickOnUpdatedHotlink(); - InventoryInstance.waitInstanceRecordViewOpened(item.title); - MatchOnVRN.verifyInstanceUpdated(); - MatchOnVRN.verifyHoldingsUpdated(); - MatchOnVRN.verifyItemUpdated(itemBarcode); - MatchOnVRN.verifyMARCBibSource(itemBarcode); - }); + // create job profiles + cy.visit(SettingsMenu.jobProfilePath); + MatchOnVRN.createJobProfileForVRN(jobProfilesData); + + // import a file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.checkIsLandingPageOpened(); + DataImport.uploadFile(editedMarcFileName); + JobProfiles.searchJobProfileForImport(jobProfilesData.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(editedMarcFileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(editedMarcFileName); + FileDetails.checkItemsStatusesInResultList(0, [FileDetails.status.created, FileDetails.status.updated, FileDetails.status.updated, FileDetails.status.updated]); + FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.dash, FileDetails.status.noAction, FileDetails.status.noAction, FileDetails.status.noAction]); + + // verify Instance, Holdings and Item details + MatchOnVRN.clickOnUpdatedHotlink(); + InventoryInstance.waitInstanceRecordViewOpened(item.title); + MatchOnVRN.verifyInstanceUpdated(); + MatchOnVRN.verifyHoldingsUpdated(); + MatchOnVRN.verifyItemUpdated(itemBarcode); + MatchOnVRN.verifyMARCBibSource(itemBarcode); + }); + }); }); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js index 497d8958e4..030ac091f2 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js @@ -22,128 +22,130 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import TopMenu from '../../../support/fragments/topMenu'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user = {}; - const fileName = `C343334autotestFile.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('End to end scenarios', () => { + let user = {}; + const fileName = `C343334autotestFile.${getRandomPostfix()}.mrc`; - const collectionOfProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `autotestMappingInstance${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `autotestActionInstance${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `autotestMappingHoldings${getRandomPostfix()}`, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `autotestActionHoldings${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `autotestMappingItem${getRandomPostfix()}`, - materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, - status: ITEM_STATUS_NAMES.AVAILABLE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `autotestActionItem${getRandomPostfix()}` } - } - ]; + const collectionOfProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `autotestMappingInstance${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `autotestActionInstance${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `autotestMappingHoldings${getRandomPostfix()}`, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `autotestActionHoldings${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `autotestMappingItem${getRandomPostfix()}`, + materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `autotestActionItem${getRandomPostfix()}` } + } + ]; - const specialJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `autotestJobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; + const specialJobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `autotestJobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - before('login', () => { - cy.createTempUser([ - permissions.dataImportUploadAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiInventoryViewInstances.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(userProperties.username, userProperties.password); - }); - }); + before('login', () => { + cy.createTempUser([ + permissions.dataImportUploadAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiInventoryViewInstances.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password); + }); + }); - const createInstanceMappingProfile = (instanceMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); - }; + const createInstanceMappingProfile = (instanceMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); + }; - const createHoldingsMappingProfile = (holdingsMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); - NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfile.permanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); - }; + const createHoldingsMappingProfile = (holdingsMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); + NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); + }; - const createItemMappingProfile = (itemMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); - NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(itemMappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); - }; + const createItemMappingProfile = (itemMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); + NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(itemMappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); + }; - after('delete test data', () => { - Users.deleteViaApi(user.userId); - // delete generated profiles - JobProfiles.deleteJobProfile(specialJobProfile.profileName); - collectionOfProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + // delete generated profiles + JobProfiles.deleteJobProfile(specialJobProfile.profileName); + collectionOfProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); }); - }); - it('C343334 MARC file import with creating a new mapping profiles, action profiles and job profile (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - createInstanceMappingProfile(collectionOfProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[0].mappingProfile.name); - createHoldingsMappingProfile(collectionOfProfiles[1].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[1].mappingProfile.name); - createItemMappingProfile(collectionOfProfiles[2].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[2].mappingProfile.name); + it('C343334 MARC file import with creating a new mapping profiles, action profiles and job profile (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // create mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + createInstanceMappingProfile(collectionOfProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[0].mappingProfile.name); + createHoldingsMappingProfile(collectionOfProfiles[1].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[1].mappingProfile.name); + createItemMappingProfile(collectionOfProfiles[2].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[2].mappingProfile.name); - collectionOfProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + collectionOfProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(specialJobProfile); - collectionOfProfiles.forEach(profile => { - NewJobProfile.linkActionProfile(profile.actionProfile); - }); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(specialJobProfile.profileName); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(specialJobProfile); + collectionOfProfiles.forEach(profile => { + NewJobProfile.linkActionProfile(profile.actionProfile); + }); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(specialJobProfile.profileName); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneMarcBib.mrc', fileName); - JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkStatusOfJobProfile(); - Logs.checkImportFile(specialJobProfile.profileName); - Logs.openFileDetails(fileName); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('oneMarcBib.mrc', fileName); + JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile(); + Logs.checkImportFile(specialJobProfile.profileName); + Logs.openFileDetails(fileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkItemsQuantityInSummaryTable(0, '1'); }); - FileDetails.checkItemsQuantityInSummaryTable(0, '1'); }); }); 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 7c9f549675..29f5f5ad19 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 @@ -20,152 +20,154 @@ 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 = {}; - let instanceHRID; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - // file name - const nameMarcFileForCreate = `C345423autotestFile.${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C345423autotestFile${getRandomPostfix()}.csv`; - const nameMarcFileForUpload = `C345423autotestFile.${getRandomPostfix()}.mrc`; - const mappingProfileFieldsForModify = { name: `autoTestMappingProf.${getRandomPostfix()}`, - 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 - }; - const matchProfile = { - profileName: `autoTestMatchProf.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001', - }, - existingRecordFields: { - field: '001', - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `autoTestJobProf.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('End to end scenarios', () => { + let user = {}; + let instanceHRID; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + // file name + const nameMarcFileForCreate = `C345423autotestFile.${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C345423autotestFile${getRandomPostfix()}.csv`; + const nameMarcFileForUpload = `C345423autotestFile.${getRandomPostfix()}.mrc`; + const mappingProfileFieldsForModify = { name: `autoTestMappingProf.${getRandomPostfix()}`, + 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 + }; + const matchProfile = { + profileName: `autoTestMatchProf.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001', + }, + existingRecordFields: { + field: '001', + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `autoTestJobProf.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.createTempUser([ - permissions.dataImportUploadAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiInventoryViewInstances.gui, - permissions.dataExportEnableModule.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading + before('login', () => { + cy.createTempUser([ + permissions.dataImportUploadAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiInventoryViewInstances.gui, + permissions.dataExportEnableModule.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); }); - }); - }); - - after('delete test data', () => { - // delete profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileFieldsForModify.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + }); - it('C345423 Verify the possibility to modify MARC Bibliographic record (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // upload a marc file for creating of the new instance, holding and item - DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.openFileDetails(nameMarcFileForCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + after('delete test data', () => { + // delete profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileFieldsForModify.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); }); - // open Instance to get hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; + it('C345423 Verify the possibility to modify MARC Bibliographic record (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + // upload a marc file for creating of the new instance, holding and item + DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); + Logs.openFileDetails(nameMarcFileForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + + // open Instance to get 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*'); + // 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); + ExportFile.exportWithDefaultJobProfile(nameForCSVFile); + ExportFile.downloadExportedMarcFile(nameMarcFileForUpload); FileManager.deleteFolder(Cypress.config('downloadsFolder')); - }); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithDefaultJobProfile(nameForCSVFile); - ExportFile.downloadExportedMarcFile(nameMarcFileForUpload); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfileFieldsForModify); - NewFieldMappingProfile.addFieldMappingsForMarc(); - 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); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfileFieldsForModify); + NewFieldMappingProfile.addFieldMappingsForMarc(); + 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); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); - // create Job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + 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(nameMarcFileForUpload); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForUpload); - Logs.checkStatusOfJobProfile(); - Logs.checkImportFile(jobProfile.profileName); - Logs.openFileDetails(nameMarcFileForUpload); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + // 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(nameMarcFileForUpload); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForUpload); + Logs.checkStatusOfJobProfile(); + Logs.checkImportFile(jobProfile.profileName); + Logs.openFileDetails(nameMarcFileForUpload); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); }); }); }); 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 da4aa297a1..09f0a769bb 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 @@ -34,441 +34,444 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import SettingsJobProfiles from '../../../support/fragments/settings/dataImport/settingsJobProfiles'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; -describe('ui-data-import', () => { - let instanceHRID = null; - // profile names for creating - const nameMarcBibMappingProfile = `autotest_marcBib_mapping_profile_${getRandomPostfix()}`; - const nameInstanceMappingProfile = `autotest_instance_mapping_profile_${getRandomPostfix()}`; - const nameHoldingsMappingProfile = `autotest_holdings_mapping_profile_${getRandomPostfix()}`; - const nameItemMappingProfile = `autotest_item_mapping_profile_${getRandomPostfix()}`; - const nameMarcBibActionProfile = `autotest_marcBib_action_profile_${getRandomPostfix()}`; - const nameInstanceActionProfile = `autotest_instance_action_profile_${getRandomPostfix()}`; - const nameHoldingsActionProfile = `autotest_holdings_action_profile_${getRandomPostfix()}`; - const nameItemActionProfile = `autotest_item_action_profile_${getRandomPostfix()}`; - const jobProfileNameCreate = `autotest_job_profile_${getRandomPostfix()}`; - const recordType = 'MARC_BIBLIOGRAPHIC'; - // file names - const nameMarcFileForImportCreate = `C343335autotestFile.${getRandomPostfix()}.mrc`; - const nameForCSVFile = `autotestFile${getRandomPostfix()}.csv`; - const nameMarcFileForImportUpdate = `C343335autotestFile${getRandomPostfix()}.mrc`; - const jobProfileNameForExport = `autoTestJobProf.${getRandomPostfix()}`; +describe('data-import', () => { + describe('End to end scenarios', () => { + let instanceHRID = null; + // profile names for creating + const nameMarcBibMappingProfile = `autotest_marcBib_mapping_profile_${getRandomPostfix()}`; + const nameInstanceMappingProfile = `autotest_instance_mapping_profile_${getRandomPostfix()}`; + const nameHoldingsMappingProfile = `autotest_holdings_mapping_profile_${getRandomPostfix()}`; + const nameItemMappingProfile = `autotest_item_mapping_profile_${getRandomPostfix()}`; + const nameMarcBibActionProfile = `autotest_marcBib_action_profile_${getRandomPostfix()}`; + const nameInstanceActionProfile = `autotest_instance_action_profile_${getRandomPostfix()}`; + const nameHoldingsActionProfile = `autotest_holdings_action_profile_${getRandomPostfix()}`; + const nameItemActionProfile = `autotest_item_action_profile_${getRandomPostfix()}`; + const jobProfileNameCreate = `autotest_job_profile_${getRandomPostfix()}`; + const recordType = 'MARC_BIBLIOGRAPHIC'; + // file names + const nameMarcFileForImportCreate = `C343335autotestFile.${getRandomPostfix()}.mrc`; + const nameForCSVFile = `autotestFile${getRandomPostfix()}.csv`; + const nameMarcFileForImportUpdate = `C343335autotestFile${getRandomPostfix()}.mrc`; + const jobProfileNameForExport = `autoTestJobProf.${getRandomPostfix()}`; - const marcBibMappingProfile = { - profile:{ - id: '', - name: nameMarcBibMappingProfile, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC, - mappingDetails: { name: 'holdings', - recordType: 'MARC_BIBLIOGRAPHIC', - marcMappingDetails: [{ - order: 0, - action: 'ADD', - field: { - field: '650', - indicator2: '4', - subfields: [{ - subfield: 'a', - data: { - text: 'Test update' - } - }] - } - }], - marcMappingOption: 'MODIFY' } - } - }; - - const instanceMappingProfile = { - profile:{ - id: '', - name: nameInstanceMappingProfile, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - } - }; - - const holdingsMappingProfile = { - profile:{ - id: '', - name: nameHoldingsMappingProfile, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - mappingDetails: { name: 'holdings', - recordType: 'HOLDINGS', - mappingFields: [ - { name: 'permanentLocationId', - enabled: true, - path: 'holdings.permanentLocationId', - value: '"Annex (KU/CC/DI/A)"' }] } - } - }; - - const itemMappingProfile = { - profile:{ - id: '', - name: nameItemMappingProfile, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - mappingDetails: { name: 'item', - recordType: 'ITEM', - mappingFields: [ - { name: 'materialType.id', - enabled: true, - path: 'item.materialType.id', - value: '"book"', - acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, - { name: 'permanentLoanType.id', - enabled: true, - path: 'item.permanentLoanType.id', - value: '"Can circulate"', - acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, - { name: 'status.name', - enabled: true, - path: 'item.status.name', - value: '"In process"' }] } - } - }; - - const marcBibActionProfile = { - profile: { - id: '', - name: nameMarcBibActionProfile, - action: 'MODIFY', - folioRecord: recordType - }, - addedRelations: [ - { - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + const marcBibMappingProfile = { + profile:{ + id: '', + name: nameMarcBibMappingProfile, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC, + mappingDetails: { name: 'holdings', + recordType: 'MARC_BIBLIOGRAPHIC', + marcMappingDetails: [{ + order: 0, + action: 'ADD', + field: { + field: '650', + indicator2: '4', + subfields: [{ + subfield: 'a', + data: { + text: 'Test update' + } + }] + } + }], + marcMappingOption: 'MODIFY' } } - ], - deletedRelations: [] - }; + }; - const instanceActionProfile = { - profile: { - id: '', - name: nameInstanceActionProfile, - action: 'CREATE', - folioRecord: 'INSTANCE' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + const instanceMappingProfile = { + profile:{ + id: '', + name: nameInstanceMappingProfile, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, } - ], - deletedRelations: [] - }; + }; - const holdingsActionProfile = { - profile: { - id: '', - name: nameHoldingsActionProfile, - action: 'CREATE', - folioRecord: 'HOLDINGS' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + const holdingsMappingProfile = { + profile:{ + id: '', + name: nameHoldingsMappingProfile, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + mappingDetails: { name: 'holdings', + recordType: 'HOLDINGS', + mappingFields: [ + { name: 'permanentLocationId', + enabled: true, + path: 'holdings.permanentLocationId', + value: '"Annex (KU/CC/DI/A)"' } + ] } } - ], - deletedRelations: [] - }; + }; - const itemActionProfile = { - profile: { - id: '', - name: nameItemActionProfile, - action: 'CREATE', - folioRecord: 'ITEM' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + const itemMappingProfile = { + profile:{ + id: '', + name: nameItemMappingProfile, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + mappingDetails: { name: 'item', + recordType: 'ITEM', + mappingFields: [ + { name: 'materialType.id', + enabled: true, + path: 'item.materialType.id', + value: '"book"', + acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, + { name: 'permanentLoanType.id', + enabled: true, + path: 'item.permanentLoanType.id', + value: '"Can circulate"', + acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, + { name: 'status.name', + enabled: true, + path: 'item.status.name', + value: '"In process"' }] } } - ], - deletedRelations: [] - }; - - // TODO redesine classes inherites - const testData = [ - { mappingProfile: marcBibMappingProfile, - actionProfile: marcBibActionProfile }, - { mappingProfile: instanceMappingProfile, - actionProfile: instanceActionProfile }, - { mappingProfile: holdingsMappingProfile, - actionProfile: holdingsActionProfile }, - { mappingProfile: itemMappingProfile, - actionProfile: itemActionProfile }, - ]; + }; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `autotestMappingInstance${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `autotestActionInstance${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `autotestMappingHoldings${getRandomPostfix()}`, - callNumberType: `"${CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS}"`, - permanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `autotestActionHoldings${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `autotestMappingItem${getRandomPostfix()}`, - materialType: `"${MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE}"`, - status: ITEM_STATUS_NAMES.AVAILABLE, - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `autotestActionItem${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; + const marcBibActionProfile = { + profile: { + id: '', + name: nameMarcBibActionProfile, + action: 'MODIFY', + folioRecord: recordType + }, + addedRelations: [ + { + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; - const collectionOfMatchProfiles = [ - { - matchProfile: { profileName: `autotestMatchInstance${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - existingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } - }, - { - matchProfile: { profileName: `autotestMatchHoldings${getRandomPostfix()}`, - incomingRecordFields: { - field: '901', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.holdingsHrid } - }, - { - matchProfile: { - profileName: `autotestMatchItem${getRandomPostfix()}`, - incomingRecordFields: { - field: '902', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemHrid - } - } - ]; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `autotestJobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - // create Field mapping profile for export - const exportMappingProfile = { - name: `autoTestMappingProf.${getRandomPostfix()}`, - holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, - holdingsMarcField: '901', - subfieldForHoldings:'$a', - itemTransformation: EXPORT_TRANSFORMATION_NAMES.ITEM_HRID, - itemMarcField:'902', - subfieldForItem:'$a' - }; + const instanceActionProfile = { + profile: { + id: '', + name: nameInstanceActionProfile, + action: 'CREATE', + folioRecord: 'INSTANCE' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; - beforeEach('create test data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - cy.getAdminToken(); + const holdingsActionProfile = { + profile: { + id: '', + name: nameHoldingsActionProfile, + action: 'CREATE', + folioRecord: 'HOLDINGS' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; - const jobProfile = { + const itemActionProfile = { profile: { - name: jobProfileNameCreate, - dataType: ACCEPTED_DATA_TYPE_NAMES.MARC + id: '', + name: nameItemActionProfile, + action: 'CREATE', + folioRecord: 'ITEM' }, - addedRelations: [], + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], deletedRelations: [] }; - testData.jobProfileForCreate = jobProfile; + // TODO redesine classes inherites + const testData = [ + { mappingProfile: marcBibMappingProfile, + actionProfile: marcBibActionProfile }, + { mappingProfile: instanceMappingProfile, + actionProfile: instanceActionProfile }, + { mappingProfile: holdingsMappingProfile, + actionProfile: holdingsActionProfile }, + { mappingProfile: itemMappingProfile, + actionProfile: itemActionProfile }, + ]; - testData.forEach(specialPair => { - cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { - cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `autotestMappingInstance${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `autotestActionInstance${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `autotestMappingHoldings${getRandomPostfix()}`, + callNumberType: `"${CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS}"`, + permanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `autotestActionHoldings${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `autotestMappingItem${getRandomPostfix()}`, + materialType: `"${MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE}"`, + status: ITEM_STATUS_NAMES.AVAILABLE, + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `autotestActionItem${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `autotestMatchInstance${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + existingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } + }, + { + matchProfile: { profileName: `autotestMatchHoldings${getRandomPostfix()}`, + incomingRecordFields: { + field: '901', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid } + }, + { + matchProfile: { + profileName: `autotestMatchItem${getRandomPostfix()}`, + incomingRecordFields: { + field: '902', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemHrid + } + } + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `autotestJobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + // create Field mapping profile for export + const exportMappingProfile = { + name: `autoTestMappingProf.${getRandomPostfix()}`, + holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, + holdingsMarcField: '901', + subfieldForHoldings:'$a', + itemTransformation: EXPORT_TRANSFORMATION_NAMES.ITEM_HRID, + itemMarcField:'902', + subfieldForItem:'$a' + }; + + beforeEach('create test data', () => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + cy.getAdminToken(); + + const jobProfile = { + profile: { + name: jobProfileNameCreate, + dataType: ACCEPTED_DATA_TYPE_NAMES.MARC + }, + addedRelations: [], + deletedRelations: [] + }; + + testData.jobProfileForCreate = jobProfile; + + testData.forEach(specialPair => { + cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { + cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + }); }); + SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) + .then((bodyWithjobProfile) => { + testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + }); }); - SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) - .then((bodyWithjobProfile) => { - testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; - }); - }); - afterEach('delete test data', () => { - // delete generated profiles - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); - }); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); - JobProfiles.deleteJobProfile(jobProfileNameCreate); - ActionProfiles.deleteActionProfile(nameMarcBibActionProfile); - ActionProfiles.deleteActionProfile(nameInstanceActionProfile); - ActionProfiles.deleteActionProfile(nameHoldingsActionProfile); - ActionProfiles.deleteActionProfile(nameItemActionProfile); - FieldMappingProfiles.deleteFieldMappingProfile(nameMarcBibMappingProfile); - FieldMappingProfiles.deleteFieldMappingProfile(nameInstanceMappingProfile); - FieldMappingProfiles.deleteFieldMappingProfile(nameHoldingsMappingProfile); - FieldMappingProfiles.deleteFieldMappingProfile(nameItemMappingProfile); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForImportUpdate}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - 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); + afterEach('delete test data', () => { + // delete generated profiles + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); }); - }); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + JobProfiles.deleteJobProfile(jobProfileNameCreate); + ActionProfiles.deleteActionProfile(nameMarcBibActionProfile); + ActionProfiles.deleteActionProfile(nameInstanceActionProfile); + ActionProfiles.deleteActionProfile(nameHoldingsActionProfile); + ActionProfiles.deleteActionProfile(nameItemActionProfile); + FieldMappingProfiles.deleteFieldMappingProfile(nameMarcBibMappingProfile); + FieldMappingProfiles.deleteFieldMappingProfile(nameInstanceMappingProfile); + FieldMappingProfiles.deleteFieldMappingProfile(nameHoldingsMappingProfile); + FieldMappingProfiles.deleteFieldMappingProfile(nameItemMappingProfile); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForImportUpdate}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + 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); + }); + }); - const createInstanceMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillCatalogedDate('###TODAY###'); - NewFieldMappingProfile.fillInstanceStatusTerm(); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; + const createInstanceMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillCatalogedDate('###TODAY###'); + NewFieldMappingProfile.fillInstanceStatusTerm(); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; - const createHoldingsMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillHoldingsType(HOLDINGS_TYPE_NAMES.ELECTRONIC); - NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); - NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); - NewFieldMappingProfile.fillCallNumber('050$a " " 050$b'); - NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u'); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; + const createHoldingsMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillHoldingsType(HOLDINGS_TYPE_NAMES.ELECTRONIC); + NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); + NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); + NewFieldMappingProfile.fillCallNumber('050$a " " 050$b'); + NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u'); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; - const createItemMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillMaterialType(profile.materialType); - NewFieldMappingProfile.addItemNotes('"Electronic bookplate"', '"Smith Family Foundation"', 'Mark for all affected records'); - NewFieldMappingProfile.fillPermanentLoanType(profile.permanentLoanType); - NewFieldMappingProfile.fillStatus(profile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; + const createItemMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillMaterialType(profile.materialType); + NewFieldMappingProfile.addItemNotes('"Electronic bookplate"', '"Smith Family Foundation"', 'Mark for all affected records'); + NewFieldMappingProfile.fillPermanentLoanType(profile.permanentLoanType); + NewFieldMappingProfile.fillStatus(profile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; - it('C343335 MARC file upload with the update of instance, holding, and items (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // upload a marc file for creating of the new instance, holding and item - DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForImportCreate); - JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); - Logs.openFileDetails(nameMarcFileForImportCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkItemsQuantityInSummaryTable(0, '1'); - FileDetails.checkItemsQuantityInSummaryTable(1, '0'); + it('C343335 MARC file upload with the update of instance, holding, and items (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + // upload a marc file for creating of the new instance, holding and item + DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForImportCreate); + JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); + Logs.openFileDetails(nameMarcFileForImportCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkItemsQuantityInSummaryTable(0, '1'); + FileDetails.checkItemsQuantityInSummaryTable(1, '0'); - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; + // 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')); - }); + // 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); + cy.visit(SettingsMenu.exportMappingProfilePath); + ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); - cy.visit(SettingsMenu.exportJobProfilePath); - ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); + cy.visit(SettingsMenu.exportJobProfilePath); + ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); - ExportFile.downloadExportedMarcFile(nameMarcFileForImportUpdate); + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); + ExportFile.downloadExportedMarcFile(nameMarcFileForImportUpdate); - // create mapping and action profiles - cy.visit(SettingsMenu.mappingProfilePath); - createInstanceMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - createItemMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + // create mapping and action profiles + cy.visit(SettingsMenu.mappingProfilePath); + createInstanceMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + createItemMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); - collectionOfMappingAndActionProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.createMatchProfile(profile.matchProfile); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.createMatchProfile(profile.matchProfile); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - // create Job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - 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(); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); + 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 - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(nameMarcFileForImportUpdate); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForImportUpdate); - Logs.openFileDetails(nameMarcFileForImportUpdate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + // upload the exported marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(nameMarcFileForImportUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForImportUpdate); + Logs.openFileDetails(nameMarcFileForImportUpdate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkItemsQuantityInSummaryTable(1, '1'); }); - FileDetails.checkItemsQuantityInSummaryTable(1, '1'); }); }); 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 352ed81879..98044e9476 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 @@ -19,131 +19,133 @@ 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 = {}; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - // unique file name to upload - const nameForMarcFile = `C17044autoTestFile${getRandomPostfix()}.mrc`; - const nameForExportedMarcFile = `C17044autoTestFile${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C17044autoTestFile${getRandomPostfix()}.csv`; - const matchProfile = { - profileName: `autoTestMatchProf.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001', - }, - existingRecordFields: { - field: '001', - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const mappingProfile = { - name: `autoTestMappingProf.${getRandomPostfix()}`, - typeValue : FOLIO_RECORD_TYPE.INSTANCE, - update: true, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - }; - const actionProfile = { - typeValue : FOLIO_RECORD_TYPE.INSTANCE, - name: `autoTestActionProf.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)', - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `autoTestJobProf.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('End to end scenarios', () => { + let user = {}; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + // unique file name to upload + const nameForMarcFile = `C17044autoTestFile${getRandomPostfix()}.mrc`; + const nameForExportedMarcFile = `C17044autoTestFile${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C17044autoTestFile${getRandomPostfix()}.csv`; + const matchProfile = { + profileName: `autoTestMatchProf.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001', + }, + existingRecordFields: { + field: '001', + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const mappingProfile = { + name: `autoTestMappingProf.${getRandomPostfix()}`, + typeValue : FOLIO_RECORD_TYPE.INSTANCE, + update: true, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, + }; + const actionProfile = { + typeValue : FOLIO_RECORD_TYPE.INSTANCE, + name: `autoTestActionProf.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)', + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `autoTestJobProf.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.createTempUser([ - permissions.dataImportUploadAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.dataExportEnableModule.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(userProperties.username, userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + before('login', () => { + cy.createTempUser([ + permissions.dataImportUploadAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.dataExportEnableModule.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + }); - it('C17044: MARC-MARC matching for 001 field (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // upload a marc file for export - DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForMarcFile); - Logs.openFileDetails(nameForMarcFile); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); + it('C17044: MARC-MARC matching for 001 field (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + // upload a marc file for export + DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForMarcFile); + Logs.openFileDetails(nameForMarcFile); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - const instanceHRID = initialInstanceHrId; + // 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 .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')); + // download exported marc file + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithDefaultJobProfile(nameForCSVFile); + ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfile(mappingProfile); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfile(mappingProfile); - // create Action profile and link it to Field mapping profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.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); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - // 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); + // 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); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); - // ensure the fields created in Field mapping profile exists in inventory - InventorySearchAndFilter.checkInstanceDetails(); + // 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 5316328753..312756ab29 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 @@ -17,161 +17,163 @@ 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', () => { - // unique file name to upload - const nameForMarcFile = `C343343autotestFile${getRandomPostfix()}.mrc`; - const nameForExportedMarcFile = `C343343autotestFile${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C343343autotestFile${getRandomPostfix()}.csv`; - - const mappingProfileForExport = { - name: `autotestMappingProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - }; - const actionProfileForExport = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `autotestActionProf${getRandomPostfix()}` - }; - const jobProfileForExport = { - ...NewJobProfile.defaultJobProfile, - profileName: `autotestJobProf${getRandomPostfix()}` - }; - const mappingProfile = { - name: `autotestMappingProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - update: true, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `autotestActionProf${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const matchProfile = { - profileName: `autotestMatchProf${getRandomPostfix()}`, - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - existingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `autotestJobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - before('login', () => { - cy.loginAsAdmin(); - cy.getAdminToken(); - }); +describe('data-import', () => { + describe('End to end scenarios', () => { + // unique file name to upload + const nameForMarcFile = `C343343autotestFile${getRandomPostfix()}.mrc`; + const nameForExportedMarcFile = `C343343autotestFile${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C343343autotestFile${getRandomPostfix()}.csv`; + + const mappingProfileForExport = { + name: `autotestMappingProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, + }; + const actionProfileForExport = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `autotestActionProf${getRandomPostfix()}` + }; + const jobProfileForExport = { + ...NewJobProfile.defaultJobProfile, + profileName: `autotestJobProf${getRandomPostfix()}` + }; + const mappingProfile = { + name: `autotestMappingProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + update: true, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `autotestActionProf${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const matchProfile = { + profileName: `autotestMatchProf${getRandomPostfix()}`, + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + existingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `autotestJobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('login', () => { + cy.loginAsAdmin(); + cy.getAdminToken(); + }); - after('delete test data', () => { - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - JobProfiles.deleteJobProfile(jobProfileForExport.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - ActionProfiles.deleteActionProfile(actionProfileForExport.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileForExport.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - }); + after('delete test data', () => { + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + JobProfiles.deleteJobProfile(jobProfileForExport.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + ActionProfiles.deleteActionProfile(actionProfileForExport.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileForExport.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + }); - it('C343343 MARC file import with matching for 999 ff field (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - // create Field mapping profile for export - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfile(mappingProfileForExport); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfileForExport.name); - - // create Action profile for export and link it to Field mapping profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfileForExport, mappingProfileForExport.name); - ActionProfiles.checkActionProfilePresented(actionProfileForExport.name); - - // create job profile for export - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfileForExport, actionProfileForExport.name); - JobProfiles.checkJobProfilePresented(jobProfileForExport.profileName); - - // upload a marc file for export - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); - JobProfiles.searchJobProfileForImport(jobProfileForExport.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForMarcFile); - Logs.openFileDetails(nameForMarcFile); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); - - // 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 + it('C343343 MARC file import with matching for 999 ff field (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // create Field mapping profile for export cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + FieldMappingProfiles.createMappingProfile(mappingProfileForExport); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfileForExport.name); - // create Action profile and link it to Field mapping profile + // create Action profile for export and link it to Field mapping profile cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + ActionProfiles.create(actionProfileForExport, mappingProfileForExport.name); + ActionProfiles.checkActionProfilePresented(actionProfileForExport.name); - // create Job profile + // create job profile for export cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfileForExport, actionProfileForExport.name); + JobProfiles.checkJobProfilePresented(jobProfileForExport.profileName); - // upload the exported marc file with 999.f.f.s fields + // upload a marc file for export 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); + DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); + JobProfiles.searchJobProfileForImport(jobProfileForExport.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(); + JobProfiles.waitFileIsImported(nameForMarcFile); + Logs.openFileDetails(nameForMarcFile); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); + + // 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 a6d2cc99bc..e8d9143f5b 100644 --- a/cypress/e2e/data-import/e2e/view-all-filter.cy.js +++ b/cypress/e2e/data-import/e2e/view-all-filter.cy.js @@ -9,112 +9,114 @@ import Logs from '../../../support/fragments/data_import/logs/logs'; import DataImport from '../../../support/fragments/data_import/dataImport'; import { JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - // Path to static file in fixtures - const pathToStaticFile = 'oneMarcBib.mrc'; - // Create unique names for MARC files - const fileNameForFailedImport = `C11113test${getRandomPostfix()}.mrc`; - const fileNameForSuccessfulImport = `C11113test${getRandomPostfix()}.mrc`; - let userName; - let jobProfileName; - let userFilterValue; - - before('create test data', () => { - cy.loginAsAdmin(); - cy.getAdminToken(); - - // Create files dynamically with given name and content in fixtures - FileManager.createFile(`cypress/fixtures/${fileNameForFailedImport}`); - // read contents of static file in fixtures - cy.readFile(`cypress/fixtures/${pathToStaticFile}`).then(content => { - // and write its contents to the file which runs successfully and create it - FileManager.createFile(`cypress/fixtures/${fileNameForSuccessfulImport}`, content); +describe('data-import', () => { + describe('End to end scenarios', () => { + // Path to static file in fixtures + const pathToStaticFile = 'oneMarcBib.mrc'; + // Create unique names for MARC files + const fileNameForFailedImport = `C11113test${getRandomPostfix()}.mrc`; + const fileNameForSuccessfulImport = `C11113test${getRandomPostfix()}.mrc`; + let userName; + let jobProfileName; + let userFilterValue; + + before('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken(); + + // Create files dynamically with given name and content in fixtures + FileManager.createFile(`cypress/fixtures/${fileNameForFailedImport}`); + // read contents of static file in fixtures + cy.readFile(`cypress/fixtures/${pathToStaticFile}`).then(content => { + // and write its contents to the file which runs successfully and create it + FileManager.createFile(`cypress/fixtures/${fileNameForSuccessfulImport}`, content); + }); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + // Upload files + // runs with errors + cy.uploadFileWithDefaultJobProfile(fileNameForFailedImport); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + // runs successfully + cy.uploadFileWithDefaultJobProfile(fileNameForSuccessfulImport); + + // Remove generated test files from fixtures after uploading + FileManager.deleteFile(`cypress/fixtures/${fileNameForSuccessfulImport}`); + FileManager.deleteFile(`cypress/fixtures/${fileNameForFailedImport}`); }); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // Upload files - // runs with errors - cy.uploadFileWithDefaultJobProfile(fileNameForFailedImport); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // runs successfully - cy.uploadFileWithDefaultJobProfile(fileNameForSuccessfulImport); - - // Remove generated test files from fixtures after uploading - FileManager.deleteFile(`cypress/fixtures/${fileNameForSuccessfulImport}`); - FileManager.deleteFile(`cypress/fixtures/${fileNameForFailedImport}`); - }); - - beforeEach(() => { - LogsViewAll.getSingleJobProfile().then(({ jobProfileInfo, runBy }) => { - const { - firstName, - lastName, - } = runBy; - jobProfileName = jobProfileInfo.name; - userFilterValue = `${firstName} ${lastName}`; - userName = firstName ? `${firstName} ${lastName}` : `${lastName}`; + beforeEach(() => { + LogsViewAll.getSingleJobProfile().then(({ jobProfileInfo, runBy }) => { + const { + firstName, + lastName, + } = runBy; + jobProfileName = jobProfileInfo.name; + userFilterValue = `${firstName} ${lastName}`; + userName = firstName ? `${firstName} ${lastName}` : `${lastName}`; + }); }); - }); - it('C11113 Filter the "View all" log screen (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - Logs.openViewAllLogs(); - LogsViewAll.checkByReverseChronologicalOrder(); - - // FILTER By "Errors in Import" - LogsViewAll.selectNofilterJobsByErrors(); - LogsViewAll.checkByErrorsInImport(JOB_STATUS_NAMES.COMPLETED); - LogsViewAll.resetAllFilters(); - LogsViewAll.selectYesfilterJobsByErrors(); - LogsViewAll.checkByErrorsInImport(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS, JOB_STATUS_NAMES.FAILED); - LogsViewAll.resetAllFilters(); - - // FILTER By "Date" - const startedDate = new Date(); - const completedDate = startedDate; - - // format date as YYYY-MM-DD - const formattedStart = DateTools.getFormattedDate({ date: startedDate }); - - // api endpoint expects completedDate increased by 1 day - completedDate.setDate(completedDate.getDate() + 1); - - LogsViewAll.filterJobsByDate({ from: formattedStart, end: formattedStart }); - - const formattedEnd = DateTools.getFormattedDate({ date: completedDate }); - LogsViewAll.checkByDate({ from: formattedStart, end: formattedEnd }); - LogsViewAll.resetAllFilters(); - - // FILTER By "Job profile" - LogsViewAll.filterJobsByJobProfile(jobProfileName); - LogsViewAll.checkByJobProfileName(jobProfileName); - LogsViewAll.resetAllFilters(); - - // FILTER By "User" - LogsViewAll.openUserIdAccordion(); - LogsViewAll.filterJobsByUser(userFilterValue); - LogsViewAll.checkByUserName(userName); - - LogsViewAll.resetAllFilters(); - - // FILTER By "Inventory single record imports" - LogsViewAll.openInventorysingleRecordImportsAccordion(); - LogsViewAll.singleRecordImportsStatuses.forEach(filter => { - // need some waiting until checkboxes become clickable after resetting filters - cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting - LogsViewAll.filterJobsByInventorySingleRecordImports(filter); - LogsViewAll.checkByInventorySingleRecord(filter); + it('C11113 Filter the "View all" log screen (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + Logs.openViewAllLogs(); + LogsViewAll.checkByReverseChronologicalOrder(); + + // FILTER By "Errors in Import" + LogsViewAll.selectNofilterJobsByErrors(); + LogsViewAll.checkByErrorsInImport(JOB_STATUS_NAMES.COMPLETED); LogsViewAll.resetAllFilters(); - }); + LogsViewAll.selectYesfilterJobsByErrors(); + LogsViewAll.checkByErrorsInImport(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS, JOB_STATUS_NAMES.FAILED); + LogsViewAll.resetAllFilters(); + + // FILTER By "Date" + const startedDate = new Date(); + const completedDate = startedDate; + + // format date as YYYY-MM-DD + const formattedStart = DateTools.getFormattedDate({ date: startedDate }); + + // api endpoint expects completedDate increased by 1 day + completedDate.setDate(completedDate.getDate() + 1); - // FILTER By more than one filter - // in this case, filter by "User" and "Errors in Import" + LogsViewAll.filterJobsByDate({ from: formattedStart, end: formattedStart }); - LogsViewAll.selectNofilterJobsByErrors(); - LogsViewAll.filterJobsByUser(userFilterValue); - LogsViewAll.checkByErrorsInImportAndUser(JOB_STATUS_NAMES.COMPLETED, userName); - LogsViewAll.resetAllFilters(); + const formattedEnd = DateTools.getFormattedDate({ date: completedDate }); + LogsViewAll.checkByDate({ from: formattedStart, end: formattedEnd }); + LogsViewAll.resetAllFilters(); + + // FILTER By "Job profile" + LogsViewAll.filterJobsByJobProfile(jobProfileName); + LogsViewAll.checkByJobProfileName(jobProfileName); + LogsViewAll.resetAllFilters(); + + // FILTER By "User" + LogsViewAll.openUserIdAccordion(); + LogsViewAll.filterJobsByUser(userFilterValue); + LogsViewAll.checkByUserName(userName); + + LogsViewAll.resetAllFilters(); + + // FILTER By "Inventory single record imports" + LogsViewAll.openInventorysingleRecordImportsAccordion(); + LogsViewAll.singleRecordImportsStatuses.forEach(filter => { + // need some waiting until checkboxes become clickable after resetting filters + cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting + LogsViewAll.filterJobsByInventorySingleRecordImports(filter); + LogsViewAll.checkByInventorySingleRecord(filter); + LogsViewAll.resetAllFilters(); + }); + + // FILTER By more than one filter + // in this case, filter by "User" and "Errors in Import" + + LogsViewAll.selectNofilterJobsByErrors(); + LogsViewAll.filterJobsByUser(userFilterValue); + LogsViewAll.checkByErrorsInImportAndUser(JOB_STATUS_NAMES.COMPLETED, userName); + LogsViewAll.resetAllFilters(); + }); }); }); diff --git a/cypress/e2e/data-import/e2e/view-all.cy.js b/cypress/e2e/data-import/e2e/view-all.cy.js index 7f0da2fc25..c874bcfb65 100644 --- a/cypress/e2e/data-import/e2e/view-all.cy.js +++ b/cypress/e2e/data-import/e2e/view-all.cy.js @@ -7,50 +7,52 @@ import DataImport from '../../../support/fragments/data_import/dataImport'; import DevTeams from '../../../support/dictionary/devTeams'; import Logs from '../../../support/fragments/data_import/logs/logs'; -describe('ui-data-import', () => { - let id; - // Create unique file name with given type to upload - const fileType = 'mrc'; - const uniqueFileName = `C11112test${getRandomPostfix()}.${fileType}`; - - before('create test data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - cy.getAdminToken(); - - // create dynamically file with given name in fixtures - FileManager.createFile(`cypress/fixtures/${uniqueFileName}`); - - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // remove generated test file from fixtures after uploading - cy.uploadFileWithDefaultJobProfile(uniqueFileName); - FileManager.deleteFile(`cypress/fixtures/${uniqueFileName}`); - }); +describe('data-import', () => { + describe('End to end scenarios', () => { + let id; + // Create unique file name with given type to upload + const fileType = 'mrc'; + const uniqueFileName = `C11112test${getRandomPostfix()}.${fileType}`; + + before('create test data', () => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + cy.getAdminToken(); + + // create dynamically file with given name in fixtures + FileManager.createFile(`cypress/fixtures/${uniqueFileName}`); + + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + // remove generated test file from fixtures after uploading + cy.uploadFileWithDefaultJobProfile(uniqueFileName); + FileManager.deleteFile(`cypress/fixtures/${uniqueFileName}`); + }); - beforeEach(() => { - // fetch dynamic data from server - LogsViewAll.getSingleJobProfile().then(({ hrId }) => { - id = hrId; + beforeEach(() => { + // fetch dynamic data from server + LogsViewAll.getSingleJobProfile().then(({ hrId }) => { + id = hrId; + }); }); - }); - it('C11112 Search the "View all" log screen (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - Logs.openViewAllLogs(); + it('C11112 Search the "View all" log screen (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + Logs.openViewAllLogs(); - LogsViewAll.options.forEach((option) => { - LogsViewAll.selectOption(option); - // when option is "ID", search with hrId otherwise, with file name - const term = option === 'ID' ? `${id}` : uniqueFileName; + LogsViewAll.options.forEach((option) => { + LogsViewAll.selectOption(option); + // when option is "ID", search with hrId otherwise, with file name + const term = option === 'ID' ? `${id}` : uniqueFileName; - LogsViewAll.searchWithTerm(term); + LogsViewAll.searchWithTerm(term); - if (option === 'ID') { - LogsViewAll.checkById({ id }); - } else { - // file name is always unique - // so, there is always one row - LogsViewAll.checkRowsCount(1); - } + if (option === 'ID') { + LogsViewAll.checkById({ id }); + } else { + // file name is always unique + // so, there is always one row + LogsViewAll.checkRowsCount(1); + } + }); }); }); }); 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 e989da9eeb..e457b072cb 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 @@ -9,54 +9,56 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - const jobProfileToRun = 'Default - Create SRS MARC Authority'; - const fileName = `C359207autotestFile.${getRandomPostfix()}.mrc`; - // eslint-disable-next-line +describe('data-import', () => { + describe('Importing MARC Authority files', () => { + let user; + const jobProfileToRun = 'Default - Create SRS MARC Authority'; + const fileName = `C359207autotestFile.${getRandomPostfix()}.mrc`; + // eslint-disable-next-line const error = '{\"error\":\"A new MARC-Authority was not created because the incoming record already contained a 999ff$s or 999ff$i field\"}'; - before('login', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, - { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - after('delete user', () => { - Users.deleteViaApi(user.userId); - }); + after('delete user', () => { + Users.deleteViaApi(user.userId); + }); - 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] }, () => { + 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 - DataImport.verifyUploadState(); - // upload the first .mrc file - DataImport.uploadFile('marcAuthFileC359207.mrc', fileName); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkStatusOfJobProfile('Completed with errors'); - Logs.openFileDetails(fileName); - cy.wrap([0, 6]).each((rowNumber) => { - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.authority - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, rowNumber); + DataImport.verifyUploadState(); + // upload the first .mrc file + DataImport.uploadFile('marcAuthFileC359207.mrc', fileName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile('Completed with errors'); + Logs.openFileDetails(fileName); + cy.wrap([0, 6]).each((rowNumber) => { + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.authority + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, rowNumber); + }); }); + cy.wrap([1, 2, 3, 4, 5, 7]).each((rowNumber) => { + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc, rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.error, FileDetails.columnNameInResultList.error, rowNumber); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('2'); + FileDetails.checkAuthorityQuantityInSummaryTable('2'); + // check No action counter in the Summary table + FileDetails.checkSrsRecordQuantityInSummaryTable('6', 2); + FileDetails.verifyErrorMessage(error, 1); }); - cy.wrap([1, 2, 3, 4, 5, 7]).each((rowNumber) => { - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc, rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.error, FileDetails.columnNameInResultList.error, rowNumber); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('2'); - FileDetails.checkAuthorityQuantityInSummaryTable('2'); - // check No action counter in the Summary table - FileDetails.checkSrsRecordQuantityInSummaryTable('6', 2); - FileDetails.verifyErrorMessage(error, 1); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js index 7d04fbf5eb..84cceff019 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js @@ -12,83 +12,85 @@ import SettingsMenu from '../../../support/fragments/settingsMenu'; import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; import { ACCEPTED_DATA_TYPE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -describe('Data Import -> Importing MARC Authority files', { retries: 2 }, () => { - const testData = {}; - const jobProfileToRun = 'Default - Create SRS MARC Authority'; - const createdJobProfile = { - profileName: 'Update MARC authority records - 999 ff $s', - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, - }; - let fileName; - const createdAuthorityIDs = []; +describe('data-import', () => { + describe('Importing MARC Authority files', { retries: 2 }, () => { + const testData = {}; + const jobProfileToRun = 'Default - Create SRS MARC Authority'; + const createdJobProfile = { + profileName: 'Update MARC authority records - 999 ff $s', + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, + }; + let fileName; + const createdAuthorityIDs = []; - before('Creating data', () => { - cy.createTempUser([ - Permissions.moduleDataImportEnabled.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, - ]).then(createdUserProperties => { - testData.userProperties = createdUserProperties; - }); - - cy.loginAsAdmin({ path: SettingsMenu.jobProfilePath, waiter: JobProfiles.waitLoadingList }) - .then(() => { - JobProfiles.createJobProfile(createdJobProfile); - NewJobProfile.linkActionProfileByName('Default - Create MARC Authority'); - NewJobProfile.saveAndClose(); + before('Creating data', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; }); - }); - beforeEach('Login to the application', () => { - fileName = `testMarcFile.${getRandomPostfix()}.mrc`; + cy.loginAsAdmin({ path: SettingsMenu.jobProfilePath, waiter: JobProfiles.waitLoadingList }) + .then(() => { + JobProfiles.createJobProfile(createdJobProfile); + NewJobProfile.linkActionProfileByName('Default - Create MARC Authority'); + NewJobProfile.saveAndClose(); + }); + }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); + beforeEach('Login to the application', () => { + fileName = `testMarcFile.${getRandomPostfix()}.mrc`; - afterEach('Deleting data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); - after('Deleting data', () => { - createdAuthorityIDs.forEach(id => { - MarcAuthority.deleteViaAPI(id); + afterEach('Deleting data', () => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); }); - JobProfiles.deleteJobProfile(createdJobProfile.profileName); - Users.deleteViaApi(testData.userProperties.userId); - }); + after('Deleting data', () => { + createdAuthorityIDs.forEach(id => { + MarcAuthority.deleteViaAPI(id); + }); - it('C350666 Create a MARC authority record via data import (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - DataImport.uploadFile('test-auth-file.mrc', fileName); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileName); - Logs.getCreatedItemsID().then(link => { - createdAuthorityIDs.push(link.split('/')[5]); + JobProfiles.deleteJobProfile(createdJobProfile.profileName); + Users.deleteViaApi(testData.userProperties.userId); }); - Logs.goToTitleLink('Created'); - MarcAuthority.contains(ACCEPTED_DATA_TYPE_NAMES.MARC); - }); - it('C350668 Update a MARC authority record via data import. Record match with 999 ff $s (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - DataImport.uploadFile('test-auth-file.mrc', fileName); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(createdJobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileName); - Logs.getCreatedItemsID().then(link => { - createdAuthorityIDs.push(link.split('/')[5]); + it('C350666 Create a MARC authority record via data import (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + DataImport.uploadFile('test-auth-file.mrc', fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileName); + Logs.getCreatedItemsID().then(link => { + createdAuthorityIDs.push(link.split('/')[5]); + }); + Logs.goToTitleLink('Created'); + MarcAuthority.contains(ACCEPTED_DATA_TYPE_NAMES.MARC); + }); + + it('C350668 Update a MARC authority record via data import. Record match with 999 ff $s (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + DataImport.uploadFile('test-auth-file.mrc', fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(createdJobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileName); + Logs.getCreatedItemsID().then(link => { + createdAuthorityIDs.push(link.split('/')[5]); + }); + Logs.goToTitleLink('Created'); + MarcAuthority.contains(ACCEPTED_DATA_TYPE_NAMES.MARC); }); - Logs.goToTitleLink('Created'); - MarcAuthority.contains(ACCEPTED_DATA_TYPE_NAMES.MARC); }); }); 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 23e8b64eb5..bca180da2e 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 @@ -23,229 +23,231 @@ import ExportFile from '../../../support/fragments/data-export/exportFile'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import FileManager from '../../../support/utils/fileManager'; -describe('ui-data-import', () => { - let instanceHrid = null; - let instanceHridForReimport = null; - let exportedFileName = null; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - // resource identifiers - const resourceIdentifiers = [ - { type: 'OCLC', value: '(OCoLC)26493177' }, - { type: 'System control number', value: '(ICU)1299036' } - ]; - const instanceStatusTerm = INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED; - const catalogedDate = '###TODAY###'; - - // unique file names - const nameMarcFileForCreate = `C17039 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C17039 fileWith999Field.${getRandomPostfix()}.mrc`; - const fileNameAfterUpload = `C17039 uploadedFile.${getRandomPostfix()}.mrc`; - - const matchProfile = { - profileName: `C17039 match profile ${getRandomPostfix()}`, - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 'i' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - existingRecordOption: NewMatchProfile.optionsList.instanceUuid - }; - - const mappingProfile = { - name: `C17039 mapping profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE - }; - - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17039 action profile ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - - const jobProfile = { - profileName: `C17039 job profile ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - before('create test data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - cy.getAdminToken() - .then(() => { - const fileName = `C17039autotestFile.${getRandomPostfix()}.mrc`; - - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneMarcBib.mrc', fileName); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.openFileDetails(fileName); - - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHridForReimport = initialInstanceHrId; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let instanceHrid = null; + let instanceHridForReimport = null; + let exportedFileName = null; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + // resource identifiers + const resourceIdentifiers = [ + { type: 'OCLC', value: '(OCoLC)26493177' }, + { type: 'System control number', value: '(ICU)1299036' } + ]; + const instanceStatusTerm = INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED; + const catalogedDate = '###TODAY###'; + + // unique file names + const nameMarcFileForCreate = `C17039 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C17039 fileWith999Field.${getRandomPostfix()}.mrc`; + const fileNameAfterUpload = `C17039 uploadedFile.${getRandomPostfix()}.mrc`; + + const matchProfile = { + profileName: `C17039 match profile ${getRandomPostfix()}`, + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 'i' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.instanceUuid + }; + + const mappingProfile = { + name: `C17039 mapping profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE + }; + + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C17039 action profile ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + + const jobProfile = { + profileName: `C17039 job profile ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('create test data', () => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + cy.getAdminToken() + .then(() => { + const fileName = `C17039autotestFile.${getRandomPostfix()}.mrc`; + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('oneMarcBib.mrc', fileName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.openFileDetails(fileName); + + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHridForReimport = initialInstanceHrId; + }); }); - }); - }); - - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHridForReimport}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); - - it('C17039 Test 001/003/035 handling for New and Updated SRS records (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFilrForC17039.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('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]] - ); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHridForReimport}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); }); + }); - // 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 + it('C17039 Test 001/003/035 handling for New and Updated SRS records (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // upload a marc file 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); + DataImport.uploadFile('marcFilrForC17039.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameAfterUpload); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); 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); - InventorySearchAndFilter.searchInstanceByHRID(instanceHridForReimport); - InventorySearchAndFilter.closeInstanceDetailPane(); - InventorySearchAndFilter.selectResultCheckboxes(1); - InventorySearchAndFilter.exportInstanceAsMarc(); - - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.getExportedFileNameViaApi() - .then(name => { - exportedFileName = name; - - ExportFile.downloadExportedMarcFile(exportedFileName); - // upload the exported marc file + Logs.openFileDetails(nameMarcFileForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('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]] + ); + }); + + // 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.uploadExportedFile(exportedFileName); + DataImport.uploadFile(editedMarcFileName, fileNameAfterUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(exportedFileName); + JobProfiles.waitFileIsImported(fileNameAfterUpload); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(exportedFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); + 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'); }); - // check instance is updated - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHridForReimport); - InventoryInstance.checkIsInstanceUpdated(); + // export instance + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHridForReimport); + InventorySearchAndFilter.closeInstanceDetailPane(); + InventorySearchAndFilter.selectResultCheckboxes(1); + InventorySearchAndFilter.exportInstanceAsMarc(); + + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.getExportedFileNameViaApi() + .then(name => { + exportedFileName = name; + + ExportFile.downloadExportedMarcFile(exportedFileName); + // upload the exported marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(exportedFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(exportedFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(exportedFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + }); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHridForReimport); - InventoryViewSource.notContains(`\\$a${instanceHridForReimport}`); + // check instance is updated + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHridForReimport); + InventoryInstance.checkIsInstanceUpdated(); + + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHridForReimport); + InventoryViewSource.notContains(`\\$a${instanceHridForReimport}`); + }); }); }); 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 index 166b346836..f606e488d8 100644 --- 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 @@ -27,244 +27,246 @@ import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRec 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 - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + 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; + 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); + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); }); - // 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); + + 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] }, () => { + 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); + 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 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); + // 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; + // 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]); - }); + // 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); + // 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[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); + 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 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 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); + // 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'); + // 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 - ); - }); + 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 9e7b9f3a34..ff3dce67d7 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 @@ -19,103 +19,105 @@ import InventorySearchAndFilter from '../../../support/fragments/inventory/inven import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; -describe('ui-data-import', () => { - let instanceHrid; - const quantityOfItems = '1'; - const marcFileForCreate = `C11103 autotestFile.${getRandomPostfix()}.mrc`; - const mappingProfile = { - name: `C11103 autotest mapping profile.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - actionForSuppress: 'Mark for all affected records', - catalogedDate: '"2021-02-24"', - catalogedDateUI: '2021-02-24', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, - statisticalCode: 'ARL (Collection stats): books - Book, print (books)', - statisticalCodeUI: 'Book, print (books)', - natureOfContent: 'bibliography' - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C11103 autotest action profile.${getRandomPostfix()}`, - action: 'Create (all record types except MARC Authority or MARC Holdings)' - }; - const jobProfile = { - profileName: `C11103 autotest job profile.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let instanceHrid; + const quantityOfItems = '1'; + const marcFileForCreate = `C11103 autotestFile.${getRandomPostfix()}.mrc`; + const mappingProfile = { + name: `C11103 autotest mapping profile.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + actionForSuppress: 'Mark for all affected records', + catalogedDate: '"2021-02-24"', + catalogedDateUI: '2021-02-24', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, + statisticalCode: 'ARL (Collection stats): books - Book, print (books)', + statisticalCodeUI: 'Book, print (books)', + natureOfContent: 'bibliography' + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C11103 autotest action profile.${getRandomPostfix()}`, + action: 'Create (all record types except MARC Authority or MARC Holdings)' + }; + const jobProfile = { + profileName: `C11103 autotest job profile.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - cy.getAdminToken(); - }); + before('login', () => { + cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + cy.getAdminToken(); + }); - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C11103 Action and field mapping: Create an instance (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C11103 Action and field mapping: Create an instance (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profile - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.addStaffSuppress(mappingProfile.actionForSuppress); - NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.actionForSuppress); - NewFieldMappingProfile.addPreviouslyHeld(mappingProfile.actionForSuppress); - NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.statusTerm); - NewFieldMappingProfile.addStatisticalCode(mappingProfile.statisticalCode, 8); - NewFieldMappingProfile.addNatureOfContentTerms(mappingProfile.natureOfContent); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addStaffSuppress(mappingProfile.actionForSuppress); + NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.actionForSuppress); + NewFieldMappingProfile.addPreviouslyHeld(mappingProfile.actionForSuppress); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.statusTerm); + NewFieldMappingProfile.addStatisticalCode(mappingProfile.statisticalCode, 8); + NewFieldMappingProfile.addNatureOfContentTerms(mappingProfile.natureOfContent); + 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 action 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(actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName(actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - // upload a marc file for creating of the new instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileForCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); + // upload a marc file for creating of the new instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + // 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/add-subfields-to-linked-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js index f940fb4ab4..1e9ff61563 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js @@ -22,209 +22,211 @@ import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthor import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; -describe('Importing MARC Bib files', () => { - const testData = {}; - // unique file name to upload - const nameForUpdatedMarcFile = `C385673autotestFile${getRandomPostfix()}.mrc`; - const nameForExportedMarcFile = `C385673autotestFile${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C385673autotestFile${getRandomPostfix()}.csv`; - const mappingProfile = { - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - update: true, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const matchProfile = { - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - existingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - const marcFiles = [ - { - marc: 'marcBibFileForC385673.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - numOfRecords: 1 - }, - { - marc: 'marcFileForC385673.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 3 - } - ]; - const linkingTagAndValues = [ - { - rowIndex: 33, - value: 'Coates, Ta-Nehisi', - tag: 100 - }, - { - rowIndex: 75, - value: 'Chin, Staceyann,', - tag: 700 - }, - { - rowIndex: 78, - value: 'Lee, Stan, 1922-2018', - tag: 700 - }, - ]; - const createdAuthorityIDs = []; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const testData = {}; + // unique file name to upload + const nameForUpdatedMarcFile = `C385673autotestFile${getRandomPostfix()}.mrc`; + const nameForExportedMarcFile = `C385673autotestFile${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C385673autotestFile${getRandomPostfix()}.csv`; + const mappingProfile = { + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + update: true, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const matchProfile = { + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + existingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const marcFiles = [ + { + marc: 'marcBibFileForC385673.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1 + }, + { + marc: 'marcFileForC385673.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 3 + } + ]; + const linkingTagAndValues = [ + { + rowIndex: 33, + value: 'Coates, Ta-Nehisi', + tag: 100 + }, + { + rowIndex: 75, + value: 'Chin, Staceyann,', + tag: 700 + }, + { + rowIndex: 78, + value: 'Lee, Stan, 1922-2018', + tag: 700 + }, + ]; + const createdAuthorityIDs = []; - before('Creating user', () => { - cy.createTempUser([ - Permissions.moduleDataImportEnabled.gui, - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - Permissions.dataExportEnableApp.gui, - ]).then(createdUserProperties => { - testData.userProperties = createdUserProperties; + before('Creating user', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + Permissions.dataExportEnableApp.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]); - }); - } + 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.loginAsAdmin().then(() => { + cy.loginAsAdmin().then(() => { // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); - 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.openNewJobProfileForm(); - NewJobProfile.fillJobProfile(jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileByName(actionProfile.name); - // waiter needed for the action profile to be linked - cy.wait(1000); - NewJobProfile.saveAndClose(); - JobProfiles.waitLoadingList(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - }); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); + 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.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileByName(actionProfile.name); + // waiter needed for the action profile to be linked + cy.wait(1000); + NewJobProfile.saveAndClose(); + JobProfiles.waitLoadingList(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); }); - }); - after('delete test data', () => { - Users.deleteViaApi(testData.userProperties.userId); - InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); - createdAuthorityIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); + after('delete test data', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + createdAuthorityIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + }); + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); }); - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); - }); - it('C385673 Add controllable, non-controllable subfields to one of the linked repeatable (multiple repeatable fields with same indicators) and not repeatable fields (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - InventoryInstance.searchByTitle(createdAuthorityIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - linkingTagAndValues.forEach(linking => { - QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(linking.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.rowIndex); - }); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); + it('C385673 Add controllable, non-controllable subfields to one of the linked repeatable (multiple repeatable fields with same indicators) and not repeatable fields (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + linkingTagAndValues.forEach(linking => { + QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(linking.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.rowIndex); + }); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); - // download .csv file - 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#####'); + // download .csv file + 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#####'); - DataImport.editMarcFile( - nameForExportedMarcFile, - nameForUpdatedMarcFile, - ['aCoates, Ta-Nehisi', 'aLee, Stan,'], - ['aCoates, Ta-NehisiaNarrator9f01479eWriter', 'aLee, Stan,aAnother author9f01479eAUTHOR'] - ); + DataImport.editMarcFile( + nameForExportedMarcFile, + nameForUpdatedMarcFile, + ['aCoates, Ta-Nehisi', 'aLee, Stan,'], + ['aCoates, Ta-NehisiaNarrator9f01479eWriter', 'aLee, Stan,aAnother author9f01479eAUTHOR'] + ); - // upload the exported marc file with 999.f.f.s fields - cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); - Logs.checkStatusOfJobProfile('Completed'); - Logs.openFileDetails(nameForUpdatedMarcFile); - Logs.clickOnHotLink(0, 3, 'Updated'); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterLinking(33, '100', '1', '\\', '$a Coates, Ta-Nehisi', '$e Writer $e author.', '$0 id.loc.gov/authorities/names/n2008001084', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(76, '700', '1', '\\', '$a Lee, Stan, $d 1922-2018', '$e AUTHOR $e creator', '$0 id.loc.gov/authorities/names/n83169267', ''); + // upload the exported marc file with 999.f.f.s fields + cy.visit(TopMenu.dataImportPath); + DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(nameForUpdatedMarcFile); + Logs.clickOnHotLink(0, 3, 'Updated'); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterLinking(33, '100', '1', '\\', '$a Coates, Ta-Nehisi', '$e Writer $e author.', '$0 id.loc.gov/authorities/names/n2008001084', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(76, '700', '1', '\\', '$a Lee, Stan, $d 1922-2018', '$e AUTHOR $e creator', '$0 id.loc.gov/authorities/names/n83169267', ''); - QuickMarcEditor.closeEditorPane(); - InventoryInstance.viewSource(); - InventoryInstance.checkExistanceOfAuthorityIconInMarcViewPane(); - MarcAuthorities.checkFieldAndContentExistence('100', '‡9'); - MarcAuthorities.checkFieldAndContentExistence('700', '‡9'); + QuickMarcEditor.closeEditorPane(); + InventoryInstance.viewSource(); + InventoryInstance.checkExistanceOfAuthorityIconInMarcViewPane(); + MarcAuthorities.checkFieldAndContentExistence('100', '‡9'); + MarcAuthorities.checkFieldAndContentExistence('700', '‡9'); + }); }); }); 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 e60933bafc..d27ba016b5 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 @@ -32,176 +32,178 @@ import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRec import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; import FileManager from '../../../support/utils/fileManager'; -describe('ui-data-import', () => { - let user; - let instanceHrid; - let exportedFileName; - const quantityOfItems = '1'; - const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - 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 ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - 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 ${getRandomPostfix()}` } - } - ]; - const matchProfile = { - profileName: `C368009 001 to Instance HRID ${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid - }; - const jobProfile = { - profileName: `C368009 Testing SRS MARC bib ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let instanceHrid; + let exportedFileName; + const quantityOfItems = '1'; + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + 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 ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + 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 ${getRandomPostfix()}` } + } + ]; + const matchProfile = { + profileName: `C368009 001 to Instance HRID ${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; + const jobProfile = { + profileName: `C368009 Testing SRS MARC bib ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.settingsDataImportEnabled.gui, - permissions.dataExportEnableApp.gui - ]) - .then(userProperties => { - user = userProperties; + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.settingsDataImportEnabled.gui, + permissions.dataExportEnableApp.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading + cy.login(user.username, user.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); + // create Instance with source = MARC + DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); + // get hrid of created instance + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileName); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); }); - // create Instance with source = MARC - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); - // get hrid of created instance - JobProfiles.waitFileIsImported(fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileName); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); - }); - }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); - Users.deleteViaApi(user.userId); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); - 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); + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - }); + Users.deleteViaApi(user.userId); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); + 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); + }); + }); - const createItemMappingProfile = (itemMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); - NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(itemMappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); - }; + const createItemMappingProfile = (itemMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); + NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(itemMappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); + }; - const createHoldingsMappingProfile = (holdingsMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); - NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfile.permanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); - }; + const createHoldingsMappingProfile = (holdingsMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); + NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); + }; - it('C368009 Verify that no created SRS is present when job profile does not have create instance action: Case 2: Create holdings and item (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C368009 Verify that no created SRS is present when job profile does not have create instance action: Case 2: Create holdings and item (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - createItemMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + cy.visit(SettingsMenu.mappingProfilePath); + createItemMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(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 action profiles + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - const selectedRecords = 1; - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.bySource(ACCEPTED_DATA_TYPE_NAMES.MARC); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventorySearchAndFilter.closeInstanceDetailPane(); - InventorySearchAndFilter.selectResultCheckboxes(selectedRecords); - InventorySearchAndFilter.exportInstanceAsMarc(); + const selectedRecords = 1; + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.bySource(ACCEPTED_DATA_TYPE_NAMES.MARC); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventorySearchAndFilter.closeInstanceDetailPane(); + InventorySearchAndFilter.selectResultCheckboxes(selectedRecords); + InventorySearchAndFilter.exportInstanceAsMarc(); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.getExportedFileNameViaApi() - .then(name => { - exportedFileName = name; + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.getExportedFileNameViaApi() + .then(name => { + exportedFileName = name; - ExportFile.downloadExportedMarcFile(exportedFileName); - // upload the exported marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(exportedFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(exportedFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(exportedFileName); - [FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems, 0); - FileDetails.checkItemQuantityInSummaryTable(quantityOfItems, 0); + ExportFile.downloadExportedMarcFile(exportedFileName); + // upload the exported marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(exportedFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(exportedFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(exportedFileName); + [FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems, 0); + FileDetails.checkItemQuantityInSummaryTable(quantityOfItems, 0); - // check created items - FileDetails.openHoldingsInInventory('Created'); - HoldingsRecordView.checkPermanentLocation(LOCATION_NAMES.ANNEX_UI); - cy.go('back'); - FileDetails.openItemInInventory('Created'); - ItemRecordView.verifyMaterialType(MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE); - ItemRecordView.verifyPermanentLoanType(LOAN_TYPE_NAMES.CAN_CIRCULATE); - ItemRecordView.verifyItemStatus(collectionOfMappingAndActionProfiles[0].mappingProfile.status); - }); - }); + // check created items + FileDetails.openHoldingsInInventory('Created'); + HoldingsRecordView.checkPermanentLocation(LOCATION_NAMES.ANNEX_UI); + cy.go('back'); + FileDetails.openItemInInventory('Created'); + ItemRecordView.verifyMaterialType(MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE); + ItemRecordView.verifyPermanentLoanType(LOAN_TYPE_NAMES.CAN_CIRCULATE); + ItemRecordView.verifyItemStatus(collectionOfMappingAndActionProfiles[0].mappingProfile.status); + }); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js index 8736d39058..d1f0861220 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js @@ -23,265 +23,267 @@ import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; import MarcFieldProtection from '../../../support/fragments/settings/dataImport/marcFieldProtection'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; -describe('Importing MARC Bib files', () => { - const testData = {}; - let firstFieldId = null; - let secondFieldId = null; - let thirdFieldId = null; - // unique file name to upload - const nameForUpdatedMarcFile = `C380511autotestFile${getRandomPostfix()}.mrc`; - const nameForExportedMarcFile = `C380511autotestFile${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C380511autotestFile${getRandomPostfix()}.csv`; - const mappingProfile = { - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - update: true, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const matchProfile = { - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - existingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - const protectedFields = { - firstField: '100', - secondField: '240', - thirdField: '700' - }; - const marcFiles = [ - { - marc: 'marcBibFileForC380511.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - numOfRecords: 1 - }, - { - marc: 'marcFileForC380511.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 4 - } - ]; - const linkingTagAndValues = [ - { - rowIndex: 17, - value: 'Ludwig van, Beethoven, 1770-1827.', - tag: '100' - }, - { - rowIndex: 18, - value: 'Beethoven, Ludwig van, 1770-1827 Variations, piano, violin, cello, op. 44, Eâ™­ major', - tag: '240' - }, - { - rowIndex: 41, - value: 'Music piano', - tag: '650' - }, - { - rowIndex: 50, - value: 'Hewitt, Angela, 1958-', - tag: '700' - }, - { - rowIndex: 51, - value: 'Ludwig van, Beethoven, 1770-1827.', - tag: '700' - }, - ]; - const createdAuthorityIDs = []; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const testData = {}; + let firstFieldId = null; + let secondFieldId = null; + let thirdFieldId = null; + // unique file name to upload + const nameForUpdatedMarcFile = `C380511autotestFile${getRandomPostfix()}.mrc`; + const nameForExportedMarcFile = `C380511autotestFile${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C380511autotestFile${getRandomPostfix()}.csv`; + const mappingProfile = { + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + update: true, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const matchProfile = { + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + existingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const protectedFields = { + firstField: '100', + secondField: '240', + thirdField: '700' + }; + const marcFiles = [ + { + marc: 'marcBibFileForC380511.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1 + }, + { + marc: 'marcFileForC380511.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 4 + } + ]; + const linkingTagAndValues = [ + { + rowIndex: 17, + value: 'Ludwig van, Beethoven, 1770-1827.', + tag: '100' + }, + { + rowIndex: 18, + value: 'Beethoven, Ludwig van, 1770-1827 Variations, piano, violin, cello, op. 44, Eâ™­ major', + tag: '240' + }, + { + rowIndex: 41, + value: 'Music piano', + tag: '650' + }, + { + rowIndex: 50, + value: 'Hewitt, Angela, 1958-', + tag: '700' + }, + { + rowIndex: 51, + value: 'Ludwig van, Beethoven, 1770-1827.', + tag: '700' + }, + ]; + const createdAuthorityIDs = []; - before('Creating user', () => { - cy.createTempUser([ - Permissions.moduleDataImportEnabled.gui, - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - Permissions.dataExportEnableApp.gui, - ]).then(createdUserProperties => { - testData.userProperties = createdUserProperties; + before('Creating user', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + Permissions.dataExportEnableApp.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]); - }); - } + 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.loginAsAdmin().then(() => { + cy.loginAsAdmin().then(() => { // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); - 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.openNewJobProfileForm(); - NewJobProfile.fillJobProfile(jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileByName(actionProfile.name); - // waiter needed for the action profile to be linked - cy.wait(1000); - NewJobProfile.saveAndClose(); - JobProfiles.waitLoadingList(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - }); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); + 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.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileByName(actionProfile.name); + // waiter needed for the action profile to be linked + cy.wait(1000); + NewJobProfile.saveAndClose(); + JobProfiles.waitLoadingList(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + }); - cy.loginAsAdmin(); - cy.getAdminToken().then(() => { - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '0', - data: '*', - source: 'USER', - field: protectedFields.firstField - }) - .then((resp) => { - firstFieldId = resp.id; - }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '0', - data: '*', - source: 'USER', - field: protectedFields.secondField - }) - .then((resp) => { - secondFieldId = resp.id; - }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '9', - data: '*', - source: 'USER', - field: protectedFields.thirdField - }) - .then((resp) => { - thirdFieldId = resp.id; - }); - }); + cy.loginAsAdmin(); + cy.getAdminToken().then(() => { + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '0', + data: '*', + source: 'USER', + field: protectedFields.firstField + }) + .then((resp) => { + firstFieldId = resp.id; + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '0', + data: '*', + source: 'USER', + field: protectedFields.secondField + }) + .then((resp) => { + secondFieldId = resp.id; + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '9', + data: '*', + source: 'USER', + field: protectedFields.thirdField + }) + .then((resp) => { + thirdFieldId = resp.id; + }); + }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); }); - }); - after('delete test data', () => { - Users.deleteViaApi(testData.userProperties.userId); - InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); - createdAuthorityIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); + after('delete test data', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + createdAuthorityIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + }); + MarcFieldProtection.deleteMarcFieldProtectionViaApi(firstFieldId); + MarcFieldProtection.deleteMarcFieldProtectionViaApi(secondFieldId); + MarcFieldProtection.deleteMarcFieldProtectionViaApi(thirdFieldId); + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); }); - MarcFieldProtection.deleteMarcFieldProtectionViaApi(firstFieldId); - MarcFieldProtection.deleteMarcFieldProtectionViaApi(secondFieldId); - MarcFieldProtection.deleteMarcFieldProtectionViaApi(thirdFieldId); - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); - }); - it('C380511 Edit protected and linked fields using update MARC Bib profile (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - InventoryInstance.searchByTitle(createdAuthorityIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - linkingTagAndValues.forEach(linking => { - QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(linking.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.rowIndex); - }); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); + it('C380511 Edit protected and linked fields using update MARC Bib profile (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + linkingTagAndValues.forEach(linking => { + QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(linking.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.rowIndex); + }); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); - // download .csv file - 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#####'); + // download .csv file + 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#####'); - DataImport.editMarcFile( - nameForExportedMarcFile, - nameForUpdatedMarcFile, - ['aLudwig van, Beethoven,d1770-1827ecomposer', '0id.loc.gov/authorities/names/n83130832', 'aMusic piano', 'ewriter of supplementary textual content.', 'aLudwig van, Beethoven,d1770-1827iContainer of (work):0id.loc.gov/authorities/names/n79107741'], - ['aBeethoven, Ludwig V.d1770-1827eAuthor', '0id.loc.gov/authorities/names/n83130833', 'aMusic pianocTest environment', 'eauthor of supplementary textual content.', 'aBeethoven, Ludwig V.d1770-1827iContainer of (work):'] - ); + DataImport.editMarcFile( + nameForExportedMarcFile, + nameForUpdatedMarcFile, + ['aLudwig van, Beethoven,d1770-1827ecomposer', '0id.loc.gov/authorities/names/n83130832', 'aMusic piano', 'ewriter of supplementary textual content.', 'aLudwig van, Beethoven,d1770-1827iContainer of (work):0id.loc.gov/authorities/names/n79107741'], + ['aBeethoven, Ludwig V.d1770-1827eAuthor', '0id.loc.gov/authorities/names/n83130833', 'aMusic pianocTest environment', 'eauthor of supplementary textual content.', 'aBeethoven, Ludwig V.d1770-1827iContainer of (work):'] + ); - // upload the exported marc file with 999.f.f.s fields - cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); - Logs.checkStatusOfJobProfile('Completed'); - Logs.openFileDetails(nameForUpdatedMarcFile); - Logs.clickOnHotLink(0, 3, 'Updated'); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterLinking(17, '100', '1', '\\', '$a Ludwig van, Beethoven, $d 1770-1827', '$e composer.', '$0 id.loc.gov/authorities/names/n79107741', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(18, '240', '1', '0', '$a Variations, $m piano, violin, cello, $n op. 44, $r Eâ™­ major', '$c Ludwig Van Beethoven.', '$0 id.loc.gov/authorities/names/n83130832', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(41, '650', '\\', '0', '$a Music piano', '$c Test environment', '$0 id.loc.gov/authorities/childrensSubjects/sj2021056711', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(50, '700', '1', '\\', '$a Hewitt, Angela, $d 1958-', '$e instrumentalist, $e writer of supplementary textual content.', '$0 id.loc.gov/authorities/names/n91099716', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(51, '700', '1', '2', '$a Ludwig van, Beethoven, $d 1770-1827', '$i Container of (work):', '$0 id.loc.gov/authorities/names/n79107741', ''); - QuickMarcEditor.verifyTagFieldAfterUnlinking(52, '700', '1', '\\', '$a Hewitt, Angela, $d 1958- $e instrumentalist, $e author of supplementary textual content. $0 id.loc.gov/authorities/names/n91099716'); - QuickMarcEditor.verifyTagFieldAfterUnlinking(53, '700', '1', '2', '$a Beethoven, Ludwig V. $d 1770-1827 $i Container of (work):'); + // upload the exported marc file with 999.f.f.s fields + cy.visit(TopMenu.dataImportPath); + DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(nameForUpdatedMarcFile); + Logs.clickOnHotLink(0, 3, 'Updated'); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterLinking(17, '100', '1', '\\', '$a Ludwig van, Beethoven, $d 1770-1827', '$e composer.', '$0 id.loc.gov/authorities/names/n79107741', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(18, '240', '1', '0', '$a Variations, $m piano, violin, cello, $n op. 44, $r Eâ™­ major', '$c Ludwig Van Beethoven.', '$0 id.loc.gov/authorities/names/n83130832', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(41, '650', '\\', '0', '$a Music piano', '$c Test environment', '$0 id.loc.gov/authorities/childrensSubjects/sj2021056711', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(50, '700', '1', '\\', '$a Hewitt, Angela, $d 1958-', '$e instrumentalist, $e writer of supplementary textual content.', '$0 id.loc.gov/authorities/names/n91099716', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(51, '700', '1', '2', '$a Ludwig van, Beethoven, $d 1770-1827', '$i Container of (work):', '$0 id.loc.gov/authorities/names/n79107741', ''); + QuickMarcEditor.verifyTagFieldAfterUnlinking(52, '700', '1', '\\', '$a Hewitt, Angela, $d 1958- $e instrumentalist, $e author of supplementary textual content. $0 id.loc.gov/authorities/names/n91099716'); + QuickMarcEditor.verifyTagFieldAfterUnlinking(53, '700', '1', '2', '$a Beethoven, Ludwig V. $d 1770-1827 $i Container of (work):'); + }); }); }); 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 3d78201830..9b4015abf0 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 @@ -10,45 +10,47 @@ import Users from '../../../support/fragments/users/users'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import { JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user; - // eslint-disable-next-line +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + 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.${getRandomPostfix()}.mrc`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const nameMarcFileForImportCreate = `C350750autotestFile.${getRandomPostfix()}.mrc`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - before('login', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); }); - }); - }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + }); - it('C350750 Error records not processed or saved for invalid MARC Bibs (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C350750 Error records not processed or saved for invalid MARC Bibs (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC350750.mrc', nameMarcFileForImportCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); - Logs.openFileDetails(nameMarcFileForImportCreate); - FileDetails.verifyTitle('No content', FileDetails.columnNameInResultList.title); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.error, FileDetails.columnNameInResultList.error); - FileDetails.verifyErrorMessage(error); - }); + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC350750.mrc', nameMarcFileForImportCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); + Logs.openFileDetails(nameMarcFileForImportCreate); + FileDetails.verifyTitle('No content', FileDetails.columnNameInResultList.title); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.error, FileDetails.columnNameInResultList.error); + FileDetails.verifyErrorMessage(error); + }); + }); }); 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 119a6ef972..61dca2e2d2 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 @@ -26,316 +26,318 @@ import FileManager from '../../../support/utils/fileManager'; import ExportFile from '../../../support/fragments/data-export/exportFile'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; -describe('ui-data-import', () => { - let instanceHrid; - const quantityOfItems = '1'; - const instance = { - instanceTitle: 'Love enough / Dionne Brand.', - instanceSubject: '35678123678', - holdingsLocation: `${LOCATION_NAMES.MAIN_LIBRARY_UI} >`, - itemStatus: ITEM_STATUS_NAMES.AVAILABLE - }; - const permanentLocation = LOCATION_NAMES.MAIN_LIBRARY; - const recordType = 'MARC_BIBLIOGRAPHIC'; - const note = 'Test administrative note for item'; - // unique file name - const marcFileForCreate = `C11123 autoTestFile.${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C11123 autotestFile${getRandomPostfix()}.csv`; - const nameMarcFileForUpload = `C11123 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C11123 fileWithItemHrid.${getRandomPostfix()}.mrc`; - const nameMarcFileForUpdate = `C11123 autotestFileForUpdateItem.${getRandomPostfix()}.mrc`; - // unique profile names for creating - const instanceMappingProfileNameForCreate = `C11123 autotest_instance_mapping_profile_${getRandomPostfix()}`; - const holdingsMappingProfileNameForCreate = `C11123 autotest_holdings_mapping_profile_${getRandomPostfix()}`; - const itemMappingProfileNameForCreate = `C11123 autotest_item_mapping_profile_${getRandomPostfix()}`; - const instanceActionProfileNameForCreate = `C11123 autotest_instance_action_profile_${getRandomPostfix()}`; - const holdingsActionProfileNameForCreate = `C11123 autotest_holdings_action_profile_${getRandomPostfix()}`; - const itemActionProfileNameForCreate = `C11123 autotest_item_action_profile_${getRandomPostfix()}`; - const jobProfileNameForCreate = `C11123 autotest_job_profile_${getRandomPostfix()}`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let instanceHrid; + const quantityOfItems = '1'; + const instance = { + instanceTitle: 'Love enough / Dionne Brand.', + instanceSubject: '35678123678', + holdingsLocation: `${LOCATION_NAMES.MAIN_LIBRARY_UI} >`, + itemStatus: ITEM_STATUS_NAMES.AVAILABLE + }; + const permanentLocation = LOCATION_NAMES.MAIN_LIBRARY; + const recordType = 'MARC_BIBLIOGRAPHIC'; + const note = 'Test administrative note for item'; + // unique file name + const marcFileForCreate = `C11123 autoTestFile.${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C11123 autotestFile${getRandomPostfix()}.csv`; + const nameMarcFileForUpload = `C11123 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C11123 fileWithItemHrid.${getRandomPostfix()}.mrc`; + const nameMarcFileForUpdate = `C11123 autotestFileForUpdateItem.${getRandomPostfix()}.mrc`; + // unique profile names for creating + const instanceMappingProfileNameForCreate = `C11123 autotest_instance_mapping_profile_${getRandomPostfix()}`; + const holdingsMappingProfileNameForCreate = `C11123 autotest_holdings_mapping_profile_${getRandomPostfix()}`; + const itemMappingProfileNameForCreate = `C11123 autotest_item_mapping_profile_${getRandomPostfix()}`; + const instanceActionProfileNameForCreate = `C11123 autotest_instance_action_profile_${getRandomPostfix()}`; + const holdingsActionProfileNameForCreate = `C11123 autotest_holdings_action_profile_${getRandomPostfix()}`; + const itemActionProfileNameForCreate = `C11123 autotest_item_action_profile_${getRandomPostfix()}`; + const jobProfileNameForCreate = `C11123 autotest_job_profile_${getRandomPostfix()}`; - // profiles for creating instance, holdings, item - const instanceMappingProfileForCreate = { - profile:{ - name: instanceMappingProfileNameForCreate, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - } - }; - const holdingsMappingProfileForCreate = { - profile:{ - name: holdingsMappingProfileNameForCreate, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - mappingDetails: { name: 'holdings', - recordType: 'HOLDINGS', - mappingFields: [ - { name: 'permanentLocationId', - enabled: true, - path: 'holdings.permanentLocationId', - value: `"${permanentLocation}"` }] } - } - }; - const itemMappingProfileForCreate = { - profile:{ - name: itemMappingProfileNameForCreate, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - mappingDetails: { name: 'item', - recordType: 'ITEM', - mappingFields: [ - { name: 'materialType.id', - enabled: true, - path: 'item.materialType.id', - value: '"book"', - acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, - { name: 'permanentLoanType.id', - enabled: true, - path: 'item.permanentLoanType.id', - value: '"Can circulate"', - acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, - { name: 'status.name', - enabled: true, - path: 'item.status.name', - value: '"Available"' }, - { name: 'permanentLocation.id', - enabled: 'true', - path: 'item.permanentLocation.id', - value: `"${permanentLocation}"`, - acceptedValues: { 'fcd64ce1-6995-48f0-840e-89ffa2288371' : 'Main Library (KU/CC/DI/M)' } }] } - } - }; - const instanceActionProfileForCreate = { - profile: { - name: instanceActionProfileNameForCreate, - action: 'CREATE', - folioRecord: 'INSTANCE' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + // profiles for creating instance, holdings, item + const instanceMappingProfileForCreate = { + profile:{ + name: instanceMappingProfileNameForCreate, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, } - ], - deletedRelations: [] - }; - const holdingsActionProfileForCreate = { - profile: { - name: holdingsActionProfileNameForCreate, - action: 'CREATE', - folioRecord: 'HOLDINGS' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + }; + const holdingsMappingProfileForCreate = { + profile:{ + name: holdingsMappingProfileNameForCreate, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + mappingDetails: { name: 'holdings', + recordType: 'HOLDINGS', + mappingFields: [ + { name: 'permanentLocationId', + enabled: true, + path: 'holdings.permanentLocationId', + value: `"${permanentLocation}"` }] } } - ], - deletedRelations: [] - }; - const itemActionProfileForCreate = { - profile: { - name: itemActionProfileNameForCreate, - action: 'CREATE', - folioRecord: 'ITEM' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + }; + const itemMappingProfileForCreate = { + profile:{ + name: itemMappingProfileNameForCreate, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + mappingDetails: { name: 'item', + recordType: 'ITEM', + mappingFields: [ + { name: 'materialType.id', + enabled: true, + path: 'item.materialType.id', + value: '"book"', + acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, + { name: 'permanentLoanType.id', + enabled: true, + path: 'item.permanentLoanType.id', + value: '"Can circulate"', + acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, + { name: 'status.name', + enabled: true, + path: 'item.status.name', + value: '"Available"' }, + { name: 'permanentLocation.id', + enabled: 'true', + path: 'item.permanentLocation.id', + value: `"${permanentLocation}"`, + acceptedValues: { 'fcd64ce1-6995-48f0-840e-89ffa2288371' : 'Main Library (KU/CC/DI/M)' } }] } } - ], - deletedRelations: [] - }; - const testData = [ - { mappingProfile: instanceMappingProfileForCreate, - actionProfile: instanceActionProfileForCreate }, - { mappingProfile: holdingsMappingProfileForCreate, - actionProfile: holdingsActionProfileForCreate }, - { mappingProfile: itemMappingProfileForCreate, - actionProfile: itemActionProfileForCreate }, - ]; - const jobProfileForCreate = { - profile: { - name: jobProfileNameForCreate, - dataType: ACCEPTED_DATA_TYPE_NAMES.MARC - }, - addedRelations: [], - deletedRelations: [] - }; - // profiles for updating item - const matchProfile = { - profileName: `C11123 match profile.${getRandomPostfix()}`, - incomingRecordFields: { - field: '945', - in1: '*', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemHrid - }; - const itemMappingProfileForUpdate = { - name: `C11123 mapping profile update item.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ITEM - }; - const itemActionProfileForUpdate = { - typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C11123 action profile update item.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C11123 job profile.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + }; + const instanceActionProfileForCreate = { + profile: { + name: instanceActionProfileNameForCreate, + action: 'CREATE', + folioRecord: 'INSTANCE' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const holdingsActionProfileForCreate = { + profile: { + name: holdingsActionProfileNameForCreate, + action: 'CREATE', + folioRecord: 'HOLDINGS' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const itemActionProfileForCreate = { + profile: { + name: itemActionProfileNameForCreate, + action: 'CREATE', + folioRecord: 'ITEM' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const testData = [ + { mappingProfile: instanceMappingProfileForCreate, + actionProfile: instanceActionProfileForCreate }, + { mappingProfile: holdingsMappingProfileForCreate, + actionProfile: holdingsActionProfileForCreate }, + { mappingProfile: itemMappingProfileForCreate, + actionProfile: itemActionProfileForCreate }, + ]; + const jobProfileForCreate = { + profile: { + name: jobProfileNameForCreate, + dataType: ACCEPTED_DATA_TYPE_NAMES.MARC + }, + addedRelations: [], + deletedRelations: [] + }; + // profiles for updating item + const matchProfile = { + profileName: `C11123 match profile.${getRandomPostfix()}`, + incomingRecordFields: { + field: '945', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemHrid + }; + const itemMappingProfileForUpdate = { + name: `C11123 mapping profile update item.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ITEM + }; + const itemActionProfileForUpdate = { + typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C11123 action profile update item.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C11123 job profile.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - InventorySearchAndFilter.getInstancesBySubjectViaApi(instance.instanceSubject) - .then(instances => { - if (instances) { - instances.forEach(({ id }) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); + before('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + InventorySearchAndFilter.getInstancesBySubjectViaApi(instance.instanceSubject) + .then(instances => { + if (instances) { + instances.forEach(({ id }) => { + cy.deleteItemViaApi(instance.items[0].id); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(id); + }); + } + }); - testData.jobProfileForCreate = jobProfileForCreate; + testData.jobProfileForCreate = jobProfileForCreate; - testData.forEach(specialPair => { - cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { - cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + testData.forEach(specialPair => { + cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { + cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + }); }); - }); - SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) - .then((bodyWithjobProfile) => { - testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) + .then((bodyWithjobProfile) => { + testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + }); + // 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('mrcFileForC11123.mrc', marcFileForCreate); + JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileForCreate); + Logs.openFileDetails(marcFileForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); }); - // 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('mrcFileForC11123.mrc', marcFileForCreate); - JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileForCreate); - Logs.openFileDetails(marcFileForCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); }); - FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); - }); - }); + }); - after('delete test data', () => { - FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(itemActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(itemActionProfileForUpdate.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForUpdate.name); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((initialInstance) => { - cy.deleteItemViaApi(initialInstance.items[0].id); - cy.deleteHoldingRecordViaApi(initialInstance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(initialInstance.id); - }); - }); + after('delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(itemActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(itemActionProfileForUpdate.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForUpdate.name); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((initialInstance) => { + cy.deleteItemViaApi(initialInstance.items[0].id); + cy.deleteHoldingRecordViaApi(initialInstance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(initialInstance.id); + }); + }); - it('C11123 Export from Inventory, edit file, and re-import to update items (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + it('C11123 Export from Inventory, edit file, and re-import to update items (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; - InventoryInstance.checkIsInstancePresented(instance.instanceTitle, instance.holdingsLocation, instance.itemStatus); - InventoryInstance.openItemByBarcode('No barcode'); - ItemRecordView.getAssignedHRID().then(initialItemHrId => { - const itemHrid = initialItemHrId; + InventoryInstance.checkIsInstancePresented(instance.instanceTitle, instance.holdingsLocation, instance.itemStatus); + InventoryInstance.openItemByBarcode('No barcode'); + ItemRecordView.getAssignedHRID().then(initialItemHrId => { + const itemHrid = initialItemHrId; - ItemRecordView.closeDetailView(); - InventorySearchAndFilter.searchByParameter('Subject', instance.instanceSubject); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.searchByParameter('Subject', instance.instanceSubject); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithDefaultJobProfile(nameForCSVFile); - ExportFile.downloadExportedMarcFile(nameMarcFileForUpload); + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithDefaultJobProfile(nameForCSVFile); + ExportFile.downloadExportedMarcFile(nameMarcFileForUpload); - // change file using item hrid for 945 field - DataImport.editMarcFile( - nameMarcFileForUpload, - editedMarcFileName, - ['testHrid'], - [itemHrid] - ); - }); + // change file using item hrid for 945 field + DataImport.editMarcFile( + nameMarcFileForUpload, + editedMarcFileName, + ['testHrid'], + [itemHrid] + ); + }); - // create mapping profile for update - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfileForUpdate); - NewFieldMappingProfile.addAdministrativeNote(note, 7); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfileForUpdate.name); - FieldMappingProfiles.checkMappingProfilePresented(itemMappingProfileForUpdate.name); + // create mapping profile for update + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfileForUpdate); + NewFieldMappingProfile.addAdministrativeNote(note, 7); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfileForUpdate.name); + FieldMappingProfiles.checkMappingProfilePresented(itemMappingProfileForUpdate.name); - // create action profile for update - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(itemActionProfileForUpdate, itemMappingProfileForUpdate.name); - ActionProfiles.checkActionProfilePresented(itemActionProfileForUpdate.name); + // create action profile for update + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(itemActionProfileForUpdate, itemMappingProfileForUpdate.name); + ActionProfiles.checkActionProfilePresented(itemActionProfileForUpdate.name); - // create match profile for update - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create match profile for update + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create job profile for update - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfileForUpdate, itemActionProfileForUpdate.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + // create job profile for update + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfileForUpdate, itemActionProfileForUpdate.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.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(editedMarcFileName, nameMarcFileForUpdate); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForUpdate); - Logs.openFileDetails(nameMarcFileForUpdate); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); - FileDetails.checkItemQuantityInSummaryTable(quantityOfItems, 1); + // 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(editedMarcFileName, nameMarcFileForUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForUpdate); + Logs.openFileDetails(nameMarcFileForUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); + FileDetails.checkItemQuantityInSummaryTable(quantityOfItems, 1); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); - InventoryInstance.openItemByBarcode('No barcode'); - ItemRecordView.checkItemAdministrativeNote(note); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); + InventoryInstance.openItemByBarcode('No barcode'); + ItemRecordView.checkItemAdministrativeNote(note); + }); }); - }); + }); }); 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 27ebd7aef2..942f7cc943 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 @@ -19,139 +19,141 @@ import InventoryViewSource from '../../../support/fragments/inventory/inventoryV import Users from '../../../support/fragments/users/users'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; -describe('ui-data-import', () => { - let user = null; - let instanceHrid = null; - const fieldsForDelete = ['977', '978', '979']; - const fieldsForDeleteIds = []; - // unique file name to upload - const fileName = `C350678autotestFileProtection.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user = null; + let instanceHrid = null; + const fieldsForDelete = ['977', '978', '979']; + const fieldsForDeleteIds = []; + // unique file name to upload + const fileName = `C350678autotestFileProtection.${getRandomPostfix()}.mrc`; - const mappingProfile = { name: `C350678 Remove extraneous MARC fields ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; + 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 ${getRandomPostfix()}`, - action: 'Modify (MARC Bibliographic record type only)' - }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + 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 ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C350678 Create bib and instance, but remove some MARC fields first ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password); - }); - }); + cy.login(user.username, user.password); + }); + }); - after('delete test data', () => { - fieldsForDeleteIds.forEach(fieldId => MarcFieldProtection.deleteMarcFieldProtectionViaApi(fieldId)); - // delete profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + fieldsForDeleteIds.forEach(fieldId => MarcFieldProtection.deleteMarcFieldProtectionViaApi(fieldId)); + // delete profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C350678 MARC field protections apply to MARC modifications of incoming records when they should not: Scenario 1 (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // create protection fields - MarcFieldProtection.createMarcFieldProtectionViaApi({ - field: '*', - indicator1: '*', - indicator2: '*', - subfield: '5', - data: 'NcD', - source: 'USER', - }) - .then(resp => { + it('C350678 MARC field protections apply to MARC modifications of incoming records when they should not: Scenario 1 (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create protection fields + MarcFieldProtection.createMarcFieldProtectionViaApi({ + field: '*', + indicator1: '*', + indicator2: '*', + subfield: '5', + data: 'NcD', + source: 'USER', + }) + .then(resp => { + const id = resp.id; + fieldsForDeleteIds.push(id); + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + field: fieldsForDelete[2], + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + }).then(resp => { const id = resp.id; fieldsForDeleteIds.push(id); }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - field: fieldsForDelete[2], - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - }).then(resp => { - const id = resp.id; - fieldsForDeleteIds.push(id); - }); - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.addFieldMappingsForMarc(); - NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', fieldsForDelete[0], 0); - NewFieldMappingProfile.addNewFieldInModificationSection(); - NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', fieldsForDelete[1], 1); - NewFieldMappingProfile.addNewFieldInModificationSection(); - NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', fieldsForDelete[2], 2); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addFieldMappingsForMarc(); + NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', fieldsForDelete[0], 0); + NewFieldMappingProfile.addNewFieldInModificationSection(); + NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', fieldsForDelete[1], 1); + NewFieldMappingProfile.addNewFieldInModificationSection(); + NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', fieldsForDelete[2], 2); + 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 action 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(actionProfile.name); - NewJobProfile.linkActionProfileByName('Default - Create instance'); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName(actionProfile.name); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.saveAndClose(); + 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('marcFileForC350678.mrc', 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); + // 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('marcFileForC350678.mrc', 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); - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + // 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`); + // 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 71a94bc550..1f5a041601 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 @@ -7,46 +7,48 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import Logs from '../../../support/fragments/data_import/logs/logs'; import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll'; -describe('ui-data-import', () => { - const filePathForUpload = 'oneMarcBib.mrc'; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const filePathForUpload = 'oneMarcBib.mrc'; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - before(() => { - cy.loginAsAdmin(); - }); + before(() => { + cy.loginAsAdmin(); + }); - it('C6707 Import a bunch of MARC files at once (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - [ - { - fileName: `C6707autotestFiles${getRandomPostfix()}`, - quantityOfFiles: '2' - }, - { - fileName: `C6707autotestFiles${getRandomPostfix()}`, - quantityOfFiles: '4' - }, - { - fileName: `C6707autotestFiles${getRandomPostfix()}`, - quantityOfFiles: '15' - } - ].forEach(upload => { - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadBunchOfFiles(filePathForUpload, upload.quantityOfFiles, upload.fileName); - DataImport.waitFileIsUploaded(); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(upload.fileName); + it('C6707 Import a bunch of MARC files at once (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + [ + { + fileName: `C6707autotestFiles${getRandomPostfix()}`, + quantityOfFiles: '2' + }, + { + fileName: `C6707autotestFiles${getRandomPostfix()}`, + quantityOfFiles: '4' + }, + { + fileName: `C6707autotestFiles${getRandomPostfix()}`, + quantityOfFiles: '15' + } + ].forEach(upload => { + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadBunchOfFiles(filePathForUpload, upload.quantityOfFiles, upload.fileName); + DataImport.waitFileIsUploaded(); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(upload.fileName); - Logs.openViewAllLogs(); - 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); + Logs.openViewAllLogs(); + 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/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js index 17b5294b62..a104388358 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js @@ -10,61 +10,63 @@ import InteractorsTools from '../../../support/utils/interactorsTools'; import Users from '../../../support/fragments/users/users'; import { JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user; - const bigFileName = `C378883autotestFile.${getRandomPostfix()}.mrc`; - const smallFileName = `C378883autotestFile.${getRandomPostfix()}.mrc`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const numberOfLogsToDelete = '1'; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + const bigFileName = `C378883autotestFile.${getRandomPostfix()}.mrc`; + const smallFileName = `C378883autotestFile.${getRandomPostfix()}.mrc`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const numberOfLogsToDelete = '1'; - before('login', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); }); - }); - }); + }); - after('delete user', () => { - Users.deleteViaApi(user.userId); - }); + after('delete user', () => { + Users.deleteViaApi(user.userId); + }); - it('C378883 Verify the ability to import additional files without hanging after stopping a running job and deleting it (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneThousandMarcBib.mrc', bigFileName); - // TODO wait until file will be uploaded - cy.wait(5000); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - Logs.checkFileIsRunning(bigFileName); - // TODO wait until at least 1% of the file will be processed - cy.wait(5000); - DataImport.deleteImportJob(bigFileName); - DataImport.verifyCancelImportJobModal(); - DataImport.cancelImportJob(); - Logs.checkStatusOfJobProfile('Stopped by user'); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - InteractorsTools.checkCalloutMessage(`${numberOfLogsToDelete} data import logs have been successfully deleted.`); + it('C378883 Verify the ability to import additional files without hanging after stopping a running job and deleting it (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('oneThousandMarcBib.mrc', bigFileName); + // TODO wait until file will be uploaded + cy.wait(5000); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + Logs.checkFileIsRunning(bigFileName); + // TODO wait until at least 1% of the file will be processed + cy.wait(5000); + DataImport.deleteImportJob(bigFileName); + DataImport.verifyCancelImportJobModal(); + DataImport.cancelImportJob(); + Logs.checkStatusOfJobProfile('Stopped by user'); + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + InteractorsTools.checkCalloutMessage(`${numberOfLogsToDelete} data import logs have been successfully deleted.`); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneMarcBib.mrc', smallFileName); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.selectJobProfile(); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(smallFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - }); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('oneMarcBib.mrc', smallFileName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.selectJobProfile(); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(smallFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js index efb164f71a..565461af46 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js @@ -13,80 +13,82 @@ import { JOB_STATUS_NAMES } from '../../../support/constants'; import InventorySteps from '../../../support/fragments/inventory/inventorySteps'; import { getCurrentDateYYMMDD } from '../../../support/utils/dateTools'; -describe('Data Import: Importing MARC Bib files', () => { - const testData = { - initialTitle: 'Bare Minimum Bib', - updatedTitleEdit: 'Bare Minimum Bib (after edit)', - updatedTitleDerive: 'Bare Minimum Bib (after derive)', - initial008EnteredValue: '750907', - expectedFieldsInQuickMarc: ['LDR', '001', '008', '005', '245', '999'], - marcFile: { - marc: 'MARC_Bib_bare_minimum_C387435.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib' - } - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const testData = { + initialTitle: 'Bare Minimum Bib', + updatedTitleEdit: 'Bare Minimum Bib (after edit)', + updatedTitleDerive: 'Bare Minimum Bib (after derive)', + initial008EnteredValue: '750907', + expectedFieldsInQuickMarc: ['LDR', '001', '008', '005', '245', '999'], + marcFile: { + marc: 'MARC_Bib_bare_minimum_C387435.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib' + } + }; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating data', () => { - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.moduleDataImportEnabled.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui - ]).then(createdUserProperties => { - testData.userProperties = createdUserProperties; - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + before('Creating data', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.moduleDataImportEnabled.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); }); - }); - after('Deleting created user and data', () => { - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach(recordID => { - InventoryInstance.deleteInstanceViaApi(recordID); + after('Deleting created user and data', () => { + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach(recordID => { + InventoryInstance.deleteInstanceViaApi(recordID); + }); + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); }); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - }); - it('C387435 Import and edit/derive "MARC Bib" record having only required fields (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - DataImport.uploadFile(testData.marcFile.marc, testData.marcFile.fileName); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(testData.marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(testData.marcFile.fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(testData.marcFile.fileName); - Logs.getCreatedItemsID().then(link => { - createdRecordIDs.push(link.split('/')[5]); - Logs.goToTitleLink('Created'); - InventoryInstance.checkInstanceTitle(testData.initialTitle); + it('C387435 Import and edit/derive "MARC Bib" record having only required fields (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + DataImport.uploadFile(testData.marcFile.marc, testData.marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(testData.marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(testData.marcFile.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(testData.marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + createdRecordIDs.push(link.split('/')[5]); + Logs.goToTitleLink('Created'); + InventoryInstance.checkInstanceTitle(testData.initialTitle); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.checkFieldsExist(testData.expectedFieldsInQuickMarc); - QuickMarcEditor.checkFieldsCount(testData.expectedFieldsInQuickMarc.length); - InventorySteps.verifyHiddenFieldValueIn008(createdRecordIDs[0], 'Entered', testData.initial008EnteredValue); - QuickMarcEditor.updateExistingField('245', '$a ' + testData.updatedTitleEdit); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.checkFieldsExist(testData.expectedFieldsInQuickMarc); + QuickMarcEditor.checkFieldsCount(testData.expectedFieldsInQuickMarc.length); + InventorySteps.verifyHiddenFieldValueIn008(createdRecordIDs[0], 'Entered', testData.initial008EnteredValue); + QuickMarcEditor.updateExistingField('245', '$a ' + testData.updatedTitleEdit); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); - InventoryInstance.deriveNewMarcBib(); - QuickMarcEditor.checkFieldsExist(testData.expectedFieldsInQuickMarc); - QuickMarcEditor.checkFieldsCount(testData.expectedFieldsInQuickMarc.length); - QuickMarcEditor.checkContent('$a ' + testData.updatedTitleEdit, 4); - QuickMarcEditor.updateExistingField('245', testData.updatedTitleDerive); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndCloseDerive(); + InventoryInstance.deriveNewMarcBib(); + QuickMarcEditor.checkFieldsExist(testData.expectedFieldsInQuickMarc); + QuickMarcEditor.checkFieldsCount(testData.expectedFieldsInQuickMarc.length); + QuickMarcEditor.checkContent('$a ' + testData.updatedTitleEdit, 4); + QuickMarcEditor.updateExistingField('245', testData.updatedTitleDerive); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndCloseDerive(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.checkFieldsExist(testData.expectedFieldsInQuickMarc); - QuickMarcEditor.checkFieldsCount(testData.expectedFieldsInQuickMarc.length); - QuickMarcEditor.checkContent('$a ' + testData.updatedTitleDerive, 4); - QuickMarcEditor.saveInstanceIdToArrayInQuickMarc(createdRecordIDs).then(() => { - InventorySteps.verifyHiddenFieldValueIn008(createdRecordIDs[1], 'Entered', getCurrentDateYYMMDD()); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.checkFieldsExist(testData.expectedFieldsInQuickMarc); + QuickMarcEditor.checkFieldsCount(testData.expectedFieldsInQuickMarc.length); + QuickMarcEditor.checkContent('$a ' + testData.updatedTitleDerive, 4); + QuickMarcEditor.saveInstanceIdToArrayInQuickMarc(createdRecordIDs).then(() => { + InventorySteps.verifyHiddenFieldValueIn008(createdRecordIDs[1], 'Entered', getCurrentDateYYMMDD()); + }); }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js index 2343d8443b..c2a469079a 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js @@ -23,164 +23,166 @@ import OrderLines from '../../../support/fragments/orders/orderLines'; import Users from '../../../support/fragments/users/users'; import Orders from '../../../support/fragments/orders/orders'; -describe('ui-data-import', () => { - let user; - let orderNumber; - const quantityOfOrders = '2'; - const filePathForCreateOrder = 'marcFileForC375174.mrc'; - const marcFileName = `C375174 autotestFileName ${getRandomPostfix()}`; - const orderData = { - title: 'ROALD DAHL : TELLER OF THE UNEXPECTED : A BIOGRAPHY.', - publicationDate: '2023', - publisher: 'PEGASUS BOOKS', - internalNote: 'AAH/bsc ', - acquisitionMethod: ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, - receiptStatus: 'Pending', - paymentStatus: 'Pending', - source: 'MARC', - selector: 'AAH', - receivingWorkflow: 'Synchronized order and receipt quantity', - accountNumber: '137009', - physicalUnitPrice: '$27.95', - quantityPhysical: '1', - currency: 'USD', - materialSupplier: VENDOR_NAMES.GOBI, - createInventory: 'Instance, Holding, Item', - materialType: MATERIAL_TYPE_NAMES.BOOK, - contributor: 'DENNISON, MATTHEW', - contributorType: 'Personal name', - productId: '9781639363322', - productIDType: 'ISBN', - vendorReferenceNumber: '99992466210', - vendorReferenceType: 'Vendor order reference number', - fund: 'Gifts (Non-recurring)(GIFTS-ONE-TIME)', - value: '100%', - locationName: 'Main Library (KU/CC/DI/M)', - locationQuantityPhysical: '1' - }; - const mappingProfile = { - name: `C375174 Test Order ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER, - orderStatus: ORDER_STATUSES.PENDING, - approved: true, - vendor: VENDOR_NAMES.GOBI, - reEncumber: 'false', - title: '245$a', - mustAcknowledgeReceivingNote: 'false', - publicationDate: '264$c; else 260$c', - publisher: '264$b; else 260$b', - edition: '250$a', - internalNote: '981$d', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, - receiptStatus: 'Pending', - paymentStatus: 'Pending', - selector: '981$e', - cancellationRestriction: 'false', - rush: '981$h', - receivingWorkflow: 'Synchronized', - accountNumber: '981$g', - physicalUnitPrice: '980$b', - quantityPhysical: '980$g', - currency: 'USD', - materialSupplier: VENDOR_NAMES.GOBI, - createInventory: 'Instance, Holding, Item', - materialType: MATERIAL_TYPE_NAMES.BOOK, - contributor: '100$a', - contributorType: 'Personal name', - productId: '020$a', - qualifier: '020$q', - productIDType: 'ISBN', - vendorReferenceNumber: '980$f', - vendorReferenceType: 'Vendor order reference number', - fundId: '981$b', - expenseClass: '981$c', - value: '100', - type: '%', - locationName: '049$a', - locationQuantityPhysical: '980$g', - volume: '993$a' - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C375174 Test Order ${getRandomPostfix()}` - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C375174 Test Order ${getRandomPostfix()}`, - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let orderNumber; + const quantityOfOrders = '2'; + const filePathForCreateOrder = 'marcFileForC375174.mrc'; + const marcFileName = `C375174 autotestFileName ${getRandomPostfix()}`; + const orderData = { + title: 'ROALD DAHL : TELLER OF THE UNEXPECTED : A BIOGRAPHY.', + publicationDate: '2023', + publisher: 'PEGASUS BOOKS', + internalNote: 'AAH/bsc ', + acquisitionMethod: ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, + receiptStatus: 'Pending', + paymentStatus: 'Pending', + source: 'MARC', + selector: 'AAH', + receivingWorkflow: 'Synchronized order and receipt quantity', + accountNumber: '137009', + physicalUnitPrice: '$27.95', + quantityPhysical: '1', + currency: 'USD', + materialSupplier: VENDOR_NAMES.GOBI, + createInventory: 'Instance, Holding, Item', + materialType: MATERIAL_TYPE_NAMES.BOOK, + contributor: 'DENNISON, MATTHEW', + contributorType: 'Personal name', + productId: '9781639363322', + productIDType: 'ISBN', + vendorReferenceNumber: '99992466210', + vendorReferenceType: 'Vendor order reference number', + fund: 'Gifts (Non-recurring)(GIFTS-ONE-TIME)', + value: '100%', + locationName: 'Main Library (KU/CC/DI/M)', + locationQuantityPhysical: '1' + }; + const mappingProfile = { + name: `C375174 Test Order ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER, + orderStatus: ORDER_STATUSES.PENDING, + approved: true, + vendor: VENDOR_NAMES.GOBI, + reEncumber: 'false', + title: '245$a', + mustAcknowledgeReceivingNote: 'false', + publicationDate: '264$c; else 260$c', + publisher: '264$b; else 260$b', + edition: '250$a', + internalNote: '981$d', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, + receiptStatus: 'Pending', + paymentStatus: 'Pending', + selector: '981$e', + cancellationRestriction: 'false', + rush: '981$h', + receivingWorkflow: 'Synchronized', + accountNumber: '981$g', + physicalUnitPrice: '980$b', + quantityPhysical: '980$g', + currency: 'USD', + materialSupplier: VENDOR_NAMES.GOBI, + createInventory: 'Instance, Holding, Item', + materialType: MATERIAL_TYPE_NAMES.BOOK, + contributor: '100$a', + contributorType: 'Personal name', + productId: '020$a', + qualifier: '020$q', + productIDType: 'ISBN', + vendorReferenceNumber: '980$f', + vendorReferenceType: 'Vendor order reference number', + fundId: '981$b', + expenseClass: '981$c', + value: '100', + type: '%', + locationName: '049$a', + locationQuantityPhysical: '980$g', + volume: '993$a' + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C375174 Test Order ${getRandomPostfix()}` + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C375174 Test Order ${getRandomPostfix()}`, + }; - before('login', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiOrganizationsView.gui, - permissions.inventoryAll.gui, - permissions.uiOrdersView.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiOrganizationsView.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + cy.login(userProperties.username, userProperties.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); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(orderId => { - Orders.deleteOrderViaApi(orderId[0].id); - }); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); + }); + }); - it('C375174 Verify the importing of orders with pending status (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C375174 Verify the importing of orders with pending status (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profile - FieldMappingProfiles.createOrderMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + FieldMappingProfiles.createOrderMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create action 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + 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(filePathForCreateOrder, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); - [0, 1].forEach(rowNumber => { - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.order - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, rowNumber); + [0, 1].forEach(rowNumber => { + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.order + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, rowNumber); + }); }); + FileDetails.checkOrderQuantityInSummaryTable(quantityOfOrders); + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.checkIsOrderCreatedWithDataFromImportedFile(orderData); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const polNumber = initialNumber; + orderNumber = polNumber.replace('-1', ''); + }); }); - FileDetails.checkOrderQuantityInSummaryTable(quantityOfOrders); - FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.checkIsOrderCreatedWithDataFromImportedFile(orderData); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const polNumber = initialNumber; - orderNumber = polNumber.replace('-1', ''); - }); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js index 629f234488..2b070ca976 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js @@ -21,93 +21,95 @@ import OrderLines from '../../../support/fragments/orders/orderLines'; import Orders from '../../../support/fragments/orders/orders'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - let orderNumber; - const quantityOfItems = '1'; - const filePathForCreateOrder = 'marcFileForC380483.mrc'; - const marcFileName = `C380483 autotestFileName.${getRandomPostfix()}`; - const mappingProfile = { - typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C380483 Test Electronic resource open order ${getRandomPostfix()}`, - orderStatus: ORDER_STATUSES.OPEN, - approved: true, - vendor: 'GOBI Library Solutions', - title: '245$a', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES.ELECTRONIC_RESOURCE_Check, - receivingWorkflow: 'Synchronized', - currency: 'USD', - electronicUnitPrice: '"25"', - quantityElectronic: '"1"', - locationName: `"${LOCATION_NAMES.ANNEX}"`, - locationQuantityElectronic: '"1"' - }; - const actionProfile = { name: `C380483 Test Electronic resource open order ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C380483 Test Order ${getRandomPostfix()}`, - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let orderNumber; + const quantityOfItems = '1'; + const filePathForCreateOrder = 'marcFileForC380483.mrc'; + const marcFileName = `C380483 autotestFileName.${getRandomPostfix()}`; + const mappingProfile = { + typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C380483 Test Electronic resource open order ${getRandomPostfix()}`, + orderStatus: ORDER_STATUSES.OPEN, + approved: true, + vendor: 'GOBI Library Solutions', + title: '245$a', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES.ELECTRONIC_RESOURCE_Check, + receivingWorkflow: 'Synchronized', + currency: 'USD', + electronicUnitPrice: '"25"', + quantityElectronic: '"1"', + locationName: `"${LOCATION_NAMES.ANNEX}"`, + locationQuantityElectronic: '"1"' + }; + const actionProfile = { name: `C380483 Test Electronic resource open order ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C380483 Test Order ${getRandomPostfix()}`, + }; - before('login', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiOrganizationsView.gui, - permissions.inventoryAll.gui, - permissions.uiOrdersView.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiOrganizationsView.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + cy.login(userProperties.username, userProperties.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); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(orderId => { Orders.deleteOrderViaApi(orderId[0].id); }); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(orderId => { Orders.deleteOrderViaApi(orderId[0].id); }); + }); - it('C380483 Import to create open orders: Electronic resource with NO inventory (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C380483 Import to create open orders: Electronic resource with NO inventory (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profile - FieldMappingProfiles.createOrderMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + FieldMappingProfiles.createOrderMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create action 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + 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(filePathForCreateOrder, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkOrderQuantityInSummaryTable(quantityOfItems); - FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { orderNumber = initialNumber.replace('-1', ''); }); - OrderLines.checkCreatedInventoryInElectronicRecourceDetails('None'); - }); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkOrderQuantityInSummaryTable(quantityOfItems); + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { orderNumber = initialNumber.replace('-1', ''); }); + OrderLines.checkCreatedInventoryInElectronicRecourceDetails('None'); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js index f6f9205153..f7e10ff95d 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js @@ -27,141 +27,143 @@ import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRec import Orders from '../../../support/fragments/orders/orders'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; -describe('ui-data-import', () => { - let user; - let orderNumber; - let instanceHrid; - const instanceTitle = 'Quiet time.'; - const filePathForCreateOrder = 'marcFileForCreateOrder.mrc'; - const marcFileName = `C380485 autotestFileName ${getRandomPostfix()}`; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { - name: `C380485 Test Other open order with instance, holdings ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER, - orderStatus: ORDER_STATUSES.OPEN, - approved: true, - vendor: VENDOR_NAMES.GOBI, - title: '245$a', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.OTHER, - receivingWorkflow: 'Synchronized', - physicalUnitPrice: '"20"', - quantityPhysical: '"1"', - currency: 'USD', - locationName: `"${LOCATION_NAMES.ANNEX}"`, - locationQuantityPhysical: '"1"' +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let orderNumber; + let instanceHrid; + const instanceTitle = 'Quiet time.'; + const filePathForCreateOrder = 'marcFileForCreateOrder.mrc'; + const marcFileName = `C380485 autotestFileName ${getRandomPostfix()}`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { + name: `C380485 Test Other open order with instance, holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER, + orderStatus: ORDER_STATUSES.OPEN, + approved: true, + vendor: VENDOR_NAMES.GOBI, + title: '245$a', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.OTHER, + receivingWorkflow: 'Synchronized', + physicalUnitPrice: '"20"', + quantityPhysical: '"1"', + currency: 'USD', + locationName: `"${LOCATION_NAMES.ANNEX}"`, + locationQuantityPhysical: '"1"' + }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C380485 Test Other open order with instance, holdings ${getRandomPostfix()}` } }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C380485 Test Other open order with instance, holdings ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C380485 Create simple holdings for open order ${getRandomPostfix()}`, - permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C380485 Create simple holdings for open order ${getRandomPostfix()}` } - } - ]; - const jobProfile = { - profileName: `C380485 Test Other open order with instance, holdings ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C380485 Create simple holdings for open order ${getRandomPostfix()}`, + permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C380485 Create simple holdings for open order ${getRandomPostfix()}` } + } + ]; + const jobProfile = { + profileName: `C380485 Test Other open order with instance, holdings ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiOrganizationsView.gui, - permissions.inventoryAll.gui, - permissions.uiOrdersView.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiOrganizationsView.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); - - after('delete test data', () => { - Users.deleteViaApi(user.userId); - JobProfiles.deleteJobProfile(jobProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); }); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(orderId => { - Orders.deleteOrderViaApi(orderId[0].id); - }); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - }); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C380485 Import to create open orders: Other with Instances, Holdings (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C380485 Import to create open orders: Other with Instances, Holdings (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profile - FieldMappingProfiles.createOrderMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.createOrderMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(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 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.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); - NewJobProfile.linkActionProfileByName('Default - Create instance'); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + 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(filePathForCreateOrder, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.order - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber().then(initialNumber => { - const polNumber = initialNumber; - orderNumber = polNumber.replace('-1', ''); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.order + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber().then(initialNumber => { + const polNumber = initialNumber; + orderNumber = polNumber.replace('-1', ''); - OrderLines.checkCreatedInventoryInOtherRecourceDetails('Instance, Holding'); - OrderLines.openLinkedInstance(); - InstanceRecordView.verifyIsInstanceOpened(instanceTitle); - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); - InstanceRecordView.verifyHotlinkToPOL(polNumber); - InstanceRecordView.verifyIsHoldingsCreated([`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`]); - InstanceRecordView.openHoldingView(); - HoldingsRecordView.checkHoldingRecordViewOpened(); - HoldingsRecordView.checkHotlinkToPOL(polNumber); + OrderLines.checkCreatedInventoryInOtherRecourceDetails('Instance, Holding'); + OrderLines.openLinkedInstance(); + InstanceRecordView.verifyIsInstanceOpened(instanceTitle); + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); + InstanceRecordView.verifyHotlinkToPOL(polNumber); + InstanceRecordView.verifyIsHoldingsCreated([`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`]); + InstanceRecordView.openHoldingView(); + HoldingsRecordView.checkHoldingRecordViewOpened(); + HoldingsRecordView.checkHotlinkToPOL(polNumber); + }); }); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js index f672d80d4c..9cf01ca1d8 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js @@ -31,164 +31,166 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import Orders from '../../../support/fragments/orders/orders'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; -describe('ui-data-import', () => { - let user; - let orderNumber; - let instanceHrid; - const instanceTitle = 'Quiet time.'; - const filePathForCreateOrder = 'marcFileForCreateOrder.mrc'; - const marcFileName = `C380474 autotestFileName ${getRandomPostfix()}`; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C380474 Test Physical resource open order with instance, holdings, item ${getRandomPostfix()}`, - orderStatus: ORDER_STATUSES.OPEN, - approved: true, - vendor: VENDOR_NAMES.GOBI, - title: '245$a', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, - receivingWorkflow: 'Synchronized', - physicalUnitPrice: '"20"', - quantityPhysical: '"1"', - currency: 'USD', - locationName: `"${LOCATION_NAMES.ANNEX}"`, - locationQuantityPhysical: '"1"' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C380474 Test Physical resource open order with instance, holdings, item ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C380474 Create simple holdings for open order ${getRandomPostfix()}`, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C380474 Create simple holdings for open order ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C380474 Create simple item for open order ${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: `C380474 Create simple item for open order${getRandomPostfix()}` } - }, - ]; - const jobProfile = { - profileName: `C380474 Test Physical resource open order with instance, holdings, item ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let orderNumber; + let instanceHrid; + const instanceTitle = 'Quiet time.'; + const filePathForCreateOrder = 'marcFileForCreateOrder.mrc'; + const marcFileName = `C380474 autotestFileName ${getRandomPostfix()}`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C380474 Test Physical resource open order with instance, holdings, item ${getRandomPostfix()}`, + orderStatus: ORDER_STATUSES.OPEN, + approved: true, + vendor: VENDOR_NAMES.GOBI, + title: '245$a', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, + receivingWorkflow: 'Synchronized', + physicalUnitPrice: '"20"', + quantityPhysical: '"1"', + currency: 'USD', + locationName: `"${LOCATION_NAMES.ANNEX}"`, + locationQuantityPhysical: '"1"' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C380474 Test Physical resource open order with instance, holdings, item ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C380474 Create simple holdings for open order ${getRandomPostfix()}`, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C380474 Create simple holdings for open order ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C380474 Create simple item for open order ${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: `C380474 Create simple item for open order${getRandomPostfix()}` } + }, + ]; + const jobProfile = { + profileName: `C380474 Test Physical resource open order with instance, holdings, item ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiOrganizationsView.gui, - permissions.inventoryAll.gui, - permissions.uiOrdersView.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiOrganizationsView.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); - - after('delete test data', () => { - Users.deleteViaApi(user.userId); - JobProfiles.deleteJobProfile(jobProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); }); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(orderId => { - Orders.deleteOrderViaApi(orderId[0].id); - }); - 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); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - }); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); + }); + 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('C380474 Import to create open orders: Physical resource with Instances, Holdings, Items (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C380474 Import to create open orders: Physical resource with Instances, Holdings, Items (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profiles - FieldMappingProfiles.createOrderMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.createOrderMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].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 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.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); - NewJobProfile.linkActionProfileByName('Default - Create instance'); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); + 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(filePathForCreateOrder, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item, - FileDetails.columnNameInResultList.order - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber().then(initialNumber => { - const polNumber = initialNumber; - orderNumber = polNumber.replace('-1', ''); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item, + FileDetails.columnNameInResultList.order + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber().then(initialNumber => { + const polNumber = initialNumber; + orderNumber = polNumber.replace('-1', ''); - OrderLines.checkCreatedInventoryInPhysicalRecourceDetails('Instance, Holding, Item'); - OrderLines.openLinkedInstance(); - InstanceRecordView.verifyIsInstanceOpened(instanceTitle); - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); - InstanceRecordView.verifyHotlinkToPOL(polNumber); - InstanceRecordView.verifyIsHoldingsCreated([`${LOCATION_NAMES.ANNEX_UI} >`]); - InstanceRecordView.openHoldingView(); - HoldingsRecordView.checkHoldingRecordViewOpened(); - HoldingsRecordView.close(); - InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.ANNEX_UI} >`); - InventoryInstance.openItemByBarcode('No barcode'); - ItemRecordView.waitLoading(); - ItemRecordView.checkHotlinksToCreatedPOL(polNumber); + OrderLines.checkCreatedInventoryInPhysicalRecourceDetails('Instance, Holding, Item'); + OrderLines.openLinkedInstance(); + InstanceRecordView.verifyIsInstanceOpened(instanceTitle); + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); + InstanceRecordView.verifyHotlinkToPOL(polNumber); + InstanceRecordView.verifyIsHoldingsCreated([`${LOCATION_NAMES.ANNEX_UI} >`]); + InstanceRecordView.openHoldingView(); + HoldingsRecordView.checkHoldingRecordViewOpened(); + HoldingsRecordView.close(); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.ANNEX_UI} >`); + InventoryInstance.openItemByBarcode('No barcode'); + ItemRecordView.waitLoading(); + ItemRecordView.checkHotlinksToCreatedPOL(polNumber); + }); }); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js index 4fab9edb5b..55b341bf41 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js @@ -22,111 +22,113 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import Users from '../../../support/fragments/users/users'; import OrderLines from '../../../support/fragments/orders/orderLines'; -describe('ui-data-import', () => { - let user; - const quantityOfItems = '17'; - const marcFileName = `C375989 autotestFileName.${getRandomPostfix()}`; - const mappingProfile = { - name: `C375989 Test Order mapping profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER, - orderStatus: ORDER_STATUSES.OPEN, - approved: true, - vendor: VENDOR_NAMES.GOBI, - reEncumber: 'false', - title: '245$a', - mustAcknowledgeReceivingNote: 'false', - publicationDate: '264$c; else 260$c', - publisher: '264$b; else 260$b', - edition: '250$a', - internalNote: '981$d', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.ELECTRONIC_RESOURCE, - receiptStatus: 'Pending', - paymentStatus: 'Pending', - selector: '981$e', - cancellationRestriction: 'false', - rush: '981$h', - receivingWorkflow: 'Synchronized', - accountNumber: '981$g', - instructionsToVendor: '981$f', - electronicUnitPrice: '980$b', - quantityElectronic: '980$g', - currency: 'USD', - accessProvider: VENDOR_NAMES.GOBI, - contributor: '100$a', - contributorType: 'Personal name', - productId: '020$a', - qualifier: '020$q', - productIDType: 'ISBN', - vendorReferenceNumber: '980$f', - vendorReferenceType: 'Vendor order reference number', - fundId: '981$b', - expenseClass: '981$c', - value: '100', - type: '%', - locationName: '049$a', - locationQuantityElectronic: '980$g' - }; - const actionProfile = { name: `C375989 Test Order action profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C375989 Test Order ${getRandomPostfix()}`, - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + const quantityOfItems = '17'; + const marcFileName = `C375989 autotestFileName.${getRandomPostfix()}`; + const mappingProfile = { + name: `C375989 Test Order mapping profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER, + orderStatus: ORDER_STATUSES.OPEN, + approved: true, + vendor: VENDOR_NAMES.GOBI, + reEncumber: 'false', + title: '245$a', + mustAcknowledgeReceivingNote: 'false', + publicationDate: '264$c; else 260$c', + publisher: '264$b; else 260$b', + edition: '250$a', + internalNote: '981$d', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.ELECTRONIC_RESOURCE, + receiptStatus: 'Pending', + paymentStatus: 'Pending', + selector: '981$e', + cancellationRestriction: 'false', + rush: '981$h', + receivingWorkflow: 'Synchronized', + accountNumber: '981$g', + instructionsToVendor: '981$f', + electronicUnitPrice: '980$b', + quantityElectronic: '980$g', + currency: 'USD', + accessProvider: VENDOR_NAMES.GOBI, + contributor: '100$a', + contributorType: 'Personal name', + productId: '020$a', + qualifier: '020$q', + productIDType: 'ISBN', + vendorReferenceNumber: '980$f', + vendorReferenceType: 'Vendor order reference number', + fundId: '981$b', + expenseClass: '981$c', + value: '100', + type: '%', + locationName: '049$a', + locationQuantityElectronic: '980$g' + }; + const actionProfile = { name: `C375989 Test Order action profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C375989 Test Order ${getRandomPostfix()}`, + }; - before(() => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiOrganizationsView.gui, - permissions.inventoryAll.gui, - permissions.uiOrdersView.gui - ]) - .then(userProperties => { - user = userProperties; + before(() => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiOrganizationsView.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + cy.login(userProperties.username, userProperties.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); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); - it('C375989 Verify the importing of eBook orders with open status (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C375989 Verify the importing of eBook orders with open status (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profile - FieldMappingProfiles.createOrderMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + FieldMappingProfiles.createOrderMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create action 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + 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('marcFileForC375989.mrc', marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkOrderQuantityInSummaryTable(quantityOfItems); - FileDetails.openOrder('Created'); - OrderLines.verifyPOLDetailsIsOpened(); - }); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC375989.mrc', marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkOrderQuantityInSummaryTable(quantityOfItems); + FileDetails.openOrder('Created'); + OrderLines.verifyPOLDetailsIsOpened(); + }); + }); }); 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 5d795f2b4f..9b44b7671a 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 @@ -33,279 +33,281 @@ import FileManager from '../../../support/utils/fileManager'; import StatisticalCodes from '../../../support/fragments/settings/inventory/instance-holdings-item/statisticalCodes'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - let statisticalCode; - const titlesItemsStatusChanged = [ - 'Making the news popular : mobilizing U.S. news audiences / Anthony M. Nadler.', - 'Genius : the game / Leopoldo Gout.', - 'Animal philosophy : essential readings in continental thought / edited by Matthew Calarco and Peter Atterton.' - ]; - const titlesItemStatusNotChanged = [ - 'Political communication in the age of dissemination.', - 'Language, borders and identity / edited by Dominic Watt and Carmen Llamas.' - ]; - const itemNote = 'THIS WAS UPDATED!'; - const jobProfileNameForExport = `C357552 Bibs with Item HRIDs ${getRandomPostfix()}`; - // file names - const nameMarcFileForImportCreate = `C357552autotestFile.${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C357552autotestFile${getRandomPostfix()}.csv`; - const nameMarcFileForUpdate = `C357552autotestFile${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let statisticalCode; + const titlesItemsStatusChanged = [ + 'Making the news popular : mobilizing U.S. news audiences / Anthony M. Nadler.', + 'Genius : the game / Leopoldo Gout.', + 'Animal philosophy : essential readings in continental thought / edited by Matthew Calarco and Peter Atterton.' + ]; + const titlesItemStatusNotChanged = [ + 'Political communication in the age of dissemination.', + 'Language, borders and identity / edited by Dominic Watt and Carmen Llamas.' + ]; + const itemNote = 'THIS WAS UPDATED!'; + const jobProfileNameForExport = `C357552 Bibs with Item HRIDs ${getRandomPostfix()}`; + // file names + 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 ${getRandomPostfix()}`, - permanentLocation: LOCATION_NAMES.ONLINE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C357552 Create simple holdings ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - 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 ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - 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 ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C357552 Create simple holdings ${getRandomPostfix()}`, + permanentLocation: LOCATION_NAMES.ONLINE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C357552 Create simple holdings ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + 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 ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + 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 ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; - const matchProfileItemHrid = { - profileName: `C357552 Match 902$a to Item HRID ${getRandomPostfix()}`, - incomingRecordFields: { - field: '902', - in1: '*', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemHrid - }; + const matchProfileItemHrid = { + profileName: `C357552 Match 902$a to Item HRID ${getRandomPostfix()}`, + incomingRecordFields: { + field: '902', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemHrid + }; - const matchProfileItemStatus = { - profileName: `C357552 Item status = Available ${getRandomPostfix()}`, - incomingStaticValue: 'Available', - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - existingRecordOption: NewMatchProfile.optionsList.status, - }; + const matchProfileItemStatus = { + profileName: `C357552 Item status = Available ${getRandomPostfix()}`, + incomingStaticValue: 'Available', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + existingRecordOption: NewMatchProfile.optionsList.status, + }; - const createJobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C357552 Create simple instance, holdings, items ${getRandomPostfix()}`, - }; + const createJobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C357552 Create simple instance, holdings, items ${getRandomPostfix()}`, + }; - const updateJobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C357552 Update item based on HRID and Status ${getRandomPostfix()}`, - }; + const updateJobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C357552 Update item based on HRID and Status ${getRandomPostfix()}`, + }; - const exportMappingProfile = { - name: `C357552 Item HRID ${getRandomPostfix()}`, - }; + const exportMappingProfile = { + name: `C357552 Item HRID ${getRandomPostfix()}`, + }; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.dataExportEnableSettings.gui, - permissions.inventoryAll.gui, - permissions.uiInventoryMarcItemInProcess.gui, - permissions.uiInventoryMarcItemIntellectual.gui, - permissions.uiInventoryMarcItemLongMissing.gui, - permissions.uiInventoryMarcItemRestricted.gui, - permissions.uiInventoryMarcItemUnavailable.gui, - permissions.uiInventoryMarcItemUnknow.gui, - permissions.uiInventoryMarkItemsWithdrawn.gui, - permissions.dataExportEnableApp.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.dataExportEnableSettings.gui, + permissions.inventoryAll.gui, + permissions.uiInventoryMarcItemInProcess.gui, + permissions.uiInventoryMarcItemIntellectual.gui, + permissions.uiInventoryMarcItemLongMissing.gui, + permissions.uiInventoryMarcItemRestricted.gui, + permissions.uiInventoryMarcItemUnavailable.gui, + permissions.uiInventoryMarcItemUnknow.gui, + permissions.uiInventoryMarkItemsWithdrawn.gui, + permissions.dataExportEnableApp.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - StatisticalCodes.createViaApi().then((resp) => { - statisticalCode = `ARL (Collection stats): ${resp.code} - ${resp.name}`; + StatisticalCodes.createViaApi().then((resp) => { + statisticalCode = `ARL (Collection stats): ${resp.code} - ${resp.name}`; + }); + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); }); - cy.login(user.username, user.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - // delete generated profiles - JobProfiles.deleteJobProfile(createJobProfile.profileName); - JobProfiles.deleteJobProfile(updateJobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfileItemHrid.profileName); - MatchProfiles.deleteMatchProfile(matchProfileItemStatus.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + // delete generated profiles + JobProfiles.deleteJobProfile(createJobProfile.profileName); + JobProfiles.deleteJobProfile(updateJobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfileItemHrid.profileName); + MatchProfiles.deleteMatchProfile(matchProfileItemStatus.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpdate}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); }); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpdate}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - }); - const mappingProfileForCreateHoldings = (holdingsMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); - NewFieldMappingProfile.addStatisticalCode(statisticalCode, 4); - NewFieldMappingProfile.fillPermanentLocation(`"${holdingsMappingProfile.permanentLocation}"`); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); - }; + const mappingProfileForCreateHoldings = (holdingsMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); + NewFieldMappingProfile.addStatisticalCode(statisticalCode, 4); + NewFieldMappingProfile.fillPermanentLocation(`"${holdingsMappingProfile.permanentLocation}"`); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); + }; - const mappingProfileForCreateItem = (itemMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); - NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); - NewFieldMappingProfile.addStatisticalCode(statisticalCode, 6); - NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(itemMappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); - }; + const mappingProfileForCreateItem = (itemMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); + NewFieldMappingProfile.fillMaterialType(itemMappingProfile.materialType); + NewFieldMappingProfile.addStatisticalCode(statisticalCode, 6); + NewFieldMappingProfile.fillPermanentLoanType(itemMappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(itemMappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); + }; - const mappingProfileForUpdateItem = (itemMappingProfile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); - NewFieldMappingProfile.addItemNotes('"Note"', `"${itemNote}"`, 'Mark for all affected records'); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); - }; + const mappingProfileForUpdateItem = (itemMappingProfile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfile); + NewFieldMappingProfile.addItemNotes('"Note"', `"${itemNote}"`, 'Mark for all affected records'); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfile.name); + }; - it('C357552 Check item update via match by status (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - mappingProfileForCreateHoldings(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - mappingProfileForCreateItem(collectionOfMappingAndActionProfiles[1].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - mappingProfileForUpdateItem(collectionOfMappingAndActionProfiles[2].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + it('C357552 Check item update via match by status (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + mappingProfileForCreateHoldings(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + mappingProfileForCreateItem(collectionOfMappingAndActionProfiles[1].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + mappingProfileForUpdateItem(collectionOfMappingAndActionProfiles[2].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); - collectionOfMappingAndActionProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfileItemHrid); - MatchProfiles.checkMatchProfilePresented(matchProfileItemHrid.profileName); - MatchProfiles.createMatchProfileWithStaticValue(matchProfileItemStatus); - MatchProfiles.checkMatchProfilePresented(matchProfileItemStatus.profileName); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfileItemHrid); + MatchProfiles.checkMatchProfilePresented(matchProfileItemHrid.profileName); + MatchProfiles.createMatchProfileWithStaticValue(matchProfileItemStatus); + MatchProfiles.checkMatchProfilePresented(matchProfileItemStatus.profileName); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(createJobProfile); - NewJobProfile.linkActionProfileByName('Default - Create instance'); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(createJobProfile.profileName); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(createJobProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(createJobProfile.profileName); - // need to wait until the first job profile will be created - cy.wait(2500); - JobProfiles.createJobProfile(updateJobProfile); - NewJobProfile.linkMatchProfile(matchProfileItemHrid.profileName); - NewJobProfile.linkMatchAndActionProfilesForSubMatches(matchProfileItemStatus.profileName, collectionOfMappingAndActionProfiles[2].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(updateJobProfile.profileName); + // need to wait until the first job profile will be created + cy.wait(2500); + JobProfiles.createJobProfile(updateJobProfile); + NewJobProfile.linkMatchProfile(matchProfileItemHrid.profileName); + NewJobProfile.linkMatchAndActionProfilesForSubMatches(matchProfileItemStatus.profileName, collectionOfMappingAndActionProfiles[2].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(updateJobProfile.profileName); - // create Field mapping profile for export - cy.visit(SettingsMenu.exportMappingProfilePath); - ExportFieldMappingProfiles.createMappingProfileForItemHrid(exportMappingProfile.name); + // create Field mapping profile for export + cy.visit(SettingsMenu.exportMappingProfilePath); + ExportFieldMappingProfiles.createMappingProfileForItemHrid(exportMappingProfile.name); - cy.visit(SettingsMenu.exportJobProfilePath); - ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); + cy.visit(SettingsMenu.exportJobProfilePath); + ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); - // 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('marcFileForC357552.mrc', nameMarcFileForImportCreate); - JobProfiles.searchJobProfileForImport(createJobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); - Logs.openFileDetails(nameMarcFileForImportCreate); - for (let i = 0; i < 9; i++) { - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, i); - }); - } - [ - { - lineNumber: 0, - markFunction: ItemActions.markAsWithdrawn, - status: 'Withdrawn' - }, - { - lineNumber: 3, - markFunction: ItemActions.markAsInProcess, - status: 'In process (non-requestable)' - }, - { - lineNumber: 7, - markFunction: ItemActions.markAsUnknown, - status: 'Unknown' - } - ].forEach(marker => { - Logs.clickOnHotLink(marker.lineNumber, 5, 'Created'); - ItemRecordView.waitLoading(); - marker.markFunction(); - ItemRecordView.verifyItemStatusInPane(marker.status); + // 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('marcFileForC357552.mrc', nameMarcFileForImportCreate); + JobProfiles.searchJobProfileForImport(createJobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); Logs.openFileDetails(nameMarcFileForImportCreate); - }); + for (let i = 0; i < 9; i++) { + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, i); + }); + } + [ + { + lineNumber: 0, + markFunction: ItemActions.markAsWithdrawn, + status: 'Withdrawn' + }, + { + lineNumber: 3, + markFunction: ItemActions.markAsInProcess, + status: 'In process (non-requestable)' + }, + { + lineNumber: 7, + markFunction: ItemActions.markAsUnknown, + status: 'Unknown' + } + ].forEach(marker => { + Logs.clickOnHotLink(marker.lineNumber, 5, 'Created'); + ItemRecordView.waitLoading(); + marker.markFunction(); + ItemRecordView.verifyItemStatusInPane(marker.status); + cy.visit(TopMenu.dataImportPath); + Logs.openFileDetails(nameMarcFileForImportCreate); + }); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.filterItemByStatisticalCode(statisticalCode); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.filterItemByStatisticalCode(statisticalCode); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); - ExportFile.downloadExportedMarcFile(nameMarcFileForUpdate); + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); + ExportFile.downloadExportedMarcFile(nameMarcFileForUpdate); - // upload the exported marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(nameMarcFileForUpdate); - JobProfiles.searchJobProfileForImport(updateJobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForUpdate); - Logs.openFileDetails(nameMarcFileForUpdate); - FileDetails.checkItemQuantityInSummaryTable('7', 1); - FileDetails.checkItemQuantityInSummaryTable('3', 2); - // check items what statuses were not changed have Updated status - titlesItemStatusNotChanged.forEach(title => { - FileDetails.openItemInInventoryByTitle(title); - ItemRecordView.waitLoading(); - ItemRecordView.checkItemNote(itemNote); + // upload the exported marc file cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(nameMarcFileForUpdate); + JobProfiles.searchJobProfileForImport(updateJobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForUpdate); Logs.openFileDetails(nameMarcFileForUpdate); + FileDetails.checkItemQuantityInSummaryTable('7', 1); + FileDetails.checkItemQuantityInSummaryTable('3', 2); + // check items what statuses were not changed have Updated status + titlesItemStatusNotChanged.forEach(title => { + FileDetails.openItemInInventoryByTitle(title); + ItemRecordView.waitLoading(); + ItemRecordView.checkItemNote(itemNote); + cy.visit(TopMenu.dataImportPath); + Logs.openFileDetails(nameMarcFileForUpdate); + }); + // check items what statuses were changed have No action status + titlesItemsStatusChanged.forEach(title => { + FileDetails.checkStatusByTitle(title, FileDetails.status.noAction); + }); }); - // check items what statuses were changed have No action status - titlesItemsStatusChanged.forEach(title => { - FileDetails.checkStatusByTitle(title, FileDetails.status.noAction); - }); - }); + }); }); 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 1128f2af6d..a3c62770f7 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 @@ -25,168 +25,170 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - const rowNumbers = [0, 1]; - const instanceHrids = []; - const marcFileName = `C368005 autotestFile.${getRandomPostfix()}.mrc`; - const itemNotes = { - note: 'This is a plain note', - checkInNoteForFirstItem: 'This is a check in note', - blindingNote: 'This is a binding note', - electronicBookplate: 'This is an electronic bookplate note', - checkOutNote: 'This is a check out note', - checkInNoteForSecondItem: 'This is a check in note', - staffOnly: 'Yes' - }; - const collectionOfProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C368005 Create instance for mapping notes ${getRandomPostfix()}`, - catalogingDate: '###TODAY###' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C368005 Create instance for mapping notes ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - 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 ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368005 Create item for mapping notes ${getRandomPostfix()}`, - materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, - noteType: '876$t', - note: '876$n', - staffOnly: 'Mark for all affected records', - noteTypeForCheckIn: '878$t', - noteForCheckIn: '878$a', - staffOnlyForCheckIn: 'Mark for all affected records', - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, - status: ITEM_STATUS_NAMES.AVAILABLE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368005 Create items for mapping notes ${getRandomPostfix()}` } - } - ]; - const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C368005 Create mappings for item notes ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + const rowNumbers = [0, 1]; + const instanceHrids = []; + const marcFileName = `C368005 autotestFile.${getRandomPostfix()}.mrc`; + const itemNotes = { + note: 'This is a plain note', + checkInNoteForFirstItem: 'This is a check in note', + blindingNote: 'This is a binding note', + electronicBookplate: 'This is an electronic bookplate note', + checkOutNote: 'This is a check out note', + checkInNoteForSecondItem: 'This is a check in note', + staffOnly: 'Yes' + }; + const collectionOfProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C368005 Create instance for mapping notes ${getRandomPostfix()}`, + catalogingDate: '###TODAY###' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C368005 Create instance for mapping notes ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + 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 ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C368005 Create item for mapping notes ${getRandomPostfix()}`, + materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, + noteType: '876$t', + note: '876$n', + staffOnly: 'Mark for all affected records', + noteTypeForCheckIn: '878$t', + noteForCheckIn: '878$a', + staffOnlyForCheckIn: 'Mark for all affected records', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C368005 Create items for mapping notes ${getRandomPostfix()}` } + } + ]; + const jobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `C368005 Create mappings for item notes ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.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); - // delete generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - collectionOfProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); - instanceHrids.forEach(hrid => { - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) - .then((instance) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); }); }); - }); - it('C368005 Verify the mapping for item record notes and check in/out notes from MARC field (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + after('delete test data', () => { + Users.deleteViaApi(user.userId); + // delete generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + instanceHrids.forEach(hrid => { + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) + .then((instance) => { + cy.deleteItemViaApi(instance.items[0].id); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + }); + + it('C368005 Verify the mapping for item record notes and check in/out notes from MARC field (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create Field mapping profiles - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfiles[2].mappingProfile); - NewFieldMappingProfile.fillMaterialType(collectionOfProfiles[2].mappingProfile.materialType); - NewFieldMappingProfile.addItemNotes(collectionOfProfiles[2].mappingProfile.noteType, collectionOfProfiles[2].mappingProfile.note, collectionOfProfiles[2].mappingProfile.staffOnly); - NewFieldMappingProfile.addCheckInCheckOutNote(collectionOfProfiles[2].mappingProfile.noteTypeForCheckIn, collectionOfProfiles[2].mappingProfile.noteForCheckIn, collectionOfProfiles[2].mappingProfile.staffOnlyForCheckIn); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfProfiles[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfProfiles[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfiles[2].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfiles[2].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfProfiles[2].mappingProfile.materialType); + NewFieldMappingProfile.addItemNotes(collectionOfProfiles[2].mappingProfile.noteType, collectionOfProfiles[2].mappingProfile.note, collectionOfProfiles[2].mappingProfile.staffOnly); + NewFieldMappingProfile.addCheckInCheckOutNote(collectionOfProfiles[2].mappingProfile.noteTypeForCheckIn, collectionOfProfiles[2].mappingProfile.noteForCheckIn, collectionOfProfiles[2].mappingProfile.staffOnlyForCheckIn); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfProfiles[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfProfiles[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfiles[2].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[2].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfiles[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfProfiles[1].mappingProfile.permanetLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfiles[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfiles[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfProfiles[1].mappingProfile.permanetLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfiles[0].mappingProfile); - NewFieldMappingProfile.fillCatalogedDate(collectionOfProfiles[0].mappingProfile.catalogingDate); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfiles[0].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[0].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfiles[0].mappingProfile); + NewFieldMappingProfile.fillCatalogedDate(collectionOfProfiles[0].mappingProfile.catalogingDate); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfiles[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[0].mappingProfile.name); - // create Action profiles - collectionOfProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create Action profiles + collectionOfProfiles.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.linkActionProfile(collectionOfProfiles[0].actionProfile); - NewJobProfile.linkActionProfile(collectionOfProfiles[1].actionProfile); - NewJobProfile.linkActionProfile(collectionOfProfiles[2].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(collectionOfProfiles[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfProfiles[1].actionProfile); + NewJobProfile.linkActionProfile(collectionOfProfiles[2].actionProfile); + 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.verifyUploadState(); - DataImport.uploadFile('marcFileForC368005.mrc', marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, 1); - }); - FileDetails.checkItemsQuantityInSummaryTable(0, '2'); + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC368005.mrc', marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, 1); + }); + FileDetails.checkItemsQuantityInSummaryTable(0, '2'); - // get instance hrids - rowNumbers.forEach(row => { - FileDetails.openInstanceInInventory('Created', row); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrids.push(initialInstanceHrId); + // get instance hrids + rowNumbers.forEach(row => { + FileDetails.openInstanceInInventory('Created', row); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrids.push(initialInstanceHrId); + }); + cy.go('back'); }); + + // check item notes in Inventory + FileDetails.openItemInInventory('Created'); + ItemRecordView.checkItemNote(itemNotes.note, itemNotes.staffOnly); + ItemRecordView.checkCheckInNote(itemNotes.checkInNoteForFirstItem); cy.go('back'); + FileDetails.openItemInInventory('Created', 1); + ItemRecordView.checkBindingNote(itemNotes.blindingNote); + ItemRecordView.checkElectronicBookplateNote(itemNotes.electronicBookplate); + ItemRecordView.checkCheckOutNote(itemNotes.checkOutNote); + ItemRecordView.checkCheckInNote(itemNotes.checkInNoteForSecondItem); }); - - // check item notes in Inventory - FileDetails.openItemInInventory('Created'); - ItemRecordView.checkItemNote(itemNotes.note, itemNotes.staffOnly); - ItemRecordView.checkCheckInNote(itemNotes.checkInNoteForFirstItem); - cy.go('back'); - FileDetails.openItemInInventory('Created', 1); - ItemRecordView.checkBindingNote(itemNotes.blindingNote); - ItemRecordView.checkElectronicBookplateNote(itemNotes.electronicBookplate); - ItemRecordView.checkCheckOutNote(itemNotes.checkOutNote); - ItemRecordView.checkCheckInNote(itemNotes.checkInNoteForSecondItem); - }); + }); }); 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 index 1aab5fe026..f052cc1323 100644 --- 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 @@ -25,158 +25,160 @@ import InstanceStatusTypes from '../../../support/fragments/settings/inventory/i 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 - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + 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, - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.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); + NewInstanceStatusType.createViaApi() + .then((initialInstanceStatusType) => { + testData.instanceStatusTypeId = initialInstanceStatusType.body.id; + }); + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); }); - 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); + + 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] }, () => { + 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); + 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); + 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 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); + // 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); + 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); + }); }); - 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-bib-import-delete-linked-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/marc-bib-import-delete-linked-field.cy.js index 69d00af139..66fedd8de9 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/marc-bib-import-delete-linked-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/marc-bib-import-delete-linked-field.cy.js @@ -22,207 +22,209 @@ import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthor import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; -describe('Importing MARC Bib files', () => { - function replace999SubfieldsInPreupdatedFile(exportedFileName, preUpdatedFileName, finalFileName) { - FileManager.readFile(`cypress/fixtures/${exportedFileName}`) - .then((actualContent) => { - const lines = actualContent.split(''); - const field999data = lines[lines.length - 2]; - FileManager.readFile(`cypress/fixtures/${preUpdatedFileName}`) - .then((updatedContent) => { - const content = updatedContent.split('\n'); - let firstString = content[0].slice(); - firstString = firstString.replace('ff000000000-0000-0000-0000-000000000000i00000000-0000-0000-0000-000000000000', field999data); - content[0] = firstString; - FileManager.createFile(`cypress/fixtures/${finalFileName}`, content.join('\n')); - }); - }); - } - - const testData = { - tag100: '100', - tag010: '010', - contributorAccordion: 'Contributor' - }; - const nameForUpdatedMarcBibFile = `C376946autotestFile${getRandomPostfix()}.mrc`; - const nameForExportedMarcBibFile = `C376946autotestFile${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C376946autotestFile${getRandomPostfix()}.csv`; - const nameForPreUpdatedMarcBibFile = 'C376946MarcBibPreUpdated.mrc'; - const mappingProfile = { - name: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - update: true, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const matchProfile = { - profileName: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - existingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - const marcFiles = [ - { - marc: 'C376946MarcBib.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - instanceTitle: 'The other side of paradise : a memoir / Staceyann Chin. C376946' - }, - { - marc: 'C376946MarcAuth.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - authorityHeading: 'Chin, Staceyann, 1972- C376946', - authority010FieldValue: 'n2008052404376946', +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + function replace999SubfieldsInPreupdatedFile(exportedFileName, preUpdatedFileName, finalFileName) { + FileManager.readFile(`cypress/fixtures/${exportedFileName}`) + .then((actualContent) => { + const lines = actualContent.split(''); + const field999data = lines[lines.length - 2]; + FileManager.readFile(`cypress/fixtures/${preUpdatedFileName}`) + .then((updatedContent) => { + const content = updatedContent.split('\n'); + let firstString = content[0].slice(); + firstString = firstString.replace('ff000000000-0000-0000-0000-000000000000i00000000-0000-0000-0000-000000000000', field999data); + content[0] = firstString; + FileManager.createFile(`cypress/fixtures/${finalFileName}`, content.join('\n')); + }); + }); } - ]; - const createdRecordIDs = []; - before('Creating user', () => { - cy.createTempUser([ - Permissions.moduleDataImportEnabled.gui, - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.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); - Logs.getCreatedItemsID().then(link => { - createdRecordIDs.push(link.split('/')[5]); + const testData = { + tag100: '100', + tag010: '010', + contributorAccordion: 'Contributor' + }; + const nameForUpdatedMarcBibFile = `C376946autotestFile${getRandomPostfix()}.mrc`; + const nameForExportedMarcBibFile = `C376946autotestFile${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C376946autotestFile${getRandomPostfix()}.csv`; + const nameForPreUpdatedMarcBibFile = 'C376946MarcBibPreUpdated.mrc'; + const mappingProfile = { + name: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + update: true, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const matchProfile = { + profileName: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + existingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: 'C376946 Update MARC Bib records by matching 999 ff $s subfield value', + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const marcFiles = [ + { + marc: 'C376946MarcBib.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + instanceTitle: 'The other side of paradise : a memoir / Staceyann Chin. C376946' + }, + { + marc: 'C376946MarcAuth.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Chin, Staceyann, 1972- C376946', + authority010FieldValue: 'n2008052404376946', + } + ]; + const createdRecordIDs = []; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.dataExportEnableApp.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); + Logs.getCreatedItemsID().then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); }); }); - }); - cy.loginAsAdmin().then(() => { + cy.loginAsAdmin().then(() => { // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); - 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.openNewJobProfileForm(); - NewJobProfile.fillJobProfile(jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileByName(actionProfile.name); - // wait for the action profile to be linked - cy.wait(1000); - NewJobProfile.saveAndClose(); - JobProfiles.waitLoadingList(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - }); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); + 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.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileByName(actionProfile.name); + // wait for the action profile to be linked + cy.wait(1000); + NewJobProfile.saveAndClose(); + JobProfiles.waitLoadingList(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + }); - // link MARC Bib field to MARC Authority - cy.visit(TopMenu.inventoryPath).then(() => { - InventoryInstances.waitContentLoading(); - InventoryInstance.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - InventoryInstance.verifyAndClickLinkIcon(testData.tag100); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(marcFiles[1].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag100); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); - }); + // link MARC Bib field to MARC Authority + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag100); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag100); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); }); - }); - after('delete test data', () => { - Users.deleteViaApi(testData.userProperties.userId); - InventoryInstance.deleteInstanceViaApi(createdRecordIDs[0]); - MarcAuthority.deleteViaAPI(createdRecordIDs[1]); - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcBibFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcBibFile}`); - }); + after('delete test data', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdRecordIDs[0]); + MarcAuthority.deleteViaAPI(createdRecordIDs[1]); + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcBibFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcBibFile}`); + }); - it('C376946 Delete non-repeatable linked field which is controlled by "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - InventoryInstance.searchByTitle(createdRecordIDs[0]); - // download .csv file - 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(nameForExportedMarcBibFile); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - cy.log('#####End Of Export#####'); + it('C376946 Delete non-repeatable linked field which is controlled by "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstance.searchByTitle(createdRecordIDs[0]); + // download .csv file + 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(nameForExportedMarcBibFile); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + cy.log('#####End Of Export#####'); - // add 999 subfield values from exported file to pre-updated file with field 100 deleted - replace999SubfieldsInPreupdatedFile(nameForExportedMarcBibFile, nameForPreUpdatedMarcBibFile, nameForUpdatedMarcBibFile); + // add 999 subfield values from exported file to pre-updated file with field 100 deleted + replace999SubfieldsInPreupdatedFile(nameForExportedMarcBibFile, nameForPreUpdatedMarcBibFile, nameForUpdatedMarcBibFile); - // upload the updated MARC file with 999 subfields and without 100 field - cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile(nameForUpdatedMarcBibFile, nameForUpdatedMarcBibFile); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForUpdatedMarcBibFile); - Logs.checkStatusOfJobProfile('Completed'); - Logs.openFileDetails(nameForUpdatedMarcBibFile); + // upload the updated MARC file with 999 subfields and without 100 field + cy.visit(TopMenu.dataImportPath); + DataImport.uploadFile(nameForUpdatedMarcBibFile, nameForUpdatedMarcBibFile); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForUpdatedMarcBibFile); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(nameForUpdatedMarcBibFile); - cy.visit(TopMenu.inventoryPath); - InventoryInstance.searchByTitle(marcFiles[0].instanceTitle); - InventoryInstances.selectInstance(); - InventoryInstance.checkValueAbsenceInDetailView(testData.contributorAccordion, marcFiles[1].authorityHeading); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.checkFieldAbsense(testData.tag100); + cy.visit(TopMenu.inventoryPath); + InventoryInstance.searchByTitle(marcFiles[0].instanceTitle); + InventoryInstances.selectInstance(); + InventoryInstance.checkValueAbsenceInDetailView(testData.contributorAccordion, marcFiles[1].authorityHeading); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.checkFieldAbsense(testData.tag100); - cy.visit(TopMenu.marcAuthorities); - MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); - MarcAuthorities.verifyEmptyNumberOfTitles(); + cy.visit(TopMenu.marcAuthorities); + MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); + MarcAuthorities.verifyEmptyNumberOfTitles(); + }); }); }); 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 8c780c139f..5bb3ce5ded 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 @@ -22,144 +22,146 @@ import InstanceRecordView from '../../../support/fragments/inventory/instanceRec import FieldMappingProfileView from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfileView'; import FileManager from '../../../support/utils/fileManager'; -describe('ui-data-import', () => { - let instanceHrid; - const quantityOfItems = '1'; - // unique file names - 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.${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.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC - }; - const instanceActionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - 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.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const matchProfile = { - profileName: `C17019 autotest match profile.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - existingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17019 autotest job profile.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let instanceHrid; + const quantityOfItems = '1'; + // unique file names + 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.${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.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC + }; + const instanceActionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + 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.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const matchProfile = { + profileName: `C17019 autotest match profile.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + existingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17019 autotest job profile.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.getAdminToken(); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); + before('login', () => { + cy.getAdminToken(); + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(instanceActionProfile.name); - ActionProfiles.deleteActionProfile(marcBibActionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfile.name); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(instanceActionProfile.name); + ActionProfiles.deleteActionProfile(marcBibActionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfile.name); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C17019 Check that MARC Update select fields works properly (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - DataImport.uploadFileViaApi('oneMarcBib.mrc', marcFileForCreate); - JobProfiles.waitFileIsImported(marcFileForCreate); - Logs.openFileDetails(marcFileForCreate); - // get instance hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + it('C17019 Check that MARC Update select fields works properly (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + DataImport.uploadFileViaApi('oneMarcBib.mrc', marcFileForCreate); + JobProfiles.waitFileIsImported(marcFileForCreate); + Logs.openFileDetails(marcFileForCreate); + // get instance hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; - // change Instance HRID in .mrc file - DataImport.editMarcFile('oneMarcBib.mrc', editedMarcFileName, ['ocn962073864'], [instanceHrid]); - }); + // change Instance HRID in .mrc file + DataImport.editMarcFile('oneMarcBib.mrc', editedMarcFileName, ['ocn962073864'], [instanceHrid]); + }); - // create field mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); - NewFieldMappingProfile.addStatisticalCode(instanceMappingProfile.statisticalCode, 8); - NewFieldMappingProfile.fillInstanceStatusTerm(instanceMappingProfile.statusTerm); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfile.name); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); + // create field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfile); + NewFieldMappingProfile.addStatisticalCode(instanceMappingProfile.statisticalCode, 8); + NewFieldMappingProfile.fillInstanceStatusTerm(instanceMappingProfile.statusTerm); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfile.name); + FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - FieldMappingProfiles.createMappingProfileForUpdatesMarc(marcBibMappingProfile); - FieldMappingProfileView.checkUpdatesSectionOfMappingProfile(marcBibMappingProfile); - FieldMappingProfileView.checkOverrideProtectedSection(marcBibMappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(marcBibMappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + FieldMappingProfiles.createMappingProfileForUpdatesMarc(marcBibMappingProfile); + FieldMappingProfileView.checkUpdatesSectionOfMappingProfile(marcBibMappingProfile); + FieldMappingProfileView.checkOverrideProtectedSection(marcBibMappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(marcBibMappingProfile.name); - // create action profiles - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(instanceActionProfile, instanceMappingProfile.name); - ActionProfiles.checkActionProfilePresented(instanceActionProfile.name); + // create action profiles + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(instanceActionProfile, instanceMappingProfile.name); + ActionProfiles.checkActionProfilePresented(instanceActionProfile.name); - ActionProfiles.create(marcBibActionProfile, marcBibMappingProfile.name); - ActionProfiles.checkActionProfilePresented(marcBibActionProfile.name); + ActionProfiles.create(marcBibActionProfile, marcBibMappingProfile.name); + ActionProfiles.checkActionProfilePresented(marcBibActionProfile.name); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create job profiles - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndTwoActionProfiles(matchProfile.profileName, marcBibActionProfile.name, instanceActionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profiles + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchAndTwoActionProfiles(matchProfile.profileName, marcBibActionProfile.name, instanceActionProfile.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.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, fileNameForUpdate); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForUpdate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForUpdate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 1); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, fileNameForUpdate); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 1); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); - // check updated instance in Inventory - FileDetails.openInstanceInInventory('Updated'); - InstanceRecordView.verifyStatisticalCode(instanceMappingProfile.statisticalCodeUI); - InstanceRecordView.verifyInstanceStatusTerm(instanceMappingProfile.instanceStatus); - InventoryInstance.viewSource(); - }); + // check updated instance in Inventory + FileDetails.openInstanceInInventory('Updated'); + InstanceRecordView.verifyStatisticalCode(instanceMappingProfile.statisticalCodeUI); + InstanceRecordView.verifyInstanceStatusTerm(instanceMappingProfile.instanceStatus); + InventoryInstance.viewSource(); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js index 05fb6558a1..cc94dd9aa1 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js @@ -25,169 +25,171 @@ import permissions from '../../../support/dictionary/permissions'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let userId = null; - const randomIdentifierCode = `(OCoLC)847143${generateItemBarcode()}8`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const filePathForCreateInstance = 'marcFileForMatchOnIdentifierForCreate.mrc'; - const filePathForUpdateInstance = 'marcFileForMatchOnIdentifierForUpdate_3.mrc'; - const editedMarcFileNameForCreate = `C347830 marcFileForCreate.${getRandomPostfix()}.mrc`; - const editedMarcFileNameForUpdate = `C347830 marcFileForUpdate.${getRandomPostfix()}.mrc`; - const fileNameForCreateInstance = `C347830autotestFile.${getRandomPostfix()}.mrc`; - const fileNameForUpdateInstance = `C347830autotestFile.${getRandomPostfix()}.mrc`; - const instanceGeneralNote = 'IDENTIFIER UPDATE 3'; - const resourceIdentifiers = [ - { type: 'UPC', value: 'ORD32671387-4' }, - { type: 'OCLC', value: randomIdentifierCode }, - { type: 'Invalid UPC', value: 'ORD32671387-4' }, - { type: 'System control number', value: '(AMB)84714376518561876438' }, - ]; - const matchProfile = { - profileName: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, - incomingRecordFields: { - field: '035', - in1: '*', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - qualifierType: 'Begins with', - qualifierValue: '(OCoLC)', - compareValue: 'Numerics only', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - existingRecordOption: NewMatchProfile.optionsList.identifierOCLC, - compareValueInComparison: 'Numerics only' - }; - const mappingProfile = { - name: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - staffSuppress: 'Unmark for all affected records', - catalogedDate: '"2021-12-03"', - catalogedDateUI: '2021-12-03', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.NOTYETASSIGNED - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let userId = null; + const randomIdentifierCode = `(OCoLC)847143${generateItemBarcode()}8`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const filePathForCreateInstance = 'marcFileForMatchOnIdentifierForCreate.mrc'; + const filePathForUpdateInstance = 'marcFileForMatchOnIdentifierForUpdate_3.mrc'; + const editedMarcFileNameForCreate = `C347830 marcFileForCreate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForUpdate = `C347830 marcFileForUpdate.${getRandomPostfix()}.mrc`; + const fileNameForCreateInstance = `C347830autotestFile.${getRandomPostfix()}.mrc`; + const fileNameForUpdateInstance = `C347830autotestFile.${getRandomPostfix()}.mrc`; + const instanceGeneralNote = 'IDENTIFIER UPDATE 3'; + const resourceIdentifiers = [ + { type: 'UPC', value: 'ORD32671387-4' }, + { type: 'OCLC', value: randomIdentifierCode }, + { type: 'Invalid UPC', value: 'ORD32671387-4' }, + { type: 'System control number', value: '(AMB)84714376518561876438' }, + ]; + const matchProfile = { + profileName: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + qualifierType: 'Begins with', + qualifierValue: '(OCoLC)', + compareValue: 'Numerics only', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.identifierOCLC, + compareValueInComparison: 'Numerics only' + }; + const mappingProfile = { + name: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + staffSuppress: 'Unmark for all affected records', + catalogedDate: '"2021-12-03"', + catalogedDateUI: '2021-12-03', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.NOTYETASSIGNED + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C347830 ID Match Test - Update3 (OCLC).${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.getAdminToken() - .then(() => { - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) - .then(instances => { - if (instances) { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); - }); + before('create test data', () => { + cy.getAdminToken() + .then(() => { + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) + .then(instances => { + if (instances) { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + } + }); + }); - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui, - permissions.inventoryAll.gui, - permissions.settingsDataImportEnabled.gui, - permissions.viewEditDeleteInvoiceInvoiceLine.gui, - permissions.viewEditCreateInvoiceInvoiceLine.gui, - permissions.assignAcqUnitsToNewInvoice.gui, - permissions.invoiceSettingsAll.gui, - permissions.remoteStorageView.gui - ]) - .then(userProperties => { - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui, + permissions.inventoryAll.gui, + permissions.settingsDataImportEnabled.gui, + permissions.viewEditDeleteInvoiceInvoiceLine.gui, + permissions.viewEditCreateInvoiceInvoiceLine.gui, + permissions.assignAcqUnitsToNewInvoice.gui, + permissions.invoiceSettingsAll.gui, + permissions.remoteStorageView.gui + ]) + .then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); }); - }); - }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - Users.deleteViaApi(userId); - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) - .then(instances => { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Users.deleteViaApi(userId); + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) + .then(instances => { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); }); - }); - }); + }); - it('C347830 Match on Instance identifier match meets both the Identifier type and Data requirements Scenario 3 (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - DataImport.editMarcFile(filePathForCreateInstance, editedMarcFileNameForCreate, - ['(OCoLC)84714376518561876438'], [randomIdentifierCode]); - DataImport.editMarcFile(filePathForUpdateInstance, editedMarcFileNameForUpdate, - ['(OCoLC)84714376518561876438'], [randomIdentifierCode]); + it('C347830 Match on Instance identifier match meets both the Identifier type and Data requirements Scenario 3 (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + DataImport.editMarcFile(filePathForCreateInstance, editedMarcFileNameForCreate, + ['(OCoLC)84714376518561876438'], [randomIdentifierCode]); + DataImport.editMarcFile(filePathForUpdateInstance, editedMarcFileNameForUpdate, + ['(OCoLC)84714376518561876438'], [randomIdentifierCode]); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreateInstance); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForCreateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForCreateInstance); - Logs.clickOnHotLink(0, 3, 'Created'); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); - cy.go('back'); - Logs.clickOnHotLink(1, 3, 'Created'); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreateInstance); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForCreateInstance); + Logs.clickOnHotLink(0, 3, 'Created'); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); + cy.go('back'); + Logs.clickOnHotLink(1, 3, 'Created'); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithQualifierAndComparePart(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithQualifierAndComparePart(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); - NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdateInstance); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForUpdateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForUpdateInstance); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc, 1); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.instance, 1); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdateInstance); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdateInstance); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc, 1); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.instance, 1); - // check updated instance in Inventory - FileDetails.openInstanceInInventory('Updated'); - InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); - InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); - }); + // check updated instance in Inventory + FileDetails.openInstanceInInventory('Updated'); + InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); + InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js index f04eeaa8c3..b49a76ce28 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js @@ -28,165 +28,167 @@ import GenerateIdentifierCode from '../../../support/utils/generateIdentifierCod import FileManager from '../../../support/utils/fileManager'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - const randomIdentifierCode = GenerateIdentifierCode.getRandomIdentifierCode(); - const editedMarcFileNameForCreate = `C347831 marcFileForCreate.${getRandomPostfix()}.mrc`; - const editedMarcFileNameForUpdate = `C347831 marcFileForUpdate.${getRandomPostfix()}.mrc`; - const fileNameForCreateInstance = `C347831autotestFile.${getRandomPostfix()}.mrc`; - const fileNameForUpdateInstance = `C347831autotestFile.${getRandomPostfix()}.mrc`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const firstInstanceTitle = 'Competing with idiots : Herman and Joe Mankiewicz, a dual portrait / Nick Davis.'; - const secondInstaneTitle = 'Letters from a Stoic : The Ancient Classic / Seneca, with a introduction of Donald Robertson.'; - const instanceGeneralNote = 'IDENTIFIER UPDATE 4'; - const resourceIdentifiers = [ - { type: 'UPC', value: 'ORD32671387-4' }, - { type: 'OCLC', value: '(OCoLC)84714376518561876438' }, - { type: 'Invalid UPC', value: 'ORD32671387-4' }, - { type: 'System control number', value: `(${randomIdentifierCode})84714376518561876438` }, - ]; - const matchProfile = { - profileName: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, - incomingRecordFields: { - field: '035', - in1: '*', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - qualifierType: 'Begins with', - qualifierValue: `(${randomIdentifierCode})`, - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - existingRecordOption: NewMatchProfile.optionsList.systemControlNumber - }; - const mappingProfile = { - name: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - staffSuppress: 'Unmark for all affected records', - catalogedDate: '"2021-12-04"', - catalogedDateUI: '2021-12-04', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.OTHER - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + const randomIdentifierCode = GenerateIdentifierCode.getRandomIdentifierCode(); + const editedMarcFileNameForCreate = `C347831 marcFileForCreate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForUpdate = `C347831 marcFileForUpdate.${getRandomPostfix()}.mrc`; + const fileNameForCreateInstance = `C347831autotestFile.${getRandomPostfix()}.mrc`; + const fileNameForUpdateInstance = `C347831autotestFile.${getRandomPostfix()}.mrc`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const firstInstanceTitle = 'Competing with idiots : Herman and Joe Mankiewicz, a dual portrait / Nick Davis.'; + const secondInstaneTitle = 'Letters from a Stoic : The Ancient Classic / Seneca, with a introduction of Donald Robertson.'; + const instanceGeneralNote = 'IDENTIFIER UPDATE 4'; + const resourceIdentifiers = [ + { type: 'UPC', value: 'ORD32671387-4' }, + { type: 'OCLC', value: '(OCoLC)84714376518561876438' }, + { type: 'Invalid UPC', value: 'ORD32671387-4' }, + { type: 'System control number', value: `(${randomIdentifierCode})84714376518561876438` }, + ]; + const matchProfile = { + profileName: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + qualifierType: 'Begins with', + qualifierValue: `(${randomIdentifierCode})`, + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.systemControlNumber + }; + const mappingProfile = { + name: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + staffSuppress: 'Unmark for all affected records', + catalogedDate: '"2021-12-04"', + catalogedDateUI: '2021-12-04', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.OTHER + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C347831 ID Match Test - Update4 (System control number).${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.getAdminToken() - .then(() => { - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) - .then(instances => { - if (instances) { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); - }); + before('create test data', () => { + cy.getAdminToken() + .then(() => { + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) + .then(instances => { + if (instances) { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + } + }); + }); - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.dataImportDeleteLogs.gui, - permissions.inventoryAll.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, - { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.dataImportDeleteLogs.gui, + permissions.inventoryAll.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - Users.deleteViaApi(user.userId); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForCreate}`); - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForUpdate}`); - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) - .then(instances => { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Users.deleteViaApi(user.userId); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForCreate}`); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForUpdate}`); + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value) + .then(instances => { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); }); - }); - }); + }); - it('C347831 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 4 (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C347831 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 4 (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // change files for create and update instance using random identifier code - DataImport.editMarcFile('marcFileForMatchOnIdentifierForCreate.mrc', editedMarcFileNameForCreate, - ['AMB'], [randomIdentifierCode]); - DataImport.editMarcFile('marcFileForMatchOnIdentifierForUpdate_4.mrc', editedMarcFileNameForUpdate, - ['AMB'], [randomIdentifierCode]); + DataImport.editMarcFile('marcFileForMatchOnIdentifierForCreate.mrc', editedMarcFileNameForCreate, + ['AMB'], [randomIdentifierCode]); + DataImport.editMarcFile('marcFileForMatchOnIdentifierForUpdate_4.mrc', editedMarcFileNameForUpdate, + ['AMB'], [randomIdentifierCode]); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreateInstance); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForCreateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForCreateInstance); - Logs.clickOnHotLink(0, 3, 'Created'); - InventoryInstance.verifyInstanceTitle(firstInstanceTitle); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); - cy.go('back'); - Logs.clickOnHotLink(1, 3, 'Created'); - InventoryInstance.verifyInstanceTitle(secondInstaneTitle); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreateInstance); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForCreateInstance); + Logs.clickOnHotLink(0, 3, 'Created'); + InventoryInstance.verifyInstanceTitle(firstInstanceTitle); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 6); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 4); + cy.go('back'); + Logs.clickOnHotLink(1, 3, 'Created'); + InventoryInstance.verifyInstanceTitle(secondInstaneTitle); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[3].type, resourceIdentifiers[3].value, 3); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithQualifierAndExistingRecordField(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithQualifierAndExistingRecordField(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); - NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatus); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdateInstance); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForUpdateInstance); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForUpdateInstance); - FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.instance); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, 1); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance, 1); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdateInstance); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdateInstance); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdateInstance); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.instance); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, 1); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance, 1); - // check updated instance in Inventory - FileDetails.openInstanceInInventory('Updated', 1); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); - InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); - InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); - }); + // check updated instance in Inventory + FileDetails.openInstanceInInventory('Updated', 1); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); + InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); + InstanceRecordView.verifyGeneralNoteContent(instanceGeneralNote); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js index 54b92d6e3a..d51f4777e6 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js @@ -27,345 +27,347 @@ import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRec import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; import FileManager from '../../../support/utils/fileManager'; -describe('ui-data-import', () => { - const permanentLocation = 'Main Library (KU/CC/DI/M)'; - const recordType = 'MARC_BIBLIOGRAPHIC'; - const rowNumbers = [0, 1, 2]; - const instanceHrids = []; - // elements for update items - const noteForHoldingsMappingProfile = 'This note for holdings mapping profile'; - const noteForItemMappingProfile = 'This note for item mapping profile'; - // unique file name - const marcFileForCreate = `C17027 autoTestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C17027 marcFileForMatchOnLocation.${getRandomPostfix()}.mrc`; - const fileNameAfterUpdate = `C17027 marcFileForMatchOnLocation.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const permanentLocation = 'Main Library (KU/CC/DI/M)'; + const recordType = 'MARC_BIBLIOGRAPHIC'; + const rowNumbers = [0, 1, 2]; + const instanceHrids = []; + // elements for update items + const noteForHoldingsMappingProfile = 'This note for holdings mapping profile'; + const noteForItemMappingProfile = 'This note for item mapping profile'; + // unique file name + const marcFileForCreate = `C17027 autoTestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C17027 marcFileForMatchOnLocation.${getRandomPostfix()}.mrc`; + const fileNameAfterUpdate = `C17027 marcFileForMatchOnLocation.${getRandomPostfix()}.mrc`; - // profiles for creating instance, holdings, item - const instanceMappingProfileForCreate = { - profile:{ - name: `autotest_instance_mapping_profile_${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - } - }; - const holdingsMappingProfileForCreate = { - profile:{ - name: `autotest_holdings_mapping_profile_${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - mappingDetails: { name: 'holdings', - recordType: 'HOLDINGS', - mappingFields: [ - { name: 'permanentLocationId', - enabled: true, - path: 'holdings.permanentLocationId', - value: `"${permanentLocation}"` }] } - } - }; - const itemMappingProfileForCreate = { - profile:{ - name: `autotest_item_mapping_profile_${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - mappingDetails: { name: 'item', - recordType: 'ITEM', - mappingFields: [ - { name: 'materialType.id', - enabled: true, - path: 'item.materialType.id', - value: '"book"', - acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, - { name: 'permanentLoanType.id', - enabled: true, - path: 'item.permanentLoanType.id', - value: '"Can circulate"', - acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, - { name: 'status.name', - enabled: true, - path: 'item.status.name', - value: '"Available"' }, - { name: 'permanentLocation.id', - enabled: 'true', - path: 'item.permanentLocation.id', - value: `"${permanentLocation}"`, - acceptedValues: { 'fcd64ce1-6995-48f0-840e-89ffa2288371' : 'Main Library (KU/CC/DI/M)' } }] } - } - }; - const instanceActionProfileForCreate = { - profile: { - name: `autotest_instance_action_profile_${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'INSTANCE' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + // profiles for creating instance, holdings, item + const instanceMappingProfileForCreate = { + profile:{ + name: `autotest_instance_mapping_profile_${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, } - ], - deletedRelations: [] - }; - const holdingsActionProfileForCreate = { - profile: { - name: `autotest_holdings_action_profile_${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'HOLDINGS' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + }; + const holdingsMappingProfileForCreate = { + profile:{ + name: `autotest_holdings_mapping_profile_${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + mappingDetails: { name: 'holdings', + recordType: 'HOLDINGS', + mappingFields: [ + { name: 'permanentLocationId', + enabled: true, + path: 'holdings.permanentLocationId', + value: `"${permanentLocation}"` }] } } - ], - deletedRelations: [] - }; - const itemActionProfileForCreate = { - profile: { - name: `autotest_item_action_profile_${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'ITEM' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + }; + const itemMappingProfileForCreate = { + profile:{ + name: `autotest_item_mapping_profile_${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + mappingDetails: { name: 'item', + recordType: 'ITEM', + mappingFields: [ + { name: 'materialType.id', + enabled: true, + path: 'item.materialType.id', + value: '"book"', + acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, + { name: 'permanentLoanType.id', + enabled: true, + path: 'item.permanentLoanType.id', + value: '"Can circulate"', + acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, + { name: 'status.name', + enabled: true, + path: 'item.status.name', + value: '"Available"' }, + { name: 'permanentLocation.id', + enabled: 'true', + path: 'item.permanentLocation.id', + value: `"${permanentLocation}"`, + acceptedValues: { 'fcd64ce1-6995-48f0-840e-89ffa2288371' : 'Main Library (KU/CC/DI/M)' } }] } } - ], - deletedRelations: [] - }; - const testData = [ - { mappingProfile: instanceMappingProfileForCreate, - actionProfile: instanceActionProfileForCreate }, - { mappingProfile: holdingsMappingProfileForCreate, - actionProfile: holdingsActionProfileForCreate }, - { mappingProfile: itemMappingProfileForCreate, - actionProfile: itemActionProfileForCreate }, - ]; - const jobProfileForCreate = { - profile: { - name: `autotest_job_profile_${getRandomPostfix()}`, - dataType: ACCEPTED_DATA_TYPE_NAMES.MARC - }, - addedRelations: [], - deletedRelations: [] - }; + }; + const instanceActionProfileForCreate = { + profile: { + name: `autotest_instance_action_profile_${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'INSTANCE' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const holdingsActionProfileForCreate = { + profile: { + name: `autotest_holdings_action_profile_${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'HOLDINGS' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const itemActionProfileForCreate = { + profile: { + name: `autotest_item_action_profile_${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'ITEM' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const testData = [ + { mappingProfile: instanceMappingProfileForCreate, + actionProfile: instanceActionProfileForCreate }, + { mappingProfile: holdingsMappingProfileForCreate, + actionProfile: holdingsActionProfileForCreate }, + { mappingProfile: itemMappingProfileForCreate, + actionProfile: itemActionProfileForCreate }, + ]; + const jobProfileForCreate = { + profile: { + name: `autotest_job_profile_${getRandomPostfix()}`, + dataType: ACCEPTED_DATA_TYPE_NAMES.MARC + }, + addedRelations: [], + deletedRelations: [] + }; - // profiles for updating instance, holdings, item - const collectionOfMatchProfiles = [ - { - matchProfile: { profileName: `C17027 match profile Instance HRID or UUID.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001', - }, - existingRecordFields: { - field: '001', - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } - }, - { - matchProfile: { profileName: `C17027 match profile Holdings Permanent location.${getRandomPostfix()}`, - incomingRecordFields: { - field: '960', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.holdingsPermLoc } - }, - { - matchProfile: { profileName: `C17027 match profile Item Permanent location.${getRandomPostfix()}`, - incomingRecordFields: { - field: '960', - subfield: 'b' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemPermLoc } - }, - ]; - const holdingsMappingProfileForUpdate = { - name: `C17027 mapping profile update holdings.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.HOLDINGS - }; - const itemMappingProfileForUpdate = { - name: `C17027 mapping profile update item.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ITEM - }; - const holdingsActionProfileForUpdate = { - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C17027 action profile update holdings.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const itemActionProfileForUpdate = { - typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C17027 action profile update item.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17027 job profile.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + // profiles for updating instance, holdings, item + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C17027 match profile Instance HRID or UUID.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001', + }, + existingRecordFields: { + field: '001', + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } + }, + { + matchProfile: { profileName: `C17027 match profile Holdings Permanent location.${getRandomPostfix()}`, + incomingRecordFields: { + field: '960', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsPermLoc } + }, + { + matchProfile: { profileName: `C17027 match profile Item Permanent location.${getRandomPostfix()}`, + incomingRecordFields: { + field: '960', + subfield: 'b' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemPermLoc } + }, + ]; + const holdingsMappingProfileForUpdate = { + name: `C17027 mapping profile update holdings.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS + }; + const itemMappingProfileForUpdate = { + name: `C17027 mapping profile update item.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ITEM + }; + const holdingsActionProfileForUpdate = { + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C17027 action profile update holdings.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const itemActionProfileForUpdate = { + typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C17027 action profile update item.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17027 job profile.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - testData.jobProfileForCreate = jobProfileForCreate; + before('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + testData.jobProfileForCreate = jobProfileForCreate; - testData.forEach(specialPair => { - cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { - cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); - }); - }); - SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) - .then((bodyWithjobProfile) => { - testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + testData.forEach(specialPair => { + cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { + cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + }); }); + SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) + .then((bodyWithjobProfile) => { + testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + }); - // 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('marcFileForC17027.mrc', marcFileForCreate); - JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileForCreate); - Logs.openFileDetails(marcFileForCreate); - rowNumbers.forEach(rowNumber => { - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance, rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.holdings, rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.item, rowNumber); - }); - FileDetails.checkItemsQuantityInSummaryTable(0, '3'); - // collect instance hrids - rowNumbers.forEach(rowNumber => { - // need to wait until page will be opened in loop - cy.wait(3000); + // 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('marcFileForC17027.mrc', marcFileForCreate); + JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileForCreate); Logs.openFileDetails(marcFileForCreate); - FileDetails.openInstanceInInventory('Created', rowNumber); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrids.push(initialInstanceHrId); + rowNumbers.forEach(rowNumber => { + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance, rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.holdings, rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.item, rowNumber); + }); + FileDetails.checkItemsQuantityInSummaryTable(0, '3'); + // collect instance hrids + rowNumbers.forEach(rowNumber => { + // need to wait until page will be opened in loop + cy.wait(3000); + cy.visit(TopMenu.dataImportPath); + Logs.openFileDetails(marcFileForCreate); + FileDetails.openInstanceInInventory('Created', rowNumber); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrids.push(initialInstanceHrId); + }); }); }); - }); - }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete profiles - JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); - }); - ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(itemActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(holdingsActionProfileForUpdate.name); - ActionProfiles.deleteActionProfile(itemActionProfileForUpdate.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForUpdate.name); - FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForUpdate.name); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - FileManager.deleteFile(`cypress/fixtures/${fileNameAfterUpdate}`); - instanceHrids.forEach(hrid => { - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) - .then((instance) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); - }); + JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); + }); + ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(itemActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(holdingsActionProfileForUpdate.name); + ActionProfiles.deleteActionProfile(itemActionProfileForUpdate.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForUpdate.name); + FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForUpdate.name); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + FileManager.deleteFile(`cypress/fixtures/${fileNameAfterUpdate}`); + instanceHrids.forEach(hrid => { + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) + .then((instance) => { + cy.deleteItemViaApi(instance.items[0].id); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); }); - }); - it('C17027 Match on location (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C17027 Match on location (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // change Instance HRID in .mrc file - DataImport.editMarcFile( - 'marcFileForC17027.mrc', - editedMarcFileName, - ['ocn933596084', 'ocn919480357', 'ocn919563272'], - [instanceHrids[0], instanceHrids[1], instanceHrids[2]] - ); + DataImport.editMarcFile( + 'marcFileForC17027.mrc', + editedMarcFileName, + ['ocn933596084', 'ocn919480357', 'ocn919563272'], + [instanceHrids[0], instanceHrids[1], instanceHrids[2]] + ); - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.createMatchProfile(profile.matchProfile); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.createMatchProfile(profile.matchProfile); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - // create Field mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfileForUpdate); - NewFieldMappingProfile.addAdministrativeNote(noteForHoldingsMappingProfile, 5); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileForUpdate.name); - FieldMappingProfiles.checkMappingProfilePresented(holdingsMappingProfileForUpdate.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfileForUpdate); - NewFieldMappingProfile.addAdministrativeNote(noteForItemMappingProfile, 7); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfileForUpdate.name); - FieldMappingProfiles.checkMappingProfilePresented(itemMappingProfileForUpdate.name); + // create Field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfileForUpdate); + NewFieldMappingProfile.addAdministrativeNote(noteForHoldingsMappingProfile, 5); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileForUpdate.name); + FieldMappingProfiles.checkMappingProfilePresented(holdingsMappingProfileForUpdate.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(itemMappingProfileForUpdate); + NewFieldMappingProfile.addAdministrativeNote(noteForItemMappingProfile, 7); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfileForUpdate.name); + FieldMappingProfiles.checkMappingProfilePresented(itemMappingProfileForUpdate.name); - // create Action profiles - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(holdingsActionProfileForUpdate, holdingsMappingProfileForUpdate.name); - ActionProfiles.checkActionProfilePresented(holdingsActionProfileForUpdate.name); - ActionProfiles.create(itemActionProfileForUpdate, itemMappingProfileForUpdate.name); - ActionProfiles.checkActionProfilePresented(itemActionProfileForUpdate.name); + // create Action profiles + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(holdingsActionProfileForUpdate, holdingsMappingProfileForUpdate.name); + ActionProfiles.checkActionProfilePresented(holdingsActionProfileForUpdate.name); + ActionProfiles.create(itemActionProfileForUpdate, itemMappingProfileForUpdate.name); + ActionProfiles.checkActionProfilePresented(itemActionProfileForUpdate.name); - // create Job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForUpdate); - NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); - NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[1].matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(holdingsActionProfileForUpdate.name); - NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[2].matchProfile.profileName, 2); - NewJobProfile.linkActionProfileForMatches(itemActionProfileForUpdate.name, 2); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[1].matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(holdingsActionProfileForUpdate.name); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[2].matchProfile.profileName, 2); + NewJobProfile.linkActionProfileForMatches(itemActionProfileForUpdate.name, 2); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, fileNameAfterUpdate); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameAfterUpdate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameAfterUpdate); - rowNumbers.forEach(rowNumber => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings, rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item, rowNumber); - }); - FileDetails.checkHoldingsQuantityInSummaryTable('3', 1); - FileDetails.checkItemQuantityInSummaryTable('3', 1); + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, fileNameAfterUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameAfterUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameAfterUpdate); + rowNumbers.forEach(rowNumber => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings, rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item, rowNumber); + }); + FileDetails.checkHoldingsQuantityInSummaryTable('3', 1); + FileDetails.checkItemQuantityInSummaryTable('3', 1); - // check updated items in Inventory - instanceHrids.forEach(hrid => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrid); - InventoryInstance.openHoldingView(); - HoldingsRecordView.checkAdministrativeNote(noteForHoldingsMappingProfile); - HoldingsRecordView.close(); - InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); - InventoryInstance.openItemByBarcode('No barcode'); - ItemRecordView.checkItemAdministrativeNote(noteForItemMappingProfile); + // check updated items in Inventory + instanceHrids.forEach(hrid => { + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(hrid); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkAdministrativeNote(noteForHoldingsMappingProfile); + HoldingsRecordView.close(); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); + InventoryInstance.openItemByBarcode('No barcode'); + ItemRecordView.checkItemAdministrativeNote(noteForItemMappingProfile); + }); }); }); }); 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 64648c6348..c68ecb77e5 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 @@ -22,203 +22,205 @@ import MatchProfiles from '../../../support/fragments/data_import/match_profiles import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; -describe('ui-data-import', () => { - let instanceHrid; - const itemsForCreateInstance = { - catalogedDate: '###TODAY###', - catalogedDateUi: DateTools.getFormattedDate({ date: new Date() }), - statusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, - statisticalCode: 'ARL (Collection stats): books - Book, print (books)', - statisticalCodeUI: 'Book, print (books)' - }; - const itemsForUpdateInstance = { - statusTerm: 'Temporary', - statisticalCode: 'ARL (Collection stats): maps - Maps, print (maps)', - statisticalCodeUI: 'Maps, print (maps)' - }; - const oclcNumber = { type: 'OCLC', value: '(OCoLC)879516309' }; - const quantityOfItems = '1'; - const actionForSuppress = 'Mark for all affected records'; - // unique file names - const nameMarcFileForCreate = `C11109 autotestFile.${getRandomPostfix()}.mrc`; - const nameMarcFileForUpdate = `C11109 autotestFile.${getRandomPostfix()}.mrc`; - - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { name: `C11109 create mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C11109 create action profile_${getRandomPostfix()}`, - action: 'Create (all record types except MARC Authority or MARC Holdings)' } - }, - { - mappingProfile: { name: `C11109 update mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C11109 update action profile_${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - - const matchProfile = { - profileName: `C11109 match profile_${getRandomPostfix()}`, - incomingRecordFields: { - field: '035', - in1: '*', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: 'Identifier: OCLC', - }; - - const collectionOfJobProfiles = [ - { jobProfile: { - profileName: `C11109 create job profile_${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - } }, - { jobProfile: { - profileName: `C11109 update job profile_${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - } } - ]; - - before('login', () => { - cy.getAdminToken() - .then(() => { - InventorySearchAndFilter.getInstancesByIdentifierViaApi(oclcNumber.value) - .then(instances => { - if (instances) { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); - }); - cy.loginAsAdmin(); - }); - - after('delete test data', () => { - JobProfiles.deleteJobProfile(collectionOfJobProfiles[0].jobProfile.profileName); - JobProfiles.deleteJobProfile(collectionOfJobProfiles[1].jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let instanceHrid; + const itemsForCreateInstance = { + catalogedDate: '###TODAY###', + catalogedDateUi: DateTools.getFormattedDate({ date: new Date() }), + statusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, + statisticalCode: 'ARL (Collection stats): books - Book, print (books)', + statisticalCodeUI: 'Book, print (books)' + }; + const itemsForUpdateInstance = { + statusTerm: 'Temporary', + statisticalCode: 'ARL (Collection stats): maps - Maps, print (maps)', + statisticalCodeUI: 'Maps, print (maps)' + }; + const oclcNumber = { type: 'OCLC', value: '(OCoLC)879516309' }; + const quantityOfItems = '1'; + const actionForSuppress = 'Mark for all affected records'; + // unique file names + const nameMarcFileForCreate = `C11109 autotestFile.${getRandomPostfix()}.mrc`; + const nameMarcFileForUpdate = `C11109 autotestFile.${getRandomPostfix()}.mrc`; + + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { name: `C11109 create mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C11109 create action profile_${getRandomPostfix()}`, + action: 'Create (all record types except MARC Authority or MARC Holdings)' } + }, + { + mappingProfile: { name: `C11109 update mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C11109 update action profile_${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + + const matchProfile = { + profileName: `C11109 match profile_${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: 'Identifier: OCLC', + }; + + const collectionOfJobProfiles = [ + { jobProfile: { + profileName: `C11109 create job profile_${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + } }, + { jobProfile: { + profileName: `C11109 update job profile_${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + } } + ]; + + before('login', () => { + cy.getAdminToken() + .then(() => { + InventorySearchAndFilter.getInstancesByIdentifierViaApi(oclcNumber.value) + .then(instances => { + if (instances) { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + } + }); + }); + cy.loginAsAdmin(); }); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(collectionOfJobProfiles[0].jobProfile.profileName); + JobProfiles.deleteJobProfile(collectionOfJobProfiles[1].jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C11109 Update an instance based on an OCLC number match (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C11109 Update an instance based on an OCLC number match (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profile for creating instance - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - NewFieldMappingProfile.addStaffSuppress(actionForSuppress); - NewFieldMappingProfile.addSuppressFromDiscovery(actionForSuppress); - NewFieldMappingProfile.addPreviouslyHeld(actionForSuppress); - NewFieldMappingProfile.fillCatalogedDate(itemsForCreateInstance.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(itemsForCreateInstance.statusTerm); - NewFieldMappingProfile.addStatisticalCode(itemsForCreateInstance.statisticalCode, 8); - NewFieldMappingProfile.addNatureOfContentTerms('bibliography'); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - - // create action profile for creating instance - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(collectionOfMappingAndActionProfiles[0].actionProfile, collectionOfMappingAndActionProfiles[0].mappingProfile.name); - ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfiles[0].actionProfile.name); - - // create job profile for creating instance - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(collectionOfJobProfiles[0].jobProfile, collectionOfMappingAndActionProfiles[0].actionProfile.name); - JobProfiles.checkJobProfilePresented(collectionOfJobProfiles[0].jobProfile.profileName); - - // upload a marc file for creating of the new instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[0].jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - - // 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); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.addStaffSuppress(actionForSuppress); + NewFieldMappingProfile.addSuppressFromDiscovery(actionForSuppress); + NewFieldMappingProfile.addPreviouslyHeld(actionForSuppress); + NewFieldMappingProfile.fillCatalogedDate(itemsForCreateInstance.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(itemsForCreateInstance.statusTerm); + NewFieldMappingProfile.addStatisticalCode(itemsForCreateInstance.statisticalCode, 8); + NewFieldMappingProfile.addNatureOfContentTerms('bibliography'); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - // create action profile for updating instance + // create action profile for creating 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); + ActionProfiles.create(collectionOfMappingAndActionProfiles[0].actionProfile, collectionOfMappingAndActionProfiles[0].mappingProfile.name); + ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfiles[0].actionProfile.name); - // create job profile for updating instance + // create job profile for creating 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); + JobProfiles.createJobProfileWithLinkingProfiles(collectionOfJobProfiles[0].jobProfile, collectionOfMappingAndActionProfiles[0].actionProfile.name); + JobProfiles.checkJobProfilePresented(collectionOfJobProfiles[0].jobProfile.profileName); - // upload a marc file for updating instance + // upload a marc file for creating of the new 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); + DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[0].jobProfile.profileName); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForUpdate); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); 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); + Logs.openFileDetails(nameMarcFileForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); 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); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); + + // 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 7f3124b4dd..9ccbc192c1 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 @@ -23,223 +23,225 @@ import InstanceRecordView from '../../../support/fragments/inventory/instanceRec import Users from '../../../support/fragments/users/users'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; -describe('ui-data-import', () => { - let user = null; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const note = 'This instance was updated, plus a new subject heading was added'; - const resourceIdentifierForFirstInstance = { type: 'System control number', value: '(NhFolYBP)2304396' }; - const resourceIdentifierForSecondInstance = { type: 'System control number', value: '(NhFolYBP)2345942-321678' }; - let firstInstanceHrid; - let secondInstanceHrid; - // unique file names - 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 ${getRandomPostfix()}`, - incomingRecordFields: { - field: '035', - in1: '*', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - existingRecordOption: NewMatchProfile.optionsList.systemControlNumber - }; - - const mappingProfile = { - 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 ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - - const jobProfile = { - profileName: `C358138 Update instance via 035 ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - before('create test data', () => { - cy.getAdminToken().then(() => { - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifierForFirstInstance.value) - .then(listOfInstancesWithFirstIdentifiers => { - if (listOfInstancesWithFirstIdentifiers) { - listOfInstancesWithFirstIdentifiers.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); - InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifierForSecondInstance.value) - .then(listOfInstancesWithSecondIdentifiers => { - if (listOfInstancesWithSecondIdentifiers) { - listOfInstancesWithSecondIdentifiers.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user = null; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const note = 'This instance was updated, plus a new subject heading was added'; + const resourceIdentifierForFirstInstance = { type: 'System control number', value: '(NhFolYBP)2304396' }; + const resourceIdentifierForSecondInstance = { type: 'System control number', value: '(NhFolYBP)2345942-321678' }; + let firstInstanceHrid; + let secondInstanceHrid; + // unique file names + 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 ${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.systemControlNumber + }; + + const mappingProfile = { + 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 ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + + const jobProfile = { + profileName: `C358138 Update instance via 035 ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('create test data', () => { + cy.getAdminToken().then(() => { + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifierForFirstInstance.value) + .then(listOfInstancesWithFirstIdentifiers => { + if (listOfInstancesWithFirstIdentifiers) { + listOfInstancesWithFirstIdentifiers.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + } + }); + InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifierForSecondInstance.value) + .then(listOfInstancesWithSecondIdentifiers => { + if (listOfInstancesWithSecondIdentifiers) { + listOfInstancesWithSecondIdentifiers.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + } + }); + }); + + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); }); }); - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui - ]) - .then(userProperties => { - user = userProperties; - - cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); - - after('delete test data', () => { - // delete profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${firstInstanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${secondInstanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + // delete profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${firstInstanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${secondInstanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C358138 Matching on newly-created 035 does not work (regression) (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C358138 Matching on newly-created 035 does not work (regression) (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // upload a marc file for creating of the new instance - DataImport.uploadFile('marcFileForC358138.mrc', fileForCreateFirstName); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileForCreateFirstName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileForCreateFirstName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1'); + DataImport.verifyUploadState(); + // upload a marc file for creating of the new instance + DataImport.uploadFile('marcFileForC358138.mrc', fileForCreateFirstName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileForCreateFirstName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileForCreateFirstName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1'); - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - firstInstanceHrid = initialInstanceHrId; - }); - InventoryInstance.verifyResourceIdentifier(resourceIdentifierForFirstInstance.type, resourceIdentifierForFirstInstance.value, 2); - InventoryInstance.viewSource(); - InventoryViewSource.contains('035\t'); - InventoryViewSource.contains(resourceIdentifierForFirstInstance.value); - - // 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.addAdministrativeNote(note, 9); - 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('marcFileForC358138_rev.mrc', fileForUpdateFirstName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileForUpdateFirstName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileForUpdateFirstName); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); - - FileDetails.openInstanceInInventory('Updated'); - InstanceRecordView.verifyAdministrativeNote(note); - InventoryInstance.viewSource(); - InventoryViewSource.contains('035\t'); - InventoryViewSource.contains(resourceIdentifierForFirstInstance.value); - InventoryViewSource.contains('650\t'); - InventoryViewSource.contains('Pulse techniques (Medical)'); - - // upload a marc file for creating of the new instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC358138_with_035.mrc', fileForCreateSecondName); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileForCreateSecondName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileForCreateSecondName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1'); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + firstInstanceHrid = initialInstanceHrId; + }); + InventoryInstance.verifyResourceIdentifier(resourceIdentifierForFirstInstance.type, resourceIdentifierForFirstInstance.value, 2); + InventoryInstance.viewSource(); + InventoryViewSource.contains('035\t'); + InventoryViewSource.contains(resourceIdentifierForFirstInstance.value); + + // 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.addAdministrativeNote(note, 9); + 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('marcFileForC358138_rev.mrc', fileForUpdateFirstName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileForUpdateFirstName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileForUpdateFirstName); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + + FileDetails.openInstanceInInventory('Updated'); + InstanceRecordView.verifyAdministrativeNote(note); + InventoryInstance.viewSource(); + InventoryViewSource.contains('035\t'); + InventoryViewSource.contains(resourceIdentifierForFirstInstance.value); + InventoryViewSource.contains('650\t'); + InventoryViewSource.contains('Pulse techniques (Medical)'); + + // upload a marc file for creating of the new instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC358138_with_035.mrc', fileForCreateSecondName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileForCreateSecondName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileForCreateSecondName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1'); - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - secondInstanceHrid = initialInstanceHrId; + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + secondInstanceHrid = initialInstanceHrId; + }); + InventoryInstance.verifyResourceIdentifier(resourceIdentifierForSecondInstance.type, resourceIdentifierForSecondInstance.value, 3); + InventoryInstance.viewSource(); + InventoryViewSource.contains('035\t'); + InventoryViewSource.contains(resourceIdentifierForSecondInstance.value); + + // 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('marcFileForC358138_with_035_rev.mrc', fileForUpdateSecondName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileForUpdateSecondName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileForUpdateSecondName); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + + FileDetails.openInstanceInInventory('Updated'); + InstanceRecordView.verifyAdministrativeNote(note); + InventoryInstance.viewSource(); + InventoryViewSource.contains('035\t'); + InventoryViewSource.contains(resourceIdentifierForSecondInstance.value); + InventoryViewSource.contains('650\t'); + InventoryViewSource.contains('Symposia'); }); - InventoryInstance.verifyResourceIdentifier(resourceIdentifierForSecondInstance.type, resourceIdentifierForSecondInstance.value, 3); - InventoryInstance.viewSource(); - InventoryViewSource.contains('035\t'); - InventoryViewSource.contains(resourceIdentifierForSecondInstance.value); - - // 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('marcFileForC358138_with_035_rev.mrc', fileForUpdateSecondName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileForUpdateSecondName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileForUpdateSecondName); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); - - FileDetails.openInstanceInInventory('Updated'); - InstanceRecordView.verifyAdministrativeNote(note); - InventoryInstance.viewSource(); - InventoryViewSource.contains('035\t'); - InventoryViewSource.contains(resourceIdentifierForSecondInstance.value); - InventoryViewSource.contains('650\t'); - InventoryViewSource.contains('Symposia'); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js index 86b57fe0ee..42c5f07782 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js @@ -29,164 +29,166 @@ import Users from '../../../support/fragments/users/users'; import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; -describe('ui-data-import', () => { - let user; - let instanceHrid; - const quantityOfItems = '1'; - const filePathForCreateOrder = 'marcFileForCreateOrder.mrc'; - const marcFileName = `C380446 autotest file ${getRandomPostfix()}`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let instanceHrid; + const quantityOfItems = '1'; + const filePathForCreateOrder = 'marcFileForCreateOrder.mrc'; + const marcFileName = `C380446 autotest file ${getRandomPostfix()}`; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { name: `C380446 Test P/E mix open order with instance, holdings, item ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER, - orderStatus: ORDER_STATUSES.OPEN, - approved: true, - vendor: VENDOR_NAMES.GOBI, - title: '245$a', - acquisitionMethod: ACQUISITION_METHOD_NAMES.APPROVAL_PLAN, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PE_MIX, - receivingWorkflow: 'Synchronized', - physicalUnitPrice: '"20"', - quantityPhysical: '"1"', - currency: 'USD', - electronicUnitPrice: '25', - quantityElectronic: '"1"', - locationName: `"${LOCATION_NAMES.ANNEX}"`, - locationQuantityPhysical: '"1"', - locationQuantityElectronic: '"1"' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C380446 Test P/E mix open order with instance, holdings, item ${getRandomPostfix()}` } - }, - { - mappingProfile: { name: `C380446 Create simple holdings for open order ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, - permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C380446 Create simple holdings for open order ${getRandomPostfix()}` } - }, - { - mappingProfile: { name: `C380446 Create simple item for open order ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ITEM, - materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, - permanentLoanType: LOAN_TYPE_NAMES.COURSE_RESERVES, - status: ITEM_STATUS_NAMES.ON_ORDER }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C380446 Create simple item for open order ${getRandomPostfix()}` } - }, - ]; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C380446 Test P/E mix open order with instance, holdings, item ${getRandomPostfix()}`, - }; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { name: `C380446 Test P/E mix open order with instance, holdings, item ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER, + orderStatus: ORDER_STATUSES.OPEN, + approved: true, + vendor: VENDOR_NAMES.GOBI, + title: '245$a', + acquisitionMethod: ACQUISITION_METHOD_NAMES.APPROVAL_PLAN, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PE_MIX, + receivingWorkflow: 'Synchronized', + physicalUnitPrice: '"20"', + quantityPhysical: '"1"', + currency: 'USD', + electronicUnitPrice: '25', + quantityElectronic: '"1"', + locationName: `"${LOCATION_NAMES.ANNEX}"`, + locationQuantityPhysical: '"1"', + locationQuantityElectronic: '"1"' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C380446 Test P/E mix open order with instance, holdings, item ${getRandomPostfix()}` } + }, + { + mappingProfile: { name: `C380446 Create simple holdings for open order ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, + permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C380446 Create simple holdings for open order ${getRandomPostfix()}` } + }, + { + mappingProfile: { name: `C380446 Create simple item for open order ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ITEM, + materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, + permanentLoanType: LOAN_TYPE_NAMES.COURSE_RESERVES, + status: ITEM_STATUS_NAMES.ON_ORDER }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C380446 Create simple item for open order ${getRandomPostfix()}` } + }, + ]; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C380446 Test P/E mix open order with instance, holdings, item ${getRandomPostfix()}`, + }; - before('create test data', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiOrganizationsView.gui, - permissions.inventoryAll.gui, - permissions.uiOrdersView.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); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + before('create test data', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiOrganizationsView.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); }); - 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); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + 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('C380446 Import to create open orders: P/E mix with Instances, Holdings, Items (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + it('C380446 Import to create open orders: P/E mix with Instances, Holdings, Items (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { // create mapping profiles - FieldMappingProfiles.createOrderMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.createOrderMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].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 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.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); - NewJobProfile.linkActionProfileByName('Default - Create instance'); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); + 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(filePathForCreateOrder, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkItemQuantityInSummaryTable(quantityOfItems); - FileDetails.openOrder('Created'); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkItemQuantityInSummaryTable(quantityOfItems); + FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.checkCreateInventory(); - OrderLines.getAssignedPOLNumber().then(initialNumber => { - const polNumber = initialNumber; + OrderLines.waitLoading(); + OrderLines.checkCreateInventory(); + OrderLines.getAssignedPOLNumber().then(initialNumber => { + const polNumber = initialNumber; - OrderLines.openLinkedInstance(); - InstanceRecordView.verifyInstanceRecordViewOpened(); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + OrderLines.openLinkedInstance(); + InstanceRecordView.verifyInstanceRecordViewOpened(); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); + InstanceRecordView.verifyHotlinkToPOL(polNumber); + InstanceRecordView.verifyIsHoldingsCreated([`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`]); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkHoldingRecordViewOpened(); + HoldingsRecordView.close(); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); + InventoryInstance.openItemByBarcode('No barcode'); + ItemRecordView.waitLoading(); + ItemRecordView.checkHotlinksToCreatedPOL(polNumber); }); - InstanceRecordView.verifyHotlinkToPOL(polNumber); - InstanceRecordView.verifyIsHoldingsCreated([`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`]); - InventoryInstance.openHoldingView(); - HoldingsRecordView.checkHoldingRecordViewOpened(); - HoldingsRecordView.close(); - InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); - InventoryInstance.openItemByBarcode('No barcode'); - ItemRecordView.waitLoading(); - ItemRecordView.checkHotlinksToCreatedPOL(polNumber); }); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js index 0468af30f8..3f57cfdd09 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js @@ -11,50 +11,52 @@ import Users from '../../../support/fragments/users/users'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import { JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const instanceTitle = 'Mistapim in Cambodia [microform]. Photos. by the author.'; - const error = '{"error":"A new Instance was not created because the incoming record already contained a 999ff$s or 999ff$i field"}'; - const nameMarcFileForCreate = `C359012 autotestFile.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const instanceTitle = 'Mistapim in Cambodia [microform]. Photos. by the author.'; + const error = '{"error":"A new Instance was not created because the incoming record already contained a 999ff$s or 999ff$i field"}'; + const nameMarcFileForCreate = `C359012 autotestFile.${getRandomPostfix()}.mrc`; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${instanceTitle}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${instanceTitle}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C359012 Checking the import of the MARC Bib file, that has records with 999 ff and without the 999 ff field (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C359012 Checking the import of the MARC Bib file, that has records with 999 ff and without the 999 ff field (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC359012.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); - Logs.openFileDetails(nameMarcFileForCreate); - // check that "SRS MARC" and "Instance" were created for record, that not contains 999 ff field - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1'); - FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.created, FileDetails.status.created]); - // check that "SRS MARC" and "Instance" were not created for record, that contain 999 ff field - FileDetails.checkSrsRecordQuantityInSummaryTable('1', 2); - FileDetails.checkErrorQuantityInSummaryTable('1', 3); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.error, FileDetails.columnNameInResultList.error); - FileDetails.verifyErrorMessage(error); - }); + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC359012.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); + Logs.openFileDetails(nameMarcFileForCreate); + // check that "SRS MARC" and "Instance" were created for record, that not contains 999 ff field + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1'); + FileDetails.checkItemsStatusesInResultList(1, [FileDetails.status.created, FileDetails.status.created]); + // check that "SRS MARC" and "Instance" were not created for record, that contain 999 ff field + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 2); + FileDetails.checkErrorQuantityInSummaryTable('1', 3); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.error, FileDetails.columnNameInResultList.error); + FileDetails.verifyErrorMessage(error); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js index 1f20abc949..0993ec3ba8 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js @@ -10,116 +10,118 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import { INSTANCE_SOURCE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - const quantityOfItems = '15'; - const rowNumbers = [1, 4, 7, 14]; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const firstRecord = { - title: 'ha-MaÊ»asÌim li-vene Erets-YisÌraʼel : halakhah vÌ£e-histÌ£oryah be-Erets-YisÌraʼel ha-BizantÌ£it / Hilel Nyuman.', - firstAlternativeTitle: 'MaÊ»asim of the people of the land of Israel : halakhah and history in Byzantine Palestine', - secondAlternativeTitle: '×”×ž×¢×©×™× ×œ×‘× ×™ ×רץ־ישר×ל : הלכה והיסטוריה ב×רץ־ישר×ל הביזנטית', - firstContributerName: 'Newman, Hillel', - secondContributerName: 'ניומן, הלל', - firstPublisher: 'Yad YitshÌ£akÌ£ Ben-Tsevi', - secondPublisher: 'יד יצחק בן-צבי', - language: 'Hebrew' - }; - const secondRecord = { - title: '8-15 shi ji zhong xi bu Xizang de li shi, wen hua yu yi shu / Airuika Fute [and four others] zhu bian = Tibet in dialogue with its neighbours : history, culture and art of central and western Tibet, 8th to 15th century / Erika Forte [and four others] eds.', - firstAlternativeTitle: 'Tibet in dialogue with its neighbour : history, culture and art of central and western Tibet, 8th to 15th century', - secondAlternativeTitle: '8-15世纪中西部西è—的历å², 文化与艺术', - contributerName: 'Forte, Erika', - firstPublisher: 'Zhongguo Zang xue chu ban she', - secondPublisher: '中国è—学出版社', - language: 'Chinese, English' - }; - const thirdRecord = { - title: '3-il man e ingnŭn Ilbonsa / TÊ»akÊ»emissŭ MakÊ»otÊ»o chiŭm ; Ko Sŏn-yun omgim.', - firstAlternativeTitle: 'Mikka de wakaru Nihonshi. Korean', - secondAlternativeTitle: '3æ—¥ã¦ã‚™ã‚ã‹ã‚‹æ—¥æœ¬å². Korean', - firstContributerName: 'Takemitsu, Makoto, 1950-', - secondContributerName: '武光誠, 1950-', - firstPublisher: 'Sŏul Munhwasa', - secondPublisher: '서울문화사', - language: 'Korean' - }; - const fourthRecord = { - title: 'Istorii︠a︡ ukraïnsʹkoho kooperatyvnoho rukhu : Iz pratsʹ Istorychno-filosofichnoï sektsiï HTSH.', - firstAlternativeTitle: 'History of Ukrainian co-operative movement', - secondAlternativeTitle: 'ІÑÑ‚Ð¾Ñ€Ñ–Ñ ÑƒÐºÑ€Ð°Ñ—Ð½Ñького кооперативного руху : Із пратÑÑŒ ІÑторично-філоÑофічної ÑектÑÑ–Ñ— ГТШ.', - contributerName: 'Vytanovych, Illi︠a︡', - publisher: 'T-vo ukr. kooperatsiï', - language: 'Ukrainian' - }; - const nameMarcFileForCreate = `C6709 autotestFile.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const quantityOfItems = '15'; + const rowNumbers = [1, 4, 7, 14]; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const firstRecord = { + title: 'ha-MaÊ»asÌim li-vene Erets-YisÌraʼel : halakhah vÌ£e-histÌ£oryah be-Erets-YisÌraʼel ha-BizantÌ£it / Hilel Nyuman.', + firstAlternativeTitle: 'MaÊ»asim of the people of the land of Israel : halakhah and history in Byzantine Palestine', + secondAlternativeTitle: '×”×ž×¢×©×™× ×œ×‘× ×™ ×רץ־ישר×ל : הלכה והיסטוריה ב×רץ־ישר×ל הביזנטית', + firstContributerName: 'Newman, Hillel', + secondContributerName: 'ניומן, הלל', + firstPublisher: 'Yad YitshÌ£akÌ£ Ben-Tsevi', + secondPublisher: 'יד יצחק בן-צבי', + language: 'Hebrew' + }; + const secondRecord = { + title: '8-15 shi ji zhong xi bu Xizang de li shi, wen hua yu yi shu / Airuika Fute [and four others] zhu bian = Tibet in dialogue with its neighbours : history, culture and art of central and western Tibet, 8th to 15th century / Erika Forte [and four others] eds.', + firstAlternativeTitle: 'Tibet in dialogue with its neighbour : history, culture and art of central and western Tibet, 8th to 15th century', + secondAlternativeTitle: '8-15世纪中西部西è—的历å², 文化与艺术', + contributerName: 'Forte, Erika', + firstPublisher: 'Zhongguo Zang xue chu ban she', + secondPublisher: '中国è—学出版社', + language: 'Chinese, English' + }; + const thirdRecord = { + title: '3-il man e ingnŭn Ilbonsa / TÊ»akÊ»emissŭ MakÊ»otÊ»o chiŭm ; Ko Sŏn-yun omgim.', + firstAlternativeTitle: 'Mikka de wakaru Nihonshi. Korean', + secondAlternativeTitle: '3æ—¥ã¦ã‚™ã‚ã‹ã‚‹æ—¥æœ¬å². Korean', + firstContributerName: 'Takemitsu, Makoto, 1950-', + secondContributerName: '武光誠, 1950-', + firstPublisher: 'Sŏul Munhwasa', + secondPublisher: '서울문화사', + language: 'Korean' + }; + const fourthRecord = { + title: 'Istorii︠a︡ ukraïnsʹkoho kooperatyvnoho rukhu : Iz pratsʹ Istorychno-filosofichnoï sektsiï HTSH.', + firstAlternativeTitle: 'History of Ukrainian co-operative movement', + secondAlternativeTitle: 'ІÑÑ‚Ð¾Ñ€Ñ–Ñ ÑƒÐºÑ€Ð°Ñ—Ð½Ñького кооперативного руху : Із пратÑÑŒ ІÑторично-філоÑофічної ÑектÑÑ–Ñ— ГТШ.', + contributerName: 'Vytanovych, Illi︠a︡', + publisher: 'T-vo ukr. kooperatsiï', + language: 'Ukrainian' + }; + const nameMarcFileForCreate = `C6709 autotestFile.${getRandomPostfix()}.mrc`; - beforeEach(() => { - cy.loginAsAdmin(); - cy.getAdminToken(); - }); + beforeEach(() => { + cy.loginAsAdmin(); + cy.getAdminToken(); + }); - it('C6709 Import a file with lots of diacritics or non-Roman alphabet records (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // upload a marc file for creating of the new instance - cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile('mrcFileForC6709.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForCreate); - rowNumbers.forEach(rowNumber => { - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance, rowNumber); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); + it('C6709 Import a file with lots of diacritics or non-Roman alphabet records (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // upload a marc file for creating of the new instance + cy.visit(TopMenu.dataImportPath); + DataImport.uploadFile('mrcFileForC6709.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFileForCreate); + rowNumbers.forEach(rowNumber => { + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance, rowNumber); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - FileDetails.openInstanceInInventory('Created', rowNumbers[0]); - InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); - InventoryInstance.verifyInstanceTitle(firstRecord.title); - InventoryInstance.verifyAlternativeTitle(0, 1, firstRecord.firstAlternativeTitle); - InventoryInstance.verifyAlternativeTitle(1, 1, firstRecord.secondAlternativeTitle); - InventoryInstance.verifyContributor(0, 1, firstRecord.firstContributerName); - InventoryInstance.verifyContributor(1, 1, firstRecord.secondContributerName); - InventoryInstance.verifyInstancePublisher(0, 0, firstRecord.firstPublisher); - InventoryInstance.verifyInstancePublisher(1, 0, firstRecord.secondPublisher); - InventoryInstance.verifyInstanceLanguage(firstRecord.language); + FileDetails.openInstanceInInventory('Created', rowNumbers[0]); + InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); + InventoryInstance.verifyInstanceTitle(firstRecord.title); + InventoryInstance.verifyAlternativeTitle(0, 1, firstRecord.firstAlternativeTitle); + InventoryInstance.verifyAlternativeTitle(1, 1, firstRecord.secondAlternativeTitle); + InventoryInstance.verifyContributor(0, 1, firstRecord.firstContributerName); + InventoryInstance.verifyContributor(1, 1, firstRecord.secondContributerName); + InventoryInstance.verifyInstancePublisher(0, 0, firstRecord.firstPublisher); + InventoryInstance.verifyInstancePublisher(1, 0, firstRecord.secondPublisher); + InventoryInstance.verifyInstanceLanguage(firstRecord.language); - cy.visit(TopMenu.dataImportPath); - Logs.openFileDetails(nameMarcFileForCreate); - FileDetails.openInstanceInInventory('Created', rowNumbers[1]); - InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); - InventoryInstance.verifyInstanceTitle(secondRecord.title); - InventoryInstance.verifyAlternativeTitle(0, 1, secondRecord.firstAlternativeTitle); - InventoryInstance.verifyAlternativeTitle(1, 1, secondRecord.secondAlternativeTitle); - InventoryInstance.verifyContributor(0, 1, secondRecord.contributerName); - InventoryInstance.verifyInstancePublisher(0, 0, secondRecord.firstPublisher); - InventoryInstance.verifyInstancePublisher(1, 0, secondRecord.secondPublisher); - InventoryInstance.verifyInstanceLanguage(secondRecord.language); + cy.visit(TopMenu.dataImportPath); + Logs.openFileDetails(nameMarcFileForCreate); + FileDetails.openInstanceInInventory('Created', rowNumbers[1]); + InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); + InventoryInstance.verifyInstanceTitle(secondRecord.title); + InventoryInstance.verifyAlternativeTitle(0, 1, secondRecord.firstAlternativeTitle); + InventoryInstance.verifyAlternativeTitle(1, 1, secondRecord.secondAlternativeTitle); + InventoryInstance.verifyContributor(0, 1, secondRecord.contributerName); + InventoryInstance.verifyInstancePublisher(0, 0, secondRecord.firstPublisher); + InventoryInstance.verifyInstancePublisher(1, 0, secondRecord.secondPublisher); + InventoryInstance.verifyInstanceLanguage(secondRecord.language); - cy.visit(TopMenu.dataImportPath); - Logs.openFileDetails(nameMarcFileForCreate); - FileDetails.openInstanceInInventory('Created', rowNumbers[2]); - InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); - InventoryInstance.verifyInstanceTitle(thirdRecord.title); - InventoryInstance.verifyAlternativeTitle(0, 1, thirdRecord.firstAlternativeTitle); - InventoryInstance.verifyAlternativeTitle(3, 1, thirdRecord.secondAlternativeTitle); - InventoryInstance.verifyContributor(0, 1, thirdRecord.firstContributerName); - InventoryInstance.verifyContributor(2, 1, thirdRecord.secondContributerName); - InventoryInstance.verifyInstancePublisher(0, 0, thirdRecord.firstPublisher); - InventoryInstance.verifyInstancePublisher(1, 0, thirdRecord.secondPublisher); - InventoryInstance.verifyInstanceLanguage(thirdRecord.language); + cy.visit(TopMenu.dataImportPath); + Logs.openFileDetails(nameMarcFileForCreate); + FileDetails.openInstanceInInventory('Created', rowNumbers[2]); + InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); + InventoryInstance.verifyInstanceTitle(thirdRecord.title); + InventoryInstance.verifyAlternativeTitle(0, 1, thirdRecord.firstAlternativeTitle); + InventoryInstance.verifyAlternativeTitle(3, 1, thirdRecord.secondAlternativeTitle); + InventoryInstance.verifyContributor(0, 1, thirdRecord.firstContributerName); + InventoryInstance.verifyContributor(2, 1, thirdRecord.secondContributerName); + InventoryInstance.verifyInstancePublisher(0, 0, thirdRecord.firstPublisher); + InventoryInstance.verifyInstancePublisher(1, 0, thirdRecord.secondPublisher); + InventoryInstance.verifyInstanceLanguage(thirdRecord.language); - cy.visit(TopMenu.dataImportPath); - Logs.openFileDetails(nameMarcFileForCreate); - FileDetails.openInstanceInInventory('Created', rowNumbers[3]); - InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); - InventoryInstance.verifyInstanceTitle(fourthRecord.title); - InventoryInstance.verifyAlternativeTitle(0, 1, fourthRecord.firstAlternativeTitle); - InventoryInstance.verifyAlternativeTitle(1, 1, fourthRecord.secondAlternativeTitle); - InventoryInstance.verifyContributor(0, 1, fourthRecord.contributerName); - InventoryInstance.verifyInstancePublisher(0, 0, fourthRecord.publisher); - InventoryInstance.verifyInstanceLanguage(fourthRecord.language); - }); + cy.visit(TopMenu.dataImportPath); + Logs.openFileDetails(nameMarcFileForCreate); + FileDetails.openInstanceInInventory('Created', rowNumbers[3]); + InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); + InventoryInstance.verifyInstanceTitle(fourthRecord.title); + InventoryInstance.verifyAlternativeTitle(0, 1, fourthRecord.firstAlternativeTitle); + InventoryInstance.verifyAlternativeTitle(1, 1, fourthRecord.secondAlternativeTitle); + InventoryInstance.verifyContributor(0, 1, fourthRecord.contributerName); + InventoryInstance.verifyInstancePublisher(0, 0, fourthRecord.publisher); + InventoryInstance.verifyInstanceLanguage(fourthRecord.language); + }); + }); }); 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 df767a4aaf..919643cd3b 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 @@ -31,274 +31,276 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import Users from '../../../support/fragments/users/users'; import FileManager from '../../../support/utils/fileManager'; -describe('ui-data-import', () => { - let user = null; - let holdingsHrId = null; - let exportedFileName = null; - let instanceHrid = null; - const holdingsPermanentLocation = 'Online'; - const recordType = 'MARC_BIBLIOGRAPHIC'; - const filePathToUpload = 'oneMarcBib.mrc'; - const marcFileNameForCreate = `C347894 marcBibFile for create.${getRandomPostfix()}`; - // profiles for creating instance, holdings, item - const instanceMappingProfileForCreate = { - profile:{ - name: `C347894 autotest instance mapping profile for create.${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE - } - }; - const holdingsMappingProfileForCreate = { - profile:{ - name: `C347894 autotest holdings mapping profile for create.${getRandomPostfix()}`, - incomingRecordType: recordType, +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user = null; + let holdingsHrId = null; + let exportedFileName = null; + let instanceHrid = null; + const holdingsPermanentLocation = 'Online'; + const recordType = 'MARC_BIBLIOGRAPHIC'; + const filePathToUpload = 'oneMarcBib.mrc'; + const marcFileNameForCreate = `C347894 marcBibFile for create.${getRandomPostfix()}`; + // profiles for creating instance, holdings, item + const instanceMappingProfileForCreate = { + profile:{ + name: `C347894 autotest instance mapping profile for create.${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE + } + }; + const holdingsMappingProfileForCreate = { + profile:{ + name: `C347894 autotest holdings mapping profile for create.${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + mappingDetails: { name: 'holdings', + recordType: 'HOLDINGS', + mappingFields: [ + { name: 'permanentLocationId', + enabled: true, + path: 'holdings.permanentLocationId', + value: `"${LOCATION_NAMES.ONLINE}"` } + ] } + } + }; + const instanceActionProfileForCreate = { + profile: { + name: `C347894 autotest instance action profile for create.${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'INSTANCE' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const holdingsActionProfileForCreate = { + profile: { + name: `C347894 autotest holdings action profile for create.${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'HOLDINGS' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const testData = [ + { mappingProfile: instanceMappingProfileForCreate, + actionProfile: instanceActionProfileForCreate }, + { mappingProfile: holdingsMappingProfileForCreate, + actionProfile: holdingsActionProfileForCreate } + ]; + const jobProfileForCreate = { + profile: { + name: `C347894 autotest job profile for create.${getRandomPostfix()}`, + dataType: ACCEPTED_DATA_TYPE_NAMES.MARC + }, + addedRelations: [], + deletedRelations: [] + }; + // profiles for updating item + const instanceMatchProfile = { + profileName: `C347894 autotest instance match profile.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; + const holdingsMatchProfile = { + profileName: `C347894 autotest holdings match profile.${getRandomPostfix()}`, + incomingStaticValue: 'Online', + matchCriterion: 'Exactly matches', existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - mappingDetails: { name: 'holdings', - recordType: 'HOLDINGS', - mappingFields: [ - { name: 'permanentLocationId', - enabled: true, - path: 'holdings.permanentLocationId', - value: `"${LOCATION_NAMES.ONLINE}"` } - ] } - } - }; - const instanceActionProfileForCreate = { - profile: { - name: `C347894 autotest instance action profile for create.${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'INSTANCE' - }, - addedRelations: [ + existingRecordOption: NewMatchProfile.optionsList.holdingsPermLoc + }; + const collectionOfMappingAndActionProfiles = [ { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE - } - ], - deletedRelations: [] - }; - const holdingsActionProfileForCreate = { - profile: { - name: `C347894 autotest holdings action profile for create.${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'HOLDINGS' - }, - addedRelations: [ + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C347894 autotest instance mapping profile for update.${getRandomPostfix()}`, + suppressFromDiscavery: 'Mark for all affected records' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C347894 autotest instance action profile.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C347894 autotest holdings mapping profile for update.${getRandomPostfix()}`, + suppressFromDiscavery: 'Mark for all affected records' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C347894 autotest holdings action profile.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } - ], - deletedRelations: [] - }; - const testData = [ - { mappingProfile: instanceMappingProfileForCreate, - actionProfile: instanceActionProfileForCreate }, - { mappingProfile: holdingsMappingProfileForCreate, - actionProfile: holdingsActionProfileForCreate } - ]; - const jobProfileForCreate = { - profile: { - name: `C347894 autotest job profile for create.${getRandomPostfix()}`, - dataType: ACCEPTED_DATA_TYPE_NAMES.MARC - }, - addedRelations: [], - deletedRelations: [] - }; - // profiles for updating item - const instanceMatchProfile = { - profileName: `C347894 autotest instance match profile.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid - }; - const holdingsMatchProfile = { - profileName: `C347894 autotest holdings match profile.${getRandomPostfix()}`, - incomingStaticValue: 'Online', - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - existingRecordOption: NewMatchProfile.optionsList.holdingsPermLoc - }; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C347894 autotest instance mapping profile for update.${getRandomPostfix()}`, - suppressFromDiscavery: 'Mark for all affected records' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C347894 autotest instance action profile.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C347894 autotest holdings mapping profile for update.${getRandomPostfix()}`, - suppressFromDiscavery: 'Mark for all affected records' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C347894 autotest holdings action profile.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C347894 autotest job profile for update.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C347894 autotest job profile for update.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - testData.jobProfileForCreate = jobProfileForCreate; + before('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + testData.jobProfileForCreate = jobProfileForCreate; - testData.forEach(specialPair => { - cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { - cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + testData.forEach(specialPair => { + cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { + cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + }); }); - }); - SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) - .then((bodyWithjobProfile) => { - testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) + .then((bodyWithjobProfile) => { + testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + }); + // 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(filePathToUpload, marcFileNameForCreate); + JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForCreate); + FileDetails.openHoldingsInInventory('Created'); + HoldingsRecordView.getHoldingsHrId().then(initialHrId => { + holdingsHrId = initialHrId; }); - // 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(filePathToUpload, marcFileNameForCreate); - JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileNameForCreate); - FileDetails.openHoldingsInInventory('Created'); - HoldingsRecordView.getHoldingsHrId().then(initialHrId => { - holdingsHrId = initialHrId; }); - }); - cy.logout(); + cy.logout(); - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.dataExportEnableSettings.gui, - permissions.settingsDataImportEnabled.gui, - permissions.dataExportEnableApp.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.dataExportEnableSettings.gui, + permissions.settingsDataImportEnabled.gui, + permissions.dataExportEnableApp.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: TopMenu.inventoryPath, waiter: InventorySearchAndFilter.waitLoading }); - }); - }); + cy.login(userProperties.username, userProperties.password, + { path: TopMenu.inventoryPath, waiter: InventorySearchAndFilter.waitLoading }); + }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); - JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - MatchProfiles.deleteMatchProfile(instanceMatchProfile.profileName); - MatchProfiles.deleteMatchProfile(holdingsMatchProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); - ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.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); + FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); + JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + MatchProfiles.deleteMatchProfile(instanceMatchProfile.profileName); + MatchProfiles.deleteMatchProfile(holdingsMatchProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - }); + ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.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('C347894 Nest matches under actions in a job profile, and run the job profile successfully (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventorySearchAndFilter.switchToHoldings(); - InventorySearchAndFilter.filterHoldingsByPermanentLocation(holdingsPermanentLocation); - InventorySearchAndFilter.searchHoldingsByHRID(holdingsHrId); - InventorySearchAndFilter.selectResultCheckboxes(1); - InventorySearchAndFilter.exportInstanceAsMarc(); + it('C347894 Nest matches under actions in a job profile, and run the job profile successfully (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.filterHoldingsByPermanentLocation(holdingsPermanentLocation); + InventorySearchAndFilter.searchHoldingsByHRID(holdingsHrId); + InventorySearchAndFilter.selectResultCheckboxes(1); + InventorySearchAndFilter.exportInstanceAsMarc(); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.getExportedFileNameViaApi() - .then(name => { - exportedFileName = name; + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.getExportedFileNameViaApi() + .then(name => { + exportedFileName = name; - ExportFile.downloadExportedMarcFile(exportedFileName); + ExportFile.downloadExportedMarcFile(exportedFileName); - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(instanceMatchProfile); - MatchProfiles.checkMatchProfilePresented(instanceMatchProfile.profileName); - MatchProfiles.createMatchProfileWithStaticValue(holdingsMatchProfile); - MatchProfiles.checkMatchProfilePresented(holdingsMatchProfile.profileName); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(instanceMatchProfile); + MatchProfiles.checkMatchProfilePresented(instanceMatchProfile.profileName); + MatchProfiles.createMatchProfileWithStaticValue(holdingsMatchProfile); + MatchProfiles.checkMatchProfilePresented(holdingsMatchProfile.profileName); - // create Field mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - NewFieldMappingProfile.addSuppressFromDiscovery(collectionOfMappingAndActionProfiles[0].mappingProfile.suppressFromDiscavery); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + // create Field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.addSuppressFromDiscovery(collectionOfMappingAndActionProfiles[0].mappingProfile.suppressFromDiscavery); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.addSuppressFromDiscovery(collectionOfMappingAndActionProfiles[1].mappingProfile.suppressFromDiscavery); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.addSuppressFromDiscovery(collectionOfMappingAndActionProfiles[1].mappingProfile.suppressFromDiscavery); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - collectionOfMappingAndActionProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + 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(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfiles(instanceMatchProfile.profileName, collectionOfMappingAndActionProfiles[0].actionProfile.name); - NewJobProfile.linkMatchProfileForMatches(holdingsMatchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchAndActionProfiles(instanceMatchProfile.profileName, collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkMatchProfileForMatches(holdingsMatchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); - // upload the exported marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(exportedFileName); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(exportedFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(exportedFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + // upload the exported marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(exportedFileName); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(exportedFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(exportedFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + FileDetails.checkHoldingsQuantityInSummaryTable('1', '1'); + FileDetails.openInstanceInInventory('Updated'); + InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); + cy.go('back'); + FileDetails.openHoldingsInInventory('Updated'); + HoldingsRecordView.checkMarkAsSuppressedFromDiscovery(); }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); - FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); - FileDetails.checkHoldingsQuantityInSummaryTable('1', '1'); - FileDetails.openInstanceInInventory('Updated'); - InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); - cy.go('back'); - FileDetails.openHoldingsInInventory('Updated'); - HoldingsRecordView.checkMarkAsSuppressedFromDiscovery(); - }); - }); + }); + }); }); 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 eae62c91ee..138e364606 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 @@ -12,69 +12,71 @@ import InventorySearchAndFilter from '../../../support/fragments/inventory/inven import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - let instanceHrid; - const oclcNumber = '42980246'; - const OCLCAuthentication = '100481406/PAOLF'; - const field005 = '20230427101124.9'; - const field035 = '‡a (OCoLC)ocm42980246'; - const notDuplicatedFieldsContent = { - first006field: 'jccnn n ', - second006field: 'm q h ', - field007: 'sd fungnnmmned', - field008: '991202s2000 ctua b 001 0 eng' - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + let instanceHrid; + const oclcNumber = '42980246'; + const OCLCAuthentication = '100481406/PAOLF'; + const field005 = '20230427101124.9'; + const field035 = '‡a (OCoLC)ocm42980246'; + const notDuplicatedFieldsContent = { + first006field: 'jccnn n ', + second006field: 'm q h ', + field007: 'sd fungnnmmned', + field008: '991202s2000 ctua b 001 0 eng' + }; - before('login', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui + ]) + .then(userProperties => { + user = userProperties; - Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); - cy.login(user.username, user.password, - { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - }); - }); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); + cy.login(user.username, user.password, + { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C347618 Overlaying with single record import creates does not duplicate control fields (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - InventoryInstances.importWithOclc(oclcNumber); - InventoryInstance.checkCalloutMessage(`Record ${oclcNumber} created. Results may take a few moments to become visible in Inventory`); - cy.visit(TopMenu.dataImportPath); - Logs.openViewAllLogs(); - LogsViewAll.openUserIdAccordion(); - LogsViewAll.filterJobsByUser(`${user.firstName} ${user.lastName}`); - Logs.openFileDetails('No file name'); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + it('C347618 Overlaying with single record import creates does not duplicate control fields (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventoryInstances.importWithOclc(oclcNumber); + InventoryInstance.checkCalloutMessage(`Record ${oclcNumber} created. Results may take a few moments to become visible in Inventory`); + cy.visit(TopMenu.dataImportPath); + Logs.openViewAllLogs(); + LogsViewAll.openUserIdAccordion(); + LogsViewAll.filterJobsByUser(`${user.firstName} ${user.lastName}`); + Logs.openFileDetails('No file name'); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - cy.wait(1000); - InventorySearchAndFilter.selectSearchResultItem(); - InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.overlayWithOclc(oclcNumber); - InventoryInstance.checkCalloutMessage(`Record ${oclcNumber} updated. Results may take a few moments to become visible in Inventory`); - InventoryInstance.viewSource(); - InventoryViewSource.verifyRecordNotContainsDuplicatedContent(field035, 2); - // check fields 006-008 are not duplicated - cy.wrap(Object.values(notDuplicatedFieldsContent)).each(content => InventoryViewSource.verifyRecordNotContainsDuplicatedContent(content)); - InventoryViewSource.contains('005\t'); - InventoryViewSource.notContains(field005); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.startOverlaySourceBibRecord(); + InventoryInstance.overlayWithOclc(oclcNumber); + InventoryInstance.checkCalloutMessage(`Record ${oclcNumber} updated. Results may take a few moments to become visible in Inventory`); + InventoryInstance.viewSource(); + InventoryViewSource.verifyRecordNotContainsDuplicatedContent(field035, 2); + // check fields 006-008 are not duplicated + cy.wrap(Object.values(notDuplicatedFieldsContent)).each(content => InventoryViewSource.verifyRecordNotContainsDuplicatedContent(content)); + InventoryViewSource.contains('005\t'); + InventoryViewSource.notContains(field005); + }); }); - }); + }); }); 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 c8e47a8767..85469267f3 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 @@ -17,100 +17,102 @@ import InventoryViewSource from '../../../support/fragments/inventory/inventoryV import Users from '../../../support/fragments/users/users'; import { TARGET_PROFILE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user = null; - let instanceHrid = null; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const protectedField = '856'; - const OCLCAuthentication = '100481406/PAOLF'; - const oclcForChanging = '466478385'; - const imported856Field = 'Notice et cote du catalogue de la BibliotheÌ€que nationale de France ‡u http://catalogue.bnf.fr/ark:/12148/cb371881758'; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user = null; + let instanceHrid = null; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const protectedField = '856'; + const OCLCAuthentication = '100481406/PAOLF'; + const oclcForChanging = '466478385'; + const imported856Field = 'Notice et cote du catalogue de la BibliotheÌ€que nationale de France ‡u http://catalogue.bnf.fr/ark:/12148/cb371881758'; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - permissions.remoteStorageView.gui, - permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui - ]) - .then(userProperties => { - user = userProperties; + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + permissions.remoteStorageView.gui, + permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - const fileName = `C358968autotestFile.${getRandomPostfix()}.mrc`; + const fileName = `C358968autotestFile.${getRandomPostfix()}.mrc`; - Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC358968.mrc', fileName); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1'); + Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC358968.mrc', fileName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1'); - // open Instance for getting hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); }); - }); - }); + }); - after('delete test data', () => { - MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: `"field"=="${protectedField}"` }) - .then(list => { - list.forEach(({ id }) => MarcFieldProtection.deleteMarcFieldProtectionViaApi(id)); - }); - Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: `"field"=="${protectedField}"` }) + .then(list => { + list.forEach(({ id }) => MarcFieldProtection.deleteMarcFieldProtectionViaApi(id)); + }); + Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C358968 Check that protected fields in incoming records are not deleted during import: Scenario 1 (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.marcFieldProtectionPath); - MarcFieldProtection.checkListOfExistingProfilesIsDisplayed(); - MarcFieldProtection.createNewMarcFieldProtection(); - MarcFieldProtection.fillMarcFieldProtection(protectedField); - MarcFieldProtection.checkFieldProtectionIsCreated(protectedField); + it('C358968 Check that protected fields in incoming records are not deleted during import: Scenario 1 (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.marcFieldProtectionPath); + MarcFieldProtection.checkListOfExistingProfilesIsDisplayed(); + MarcFieldProtection.createNewMarcFieldProtection(); + MarcFieldProtection.fillMarcFieldProtection(protectedField); + MarcFieldProtection.checkFieldProtectionIsCreated(protectedField); - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.openTargetProfile(); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - cy.wait(1000); - InventorySearchAndFilter.selectSearchResultItem(); - InventoryInstance.editMarcBibliographicRecord(); - InventoryEditMarcRecord.deleteField(29); - InventoryEditMarcRecord.saveAndClose(); - InventoryEditMarcRecord.confirmDeletingField(); - InventoryInstance.checkElectronicAccess(); - InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); - InventoryInstance.overlayWithOclc(oclcForChanging); - InventoryInstance.checkCalloutMessage(`Record ${oclcForChanging} updated. Results may take a few moments to become visible in Inventory`); - InventoryInstance.viewSource(); - InventoryViewSource.contains(`${protectedField}\t`); - InventoryViewSource.contains(imported856Field); - }); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryEditMarcRecord.deleteField(29); + InventoryEditMarcRecord.saveAndClose(); + InventoryEditMarcRecord.confirmDeletingField(); + InventoryInstance.checkElectronicAccess(); + InventoryInstance.startOverlaySourceBibRecord(); + InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); + InventoryInstance.overlayWithOclc(oclcForChanging); + InventoryInstance.checkCalloutMessage(`Record ${oclcForChanging} updated. Results may take a few moments to become visible in Inventory`); + InventoryInstance.viewSource(); + InventoryViewSource.contains(`${protectedField}\t`); + InventoryViewSource.contains(imported856Field); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js index 41662a1a94..f60f8e3a29 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js @@ -13,112 +13,114 @@ import Users from '../../../support/fragments/users/users'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import { TARGET_PROFILE_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user = null; - const OCLCAuthentication = '100481406/PAOLF'; - const oclcForImport = '19257462'; - const initialFields = { - first580field: '‡a Merged with: Journal of the Chemical Society. Perkin transactions I; Journal of the Chemical Society. Perkin transactions II; and Journal of the Chemical Society. Dalton transactions, to form: Perkin 1; Perkin 2; and Dalton (Cambridge, England).', - first780field: '‡t Acta chemica Scandinavica. Series A, Physical and inorganic chemistry ‡x 0302-4377 ‡w (DLC)sn 79006037 ‡w (OCoLC)981847', - second780field: '‡t Acta chemica Scandinavica. Series B, Organic chemistry and biochemistry ‡x 0302-4369 ‡w (DLC)sn 78006299 ‡w (OCoLC)981837', - first785field: '‡t Journal of the Chemical Society. Perkin transactions I ‡x 0300-922X ‡w (DLC) 2006219014 ‡w (OCoLC)1033975', - second785field: '‡t Journal of the Chemical Society. Perkin transactions II ‡x 0300-9580 ‡w (DLC) 72623335 ‡w (OCoLC)1064266', - third785field: '‡t Journal of the Chemical Society. Dalton transactions ‡x 0300-9246 ‡w (DLC) 72624566 ‡w (OCoLC)1034240', - fourth785field: '‡t Perkin 1 ‡x 1470-4358 ‡w (DLC) 00252538 ‡w (OCoLC)44000773', - fifth785field: '‡t Perkin 2 ‡x 1470-1820 ‡w (DLC) 00214936 ‡w (OCoLC)44000837', - sixth785field: '‡t Dalton (Cambridge, England) ‡x 1470-479X ‡w (DLC) 00252543 ‡w (OCoLC)44000666' - }; - const fieldsForChanging = { - first780Field: '$t Acta chemica Scandinavica. Series B, Organic chemistry and biochemistry $x 0302-4369 $w (DLC)sn 78006299 $w (OCoLC)981837', - first785Field: '$t Journal of the Chemical Society. Perkin transactions II $x 0300-9580 $w (DLC) 72623335 $w (OCoLC)1064266', - second785Field: '$t Journal of the Chemical Society. Dalton transactions $x 0300-9246 $w (DLC) 72624566 $w (OCoLC)1034240', - third785Field: '$t Perkin 1 $x 1470-4358 $w (DLC) 00252538 $w (OCoLC)44000773', - fourth785Field: '$t Perkin 2 $x 1470-1820 $w (DLC) 00214936 $w (OCoLC)44000837', - fifth785Field: '$t Dalton (Cambridge, England) $x 1470-479X $w (DLC) 00252543 $w (OCoLC)44000666' - }; - const changedFields = { - first580field: 'Test ‡5 NcD', - first780field: '‡t Acta chemica Scandinavica. Series B, Organic chemistry and biochemistry ‡x 0302-4369 ‡w (DLC)sn 78006299 ‡w (OCoLC)981837 ‡5 NcD', - first785field: '‡t Journal of the Chemical Society. Perkin transactions II ‡x 0300-9580 ‡w (DLC) 72623335 ‡w (OCoLC)1064266 ‡5 NcD', - third785field: '‡t Journal of the Chemical Society. Dalton transactions ‡x 0300-9246 ‡w (DLC) 72624566 ‡w (OCoLC)1034240 ‡5 NcD', - fourth785field: '‡t Perkin 1 ‡x 1470-4358 ‡w (DLC) 00252538 ‡w (OCoLC)44000773 ‡5 NcD', - fifth785field: '‡t Perkin 2 ‡x 1470-1820 ‡w (DLC) 00214936 ‡w (OCoLC)44000837 ‡5 NcD', - sixth785field: '‡t Dalton (Cambridge, England) ‡x 1470-479X ‡w (DLC) 00252543 ‡w (OCoLC)44000666 ‡5 NcD' - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user = null; + const OCLCAuthentication = '100481406/PAOLF'; + const oclcForImport = '19257462'; + const initialFields = { + first580field: '‡a Merged with: Journal of the Chemical Society. Perkin transactions I; Journal of the Chemical Society. Perkin transactions II; and Journal of the Chemical Society. Dalton transactions, to form: Perkin 1; Perkin 2; and Dalton (Cambridge, England).', + first780field: '‡t Acta chemica Scandinavica. Series A, Physical and inorganic chemistry ‡x 0302-4377 ‡w (DLC)sn 79006037 ‡w (OCoLC)981847', + second780field: '‡t Acta chemica Scandinavica. Series B, Organic chemistry and biochemistry ‡x 0302-4369 ‡w (DLC)sn 78006299 ‡w (OCoLC)981837', + first785field: '‡t Journal of the Chemical Society. Perkin transactions I ‡x 0300-922X ‡w (DLC) 2006219014 ‡w (OCoLC)1033975', + second785field: '‡t Journal of the Chemical Society. Perkin transactions II ‡x 0300-9580 ‡w (DLC) 72623335 ‡w (OCoLC)1064266', + third785field: '‡t Journal of the Chemical Society. Dalton transactions ‡x 0300-9246 ‡w (DLC) 72624566 ‡w (OCoLC)1034240', + fourth785field: '‡t Perkin 1 ‡x 1470-4358 ‡w (DLC) 00252538 ‡w (OCoLC)44000773', + fifth785field: '‡t Perkin 2 ‡x 1470-1820 ‡w (DLC) 00214936 ‡w (OCoLC)44000837', + sixth785field: '‡t Dalton (Cambridge, England) ‡x 1470-479X ‡w (DLC) 00252543 ‡w (OCoLC)44000666' + }; + const fieldsForChanging = { + first780Field: '$t Acta chemica Scandinavica. Series B, Organic chemistry and biochemistry $x 0302-4369 $w (DLC)sn 78006299 $w (OCoLC)981837', + first785Field: '$t Journal of the Chemical Society. Perkin transactions II $x 0300-9580 $w (DLC) 72623335 $w (OCoLC)1064266', + second785Field: '$t Journal of the Chemical Society. Dalton transactions $x 0300-9246 $w (DLC) 72624566 $w (OCoLC)1034240', + third785Field: '$t Perkin 1 $x 1470-4358 $w (DLC) 00252538 $w (OCoLC)44000773', + fourth785Field: '$t Perkin 2 $x 1470-1820 $w (DLC) 00214936 $w (OCoLC)44000837', + fifth785Field: '$t Dalton (Cambridge, England) $x 1470-479X $w (DLC) 00252543 $w (OCoLC)44000666' + }; + const changedFields = { + first580field: 'Test ‡5 NcD', + first780field: '‡t Acta chemica Scandinavica. Series B, Organic chemistry and biochemistry ‡x 0302-4369 ‡w (DLC)sn 78006299 ‡w (OCoLC)981837 ‡5 NcD', + first785field: '‡t Journal of the Chemical Society. Perkin transactions II ‡x 0300-9580 ‡w (DLC) 72623335 ‡w (OCoLC)1064266 ‡5 NcD', + third785field: '‡t Journal of the Chemical Society. Dalton transactions ‡x 0300-9246 ‡w (DLC) 72624566 ‡w (OCoLC)1034240 ‡5 NcD', + fourth785field: '‡t Perkin 1 ‡x 1470-4358 ‡w (DLC) 00252538 ‡w (OCoLC)44000773 ‡5 NcD', + fifth785field: '‡t Perkin 2 ‡x 1470-1820 ‡w (DLC) 00214936 ‡w (OCoLC)44000837 ‡5 NcD', + sixth785field: '‡t Dalton (Cambridge, England) ‡x 1470-479X ‡w (DLC) 00252543 ‡w (OCoLC)44000666 ‡5 NcD' + }; - before('login', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.remoteStorageView.gui, - permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.remoteStorageView.gui, + permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password); + cy.login(user.username, user.password); - Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); - }); - }); + Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + }); + }); - after('delete test data', () => { - MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: 'data==NcD' }) - .then((response) => { - MarcFieldProtection.deleteMarcFieldProtectionViaApi(response[0].id); - }); - Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + MarcFieldProtection.getListOfMarcFieldProtectionViaApi({ query: 'data==NcD' }) + .then((response) => { + MarcFieldProtection.deleteMarcFieldProtectionViaApi(response[0].id); + }); + Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + Users.deleteViaApi(user.userId); + }); - it('C359189 Check that protected fields in incoming records are not deleted during import: Scenario 2 (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.marcFieldProtectionPath); - MarcFieldProtection.checkListOfExistingProfilesIsDisplayed(); - MarcFieldProtection.createNewMarcFieldProtection(); - MarcFieldProtection.fillMarcFieldProtection('*', '5', 'NcD'); - MarcFieldProtection.checkFieldProtectionIsCreated('NcD'); + it('C359189 Check that protected fields in incoming records are not deleted during import: Scenario 2 (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.marcFieldProtectionPath); + MarcFieldProtection.checkListOfExistingProfilesIsDisplayed(); + MarcFieldProtection.createNewMarcFieldProtection(); + MarcFieldProtection.fillMarcFieldProtection('*', '5', 'NcD'); + MarcFieldProtection.checkFieldProtectionIsCreated('NcD'); - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.openTargetProfile(); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); - cy.visit(TopMenu.inventoryPath); - InventoryInstances.importWithOclc(oclcForImport); - // check fields is presented in .mrc file - InventoryInstance.viewSource(); - Object.values(initialFields).forEach((field) => InventoryViewSource.contains(field)); - cy.intercept('GET', '/orders/titles?*').as('getOrdersTitles'); - InventoryViewSource.close(); - cy.wait('@getOrdersTitles'); + cy.visit(TopMenu.inventoryPath); + InventoryInstances.importWithOclc(oclcForImport); + // check fields is presented in .mrc file + InventoryInstance.viewSource(); + Object.values(initialFields).forEach((field) => InventoryViewSource.contains(field)); + cy.intercept('GET', '/orders/titles?*').as('getOrdersTitles'); + InventoryViewSource.close(); + cy.wait('@getOrdersTitles'); - // edit the MARC bibliographic record - InventoryInstance.editMarcBibliographicRecord(); - Object.values(fieldsForChanging).forEach((field) => InventoryEditMarcRecord.editField(field, `${field} $5 NcD`)); - InventoryEditMarcRecord.addField('580', 'Test $5 NcD'); - InventoryEditMarcRecord.saveAndClose(); + // edit the MARC bibliographic record + InventoryInstance.editMarcBibliographicRecord(); + Object.values(fieldsForChanging).forEach((field) => InventoryEditMarcRecord.editField(field, `${field} $5 NcD`)); + InventoryEditMarcRecord.addField('580', 'Test $5 NcD'); + InventoryEditMarcRecord.saveAndClose(); - // overlay source bibliographic record - InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); - InventoryInstance.overlayWithOclc(oclcForImport); - InventoryInstance.checkCalloutMessage(`Record ${oclcForImport} updated. Results may take a few moments to become visible in Inventory`); + // overlay source bibliographic record + InventoryInstance.startOverlaySourceBibRecord(); + InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); + InventoryInstance.overlayWithOclc(oclcForImport); + InventoryInstance.checkCalloutMessage(`Record ${oclcForImport} updated. Results may take a few moments to become visible in Inventory`); - // need to wait because after the import the data in the instance is displayed for a long time - // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(10000); - InventoryInstance.viewSource(); - // check fields without NcD is presented in .mrc file - Object.values(initialFields).forEach((field) => InventoryViewSource.contains(field)); + // need to wait because after the import the data in the instance is displayed for a long time + // https://issues.folio.org/browse/MODCPCT-73 + cy.wait(10000); + InventoryInstance.viewSource(); + // check fields without NcD is presented in .mrc file + Object.values(initialFields).forEach((field) => InventoryViewSource.contains(field)); - // check fields with NcD is presented in .mrc file - Object.values(changedFields).forEach((field) => InventoryViewSource.contains(field)); - }); + // check fields with NcD is presented in .mrc file + Object.values(changedFields).forEach((field) => InventoryViewSource.contains(field)); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js index ccaba3d9bf..847fdf3ca1 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js @@ -14,83 +14,85 @@ import InventoryInstances from '../../../support/fragments/inventory/inventoryIn import Users from '../../../support/fragments/users/users'; import { TARGET_PROFILE_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user = {}; - const OCLCAuthentication = '100481406/PAOLF'; - const fileName = `C356824autotestFile.${getRandomPostfix()}.mrc`; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const oclcForImport = '912958093'; - const oclcForUpdating = '698820890'; - const updatedInstanceData = { - title: 'Dictionary of Louisiana French : as spoken in Cajun, Creole, and American Indian communities / Albert Valdman, editor ; Kevin J. Rottet, associate editor.', - language: 'English, French', - publisher: 'University Press of Mississippi', - placeOfPublication: 'Jackson', - publicationDate: '2010', - physicalDescription: 'XL, 892 S', - subject: 'French language--Dialects--Louisiana--Dictionaries', - notes: { noteType: 'Bibliography note', noteContent: 'Includes bibliographical references and index' } - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user = {}; + const OCLCAuthentication = '100481406/PAOLF'; + const fileName = `C356824autotestFile.${getRandomPostfix()}.mrc`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const oclcForImport = '912958093'; + const oclcForUpdating = '698820890'; + const updatedInstanceData = { + title: 'Dictionary of Louisiana French : as spoken in Cajun, Creole, and American Indian communities / Albert Valdman, editor ; Kevin J. Rottet, associate editor.', + language: 'English, French', + publisher: 'University Press of Mississippi', + placeOfPublication: 'Jackson', + publicationDate: '2010', + physicalDescription: 'XL, 892 S', + subject: 'French language--Dialects--Louisiana--Dictionaries', + notes: { noteType: 'Bibliography note', noteContent: 'Includes bibliographical references and index' } + }; - before('create test data', () => { - cy.getAdminToken(); - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui, - permissions.settingsDataImportEnabled.gui, - permissions.remoteStorageView.gui - ]).then(userProperties => { - user = userProperties; + before('create test data', () => { + cy.getAdminToken(); + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui, + permissions.settingsDataImportEnabled.gui, + permissions.remoteStorageView.gui + ]).then(userProperties => { + user = userProperties; - cy.login(user.username, user.password); - Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + cy.login(user.username, user.password); + Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + }); }); - }); - after('delete test data', () => { - Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); - Users.deleteViaApi(user.userId); + after('delete test data', () => { + Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + Users.deleteViaApi(user.userId); // TODO delete all instances - }); + }); - it('C356824 Inventory single record import is not delayed when large data import jobs are running (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); + it('C356824 Inventory single record import is not delayed when large data import jobs are running (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.openTargetProfile(); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); - // import a file - cy.visit(TopMenu.dataImportPath); - DataImport.checkIsLandingPageOpened(); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneThousandMarcBib.mrc', fileName); - // wait until file will be uploaded - cy.wait(10000); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - Logs.checkFileIsRunning(fileName); + // import a file + cy.visit(TopMenu.dataImportPath); + DataImport.checkIsLandingPageOpened(); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('oneThousandMarcBib.mrc', fileName); + // wait until file will be uploaded + cy.wait(10000); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + Logs.checkFileIsRunning(fileName); - cy.visit(TopMenu.inventoryPath); - InventoryInstances.importWithOclc(oclcForImport); - InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); - InventoryInstance.overlayWithOclc(oclcForUpdating); - InventoryInstance.checkCalloutMessage(`Record ${oclcForUpdating} updated. Results may take a few moments to become visible in Inventory`); + cy.visit(TopMenu.inventoryPath); + InventoryInstances.importWithOclc(oclcForImport); + InventoryInstance.startOverlaySourceBibRecord(); + InventoryInstance.singleOverlaySourceBibRecordModalIsPresented(); + InventoryInstance.importWithOclc(oclcForUpdating); + InventoryInstance.checkCalloutMessage(`Record ${oclcForUpdating} updated. Results may take a few moments to become visible in Inventory`); - // check instance is updated - InventoryInstance.verifyInstanceTitle(updatedInstanceData.title); - InventoryInstance.verifyInstanceLanguage(updatedInstanceData.language); - InventoryInstance.verifyInstancePublisher(0, 0, updatedInstanceData.publisher); - InventoryInstance.verifyInstancePublisher(0, 2, updatedInstanceData.placeOfPublication); - InventoryInstance.verifyInstancePublisher(0, 3, updatedInstanceData.publicationDate); - InventoryInstance.verifyInstancePhysicalcyDescription(updatedInstanceData.physicalDescription); - InventoryInstance.verifyInstanceSubject(0, 0, updatedInstanceData.subject); - InventoryInstance.checkInstanceNotes(updatedInstanceData.notes.noteType, updatedInstanceData.notes.noteContent); + // check instance is updated + InventoryInstance.verifyInstanceTitle(updatedInstanceData.title); + InventoryInstance.verifyInstanceLanguage(updatedInstanceData.language); + InventoryInstance.verifyInstancePublisher(0, 0, updatedInstanceData.publisher); + InventoryInstance.verifyInstancePublisher(0, 2, updatedInstanceData.placeOfPublication); + InventoryInstance.verifyInstancePublisher(0, 3, updatedInstanceData.publicationDate); + InventoryInstance.verifyInstancePhysicalcyDescription(updatedInstanceData.physicalDescription); + InventoryInstance.verifyInstanceSubject(0, 0, updatedInstanceData.subject); + InventoryInstance.checkInstanceNotes(updatedInstanceData.notes.noteType, updatedInstanceData.notes.noteContent); - cy.visit(TopMenu.dataImportPath); - Logs.checkFileIsRunning(fileName); - }); + cy.visit(TopMenu.dataImportPath); + Logs.checkFileIsRunning(fileName); + }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js index 989ff41c1a..e67da0c78a 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js @@ -27,253 +27,255 @@ import FileManager from '../../../support/utils/fileManager'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; -describe('ui-data-import', () => { - const instanceTitle = 'The distant sound / Susan Philipsz.'; - const itemBarcode = uuid(); - const quantityOfItems = '1'; - const filePathToUpload = 'marcFileForC17036.mrc'; - const editedMarcFileName = `C17036 autotestFile.${getRandomPostfix()}.mrc`; - const marcFileNameForFirstUpdate = `C17036 autotestFile.${getRandomPostfix()}.mrc`; - const marcFileNameForSecondUpdate = `C17036 autotestFile.${getRandomPostfix()}.mrc`; - // profiles for create - const collectionOfMappingAndActionProfilesForCreate = [ - { - mappingProfile: { name: `C17036 instance create mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17036 instance create action profile_${getRandomPostfix()}` } - }, - { - mappingProfile: { name: `C17036 holdings create mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, - permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C17036 holdings create action profile_${getRandomPostfix()}` } - }, - { - mappingProfile: { name: `C17036 item create mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ITEM, - barcode: '945$a', - materialType: MATERIAL_TYPE_NAMES.BOOK, - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, - status: ITEM_STATUS_NAMES.AVAILABLE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C17036 item create action profile_${getRandomPostfix()}` } - }, - ]; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17036 create job profile_${getRandomPostfix()}` - }; - const collectionOfMatchProfiles = [ - { - matchProfile: { profileName: `C17036 FAIL match profile_${getRandomPostfix()}`, - incomingRecordFields: { - field: '945', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.barcode } - }, - { - matchProfile: { - profileName: `C17036 SUCCEED match profile_${getRandomPostfix()}`, - incomingRecordFields: { - field: '945', - in1: '*', - in2: '*', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.barcode +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const instanceTitle = 'The distant sound / Susan Philipsz.'; + const itemBarcode = uuid(); + const quantityOfItems = '1'; + const filePathToUpload = 'marcFileForC17036.mrc'; + const editedMarcFileName = `C17036 autotestFile.${getRandomPostfix()}.mrc`; + const marcFileNameForFirstUpdate = `C17036 autotestFile.${getRandomPostfix()}.mrc`; + const marcFileNameForSecondUpdate = `C17036 autotestFile.${getRandomPostfix()}.mrc`; + // profiles for create + const collectionOfMappingAndActionProfilesForCreate = [ + { + mappingProfile: { name: `C17036 instance create mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C17036 instance create action profile_${getRandomPostfix()}` } + }, + { + mappingProfile: { name: `C17036 holdings create mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, + permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C17036 holdings create action profile_${getRandomPostfix()}` } + }, + { + mappingProfile: { name: `C17036 item create mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ITEM, + barcode: '945$a', + materialType: MATERIAL_TYPE_NAMES.BOOK, + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C17036 item create action profile_${getRandomPostfix()}` } + }, + ]; + const jobProfileForCreate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17036 create job profile_${getRandomPostfix()}` + }; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C17036 FAIL match profile_${getRandomPostfix()}`, + incomingRecordFields: { + field: '945', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.barcode } + }, + { + matchProfile: { + profileName: `C17036 SUCCEED match profile_${getRandomPostfix()}`, + incomingRecordFields: { + field: '945', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.barcode + } } - } - ]; - // profiles for update - const collectionOfMappingAndActionProfilesForUpdate = [ - { - mappingProfile: { name: `C17036 item update mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ITEM, - itemIdentifier: `"${'SUCCEED'}"`, - itemIdentifierUI: 'SUCCEED' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C17036 item update action profile_${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - const jobProfileForUpdateWithFail = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17036 FAIL update job profile_${getRandomPostfix()}` - }; - const jobProfileForUpdateWithSucceed = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17036 SUCCEED update job profile_${getRandomPostfix()}` - }; - - before('login', () => { - cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - cy.getAdminToken(); - }); + ]; + // profiles for update + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C17036 item update mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ITEM, + itemIdentifier: `"${'SUCCEED'}"`, + itemIdentifierUI: 'SUCCEED' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C17036 item update action profile_${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const jobProfileForUpdateWithFail = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17036 FAIL update job profile_${getRandomPostfix()}` + }; + const jobProfileForUpdateWithSucceed = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17036 SUCCEED update job profile_${getRandomPostfix()}` + }; - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); - JobProfiles.deleteJobProfile(jobProfileForUpdateWithFail.profileName); - JobProfiles.deleteJobProfile(jobProfileForUpdateWithSucceed.profileName); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); + before('login', () => { + cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + cy.getAdminToken(); }); - 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); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); + JobProfiles.deleteJobProfile(jobProfileForUpdateWithFail.profileName); + JobProfiles.deleteJobProfile(jobProfileForUpdateWithSucceed.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.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); + }); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); }); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - }); - it('C17036 Test Any versus All for MARC indicators in match profiles (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C17036 Test Any versus All for MARC indicators in match profiles (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // change file for adding random barcode - DataImport.editMarcFile(filePathToUpload, editedMarcFileName, ['testBarcode'], [itemBarcode]); + DataImport.editMarcFile(filePathToUpload, editedMarcFileName, ['testBarcode'], [itemBarcode]); - // create mapping profiles for create - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); + // create mapping profiles for create + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile); - NewFieldMappingProfile.fillBarcode(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.barcode); - NewFieldMappingProfile.fillMaterialType(`"${collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.materialType}"`); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile); + NewFieldMappingProfile.fillBarcode(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.barcode); + NewFieldMappingProfile.fillMaterialType(`"${collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.materialType}"`); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.name); - // create action profiles for create - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profiles for create + collectionOfMappingAndActionProfilesForCreate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create job profile for create - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForCreate); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[0].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[1].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[2].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); + // create job profile for create + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForCreate); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[1].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[2].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.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); - JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(editedMarcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(editedMarcFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); + // 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); + JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(editedMarcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(editedMarcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); - // check created instance - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.checkIsInstancePresented( - instanceTitle, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationUI, - collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status - ); + // check created instance + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.checkIsInstancePresented( + instanceTitle, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationUI, + collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status + ); - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.createMatchProfile(profile.matchProfile); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.createMatchProfile(profile.matchProfile); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - // create mapping profiles for update - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); - NewFieldMappingProfile.fillItemIdentifier(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.itemIdentifier); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + // create mapping profiles for update + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.fillItemIdentifier(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.itemIdentifier); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); - // create action profile for update - collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profile for update + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create job profile for update - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForUpdateWithFail); - NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); + // create job profile for update + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdateWithFail); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - // create job profile for update - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForUpdateWithSucceed); - NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); + // create job profile for update + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdateWithSucceed); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - // upload a marc file for updating - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, marcFileNameForFirstUpdate); - JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithFail.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForFirstUpdate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileNameForFirstUpdate); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.item); + // upload a marc file for updating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, marcFileNameForFirstUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithFail.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForFirstUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForFirstUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.item); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.searchByParameter('Barcode', itemBarcode); - ItemRecordView.verifyItemIdentifier('-'); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', itemBarcode); + ItemRecordView.verifyItemIdentifier('-'); - // upload a marc file for updating - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, marcFileNameForSecondUpdate); - JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithSucceed.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForSecondUpdate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileNameForSecondUpdate); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); + // upload a marc file for updating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, marcFileNameForSecondUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithSucceed.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForSecondUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForSecondUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); - // check updated item - FileDetails.openItemInInventory('Updated'); - ItemRecordView.verifyItemIdentifier(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.itemIdentifierUI); - }); + // check updated item + FileDetails.openItemInInventory('Updated'); + ItemRecordView.verifyItemIdentifier(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.itemIdentifierUI); + }); + }); }); 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 6a3933ffaa..2b39054314 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 @@ -30,290 +30,292 @@ import { JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - const itemBarcode = uuid(); - const quantityOfItems = '1'; - const marcFileNameForCreate = `C17033 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `marcFileForC317033.${getRandomPostfix()}.mrc`; - // profiles for creating - const collectionOfMappingAndActionProfilesForCreate = [ - { - mappingProfile: { name: `C17033 instance create mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17033 instance create action profile_${getRandomPostfix()}` } - }, - { - mappingProfile: { name: `C17033 holdings create mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, - permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI, - permanentLocationInHoldingsAccordion: `${LOCATION_NAMES.MAIN_LIBRARY_UI} >`, - temporaryLocation: `"${LOCATION_NAMES.ONLINE}"`, - temporaryLocationUI: LOCATION_NAMES.ONLINE_UI, - illPolicy: 'Unknown lending policy', - digitizationPolicy: '"Digitization policy"', - digitizationPolicyUI: 'Digitization policy' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C17033 holdings create action profile_${getRandomPostfix()}` } - }, - { - mappingProfile: { name: `C17033 item create mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ITEM, - barcode: '945$a', - accessionNumber: '"12345"', - accessionNumberUI: '12345', - materialType: MATERIAL_TYPE_NAMES.BOOK, - numberOfPieces: '"25"', - numberOfPiecesUI: '25', - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, - temporaryLoanType: `"${LOAN_TYPE_NAMES.COURSE_RESERVES}"`, - temporaryLoanTypeUI: LOAN_TYPE_NAMES.COURSE_RESERVES, - status: ITEM_STATUS_NAMES.AVAILABLE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C17033 item create action profile_${getRandomPostfix()}` } - }, - ]; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17033 create job profile_${getRandomPostfix()}` - }; - // profiles for updating - const collectionOfMatchProfiles = [ - { - matchProfile: { profileName: `autotestMatchHoldings${getRandomPostfix()}`, - incomingRecordFields: { - field: '901', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.holdingsHrid } - }, - { - matchProfile: { - profileName: `autotestMatchItem${getRandomPostfix()}`, - incomingRecordFields: { - field: '945', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.barcode +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const itemBarcode = uuid(); + const quantityOfItems = '1'; + const marcFileNameForCreate = `C17033 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `marcFileForC317033.${getRandomPostfix()}.mrc`; + // profiles for creating + const collectionOfMappingAndActionProfilesForCreate = [ + { + mappingProfile: { name: `C17033 instance create mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C17033 instance create action profile_${getRandomPostfix()}` } + }, + { + mappingProfile: { name: `C17033 holdings create mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, + permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI, + permanentLocationInHoldingsAccordion: `${LOCATION_NAMES.MAIN_LIBRARY_UI} >`, + temporaryLocation: `"${LOCATION_NAMES.ONLINE}"`, + temporaryLocationUI: LOCATION_NAMES.ONLINE_UI, + illPolicy: 'Unknown lending policy', + digitizationPolicy: '"Digitization policy"', + digitizationPolicyUI: 'Digitization policy' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C17033 holdings create action profile_${getRandomPostfix()}` } + }, + { + mappingProfile: { name: `C17033 item create mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ITEM, + barcode: '945$a', + accessionNumber: '"12345"', + accessionNumberUI: '12345', + materialType: MATERIAL_TYPE_NAMES.BOOK, + numberOfPieces: '"25"', + numberOfPiecesUI: '25', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + temporaryLoanType: `"${LOAN_TYPE_NAMES.COURSE_RESERVES}"`, + temporaryLoanTypeUI: LOAN_TYPE_NAMES.COURSE_RESERVES, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C17033 item create action profile_${getRandomPostfix()}` } + }, + ]; + const jobProfileForCreate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17033 create job profile_${getRandomPostfix()}` + }; + // profiles for updating + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `autotestMatchHoldings${getRandomPostfix()}`, + incomingRecordFields: { + field: '901', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid } + }, + { + matchProfile: { + profileName: `autotestMatchItem${getRandomPostfix()}`, + incomingRecordFields: { + field: '945', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.barcode + } } - } - ]; - const collectionOfMappingAndActionProfilesForUpdate = [ - { - mappingProfile: { name: `C17033 holdings update mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - temporaryLocation: '###REMOVE###', - digitizationPolicy: '###REMOVE###' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C17033 holdings update action profile_${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { name: `C17033 item update mapping profile_${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ITEM, - accessionNumber: '###REMOVE###', - numberOfPieces: '###REMOVE###', - temporaryLoanType:'###REMOVE###' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C17033 item update action profile_${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - ]; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C17033 update job profile_${getRandomPostfix()}` - }; + ]; + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C17033 holdings update mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + temporaryLocation: '###REMOVE###', + digitizationPolicy: '###REMOVE###' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C17033 holdings update action profile_${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C17033 item update mapping profile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ITEM, + accessionNumber: '###REMOVE###', + numberOfPieces: '###REMOVE###', + temporaryLoanType:'###REMOVE###' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C17033 item update action profile_${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C17033 update job profile_${getRandomPostfix()}` + }; - before('login', () => { - cy.getAdminToken(); - cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); + before('login', () => { + cy.getAdminToken(); + cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete profiles - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.deleteMatchProfile(profile.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); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.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); + }); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${marcFileNameForCreate}`); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); }); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${marcFileNameForCreate}`); - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - }); - it('C17033 Test ###REMOVE### field mapping option (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C17033 Test ###REMOVE### field mapping option (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profiles - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); - NewFieldMappingProfile.fillTemporaryLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.temporaryLocation); - NewFieldMappingProfile.fillIllPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.illPolicy); - NewFieldMappingProfile.fillDigitizationPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.digitizationPolicy); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); + NewFieldMappingProfile.fillTemporaryLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.temporaryLocation); + NewFieldMappingProfile.fillIllPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.illPolicy); + NewFieldMappingProfile.fillDigitizationPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.digitizationPolicy); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile); - NewFieldMappingProfile.fillBarcode(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.barcode); - NewFieldMappingProfile.fillAccessionNumber(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.accessionNumber); - NewFieldMappingProfile.fillMaterialType(`"${collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.materialType}"`); - NewFieldMappingProfile.fillNumberOfPieces(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.numberOfPieces); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillTemporaryLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.temporaryLoanType); - NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile); + NewFieldMappingProfile.fillBarcode(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.barcode); + NewFieldMappingProfile.fillAccessionNumber(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.accessionNumber); + NewFieldMappingProfile.fillMaterialType(`"${collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.materialType}"`); + NewFieldMappingProfile.fillNumberOfPieces(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.numberOfPieces); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillTemporaryLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.temporaryLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.name); - // create action profiles - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profiles + collectionOfMappingAndActionProfilesForCreate.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(jobProfileForCreate); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[0].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[1].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[2].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForCreate); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[1].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfilesForCreate[2].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - // change file for adding random barcode - DataImport.editMarcFile('marcFileForC17033.mrc', marcFileNameForCreate, ['testBarcode'], [itemBarcode]); + // change file for adding random barcode + DataImport.editMarcFile('marcFileForC17033.mrc', marcFileNameForCreate, ['testBarcode'], [itemBarcode]); - // 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(marcFileNameForCreate); - JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileNameForCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); + // 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(marcFileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); - // check created instance - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - InventoryInstance.openHoldingView(); - HoldingsRecordView.getHoldingsHrId().then(holdingsHrId => { - HoldingsRecordView.checkPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationUI); - HoldingsRecordView.checkTemporaryLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.temporaryLocationUI); - HoldingsRecordView.checkIllPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.illPolicy); - HoldingsRecordView.checkDigitizationPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.digitizationPolicyUI); - HoldingsRecordView.close(); - InventoryInstance.openHoldingsAccordion(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationInHoldingsAccordion); - InventoryInstance.openItemByBarcode(itemBarcode); - ItemRecordView.checkBarcode(itemBarcode); - ItemRecordView.verifyMaterialType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.materialType); - ItemRecordView.checkAccessionNumber(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.accessionNumberUI); - ItemRecordView.checkNumberOfPieces(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.numberOfPiecesUI); - ItemRecordView.verifyPermanentLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.permanentLoanType); - ItemRecordView.verifyTemporaryLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.temporaryLoanTypeUI); - ItemRecordView.checkStatus(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status); + // check created instance + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + InventoryInstance.openHoldingView(); + HoldingsRecordView.getHoldingsHrId().then(holdingsHrId => { + HoldingsRecordView.checkPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationUI); + HoldingsRecordView.checkTemporaryLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.temporaryLocationUI); + HoldingsRecordView.checkIllPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.illPolicy); + HoldingsRecordView.checkDigitizationPolicy(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.digitizationPolicyUI); + HoldingsRecordView.close(); + InventoryInstance.openHoldingsAccordion(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationInHoldingsAccordion); + InventoryInstance.openItemByBarcode(itemBarcode); + ItemRecordView.checkBarcode(itemBarcode); + ItemRecordView.verifyMaterialType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.materialType); + ItemRecordView.checkAccessionNumber(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.accessionNumberUI); + ItemRecordView.checkNumberOfPieces(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.numberOfPiecesUI); + ItemRecordView.verifyPermanentLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.permanentLoanType); + ItemRecordView.verifyTemporaryLoanType(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.temporaryLoanTypeUI); + ItemRecordView.checkStatus(collectionOfMappingAndActionProfilesForCreate[2].mappingProfile.status); - // change file for adding random barcode and holdings hrid - DataImport.editMarcFile('marcFileForC17033_withHoldingsHrid.mrc', editedMarcFileName, ['testBarcode', 'holdingsHrid'], [itemBarcode, holdingsHrId]); + // change file for adding random barcode and holdings hrid + DataImport.editMarcFile('marcFileForC17033_withHoldingsHrid.mrc', editedMarcFileName, ['testBarcode', 'holdingsHrid'], [itemBarcode, holdingsHrId]); - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.createMatchProfile(profile.matchProfile); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.createMatchProfile(profile.matchProfile); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); - NewFieldMappingProfile.fillTemporaryLocation(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.temporaryLocation); - NewFieldMappingProfile.fillDigitizationPolicy(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.digitizationPolicy); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + // create mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.fillTemporaryLocation(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.temporaryLocation); + NewFieldMappingProfile.fillDigitizationPolicy(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.digitizationPolicy); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile); - NewFieldMappingProfile.fillAccessionNumber(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.accessionNumber); - NewFieldMappingProfile.fillNumberOfPieces(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.numberOfPieces); - NewFieldMappingProfile.fillTemporaryLoanType(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.temporaryLoanType); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile); + NewFieldMappingProfile.fillAccessionNumber(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.accessionNumber); + NewFieldMappingProfile.fillNumberOfPieces(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.numberOfPieces); + NewFieldMappingProfile.fillTemporaryLoanType(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.temporaryLoanType); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); - // create action profiles - collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profiles + collectionOfMappingAndActionProfilesForUpdate.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.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - 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); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); + 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); - // upload a marc file for updating - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(editedMarcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(editedMarcFileName); - [FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems, 1); - FileDetails.checkItemQuantityInSummaryTable(quantityOfItems, 1); + // upload a marc file for updating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(editedMarcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(editedMarcFileName); + [FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems, 1); + FileDetails.checkItemQuantityInSummaryTable(quantityOfItems, 1); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(initialInstanceHrId); - InventoryInstance.openHoldingView(); - HoldingsRecordView.checkTemporaryLocation('-'); - HoldingsRecordView.checkDigitizationPolicy('-'); - HoldingsRecordView.close(); - InventoryInstance.openHoldingsAccordion(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationInHoldingsAccordion); - InventoryInstance.openItemByBarcode(itemBarcode); - ItemRecordView.checkAccessionNumber('-'); - ItemRecordView.checkNumberOfPieces('-'); - ItemRecordView.verifyTemporaryLoanType('-'); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(initialInstanceHrId); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkTemporaryLocation('-'); + HoldingsRecordView.checkDigitizationPolicy('-'); + HoldingsRecordView.close(); + InventoryInstance.openHoldingsAccordion(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocationInHoldingsAccordion); + InventoryInstance.openItemByBarcode(itemBarcode); + ItemRecordView.checkAccessionNumber('-'); + ItemRecordView.checkNumberOfPieces('-'); + ItemRecordView.verifyTemporaryLoanType('-'); + }); }); }); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js index 34c5d5db7d..32ec70e845 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js @@ -22,217 +22,220 @@ import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthor import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; -describe('Importing MARC Bib files', () => { - const testData = {}; - // unique file name to upload - const nameForUpdatedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; - const nameForExportedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C375098autotestFile${getRandomPostfix()}.csv`; - const mappingProfile = { - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - update: true, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const matchProfile = { - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - existingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - const marcFiles = [ - { - marc: 'marcBibFileForC385665.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - numOfRecords: 1 - }, - { - marc: 'marcAuthFileC385665_1.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 1 - }, - { - marc: 'marcAuthFileC385665_2.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 1 - }, - { - marc: 'marcAuthFileC385665_3.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 1 - }, - ]; - const linkingTagAndValues = [ - { - rowIndex: 75, - value: 'Chin, Staceyann' - }, - { - rowIndex: 76, - value: 'Lee, Stan, 1922-2018' - }, - { - rowIndex: 77, - value: 'Kirby, Jack' - }, - ]; - const createdAuthorityIDs = []; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const testData = {}; + // unique file name to upload + const nameForUpdatedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; + const nameForExportedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C375098autotestFile${getRandomPostfix()}.csv`; + const mappingProfile = { + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + update: true, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const matchProfile = { + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + existingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const marcFiles = [ + { + marc: 'marcBibFileForC385665.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1 + }, + { + marc: 'marcAuthFileC385665_1.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1 + }, + { + marc: 'marcAuthFileC385665_2.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1 + }, + { + marc: 'marcAuthFileC385665_3.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1 + }, + ]; + const linkingTagAndValues = [ + { + rowIndex: 75, + value: 'Chin, Staceyann' + }, + { + rowIndex: 76, + value: 'Lee, Stan, 1922-2018' + }, + { + rowIndex: 77, + value: 'Kirby, Jack' + }, + ]; + const createdAuthorityIDs = []; - before('Creating user', () => { - cy.createTempUser([ - Permissions.moduleDataImportEnabled.gui, - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - Permissions.dataExportEnableApp.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]); - }); - } + before('Creating user', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + Permissions.dataExportEnableApp.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.loginAsAdmin().then(() => { + cy.loginAsAdmin().then(() => { // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); - 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.openNewJobProfileForm(); - NewJobProfile.fillJobProfile(jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileByName(actionProfile.name); - // wait for the action profile to be linked - cy.wait(1000); - NewJobProfile.saveAndClose(); - JobProfiles.waitLoadingList(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - }); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); + 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.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileByName(actionProfile.name); + // wait for the action profile to be linked + cy.wait(1000); + NewJobProfile.saveAndClose(); + JobProfiles.waitLoadingList(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); }); - }); - after('delete test data', () => { - Users.deleteViaApi(testData.userProperties.userId); - if (createdAuthorityIDs[0]) InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); - createdAuthorityIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); + after('delete test data', () => { + Users.deleteViaApi(testData.userProperties.userId); + if (createdAuthorityIDs[0]) InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + createdAuthorityIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + }); + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); }); - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); - }); - it('C385665 Update controllable subfield, "$0" in one of the linked repeatable fields (multiple repeatable fields with same indicators) (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - InventoryInstance.searchByTitle(createdAuthorityIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - linkingTagAndValues.forEach(linking => { - QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(linking.value); - InventoryInstance.clickLinkButton(); - InventoryInstance.closeDetailsView(); - InventoryInstance.closeFindAuthorityModal(); - // waiter needed for the fileds to be linked. - cy.wait(1000); - }); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); + it('C385665 Update controllable subfield, "$0" in one of the linked repeatable fields (multiple repeatable fields with same indicators) (spitfire)', + { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + linkingTagAndValues.forEach(linking => { + QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(linking.value); + InventoryInstance.clickLinkButton(); + InventoryInstance.closeDetailsView(); + InventoryInstance.closeFindAuthorityModal(); + // waiter needed for the fileds to be linked. + cy.wait(1000); + }); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); - // download .csv file - 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#####'); + // download .csv file + 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#####'); - DataImport.editMarcFile( - nameForExportedMarcFile, - nameForUpdatedMarcFile, - ['aKirby, Jack', 'n77020008'], - ['aKirby, Steve,', 'n77020008test'] - ); + DataImport.editMarcFile( + nameForExportedMarcFile, + nameForUpdatedMarcFile, + ['aKirby, Jack', 'n77020008'], + ['aKirby, Steve,', 'n77020008test'] + ); - // upload the exported marc file with 999.f.f.s fields - cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); - Logs.checkStatusOfJobProfile('Completed'); - Logs.openFileDetails(nameForUpdatedMarcFile); + // upload the exported marc file with 999.f.f.s fields + cy.visit(TopMenu.dataImportPath); + DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(nameForUpdatedMarcFile); - cy.visit(TopMenu.inventoryPath); - InventoryInstance.searchByTitle(createdAuthorityIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(76, '700', '1', '\\', '$a Lee, Stan, $d 1922-2018', '$e creator', '$0 id.loc.gov/authorities/names/n83169267', ''); - QuickMarcEditor.verifyTagFieldAfterUnlinking(77, '700', '1', '\\', '$a Kirby, Steve, $e creator. $0 id.loc.gov/authorities/names/n77020008test'); + cy.visit(TopMenu.inventoryPath); + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(76, '700', '1', '\\', '$a Lee, Stan, $d 1922-2018', '$e creator', '$0 id.loc.gov/authorities/names/n83169267', ''); + QuickMarcEditor.verifyTagFieldAfterUnlinking(77, '700', '1', '\\', '$a Kirby, Steve, $e creator. $0 id.loc.gov/authorities/names/n77020008test'); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js index 43d0d79052..aeb4433cdc 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js @@ -22,184 +22,186 @@ import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthor import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; -describe('Importing MARC Bib files', () => { - const testData = {}; - // unique file name to upload - const nameForUpdatedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; - const nameForExportedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C375098autotestFile${getRandomPostfix()}.csv`; - const mappingProfile = { - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - update: true, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"` - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: 'Update MARC Bib records by matching 999 ff $s subfield value', - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const matchProfile = { - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - existingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 's' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - const marcFiles = [ - { - marc: 'marcBibFileForC375098.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - numOfRecords: 1 - }, - { - marc: 'marcFileForC375098.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 1 - } - ]; - const createdAuthorityIDs = []; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + const testData = {}; + // unique file name to upload + const nameForUpdatedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; + const nameForExportedMarcFile = `C375098autotestFile${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C375098autotestFile${getRandomPostfix()}.csv`; + const mappingProfile = { + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + update: true, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: 'Update MARC Bib records by matching 999 ff $s subfield value', + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const matchProfile = { + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + existingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 's' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: 'Update MARC Bib records by matching 999 ff $s subfield value', + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const marcFiles = [ + { + marc: 'marcBibFileForC375098.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1 + }, + { + marc: 'marcFileForC375098.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1 + } + ]; + const createdAuthorityIDs = []; - before('Creating user', () => { - cy.createTempUser([ - Permissions.moduleDataImportEnabled.gui, - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - Permissions.dataExportEnableApp.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]); - }); - } + before('Creating user', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + Permissions.dataExportEnableApp.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.loginAsAdmin().then(() => { + cy.loginAsAdmin().then(() => { // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); - 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.openNewJobProfileForm(); - NewJobProfile.fillJobProfile(jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileByName(actionProfile.name); - // wait for the action profile to be linked - cy.wait(1000); - NewJobProfile.saveAndClose(); - JobProfiles.waitLoadingList(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - }); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfileForUpdatesMarc(mappingProfile); + 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.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileByName(actionProfile.name); + // wait for the action profile to be linked + cy.wait(1000); + NewJobProfile.saveAndClose(); + JobProfiles.waitLoadingList(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); }); - }); - after('delete test data', () => { - Users.deleteViaApi(testData.userProperties.userId); - InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); - MarcAuthority.deleteViaAPI(createdAuthorityIDs[1]); - // clean up generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); - }); + after('delete test data', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + MarcAuthority.deleteViaAPI(createdAuthorityIDs[1]); + // clean up generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${nameForExportedMarcFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + FileManager.deleteFile(`cypress/fixtures/${nameForUpdatedMarcFile}`); + }); - it('C375098 Update controlled and not controlled subfields of linked "MARC Bib" field which is controlled by "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - InventoryInstance.searchByTitle(createdAuthorityIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - InventoryInstance.verifyAndClickLinkIcon('100'); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults('Chin, Staceyann, 1972-'); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingAuthority('100'); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); + it('C375098 Update controlled and not controlled subfields of linked "MARC Bib" field which is controlled by "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon('100'); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults('Chin, Staceyann, 1972-'); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority('100'); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); - // download .csv file - 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#####'); + // download .csv file + 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#####'); - DataImport.editMarcFile( - nameForExportedMarcFile, - nameForUpdatedMarcFile, - ['aChin, Staceyann,', 'eauthor', 'aThe other side of paradise :'], - ['aChin, S-nn', 'eProducereNarratorctestutest4prf', 'aParadise of other side (updated title) :'] - ); + DataImport.editMarcFile( + nameForExportedMarcFile, + nameForUpdatedMarcFile, + ['aChin, Staceyann,', 'eauthor', 'aThe other side of paradise :'], + ['aChin, S-nn', 'eProducereNarratorctestutest4prf', 'aParadise of other side (updated title) :'] + ); - // upload the exported marc file with 999.f.f.s fields - cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); - JobProfiles.waitLoadingList(); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); - Logs.checkStatusOfJobProfile('Completed'); - Logs.openFileDetails(nameForUpdatedMarcFile); + // upload the exported marc file with 999.f.f.s fields + cy.visit(TopMenu.dataImportPath); + DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForUpdatedMarcFile); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(nameForUpdatedMarcFile); - cy.visit(TopMenu.inventoryPath); - InventoryInstance.searchByTitle('Paradise of other side (updated title)'); - InventoryInstances.selectInstance(); - InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane('Contributor'); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterLinking(19, '100', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e Producer $e Narrator $u test', '$0 id.loc.gov/authorities/names/n2008052404', '$4 prf.'); - QuickMarcEditor.verifyTagFieldAfterUnlinking(20, '245', '1', '4', '$a Paradise of other side (updated title) : $b a memoir / $c Staceyann Chin.'); + cy.visit(TopMenu.inventoryPath); + InventoryInstance.searchByTitle('Paradise of other side (updated title)'); + InventoryInstances.selectInstance(); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane('Contributor'); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterLinking(19, '100', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e Producer $e Narrator $u test', '$0 id.loc.gov/authorities/names/n2008052404', '$4 prf.'); + QuickMarcEditor.verifyTagFieldAfterUnlinking(20, '245', '1', '4', '$a Paradise of other side (updated title) : $b a memoir / $c Staceyann Chin.'); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js index 34f453190f..9128fe8cb9 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js @@ -27,273 +27,275 @@ import Helper from '../../../support/fragments/finance/financeHelper'; import FileManager from '../../../support/utils/fileManager'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; -describe('ui-data-import', () => { - let instanceHrid; - const quantityOfItems = '1'; - const marcFileNameForCreate = `C11110 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C11110 editedMarcFile.${getRandomPostfix()}.mrc`; - const marcFileNameForUpdate = `C11110 autotestFile.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let instanceHrid; + const quantityOfItems = '1'; + const marcFileNameForCreate = `C11110 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C11110 editedMarcFile.${getRandomPostfix()}.mrc`; + const marcFileNameForUpdate = `C11110 autotestFile.${getRandomPostfix()}.mrc`; - const instanceMappingProfileForCreate = { - name: `C11110 autotest instance mapping profile.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - actionForSuppress: 'Mark for all affected records', - catalogedDate: '"2021-02-24"', - catalogedDateUI: '2021-02-24', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, - statisticalCode: 'ARL (Collection stats): books - Book, print (books)', - statisticalCodeUI: 'Book, print (books)', - natureOfContent: 'bibliography' - }; - const holdingsMappingProfileForCreate = { - name: `C11110 autotest holdings mapping profile.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - formerHoldingsId: `autotestFormerHoldingsId.${getRandomPostfix()}`, - holdingsType: HOLDINGS_TYPE_NAMES.MONOGRAPH, - statisticalCode: 'ARL (Collection stats): books - Book, print (books)', - statisticalCodeUI: 'Book, print (books)', - adminNote: `autotestAdminNote.${getRandomPostfix()}`, - permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, - permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI, - temporaryLocation: `"${LOCATION_NAMES.ONLINE}"`, - temporaryLocationUI: LOCATION_NAMES.ONLINE_UI, - shelvingTitle: `autotestShelvingTitle.${getRandomPostfix()}`, - callNumberType: CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_MEDICINE, - callNumber: Helper.getRandomBarcode(), - holdingsStatements: `autotestHoldingsStatements.${getRandomPostfix()}`, - illPolicy: 'Unknown lending policy', - noteType: '"Binding"', - holdingsNote: `autotestHoldingsNote.${getRandomPostfix()}`, - staffOnly: 'Mark for all affected records' - }; - const holdingsMappingProfileForUpdate = { - name: `C11110 autotest holdings mapping profile.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - formerHoldingsId: `autotestFormerHoldingsId.${getRandomPostfix()}`, - holdingsType: 'Physical', - statisticalCode: 'ARL (Collection stats): emusic - Music scores, electronic', - statisticalCodeUI: 'Music scores, electronic', - adminNote: `autotestAdminNote.${getRandomPostfix()}`, - shelvingTitle: `autotestShelvingTitle.${getRandomPostfix()}`, - callNumberType: CALL_NUMBER_TYPE_NAMES.OTHER_SCHEME, - callNumber: Helper.getRandomBarcode(), - holdingsStatements: `autotestHoldingsStatements.${getRandomPostfix()}`, - illPolicy: 'Will lend' - }; - const instanceActionProfileForCreate = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C11110 autotest instance action profile.${getRandomPostfix()}` - }; - const holdingsActionProfileForCreate = { - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C11110 autotest holdings action profile.${getRandomPostfix()}` - }; - const holdingsActionProfileForUpdate = { - typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C11110 autotest holdings action profile.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const instanceMatchProfile = { - profileName: `C11110 autotest instance match profile.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid - }; - const holdingsMatchProfile = { - profileName: `C11110 autotest holdings match profile.${getRandomPostfix()}`, - incomingStaticValue: 'Main Library (KU/CC/DI/M)', - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - existingRecordOption: NewMatchProfile.optionsList.holdingsPermLoc - }; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C11110 autotest job profile.${getRandomPostfix()}` - }; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C11110 autotest job profile.${getRandomPostfix()}` - }; + const instanceMappingProfileForCreate = { + name: `C11110 autotest instance mapping profile.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + actionForSuppress: 'Mark for all affected records', + catalogedDate: '"2021-02-24"', + catalogedDateUI: '2021-02-24', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, + statisticalCode: 'ARL (Collection stats): books - Book, print (books)', + statisticalCodeUI: 'Book, print (books)', + natureOfContent: 'bibliography' + }; + const holdingsMappingProfileForCreate = { + name: `C11110 autotest holdings mapping profile.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + formerHoldingsId: `autotestFormerHoldingsId.${getRandomPostfix()}`, + holdingsType: HOLDINGS_TYPE_NAMES.MONOGRAPH, + statisticalCode: 'ARL (Collection stats): books - Book, print (books)', + statisticalCodeUI: 'Book, print (books)', + adminNote: `autotestAdminNote.${getRandomPostfix()}`, + permanentLocation: `"${LOCATION_NAMES.MAIN_LIBRARY}"`, + permanentLocationUI: LOCATION_NAMES.MAIN_LIBRARY_UI, + temporaryLocation: `"${LOCATION_NAMES.ONLINE}"`, + temporaryLocationUI: LOCATION_NAMES.ONLINE_UI, + shelvingTitle: `autotestShelvingTitle.${getRandomPostfix()}`, + callNumberType: CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_MEDICINE, + callNumber: Helper.getRandomBarcode(), + holdingsStatements: `autotestHoldingsStatements.${getRandomPostfix()}`, + illPolicy: 'Unknown lending policy', + noteType: '"Binding"', + holdingsNote: `autotestHoldingsNote.${getRandomPostfix()}`, + staffOnly: 'Mark for all affected records' + }; + const holdingsMappingProfileForUpdate = { + name: `C11110 autotest holdings mapping profile.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + formerHoldingsId: `autotestFormerHoldingsId.${getRandomPostfix()}`, + holdingsType: 'Physical', + statisticalCode: 'ARL (Collection stats): emusic - Music scores, electronic', + statisticalCodeUI: 'Music scores, electronic', + adminNote: `autotestAdminNote.${getRandomPostfix()}`, + shelvingTitle: `autotestShelvingTitle.${getRandomPostfix()}`, + callNumberType: CALL_NUMBER_TYPE_NAMES.OTHER_SCHEME, + callNumber: Helper.getRandomBarcode(), + holdingsStatements: `autotestHoldingsStatements.${getRandomPostfix()}`, + illPolicy: 'Will lend' + }; + const instanceActionProfileForCreate = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C11110 autotest instance action profile.${getRandomPostfix()}` + }; + const holdingsActionProfileForCreate = { + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C11110 autotest holdings action profile.${getRandomPostfix()}` + }; + const holdingsActionProfileForUpdate = { + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C11110 autotest holdings action profile.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const instanceMatchProfile = { + profileName: `C11110 autotest instance match profile.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; + const holdingsMatchProfile = { + profileName: `C11110 autotest holdings match profile.${getRandomPostfix()}`, + incomingStaticValue: 'Main Library (KU/CC/DI/M)', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + existingRecordOption: NewMatchProfile.optionsList.holdingsPermLoc + }; + const jobProfileForCreate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C11110 autotest job profile.${getRandomPostfix()}` + }; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C11110 autotest job profile.${getRandomPostfix()}` + }; - before('create test data', () => { - cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - cy.getAdminToken(); - }); - - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - MatchProfiles.deleteMatchProfile(instanceMatchProfile.profileName); - MatchProfiles.deleteMatchProfile(holdingsMatchProfile.profileName); - ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.name); - ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.name); - ActionProfiles.deleteActionProfile(holdingsActionProfileForUpdate.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.name); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.name); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForUpdate.name); - // delete created files - 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('C11110 Update a holdings via a static value submatch (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // create mapping profiles - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfileForCreate); - NewFieldMappingProfile.addStaffSuppress(instanceMappingProfileForCreate.actionForSuppress); - NewFieldMappingProfile.addSuppressFromDiscovery(instanceMappingProfileForCreate.actionForSuppress); - NewFieldMappingProfile.addPreviouslyHeld(instanceMappingProfileForCreate.actionForSuppress); - NewFieldMappingProfile.fillCatalogedDate(instanceMappingProfileForCreate.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(instanceMappingProfileForCreate.statusTerm); - NewFieldMappingProfile.addStatisticalCode(instanceMappingProfileForCreate.statisticalCode, 8); - NewFieldMappingProfile.addNatureOfContentTerms(instanceMappingProfileForCreate.natureOfContent); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfileForCreate.name); - FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfileForCreate.name); - - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfileForCreate); - NewFieldMappingProfile.addFormerHoldings(holdingsMappingProfileForCreate.formerHoldingsId); - NewFieldMappingProfile.fillHoldingsType(holdingsMappingProfileForCreate.holdingsType); - NewFieldMappingProfile.addStatisticalCode(holdingsMappingProfileForCreate.statisticalCode, 4); - NewFieldMappingProfile.addAdministrativeNote(holdingsMappingProfileForCreate.adminNote, 5); - NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfileForCreate.permanentLocation); - NewFieldMappingProfile.fillTemporaryLocation(holdingsMappingProfileForCreate.temporaryLocation); - NewFieldMappingProfile.fillCallNumberType(`"${holdingsMappingProfileForCreate.callNumberType}"`); - NewFieldMappingProfile.fillCallNumber(`"${holdingsMappingProfileForCreate.callNumber}"`); - NewFieldMappingProfile.addHoldingsStatements(holdingsMappingProfileForCreate.holdingsStatements); - NewFieldMappingProfile.fillIllPolicy(holdingsMappingProfileForCreate.illPolicy); - NewFieldMappingProfile.addHoldingsNotes(holdingsMappingProfileForCreate.noteType, holdingsMappingProfileForCreate.holdingsNote, holdingsMappingProfileForCreate.staffOnly); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileForCreate.name); - FieldMappingProfiles.checkMappingProfilePresented(holdingsMappingProfileForCreate.name); - - // create action profiles - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(instanceActionProfileForCreate, instanceMappingProfileForCreate.name); - ActionProfiles.checkActionProfilePresented(instanceActionProfileForCreate.name); - ActionProfiles.create(holdingsActionProfileForCreate, holdingsMappingProfileForCreate.name); - ActionProfiles.checkActionProfilePresented(holdingsActionProfileForCreate.name); - - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForCreate); - NewJobProfile.linkActionProfile(instanceActionProfileForCreate); - NewJobProfile.linkActionProfile(holdingsActionProfileForCreate); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.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('oneMarcBib.mrc', marcFileNameForCreate); - JobProfiles.searchJobProfileForImport(jobProfileForCreate.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); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems); - - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + before('create test data', () => { + cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + cy.getAdminToken(); + }); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.openHoldingView(); - HoldingsRecordView.checkFormerHoldingsId(holdingsMappingProfileForCreate.formerHoldingsId); - HoldingsRecordView.checkHoldingsType(holdingsMappingProfileForCreate.holdingsType); - HoldingsRecordView.checkStatisticalCode(holdingsMappingProfileForCreate.statisticalCodeUI); - HoldingsRecordView.checkAdministrativeNote(holdingsMappingProfileForCreate.adminNote); - HoldingsRecordView.checkPermanentLocation(holdingsMappingProfileForCreate.permanentLocationUI); - HoldingsRecordView.checkTemporaryLocation(holdingsMappingProfileForCreate.temporaryLocationUI); - HoldingsRecordView.checkCallNumberType(holdingsMappingProfileForCreate.callNumberType); - HoldingsRecordView.checkCallNumber(holdingsMappingProfileForCreate.callNumber); - HoldingsRecordView.checkHoldingsStatement(holdingsMappingProfileForCreate.holdingsStatements); - HoldingsRecordView.checkIllPolicy(holdingsMappingProfileForCreate.illPolicy); - HoldingsRecordView.checkHoldingsNote(holdingsMappingProfileForCreate.holdingsNote); + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + MatchProfiles.deleteMatchProfile(instanceMatchProfile.profileName); + MatchProfiles.deleteMatchProfile(holdingsMatchProfile.profileName); + ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.name); + ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.name); + ActionProfiles.deleteActionProfile(holdingsActionProfileForUpdate.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForUpdate.name); + // delete created files + 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); + }); + }); - DataImport.editMarcFile('oneMarcBib.mrc', editedMarcFileName, ['ocn962073864'], [instanceHrid]); + it('C11110 Update a holdings via a static value submatch (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create mapping profiles + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(instanceMappingProfileForCreate); + NewFieldMappingProfile.addStaffSuppress(instanceMappingProfileForCreate.actionForSuppress); + NewFieldMappingProfile.addSuppressFromDiscovery(instanceMappingProfileForCreate.actionForSuppress); + NewFieldMappingProfile.addPreviouslyHeld(instanceMappingProfileForCreate.actionForSuppress); + NewFieldMappingProfile.fillCatalogedDate(instanceMappingProfileForCreate.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(instanceMappingProfileForCreate.statusTerm); + NewFieldMappingProfile.addStatisticalCode(instanceMappingProfileForCreate.statisticalCode, 8); + NewFieldMappingProfile.addNatureOfContentTerms(instanceMappingProfileForCreate.natureOfContent); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfileForCreate.name); + FieldMappingProfiles.checkMappingProfilePresented(instanceMappingProfileForCreate.name); - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfileForUpdate); - NewFieldMappingProfile.addFormerHoldings(holdingsMappingProfileForUpdate.formerHoldingsId, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); - NewFieldMappingProfile.fillHoldingsType(holdingsMappingProfileForUpdate.holdingsType); - NewFieldMappingProfile.addStatisticalCode(holdingsMappingProfileForUpdate.statisticalCode, 4, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); - NewFieldMappingProfile.addAdministrativeNote(holdingsMappingProfileForUpdate.adminNote, 5, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); - NewFieldMappingProfile.fillCallNumberType(`"${holdingsMappingProfileForUpdate.callNumberType}"`); - NewFieldMappingProfile.fillCallNumber(`"${holdingsMappingProfileForUpdate.callNumber}"`); - NewFieldMappingProfile.addHoldingsStatements(holdingsMappingProfileForUpdate.holdingsStatements, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); - NewFieldMappingProfile.fillIllPolicy(holdingsMappingProfileForUpdate.illPolicy); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfileForCreate); + NewFieldMappingProfile.addFormerHoldings(holdingsMappingProfileForCreate.formerHoldingsId); + NewFieldMappingProfile.fillHoldingsType(holdingsMappingProfileForCreate.holdingsType); + NewFieldMappingProfile.addStatisticalCode(holdingsMappingProfileForCreate.statisticalCode, 4); + NewFieldMappingProfile.addAdministrativeNote(holdingsMappingProfileForCreate.adminNote, 5); + NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfileForCreate.permanentLocation); + NewFieldMappingProfile.fillTemporaryLocation(holdingsMappingProfileForCreate.temporaryLocation); + NewFieldMappingProfile.fillCallNumberType(`"${holdingsMappingProfileForCreate.callNumberType}"`); + NewFieldMappingProfile.fillCallNumber(`"${holdingsMappingProfileForCreate.callNumber}"`); + NewFieldMappingProfile.addHoldingsStatements(holdingsMappingProfileForCreate.holdingsStatements); + NewFieldMappingProfile.fillIllPolicy(holdingsMappingProfileForCreate.illPolicy); + NewFieldMappingProfile.addHoldingsNotes(holdingsMappingProfileForCreate.noteType, holdingsMappingProfileForCreate.holdingsNote, holdingsMappingProfileForCreate.staffOnly); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileForUpdate.name); - FieldMappingProfiles.checkMappingProfilePresented(holdingsMappingProfileForUpdate.name); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileForCreate.name); + FieldMappingProfiles.checkMappingProfilePresented(holdingsMappingProfileForCreate.name); - // create action profile + // create action profiles cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(holdingsActionProfileForUpdate, holdingsMappingProfileForUpdate.name); - ActionProfiles.checkActionProfilePresented(holdingsActionProfileForUpdate.name); - - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(instanceMatchProfile); - MatchProfiles.checkMatchProfilePresented(instanceMatchProfile.profileName); - MatchProfiles.createMatchProfileWithStaticValue(holdingsMatchProfile); - MatchProfiles.checkMatchProfilePresented(holdingsMatchProfile.profileName); + ActionProfiles.create(instanceActionProfileForCreate, instanceMappingProfileForCreate.name); + ActionProfiles.checkActionProfilePresented(instanceActionProfileForCreate.name); + ActionProfiles.create(holdingsActionProfileForCreate, holdingsMappingProfileForCreate.name); + ActionProfiles.checkActionProfilePresented(holdingsActionProfileForCreate.name); // create job profile cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForUpdate); - NewJobProfile.linkMatchProfile(instanceMatchProfile.profileName); - NewJobProfile.linkMatchProfileForMatches(holdingsMatchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(holdingsActionProfileForUpdate.name); + JobProfiles.createJobProfile(jobProfileForCreate); + NewJobProfile.linkActionProfile(instanceActionProfileForCreate); + NewJobProfile.linkActionProfile(holdingsActionProfileForCreate); NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - // upload .mrc file + // upload a marc file for creating cy.visit(TopMenu.dataImportPath); - DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, marcFileNameForUpdate); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + DataImport.uploadFile('oneMarcBib.mrc', marcFileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForUpdate); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(marcFileNameForUpdate); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); - FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems, 1); + 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); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); + FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems); + + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.openHoldingView(); + HoldingsRecordView.checkFormerHoldingsId(holdingsMappingProfileForCreate.formerHoldingsId); + HoldingsRecordView.checkHoldingsType(holdingsMappingProfileForCreate.holdingsType); + HoldingsRecordView.checkStatisticalCode(holdingsMappingProfileForCreate.statisticalCodeUI); + HoldingsRecordView.checkAdministrativeNote(holdingsMappingProfileForCreate.adminNote); + HoldingsRecordView.checkPermanentLocation(holdingsMappingProfileForCreate.permanentLocationUI); + HoldingsRecordView.checkTemporaryLocation(holdingsMappingProfileForCreate.temporaryLocationUI); + HoldingsRecordView.checkCallNumberType(holdingsMappingProfileForCreate.callNumberType); + HoldingsRecordView.checkCallNumber(holdingsMappingProfileForCreate.callNumber); + HoldingsRecordView.checkHoldingsStatement(holdingsMappingProfileForCreate.holdingsStatements); + HoldingsRecordView.checkIllPolicy(holdingsMappingProfileForCreate.illPolicy); + HoldingsRecordView.checkHoldingsNote(holdingsMappingProfileForCreate.holdingsNote); + + DataImport.editMarcFile('oneMarcBib.mrc', editedMarcFileName, ['ocn962073864'], [instanceHrid]); + + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfileForUpdate); + NewFieldMappingProfile.addFormerHoldings(holdingsMappingProfileForUpdate.formerHoldingsId, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); + NewFieldMappingProfile.fillHoldingsType(holdingsMappingProfileForUpdate.holdingsType); + NewFieldMappingProfile.addStatisticalCode(holdingsMappingProfileForUpdate.statisticalCode, 4, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); + NewFieldMappingProfile.addAdministrativeNote(holdingsMappingProfileForUpdate.adminNote, 5, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); + NewFieldMappingProfile.fillCallNumberType(`"${holdingsMappingProfileForUpdate.callNumberType}"`); + NewFieldMappingProfile.fillCallNumber(`"${holdingsMappingProfileForUpdate.callNumber}"`); + NewFieldMappingProfile.addHoldingsStatements(holdingsMappingProfileForUpdate.holdingsStatements, NewFieldMappingProfile.actions.deleteAllExistingAndAddThese); + NewFieldMappingProfile.fillIllPolicy(holdingsMappingProfileForUpdate.illPolicy); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileForUpdate.name); + FieldMappingProfiles.checkMappingProfilePresented(holdingsMappingProfileForUpdate.name); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.openHoldingView(); - HoldingsRecordView.checkFormerHoldingsId(holdingsMappingProfileForUpdate.formerHoldingsId); - HoldingsRecordView.checkHoldingsType(holdingsMappingProfileForUpdate.holdingsType); - HoldingsRecordView.checkStatisticalCode(holdingsMappingProfileForUpdate.statisticalCodeUI); - HoldingsRecordView.checkAdministrativeNote(holdingsMappingProfileForUpdate.adminNote); - HoldingsRecordView.checkCallNumberType(holdingsMappingProfileForUpdate.callNumberType); - HoldingsRecordView.checkCallNumber(holdingsMappingProfileForUpdate.callNumber); - HoldingsRecordView.checkHoldingsStatement(holdingsMappingProfileForUpdate.holdingsStatements); - HoldingsRecordView.checkIllPolicy(holdingsMappingProfileForUpdate.illPolicy); + // create action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(holdingsActionProfileForUpdate, holdingsMappingProfileForUpdate.name); + ActionProfiles.checkActionProfilePresented(holdingsActionProfileForUpdate.name); + + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(instanceMatchProfile); + MatchProfiles.checkMatchProfilePresented(instanceMatchProfile.profileName); + MatchProfiles.createMatchProfileWithStaticValue(holdingsMatchProfile); + MatchProfiles.checkMatchProfilePresented(holdingsMatchProfile.profileName); + + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchProfile(instanceMatchProfile.profileName); + NewJobProfile.linkMatchProfileForMatches(holdingsMatchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(holdingsActionProfileForUpdate.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + DataImport.checkIsLandingPageOpened(); + // 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(); + Logs.openFileDetails(marcFileNameForUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); + FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems, 1); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.openHoldingView(); + HoldingsRecordView.checkFormerHoldingsId(holdingsMappingProfileForUpdate.formerHoldingsId); + HoldingsRecordView.checkHoldingsType(holdingsMappingProfileForUpdate.holdingsType); + HoldingsRecordView.checkStatisticalCode(holdingsMappingProfileForUpdate.statisticalCodeUI); + HoldingsRecordView.checkAdministrativeNote(holdingsMappingProfileForUpdate.adminNote); + HoldingsRecordView.checkCallNumberType(holdingsMappingProfileForUpdate.callNumberType); + HoldingsRecordView.checkCallNumber(holdingsMappingProfileForUpdate.callNumber); + HoldingsRecordView.checkHoldingsStatement(holdingsMappingProfileForUpdate.holdingsStatements); + HoldingsRecordView.checkIllPolicy(holdingsMappingProfileForUpdate.illPolicy); + }); }); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js index 86e5df30dc..1c7cd5cd70 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js @@ -24,99 +24,223 @@ import InstanceRecordView from '../../../support/fragments/inventory/instanceRec import Users from '../../../support/fragments/users/users'; import FileManager from '../../../support/utils/fileManager'; -describe('ui-data-import', () => { - let user = null; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - // unique file names - const firstMarcFileNameForCreate = `C358998 firstCreateAutotestFile.${getRandomPostfix()}.mrc`; - const firstMarcFileNameForUpdate = `C358998 firstUpdateAutotestFile.${getRandomPostfix()}.mrc`; - const firstFileNameAfterUpload = `C358998 firstFileNameAfterUpload.${getRandomPostfix()}.mrc`; - const secondMarcFileNameForCreate = `C358998 secondCreateAutotestFile.${getRandomPostfix()}.mrc`; - const secondMarcFileNameForUpdate = `C358998 secondUpdateAutotestFile.${getRandomPostfix()}.mrc`; - const secondFileNameAfterUpload = `C358998 secondFileNameAfterUpload.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user = null; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + // unique file names + const firstMarcFileNameForCreate = `C358998 firstCreateAutotestFile.${getRandomPostfix()}.mrc`; + const firstMarcFileNameForUpdate = `C358998 firstUpdateAutotestFile.${getRandomPostfix()}.mrc`; + const firstFileNameAfterUpload = `C358998 firstFileNameAfterUpload.${getRandomPostfix()}.mrc`; + const secondMarcFileNameForCreate = `C358998 secondCreateAutotestFile.${getRandomPostfix()}.mrc`; + const secondMarcFileNameForUpdate = `C358998 secondUpdateAutotestFile.${getRandomPostfix()}.mrc`; + const secondFileNameAfterUpload = `C358998 secondFileNameAfterUpload.${getRandomPostfix()}.mrc`; - const mappingProfile = { - name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, - statisticalCode: 'ARL (Collection stats): books - Book, print (books)', - statisticalCodeUI: 'Book, print (books)' - }; + const mappingProfile = { + name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, + statisticalCode: 'ARL (Collection stats): books - Book, print (books)', + statisticalCodeUI: 'Book, print (books)' + }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; - const matchProfile = { - profileName: `C358998 Match 999$i to Instance UUID ${getRandomPostfix()}`, - incomingRecordFields: { - field: '999', - in1: 'f', - in2: 'f', - subfield: 'i' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - existingRecordOption: NewMatchProfile.optionsList.instanceUuid - }; + const matchProfile = { + profileName: `C358998 Match 999$i to Instance UUID ${getRandomPostfix()}`, + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 'i' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.instanceUuid + }; - const jobProfile = { - profileName: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + const jobProfile = { + profileName: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - beforeEach('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, - permissions.remoteStorageView.gui - ]) - .then(userProperties => { - user = userProperties; + beforeEach('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, + permissions.remoteStorageView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - it('C358998 Data Import Updates should add 035 field from 001/003, if HRID already exists (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C358998 Data Import Updates should add 035 field from 001/003, if HRID already exists (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - // upload the first .mrc file - DataImport.uploadFile('marcFileForC358998ForCreate_1.mrc', firstMarcFileNameForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(firstMarcFileNameForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(firstMarcFileNameForCreate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + DataImport.verifyUploadState(); + // upload the first .mrc file + DataImport.uploadFile('marcFileForC358998ForCreate_1.mrc', firstMarcFileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(firstMarcFileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(firstMarcFileNameForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1'); + + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + const instanceHrId = initialInstanceHrId; + + InventoryInstance.viewSource(); + // changing the first file + InventoryViewSource.extructDataFrom999Field() + .then(uuid => { + // change file using uuid for 999 field + DataImport.editMarcFile( + 'marcFileForC358998ForUpdate_1.mrc', + firstMarcFileNameForUpdate, + ['srsUuid', 'instanceUuid', '303845'], + [uuid[0], uuid[1], instanceHrId] + ); + }); + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatusTerm); + NewFieldMappingProfile.addStatisticalCode(mappingProfile.statisticalCode, 8); + 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 match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithExistingPart(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // 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 first instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(firstMarcFileNameForUpdate, firstFileNameAfterUpload); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(firstFileNameAfterUpload); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(firstFileNameAfterUpload); + 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 the first Instance in the Inventory and check 001, 003, 035 fields + FileDetails.openInstanceInInventory('Updated'); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatusTerm); + InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); + InventoryInstance.viewSource(); + InventoryViewSource.contains('001\t'); + InventoryViewSource.contains(instanceHrId); + InventoryViewSource.notContains('003\t'); + InventoryViewSource.contains('035\t'); + InventoryViewSource.contains('(LTSCA)303845'); + + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Users.deleteViaApi(user.userId); + // delete downloads folder and created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${firstMarcFileNameForUpdate}`); + FileManager.deleteFile(`cypress/fixtures/${secondMarcFileNameForUpdate}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrId}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1'); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - const instanceHrId = initialInstanceHrId; + it('C358998 Data Import Updates should add 035 field from 001/003, if it is not HRID (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + const itemQuantity = '8'; + const arrayOf999Fields = []; + const fieldsContent = [ + { rowNumber: 0, content:'(LTSCA)303845' }, + { rowNumber: 1, content:'(LTSCA)2300089' }, + { rowNumber: 2, content:'(NhCcYBP)yb1104243' }, + { rowNumber: 3, content:'289717' }, + { rowNumber: 4, content:'(OCoLC)1144093654' }, + { rowNumber: 5, content:'(OCoLC)1201684651' }, + { rowNumber: 6, content:'(OCoLC)1195818788' }, + { rowNumber: 7, content:'(OCoLC)ocn991553174' } + ]; - InventoryInstance.viewSource(); - // changing the first file - InventoryViewSource.extructDataFrom999Field() - .then(uuid => { + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + DataImport.uploadFile('marcFileForC358998ForCreate_2.mrc', secondMarcFileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(secondMarcFileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(secondMarcFileNameForCreate); + cy.wrap(fieldsContent).each(row => { + cy.wait(8000); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, row.rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance, row.rowNumber); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(itemQuantity); + FileDetails.checkInstanceQuantityInSummaryTable(itemQuantity); + cy.wrap(fieldsContent).each(row => { + // need to wait until page will be opened in loop + cy.wait(8000); + cy.visit(TopMenu.dataImportPath); + DataImport.waitLoading(); + Logs.openFileDetails(secondMarcFileNameForCreate); + FileDetails.openInstanceInInventory('Created', row.rowNumber); + cy.wait(8000); + InventoryInstance.viewSource(); + // changing the second file + InventoryViewSource.extructDataFrom999Field() + .then(uuid => { + arrayOf999Fields.push(uuid[0], uuid[1]); + }); + }) + .then(() => { // change file using uuid for 999 field DataImport.editMarcFile( - 'marcFileForC358998ForUpdate_1.mrc', - firstMarcFileNameForUpdate, - ['srsUuid', 'instanceUuid', '303845'], - [uuid[0], uuid[1], instanceHrId] + 'marcFileForC358998ForUpdate_2.mrc', + secondMarcFileNameForUpdate, + ['firstSrsUuid', 'firstInstanceUuid', 'secondSrsUuid', 'secondInstanceUuid', + 'thirdSrsUuid', 'thirdInstanceUuid', 'forthSrsUuid', 'forthInstanceUuid', + 'fifthSrsUuid', 'fifthInstanceUuid', 'sixthSrsUuid', 'sixthInstanceUuid', + 'seventhSrsUuid', 'seventhInstanceUuid', 'eighthSrsUuid', 'eighthInstanceUuid'], + [...arrayOf999Fields] ); }); + // create mapping profile cy.visit(SettingsMenu.mappingProfilePath); FieldMappingProfiles.openNewMappingProfileForm(); @@ -142,30 +266,45 @@ describe('ui-data-import', () => { JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); JobProfiles.checkJobProfilePresented(jobProfile.profileName); - // upload a marc file for updating already created first instance + // upload a marc file for updating already created instances cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(firstMarcFileNameForUpdate, firstFileNameAfterUpload); + DataImport.waitLoading(); + DataImport.uploadFile(secondMarcFileNameForUpdate, secondFileNameAfterUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(firstFileNameAfterUpload); + JobProfiles.waitFileIsImported(secondFileNameAfterUpload); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(firstFileNameAfterUpload); - 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 the first Instance in the Inventory and check 001, 003, 035 fields - FileDetails.openInstanceInInventory('Updated'); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatusTerm); - InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); - InventoryInstance.viewSource(); - InventoryViewSource.contains('001\t'); - InventoryViewSource.contains(instanceHrId); - InventoryViewSource.notContains('003\t'); - InventoryViewSource.contains('035\t'); - InventoryViewSource.contains('(LTSCA)303845'); + Logs.openFileDetails(secondFileNameAfterUpload); + cy.wrap(fieldsContent).each(row => { + cy.wait(8000); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc, row.rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance, row.rowNumber); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(itemQuantity, 1); + FileDetails.checkInstanceQuantityInSummaryTable(itemQuantity, 1); + + // open the instances in the Inventory and check 001, 003, 035 fields + cy.wrap(fieldsContent).each(element => { + // need to wait until page will be opened in loop + cy.wait(8000); + cy.visit(TopMenu.dataImportPath); + Logs.openFileDetails(secondFileNameAfterUpload); + FileDetails.openInstanceInInventory('Updated', element.rowNumber); + cy.wait(8000); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatusTerm); + InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + const instanceHrid = initialInstanceHrId; + + InventoryInstance.viewSource(); + InventoryViewSource.contains('001\t'); + InventoryViewSource.contains(instanceHrid); + InventoryViewSource.notContains('003\t'); + InventoryViewSource.contains('035\t'); + InventoryViewSource.contains(element.content); + }); + cy.wait(8000); + }); JobProfiles.deleteJobProfile(jobProfile.profileName); MatchProfiles.deleteMatchProfile(matchProfile.profileName); @@ -175,143 +314,6 @@ describe('ui-data-import', () => { // delete downloads folder and created files in fixtures FileManager.deleteFile(`cypress/fixtures/${firstMarcFileNameForUpdate}`); FileManager.deleteFile(`cypress/fixtures/${secondMarcFileNameForUpdate}`); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrId}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); - }); - - it('C358998 Data Import Updates should add 035 field from 001/003, if it is not HRID (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - const itemQuantity = '8'; - const arrayOf999Fields = []; - const fieldsContent = [ - { rowNumber: 0, content:'(LTSCA)303845' }, - { rowNumber: 1, content:'(LTSCA)2300089' }, - { rowNumber: 2, content:'(NhCcYBP)yb1104243' }, - { rowNumber: 3, content:'289717' }, - { rowNumber: 4, content:'(OCoLC)1144093654' }, - { rowNumber: 5, content:'(OCoLC)1201684651' }, - { rowNumber: 6, content:'(OCoLC)1195818788' }, - { rowNumber: 7, content:'(OCoLC)ocn991553174' } - ]; - - // upload .mrc file - cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile('marcFileForC358998ForCreate_2.mrc', secondMarcFileNameForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(secondMarcFileNameForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(secondMarcFileNameForCreate); - cy.wrap(fieldsContent).each(row => { - cy.wait(8000); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc, row.rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance, row.rowNumber); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(itemQuantity); - FileDetails.checkInstanceQuantityInSummaryTable(itemQuantity); - cy.wrap(fieldsContent).each(row => { - // need to wait until page will be opened in loop - cy.wait(8000); - cy.visit(TopMenu.dataImportPath); - DataImport.waitLoading(); - Logs.openFileDetails(secondMarcFileNameForCreate); - FileDetails.openInstanceInInventory('Created', row.rowNumber); - cy.wait(8000); - InventoryInstance.viewSource(); - // changing the second file - InventoryViewSource.extructDataFrom999Field() - .then(uuid => { - arrayOf999Fields.push(uuid[0], uuid[1]); - }); - }) - .then(() => { - // change file using uuid for 999 field - DataImport.editMarcFile( - 'marcFileForC358998ForUpdate_2.mrc', - secondMarcFileNameForUpdate, - ['firstSrsUuid', 'firstInstanceUuid', 'secondSrsUuid', 'secondInstanceUuid', - 'thirdSrsUuid', 'thirdInstanceUuid', 'forthSrsUuid', 'forthInstanceUuid', - 'fifthSrsUuid', 'fifthInstanceUuid', 'sixthSrsUuid', 'sixthInstanceUuid', - 'seventhSrsUuid', 'seventhInstanceUuid', 'eighthSrsUuid', 'eighthInstanceUuid'], - [...arrayOf999Fields] - ); - }); - - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatusTerm); - NewFieldMappingProfile.addStatisticalCode(mappingProfile.statisticalCode, 8); - 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 match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithExistingPart(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // 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 instances - cy.visit(TopMenu.dataImportPath); - DataImport.waitLoading(); - DataImport.uploadFile(secondMarcFileNameForUpdate, secondFileNameAfterUpload); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(secondFileNameAfterUpload); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(secondFileNameAfterUpload); - cy.wrap(fieldsContent).each(row => { - cy.wait(8000); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc, row.rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance, row.rowNumber); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(itemQuantity, 1); - FileDetails.checkInstanceQuantityInSummaryTable(itemQuantity, 1); - - // open the instances in the Inventory and check 001, 003, 035 fields - cy.wrap(fieldsContent).each(element => { - // need to wait until page will be opened in loop - cy.wait(8000); - cy.visit(TopMenu.dataImportPath); - Logs.openFileDetails(secondFileNameAfterUpload); - FileDetails.openInstanceInInventory('Updated', element.rowNumber); - cy.wait(8000); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatusTerm); - InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - const instanceHrid = initialInstanceHrId; - - InventoryInstance.viewSource(); - InventoryViewSource.contains('001\t'); - InventoryViewSource.contains(instanceHrid); - InventoryViewSource.notContains('003\t'); - InventoryViewSource.contains('035\t'); - InventoryViewSource.contains(element.content); - }); - cy.wait(8000); }); - - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - Users.deleteViaApi(user.userId); - // delete downloads folder and created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${firstMarcFileNameForUpdate}`); - FileManager.deleteFile(`cypress/fixtures/${secondMarcFileNameForUpdate}`); - }); + }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js index 6d33a8826f..56407e67b5 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js @@ -24,187 +24,189 @@ import GenerateIdentifierCode from '../../../support/utils/generateIdentifierCod import FileManager from '../../../support/utils/fileManager'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - const randomIdentifierCode = GenerateIdentifierCode.getRandomIdentifierCode(); - const quantityOfItems = '1'; - const protectedFields = { - firstField: '020', - secondField: '514' - }; - const protectedFieldIds = []; - const filePathToUpload = 'marcBibFileForC380390.mrc'; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const fileNameForCreate = `C380390 autotest file.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C380390 autotest file.${getRandomPostfix()}.mrc`; - const fileNameForMatch = `C380390 autotest file.${getRandomPostfix()}.mrc`; - const fileNameForUpdate = `C380390 autotest file.${getRandomPostfix()}.mrc`; - const matchProfile = { - profileName: `C380390 ccn MARC match ${getRandomPostfix()}`, - incomingRecordFields: { - field: '035', - subfield: 'a' - }, - qualifierType: 'Begins with', - qualifierValue: `${randomIdentifierCode}`, - existingRecordFields: { - field: '035', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C380390 Reject based on ccn.${getRandomPostfix()}` - }; - const mappingProfile = { - name: `C380390 New or update on ccn.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC - }; - const actionProfile = { - name: `C380390 New or update on ccn.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)', - }; - const jobProfileForUpdate = { - profileName: `C380390 New or update on ccn.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Importing MARC Bib files', () => { + let user; + const randomIdentifierCode = GenerateIdentifierCode.getRandomIdentifierCode(); + const quantityOfItems = '1'; + const protectedFields = { + firstField: '020', + secondField: '514' + }; + const protectedFieldIds = []; + const filePathToUpload = 'marcBibFileForC380390.mrc'; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const fileNameForCreate = `C380390 autotest file.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C380390 autotest file.${getRandomPostfix()}.mrc`; + const fileNameForMatch = `C380390 autotest file.${getRandomPostfix()}.mrc`; + const fileNameForUpdate = `C380390 autotest file.${getRandomPostfix()}.mrc`; + const matchProfile = { + profileName: `C380390 ccn MARC match ${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + subfield: 'a' + }, + qualifierType: 'Begins with', + qualifierValue: `${randomIdentifierCode}`, + existingRecordFields: { + field: '035', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C380390 Reject based on ccn.${getRandomPostfix()}` + }; + const mappingProfile = { + name: `C380390 New or update on ccn.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC + }; + const actionProfile = { + name: `C380390 New or update on ccn.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)', + }; + const jobProfileForUpdate = { + profileName: `C380390 New or update on ccn.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create user and login', () => { - cy.getAdminToken() - .then(() => { - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field: protectedFields.firstField - }) - .then((firstResp) => { protectedFieldIds.push(firstResp.id); }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field: protectedFields.secondField - }) - .then((secondResp) => { protectedFieldIds.push(secondResp.id); }); - }); + before('create user and login', () => { + cy.getAdminToken() + .then(() => { + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field: protectedFields.firstField + }) + .then((firstResp) => { protectedFieldIds.push(firstResp.id); }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field: protectedFields.secondField + }) + .then((secondResp) => { protectedFieldIds.push(secondResp.id); }); + }); - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, - { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfile.profileName); - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - Users.deleteViaApi(user.userId); - protectedFieldIds.forEach(fieldId => MarcFieldProtection.deleteMarcFieldProtectionViaApi(fieldId)); - InventorySearchAndFilter.getInstancesByIdentifierViaApi(`${randomIdentifierCode}00999523`) - .then(instances => { - if (instances) { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); - }); + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + Users.deleteViaApi(user.userId); + protectedFieldIds.forEach(fieldId => MarcFieldProtection.deleteMarcFieldProtectionViaApi(fieldId)); + InventorySearchAndFilter.getInstancesByIdentifierViaApi(`${randomIdentifierCode}00999523`) + .then(instances => { + if (instances) { + instances.forEach(({ id }) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + } + }); + }); - it('C380390 Verify updating record via 035 match, without taking incorrect records into account (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C380390 Verify updating record via 035 match, without taking incorrect records into account (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // change files for create instance using random identifier code - DataImport.editMarcFile(filePathToUpload, editedMarcFileName, - ['ccn'], [randomIdentifierCode]); + DataImport.editMarcFile(filePathToUpload, editedMarcFileName, + ['ccn'], [randomIdentifierCode]); - // upload a marc file - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, fileNameForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + // upload a marc file + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, fileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithQualifier(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithQualifier(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkProfileForNonMatches('Default - Create instance'); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkProfileForNonMatches('Default - Create instance'); + 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.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, fileNameForMatch); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForMatch); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForMatch); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.instance); + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, fileNameForMatch); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForMatch); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForMatch); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.instance); - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillMappingProfileForUpdatesMarc(mappingProfile); - NewFieldMappingProfile.markFieldForProtection(protectedFields.firstField); - NewFieldMappingProfile.markFieldForProtection(protectedFields.secondField); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillMappingProfileForUpdatesMarc(mappingProfile); + NewFieldMappingProfile.markFieldForProtection(protectedFields.firstField); + NewFieldMappingProfile.markFieldForProtection(protectedFields.secondField); + 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 action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); - NewJobProfile.linkProfileForNonMatches('Default - Create instance'); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); + NewJobProfile.linkProfileForNonMatches('Default - Create instance'); + 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.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, 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].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, 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].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); + FileDetails.checkInstanceQuantityInSummaryTable('1', 1); }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); - FileDetails.checkInstanceQuantityInSummaryTable('1', 1); - }); + }); }); 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 58042995d8..16be3903a8 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 @@ -11,72 +11,74 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import Users from '../../../support/fragments/users/users'; import FileManager from '../../../support/utils/fileManager'; -describe('ui-data-import', () => { - let user; - let instanceHrid; - 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"}'; +describe('data-import', () => { + describe('Importing MARC Holdings files', () => { + let user; + let instanceHrid; + 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', () => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, - permissions.uiQuickMarcQuickMarcHoldingsEditorAll.gui, - permissions.settingsTenantViewLocation.gui - ]) - .then(userProperties => { - user = userProperties; + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, + permissions.uiQuickMarcQuickMarcHoldingsEditorAll.gui, + permissions.settingsTenantViewLocation.gui + ]) + .then(userProperties => { + user = userProperties; - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); - cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - JobProfiles.waitFileIsImported(fileName); - Logs.openFileDetails(fileName); - FileDetails.openInstanceInInventory('Created'); - }); - }); + DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); + cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + JobProfiles.waitFileIsImported(fileName); + Logs.openFileDetails(fileName); + FileDetails.openInstanceInInventory('Created'); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + }); - it('C359209 Checking the import to Create MARC Holdings records, when some incoming records do or do not have 999 ff fields (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + it('C359209 Checking the import to Create MARC Holdings records, when some incoming records do or do not have 999 ff fields (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; - DataImport.editMarcFile('marcFileForC359209.mrc', - editedMarcFileName, - ['test1', 'test2', 'test3', 'test4'], - [instanceHrid, instanceHrid, instanceHrid, instanceHrid]); - }); + DataImport.editMarcFile('marcFileForC359209.mrc', + editedMarcFileName, + ['test1', 'test2', 'test3', 'test4'], + [instanceHrid, instanceHrid, instanceHrid, instanceHrid]); + }); - // upload a marc file for creating holdings - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName); - JobProfiles.searchJobProfileForImport('Default - Create Holdings and SRS MARC Holdings'); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(editedMarcFileName); - Logs.openFileDetails(editedMarcFileName); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.holdings - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, 1); + // upload a marc file for creating holdings + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName); + JobProfiles.searchJobProfileForImport('Default - Create Holdings and SRS MARC Holdings'); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(editedMarcFileName); + Logs.openFileDetails(editedMarcFileName); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.holdings + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, 1); + }); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc, 2); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc, 3); + // check created counter in the Summary table + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkHoldingsQuantityInSummaryTable('1'); + // check No action counter in the Summary table + FileDetails.checkSrsRecordQuantityInSummaryTable('3', 2); + // check Error counter in the Summary table + FileDetails.checkSrsRecordQuantityInSummaryTable('3', 3); + FileDetails.verifyErrorMessage(error); }); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc, 2); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.srsMarc, 3); - // check created counter in the Summary table - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkHoldingsQuantityInSummaryTable('1'); - // check No action counter in the Summary table - FileDetails.checkSrsRecordQuantityInSummaryTable('3', 2); - // check Error counter in the Summary table - FileDetails.checkSrsRecordQuantityInSummaryTable('3', 3); - FileDetails.verifyErrorMessage(error); - }); + }); }); 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 06ffa45942..2f7dfb4e05 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 @@ -12,46 +12,48 @@ import Users from '../../../support/fragments/users/users'; let user; const maxLogsQuantityOnPage = 100; -describe('ui-data-import', () => { - before(() => { - cy.createTempUser([ - permissions.dataImportDeleteLogs.gui - ]) - .then(userProperties => { - user = userProperties; - - for (let i = 0; i < 101; i++) { - const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; - - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); - } - - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading +describe('data-import', () => { + describe('Log details', () => { + before(() => { + cy.createTempUser([ + permissions.dataImportDeleteLogs.gui + ]) + .then(userProperties => { + user = userProperties; + + for (let i = 0; i < 101; i++) { + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; + + DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); + } + + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading + }); }); - }); - }); - - after(() => { - Users.deleteViaApi(user.userId); - }); + }); - it('C367923 A user can delete logs from the Import app "View all" page (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - Logs.openViewAllLogs(); - LogsViewAll.viewAllIsOpened(); - LogsViewAll.selectAllLogs(); - LogsViewAll.checkIsLogsSelected(maxLogsQuantityOnPage); - LogsViewAll.deleteLog(); - DeleteDataImportLogsModal.cancelDelete(maxLogsQuantityOnPage); - LogsViewAll.checkmarkAllLogsIsRemoved(); - - LogsViewAll.selectAllLogs(); - LogsViewAll.checkIsLogsSelected(maxLogsQuantityOnPage); - LogsViewAll.deleteLog(); - DeleteDataImportLogsModal.confirmDelete(maxLogsQuantityOnPage); - LogsViewAll.verifyMessageOfDeleted(maxLogsQuantityOnPage); - LogsViewAll.modalIsAbsent(); + after(() => { + Users.deleteViaApi(user.userId); }); + + it('C367923 A user can delete logs from the Import app "View all" page (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + Logs.openViewAllLogs(); + LogsViewAll.viewAllIsOpened(); + LogsViewAll.selectAllLogs(); + LogsViewAll.checkIsLogsSelected(maxLogsQuantityOnPage); + LogsViewAll.deleteLog(); + DeleteDataImportLogsModal.cancelDelete(maxLogsQuantityOnPage); + LogsViewAll.checkmarkAllLogsIsRemoved(); + + LogsViewAll.selectAllLogs(); + LogsViewAll.checkIsLogsSelected(maxLogsQuantityOnPage); + LogsViewAll.deleteLog(); + DeleteDataImportLogsModal.confirmDelete(maxLogsQuantityOnPage); + LogsViewAll.verifyMessageOfDeleted(maxLogsQuantityOnPage); + LogsViewAll.modalIsAbsent(); + }); + }); }); diff --git a/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js b/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js index bd1675e09b..07489edf44 100644 --- a/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js +++ b/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js @@ -20,92 +20,94 @@ 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 invoiceNumber = '1024200'; - const quantityOfItems = '1'; - const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.ebsco; - const marcFileName = `C357018 autotest file ${getRandomPostfix()}`; - const mappingProfile = { - name:`C357018 Test invoice log table Create EBSCO invoice ${getRandomPostfix()}`, - incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, - existingRecordType:FOLIO_RECORD_TYPE.INVOICE, - description:'', - batchGroup: BATCH_GROUP.AMHERST, - organizationName: VENDOR_NAMES.EBSCO, - paymentMethod: PAYMENT_METHOD.CREDIT_CARD - }; - const actionProfile = { - name: `C357018 Test invoice log table ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INVOICE, - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C357018 autoTestJobProf.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT - }; +describe('data-import', () => { + describe('Log details', () => { + let user; + const invoiceNumber = '1024200'; + const quantityOfItems = '1'; + const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.ebsco; + const marcFileName = `C357018 autotest file ${getRandomPostfix()}`; + const mappingProfile = { + name:`C357018 Test invoice log table Create EBSCO invoice ${getRandomPostfix()}`, + incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, + existingRecordType:FOLIO_RECORD_TYPE.INVOICE, + description:'', + batchGroup: BATCH_GROUP.AMHERST, + organizationName: VENDOR_NAMES.EBSCO, + paymentMethod: PAYMENT_METHOD.CREDIT_CARD + }; + const actionProfile = { + name: `C357018 Test invoice log table ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INVOICE, + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C357018 autoTestJobProf.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT + }; - before(() => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiOrganizationsViewEditCreate.gui - ]) - .then(userProperties => { - user = userProperties; + before(() => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiOrganizationsViewEditCreate.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + cy.login(userProperties.username, userProperties.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); - cy.getInvoiceIdApi({ query: `vendorInvoiceNo="${invoiceNumber}"` }) - .then(id => cy.deleteInvoiceFromStorageViaApi(id)); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + cy.getInvoiceIdApi({ query: `vendorInvoiceNo="${invoiceNumber}"` }) + .then(id => cy.deleteInvoiceFromStorageViaApi(id)); + }); - it('C357018 Check the filter in summary table with "create + discarded + error" actions for the Invoice column (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C357018 Check the filter in summary table with "create + discarded + error" actions for the Invoice column (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create Field mapping profile - FieldMappingProfiles.waitLoading(); - FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + FieldMappingProfiles.waitLoading(); + FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); + 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 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + 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('ediFileForC357018.edi', marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); - Logs.openFileDetails(marcFileName); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('ediFileForC357018.edi', marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); + Logs.openFileDetails(marcFileName); - // check created counter in the Summary table - FileDetails.checkInvoiceInSummaryTable(quantityOfItems, 0); - // check No action counter in the Summary table - FileDetails.checkInvoiceInSummaryTable(quantityOfItems, 2); - // check Error counter in the Summary table - FileDetails.checkInvoiceInSummaryTable(quantityOfItems, 3); - FileDetails.filterRecordsWithError(quantityOfItems); - FileDetails.verifyQuantityOfRecordsWithError(3); - FileDetails.verifyLogSummaryTableIsHidden(); - FileDetails.verifyRecordsSortingOrder(); - }); + // check created counter in the Summary table + FileDetails.checkInvoiceInSummaryTable(quantityOfItems, 0); + // check No action counter in the Summary table + FileDetails.checkInvoiceInSummaryTable(quantityOfItems, 2); + // check Error counter in the Summary table + FileDetails.checkInvoiceInSummaryTable(quantityOfItems, 3); + FileDetails.filterRecordsWithError(quantityOfItems); + FileDetails.verifyQuantityOfRecordsWithError(3); + FileDetails.verifyLogSummaryTableIsHidden(); + FileDetails.verifyRecordsSortingOrder(); + }); + }); }); 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 be7609030e..7e7842269f 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 @@ -32,558 +32,560 @@ import InstanceStatusTypes from '../../../support/fragments/settings/inventory/i import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; -describe('ui-data-import', () => { - const testData = { - protectedField: '856', - protectedFieldId: null, - fileName: 'marcFileForSubmatch.mrc', - newUri: 'http://jbjjhhjj:3000/Test2' - }; - 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([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui - ]) - .then(userProperties => { - user = userProperties; - - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field: testData.protectedField - }) - .then((resp) => { - testData.protectedFieldId = resp.id; +describe('data-import', () => { + describe('Log details', () => { + const testData = { + protectedField: '856', + protectedFieldId: null, + fileName: 'marcFileForSubmatch.mrc', + newUri: 'http://jbjjhhjj:3000/Test2' + }; + 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([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui + ]) + .then(userProperties => { + user = userProperties; + + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field: testData.protectedField + }) + .then((resp) => { + testData.protectedFieldId = resp.id; + }); + NewInstanceStatusType.createViaApi() + .then((initialInstanceStatusType) => { + testData.instanceStatusTypeId = initialInstanceStatusType.body.id; + }); + 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); }); - NewInstanceStatusType.createViaApi() - .then((initialInstanceStatusType) => { - testData.instanceStatusTypeId = initialInstanceStatusType.body.id; + + // 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}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); }); - cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); - // create Field mapping profiles for creating + it('C397983 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 2 matches (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + const fileNameForCreate = `C397983 autotestFileForCreate.${getRandomPostfix()}.mrc`; + const fileNameForUpdate = `C397983 autotestFileForUpdate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForCreate = `C397983 editedAutotestFileForCreate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForUpdate = `C397983 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; + const uniq001Field = Helper.getRandomBarcode(); + const newUri = 'http://jbjjhhjj:3000/Test2'; + // profiles for update + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C397983 Override 856 protection ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C397983 Update srs override 856 protection ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C397983 Instance status submatch - Electronic Resource ${getRandomPostfix()}`, + incomingStaticValue: 'Electronic Resource', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.instanceStatusTerm } + }, + { + matchProfile: { profileName: `C397983 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 } + } + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C397983 035$a to 035$a match with instance status 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.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.instanceStatusTerm); + NewFieldMappingProfile.fillMappingProfileForUpdatesMarc(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.markFieldForProtection(testData.protectedField); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[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 + // create action profiles for updating + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create( + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile, + collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name ); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); + ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.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 match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[0].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[0].matchProfile.profileName); + MatchProfiles.createMatchProfile(collectionOfMatchProfiles[1].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[1].matchProfile.profileName); - // create job profile for creating + // create job profile for updating cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForCreate); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[0].actionProfile.name); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[1].actionProfile.name); + JobProfiles.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); + NewJobProfile.linkMatchAndActionProfilesForSubMatches( + collectionOfMatchProfiles[0].matchProfile.profileName, + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name + ); NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); + 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.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc); + FileDetails.openInstanceInInventory('Updated'); + InventoryInstance.getAssignedHRID() + .then(hrId => { + instanceHrids.push(hrId); + }); + InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); + InstanceRecordView.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); + + // delete profiles + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); + MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); + 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}`); }); - }); - 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}"` }) - .then((instance) => { - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); + it('C397984 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 1 match (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + const fileNameForCreate = `C397984 autotestFileForCreate.${getRandomPostfix()}.mrc`; + const fileNameForUpdate = `C397984 autotestFileForUpdate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForCreate = `C397984 editedAutotestFileForCreate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForUpdate = `C397984 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; + const uniq001Field = Helper.getRandomBarcode(); + const newUri = 'http://jbjjhhjj:3000/Test'; + // profiles for update + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C397984 Override 856 protection ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C397984 Update srs override 856 protection ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const matchProfile = { + profileName: `C397984 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 + }; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C397984 035$a to 035$a match with instance status 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); }); - }); - }); - it('C397983 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 2 matches (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - const fileNameForCreate = `C397983 autotestFileForCreate.${getRandomPostfix()}.mrc`; - const fileNameForUpdate = `C397983 autotestFileForUpdate.${getRandomPostfix()}.mrc`; - const editedMarcFileNameForCreate = `C397983 editedAutotestFileForCreate.${getRandomPostfix()}.mrc`; - const editedMarcFileNameForUpdate = `C397983 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; - const uniq001Field = Helper.getRandomBarcode(); - const newUri = 'http://jbjjhhjj:3000/Test2'; - // profiles for update - const collectionOfMappingAndActionProfilesForUpdate = [ - { - mappingProfile: { name: `C397983 Override 856 protection ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C397983 Update srs override 856 protection ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - const collectionOfMatchProfiles = [ - { - matchProfile: { profileName: `C397983 Instance status submatch - Electronic Resource ${getRandomPostfix()}`, - incomingStaticValue: 'Electronic Resource', - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - existingRecordOption: NewMatchProfile.optionsList.instanceStatusTerm } - }, - { - matchProfile: { profileName: `C397983 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 } - } - ]; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C397983 035$a to 035$a match with instance status 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]); - // 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); - - // create action profiles for updating - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create( - collectionOfMappingAndActionProfilesForUpdate[0].actionProfile, - collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name - ); - ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); - - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[0].matchProfile); - MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[0].matchProfile.profileName); - MatchProfiles.createMatchProfile(collectionOfMatchProfiles[1].matchProfile); - MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[1].matchProfile.profileName); - - // create job profile for updating - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.openNewJobProfileForm(); - NewJobProfile.fillJobProfile(jobProfileForUpdate); - NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); - NewJobProfile.linkMatchAndActionProfilesForSubMatches( - collectionOfMatchProfiles[0].matchProfile.profileName, - collectionOfMappingAndActionProfilesForUpdate[0].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.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc); - FileDetails.openInstanceInInventory('Updated'); - InventoryInstance.getAssignedHRID() - .then(hrId => { - instanceHrids.push(hrId); - }); - InstanceRecordView.verifyElectronicAccess(newUri); - InstanceRecordView.verifyElectronicAccessAbsent(1); - InstanceRecordView.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); - - // delete profiles - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); - MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); - 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}`); - }); + // 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); - it('C397984 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 1 match (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - const fileNameForCreate = `C397984 autotestFileForCreate.${getRandomPostfix()}.mrc`; - const fileNameForUpdate = `C397984 autotestFileForUpdate.${getRandomPostfix()}.mrc`; - const editedMarcFileNameForCreate = `C397984 editedAutotestFileForCreate.${getRandomPostfix()}.mrc`; - const editedMarcFileNameForUpdate = `C397984 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; - const uniq001Field = Helper.getRandomBarcode(); - const newUri = 'http://jbjjhhjj:3000/Test'; - // profiles for update - const collectionOfMappingAndActionProfilesForUpdate = [ - { - mappingProfile: { name: `C397984 Override 856 protection ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C397984 Update srs override 856 protection ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - const matchProfile = { - profileName: `C397984 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 - }; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C397984 035$a to 035$a match with instance status 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); - }); + // create action profiles for updating + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create( + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile, + collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name + ); + ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); - // 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); - - // create action profiles for updating - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create( - collectionOfMappingAndActionProfilesForUpdate[0].actionProfile, - collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name - ); - ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); - - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create job profile for updating - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles( - jobProfileForUpdate, - collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, - matchProfile.profileName - ); - 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].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.openInstanceInInventory('Updated'); - InventoryInstance.getAssignedHRID() - .then(hrId => { - instanceHrids.push(hrId); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create job profile for updating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles( + jobProfileForUpdate, + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, + matchProfile.profileName + ); + 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].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); }); - InstanceRecordView.verifyElectronicAccess(newUri); - InstanceRecordView.verifyElectronicAccessAbsent(1); - InstanceRecordView.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); - - // delete profiles - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + FileDetails.openInstanceInInventory('Updated'); + InventoryInstance.getAssignedHRID() + .then(hrId => { + instanceHrids.push(hrId); + }); + InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); + InstanceRecordView.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); + + // delete profiles + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + 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}`); }); - // 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); - }); + it('C397383 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 3 matches (folijet)', + { tags: [TestTypes.smoke, 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); - }); + // change file for changing content of 856 field + DataImport.editMarcFile(testData.fileName, editedMarcFileNameForUpdate, ['9000098', 'http://jbjjhhjj:3000/'], + [uniq001Field, newUri]); - // 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); + // 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); }); - 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); + + // 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); + }); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForCreate}`); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForUpdate}`); }); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForCreate}`); - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForUpdate}`); - }); + }); }); 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 34c37c48f5..f96a02eac4 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 @@ -21,145 +21,147 @@ import { LOCATION_NAMES, MATERIAL_TYPE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user; - 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.${getRandomPostfix()}.mrc`; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356801 instance mapping profile ${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356801 instance action profile ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356801 holdings mapping profile ${getRandomPostfix()}`, - pernanentLocation: `"${LOCATION_NAMES.ONLINE}"`, - pernanentLocationUI: LOCATION_NAMES.ONLINE_UI }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356801 holdings action profile ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - 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: `C356801 item action profile ${getRandomPostfix()}` } - } - ]; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C356801 job profile ${getRandomPostfix()}` - }; +describe('data-import', () => { + describe('Log details', () => { + let user; + 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.${getRandomPostfix()}.mrc`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C356801 instance mapping profile ${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C356801 instance action profile ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356801 holdings mapping profile ${getRandomPostfix()}`, + pernanentLocation: `"${LOCATION_NAMES.ONLINE}"`, + pernanentLocationUI: LOCATION_NAMES.ONLINE_UI }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356801 holdings action profile ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + 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: `C356801 item action profile ${getRandomPostfix()}` } + } + ]; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C356801 job profile ${getRandomPostfix()}` + }; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiInventoryViewInstances.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); - - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiInventoryViewInstances.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); }); - Users.deleteViaApi(user.userId); - 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); + + after('delete test data', () => { + 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.deleteItemViaApi(instance.items[0].id); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C356801 Check import summary table with "Created" actions for instance, holding and item (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C356801 Check import summary table with "Created" actions for instance, holding and item (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profiles - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.pernanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.pernanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].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 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.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); + NewJobProfile.saveAndClose(); + 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(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFile); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFile); + // 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(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFile); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFile); - // check created instance - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; - }); - InventoryInstance.checkIsInstancePresented( - instanceTitle, - collectionOfMappingAndActionProfiles[1].mappingProfile.pernanentLocationUI, - collectionOfMappingAndActionProfiles[2].mappingProfile.status - ); - cy.go('back'); + // check created instance + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); + InventoryInstance.checkIsInstancePresented( + instanceTitle, + collectionOfMappingAndActionProfiles[1].mappingProfile.pernanentLocationUI, + collectionOfMappingAndActionProfiles[2].mappingProfile.status + ); + cy.go('back'); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + // check Created counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); + // check Updated counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(1, '0'); + // check No action counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(2, '0'); + // check Error counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(3, '0'); }); - // check Created counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(0, quantityOfItems); - // check Updated counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(1, '0'); - // check No action counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(2, '0'); - // check Error counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(3, '0'); - }); + }); }); 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 a423f65246..7879b2f754 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 @@ -36,391 +36,393 @@ import ItemRecordView from '../../../support/fragments/inventory/item/itemRecord import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - let instanceHrids; - const quantityOfUpdatedItems = '2'; - const quantityOfCreatedItems = '1'; - const filePathForCreateInstance = 'marcFileForC356791.mrc'; - const filePathWithUpdatedContent = 'marcFileForC356791_for_update.mrc'; - const fileNameForCreateInstance = `C356791 autotestFileForCreate.${getRandomPostfix()}.mrc`; - const nameForCSVFile = `C356791autotestCsvFile.${getRandomPostfix()}.csv`; - const exportedFileName = `C356791 autotestExportedFile.${getRandomPostfix()}.mrc`; - const fileNameWithUpdatedContent = `C356791 autotestFileForUpdate.${getRandomPostfix()}.mrc`; - const fileNameForUpdateInstance = `C356791 autotestFileForUpdate.${getRandomPostfix()}.mrc`; - const jobProfileNameForExport = `C356791 autotest job profile.${getRandomPostfix()}`; - const addedInstanceTitle = 'Minakata Kumagusu kinrui saishoku zufu hyakusen.'; +describe('data-import', () => { + describe('Log details', () => { + let user; + let instanceHrids; + const quantityOfUpdatedItems = '2'; + const quantityOfCreatedItems = '1'; + const filePathForCreateInstance = 'marcFileForC356791.mrc'; + const filePathWithUpdatedContent = 'marcFileForC356791_for_update.mrc'; + const fileNameForCreateInstance = `C356791 autotestFileForCreate.${getRandomPostfix()}.mrc`; + const nameForCSVFile = `C356791autotestCsvFile.${getRandomPostfix()}.csv`; + const exportedFileName = `C356791 autotestExportedFile.${getRandomPostfix()}.mrc`; + const fileNameWithUpdatedContent = `C356791 autotestFileForUpdate.${getRandomPostfix()}.mrc`; + const fileNameForUpdateInstance = `C356791 autotestFileForUpdate.${getRandomPostfix()}.mrc`; + const jobProfileNameForExport = `C356791 autotest job profile.${getRandomPostfix()}`; + const addedInstanceTitle = 'Minakata Kumagusu kinrui saishoku zufu hyakusen.'; - const collectionOfProfilesForCreate = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C356791 autotest marcBib mapping profile.${getRandomPostfix()}`, - modifications: { action: 'Add', - field: '650', - ind1: '', - ind2: '4', - subfield: 'a', - data: `Test update.${getRandomPostfix()}` } }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C356791 autotest marcBib action profile.${getRandomPostfix()}`, - action: 'Modify (MARC Bibliographic record type only)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356791 autotest instance mapping profile.${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356791 autotest instance action profile.${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356791 autotest holdings mapping profile.${getRandomPostfix()}`, - permanentLocation: `"${LOCATION_NAMES.ONLINE}"`, - pernanentLocationUI: LOCATION_NAMES.ONLINE_UI }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356791 autotest holdings action profile.${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356791 autotest item mapping profile.${getRandomPostfix()}`, - materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, - status: ITEM_STATUS_NAMES.AVAILABLE, - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356791 autotest item action profile.${getRandomPostfix()}` } - } - ]; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C356791 autotest job profile.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - const exportMappingProfile = { - name: `C356791 autotest mapping profile.${getRandomPostfix()}`, - holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, - holdingsMarcField: '901', - subfieldForHoldings:'$h', - itemTransformation: EXPORT_TRANSFORMATION_NAMES.ITEM_HRID, - itemMarcField:'902', - subfieldForItem:'$i' - }; - const collectionOfProfilesForUpdate = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356791 autotest instance mapping profile.${getRandomPostfix()}`, - catalogingDate: '###TODAY###', - statusTerm: 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: `C356791 autotest instance action profile.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356791 autotest holdings mapping profile.${getRandomPostfix()}`, - holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, - permanetLocation: `"${LOCATION_NAMES.ONLINE}"`, - permanetLocationUI: LOCATION_NAMES.ONLINE_UI, - callNumberType: CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS, - callNumber: '050$a " " 050$b' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356791 autotest action mapping profile.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356791 autotest item mapping profile.${getRandomPostfix()}`, - materialType: `"${MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE}"`, - noteType: '"Electronic bookplate"', - note: '"Smith Family Foundation"', - noteUI: 'Smith Family Foundation', - staffOnly: 'Mark for all affected records', - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, - status: ITEM_STATUS_NAMES.AVAILABLE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356791 autotest item action profile.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - const collectionOfMatchProfiles = [ - { - matchProfile: { profileName: `C356791 MARC-to-MARC 001 to 001.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - existingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } - }, - { - matchProfile: { profileName: `C356791 MARC-to-Holdings 901h to Holdings HRID.${getRandomPostfix()}`, - incomingRecordFields: { - field: '901', - subfield: 'h' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.holdingsHrid } - }, - { - matchProfile: { - profileName: `C356791 MARC-to-Item 902i to Item HRID.${getRandomPostfix()}`, - incomingRecordFields: { - field: '902', - subfield: 'i' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemHrid + const collectionOfProfilesForCreate = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C356791 autotest marcBib mapping profile.${getRandomPostfix()}`, + modifications: { action: 'Add', + field: '650', + ind1: '', + ind2: '4', + subfield: 'a', + data: `Test update.${getRandomPostfix()}` } }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C356791 autotest marcBib action profile.${getRandomPostfix()}`, + action: 'Modify (MARC Bibliographic record type only)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C356791 autotest instance mapping profile.${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C356791 autotest instance action profile.${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356791 autotest holdings mapping profile.${getRandomPostfix()}`, + permanentLocation: `"${LOCATION_NAMES.ONLINE}"`, + pernanentLocationUI: LOCATION_NAMES.ONLINE_UI }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356791 autotest holdings action profile.${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C356791 autotest item mapping profile.${getRandomPostfix()}`, + materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, + status: ITEM_STATUS_NAMES.AVAILABLE, + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C356791 autotest item action profile.${getRandomPostfix()}` } } - } - ]; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C356791 autotest job profile.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + ]; + const jobProfileForCreate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C356791 autotest job profile.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const exportMappingProfile = { + name: `C356791 autotest mapping profile.${getRandomPostfix()}`, + holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, + holdingsMarcField: '901', + subfieldForHoldings:'$h', + itemTransformation: EXPORT_TRANSFORMATION_NAMES.ITEM_HRID, + itemMarcField:'902', + subfieldForItem:'$i' + }; + const collectionOfProfilesForUpdate = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C356791 autotest instance mapping profile.${getRandomPostfix()}`, + catalogingDate: '###TODAY###', + statusTerm: 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: `C356791 autotest instance action profile.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356791 autotest holdings mapping profile.${getRandomPostfix()}`, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, + permanetLocation: `"${LOCATION_NAMES.ONLINE}"`, + permanetLocationUI: LOCATION_NAMES.ONLINE_UI, + callNumberType: CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS, + callNumber: '050$a " " 050$b' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356791 autotest action mapping profile.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C356791 autotest item mapping profile.${getRandomPostfix()}`, + materialType: `"${MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE}"`, + noteType: '"Electronic bookplate"', + note: '"Smith Family Foundation"', + noteUI: 'Smith Family Foundation', + staffOnly: 'Mark for all affected records', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C356791 autotest item action profile.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C356791 MARC-to-MARC 001 to 001.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + existingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } + }, + { + matchProfile: { profileName: `C356791 MARC-to-Holdings 901h to Holdings HRID.${getRandomPostfix()}`, + incomingRecordFields: { + field: '901', + subfield: 'h' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid } + }, + { + matchProfile: { + profileName: `C356791 MARC-to-Item 902i to Item HRID.${getRandomPostfix()}`, + incomingRecordFields: { + field: '902', + subfield: 'i' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemHrid + } + } + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C356791 autotest job profile.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create and login user', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.dataExportEnableApp.gui, - permissions.dataExportEnableSettings.gui - ]) - .then(userProperties => { - user = userProperties; + before('create and login user', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.dataExportEnableApp.gui, + permissions.dataExportEnableSettings.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); - FileManager.deleteFile(`cypress/fixtures/${fileNameWithUpdatedContent}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); - }); - collectionOfProfilesForCreate.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); - collectionOfProfilesForUpdate.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); - Users.deleteViaApi(user.userId); - cy.wrap(instanceHrids).each(hrid => { - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) - .then((instance) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); - }); + FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); + FileManager.deleteFile(`cypress/fixtures/${fileNameWithUpdatedContent}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); + }); + collectionOfProfilesForCreate.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + collectionOfProfilesForUpdate.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + Users.deleteViaApi(user.userId); + cy.wrap(instanceHrids).each(hrid => { + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) + .then((instance) => { + cy.deleteItemViaApi(instance.items[0].id); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); }); - }); - it('C356791 Check import summary table with "create + update" actions (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C356791 Check import summary table with "create + update" actions (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profiles for creating - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[0].mappingProfile); - NewFieldMappingProfile.addFieldMappingsForMarc(); - NewFieldMappingProfile.fillModificationSectionWithAdd(collectionOfProfilesForCreate[0].mappingProfile.modifications); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[0].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForCreate[0].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[0].mappingProfile); + NewFieldMappingProfile.addFieldMappingsForMarc(); + NewFieldMappingProfile.fillModificationSectionWithAdd(collectionOfProfilesForCreate[0].mappingProfile.modifications); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForCreate[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[1].mappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForCreate[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[1].mappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForCreate[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[2].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfProfilesForCreate[2].mappingProfile.permanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[2].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfProfilesForCreate[2].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[2].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[3].mappingProfile); - NewFieldMappingProfile.fillMaterialType(collectionOfProfilesForCreate[3].mappingProfile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfProfilesForCreate[3].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfProfilesForCreate[3].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[3].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForCreate[3].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfProfilesForCreate[3].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfProfilesForCreate[3].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfProfilesForCreate[3].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForCreate[3].mappingProfile.name); - // create action profiles for creating - collectionOfProfilesForCreate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profiles for creating + collectionOfProfilesForCreate.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); - collectionOfProfilesForCreate.forEach(profile => { - NewJobProfile.linkActionProfile(profile.actionProfile); - }); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); + // create job profile for creating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForCreate); + collectionOfProfilesForCreate.forEach(profile => { + NewJobProfile.linkActionProfile(profile.actionProfile); + }); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - // upload the marc file for creating - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); - JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForCreateInstance); - Logs.openFileDetails(fileNameForCreateInstance); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); + // upload the marc file for creating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); + JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreateInstance); + Logs.openFileDetails(fileNameForCreateInstance); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); - // create Field mapping profile for export - cy.visit(SettingsMenu.exportMappingProfilePath); - ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); + // create Field mapping profile for export + cy.visit(SettingsMenu.exportMappingProfilePath); + ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); - // create job profile for export - cy.visit(SettingsMenu.exportJobProfilePath); - ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); + // create job profile for export + cy.visit(SettingsMenu.exportJobProfilePath); + ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchByParameter('Subject', collectionOfProfilesForCreate[0].mappingProfile.modifications.data); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchByParameter('Subject', collectionOfProfilesForCreate[0].mappingProfile.modifications.data); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); - ExportFile.downloadExportedMarcFile(exportedFileName); + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); + ExportFile.downloadExportedMarcFile(exportedFileName); - // edit marc file to add one record - DataImport.editMarcFileAddNewRecords(exportedFileName, fileNameWithUpdatedContent, filePathWithUpdatedContent); + // edit marc file to add one record + DataImport.editMarcFileAddNewRecords(exportedFileName, fileNameWithUpdatedContent, filePathWithUpdatedContent); - // create mapping profiles for updating - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForUpdate[0].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfProfilesForUpdate[0].mappingProfile.instanceStatusTerm); - NewFieldMappingProfile.addStatisticalCode(collectionOfProfilesForUpdate[0].mappingProfile.statisticalCode, 8); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForUpdate[0].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForUpdate[0].mappingProfile.name); + // create mapping profiles for updating + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfProfilesForUpdate[0].mappingProfile.instanceStatusTerm); + NewFieldMappingProfile.addStatisticalCode(collectionOfProfilesForUpdate[0].mappingProfile.statisticalCode, 8); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForUpdate[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForUpdate[0].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForUpdate[1].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfProfilesForUpdate[1].mappingProfile.permanetLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForUpdate[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForUpdate[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForUpdate[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfProfilesForUpdate[1].mappingProfile.permanetLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForUpdate[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfilesForUpdate[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForUpdate[2].mappingProfile); - NewFieldMappingProfile.fillMaterialType(collectionOfProfilesForUpdate[2].mappingProfile.materialType); - NewFieldMappingProfile.addItemNotes( - collectionOfProfilesForUpdate[2].mappingProfile.noteType, - collectionOfProfilesForUpdate[2].mappingProfile.note, - collectionOfProfilesForUpdate[2].mappingProfile.staffOnly - ); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfProfilesForUpdate[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfProfilesForUpdate[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForUpdate[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfProfilesForUpdate[2].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfProfilesForUpdate[2].mappingProfile.materialType); + NewFieldMappingProfile.addItemNotes( + collectionOfProfilesForUpdate[2].mappingProfile.noteType, + collectionOfProfilesForUpdate[2].mappingProfile.note, + collectionOfProfilesForUpdate[2].mappingProfile.staffOnly + ); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfProfilesForUpdate[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfProfilesForUpdate[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfProfilesForUpdate[2].mappingProfile.name); - // create action profiles for updating - collectionOfProfilesForUpdate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profiles for updating + collectionOfProfilesForUpdate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create match profiles for updating - cy.visit(SettingsMenu.matchProfilePath); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.createMatchProfile(profile.matchProfile); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + // create match profiles for updating + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.createMatchProfile(profile.matchProfile); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - // create job profile for updating - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfProfilesForUpdate[0].actionProfile.name); - NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[1].actionProfile.name); - NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfProfilesForUpdate[1].actionProfile.name, 2); - NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[2].actionProfile.name, 3); - NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfProfilesForUpdate[2].actionProfile.name, 4); - NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[3].actionProfile.name, 5); - NewJobProfile.saveAndClose(); + // create job profile for updating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfProfilesForUpdate[0].actionProfile.name); + NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[1].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfProfilesForUpdate[1].actionProfile.name, 2); + NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[2].actionProfile.name, 3); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfProfilesForUpdate[2].actionProfile.name, 4); + NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[3].actionProfile.name, 5); + NewJobProfile.saveAndClose(); - // upload the edited marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.uploadFile(fileNameWithUpdatedContent, fileNameForUpdateInstance); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForUpdateInstance); - Logs.openFileDetails(fileNameForUpdateInstance); - // check Created counter in the Summary table - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfCreatedItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfCreatedItems); - FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfCreatedItems); - FileDetails.checkItemQuantityInSummaryTable(quantityOfCreatedItems); - // check Updated counter in the Summary table - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfUpdatedItems, 1); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfUpdatedItems, 1); - FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfUpdatedItems, 1); - FileDetails.checkItemQuantityInSummaryTable(quantityOfUpdatedItems, 1); + // upload the edited marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.uploadFile(fileNameWithUpdatedContent, fileNameForUpdateInstance); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdateInstance); + Logs.openFileDetails(fileNameForUpdateInstance); + // check Created counter in the Summary table + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfCreatedItems); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfCreatedItems); + FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfCreatedItems); + FileDetails.checkItemQuantityInSummaryTable(quantityOfCreatedItems); + // check Updated counter in the Summary table + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfUpdatedItems, 1); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfUpdatedItems, 1); + FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfUpdatedItems, 1); + FileDetails.checkItemQuantityInSummaryTable(quantityOfUpdatedItems, 1); - // check items is updated in Inventory - [0, 1].forEach(rowNumber => { - FileDetails.checkItemsStatusesInResultList( - rowNumber, - [FileDetails.status.updated, FileDetails.status.updated, - FileDetails.status.updated, FileDetails.status.updated] + // check items is updated in Inventory + [0, 1].forEach(rowNumber => { + FileDetails.checkItemsStatusesInResultList( + rowNumber, + [FileDetails.status.updated, FileDetails.status.updated, + FileDetails.status.updated, FileDetails.status.updated] + ); + FileDetails.openInstanceInInventory('Updated', rowNumber); + InstanceRecordView.verifyInstanceStatusTerm(collectionOfProfilesForUpdate[0].mappingProfile.statusTerm); + InstanceRecordView.verifyStatisticalCode(collectionOfProfilesForUpdate[0].mappingProfile.statisticalCodeUI); + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => instanceHrids.push(initialInstanceHrId)); + cy.go('back'); + FileDetails.openHoldingsInInventory('Updated', rowNumber); + HoldingsRecordView.checkPermanentLocation(collectionOfProfilesForUpdate[1].mappingProfile.permanetLocationUI); + HoldingsRecordView.checkCallNumberType(collectionOfProfilesForUpdate[1].mappingProfile.callNumberType); + cy.go('back'); + FileDetails.openItemInInventory('Updated', rowNumber); + ItemRecordView.verifyMaterialType(collectionOfProfilesForUpdate[2].mappingProfile.materialType); + ItemRecordView.verifyPermanentLoanType(collectionOfProfilesForUpdate[2].mappingProfile.permanentLoanType); + ItemRecordView.verifyItemStatus(collectionOfProfilesForUpdate[2].mappingProfile.status); + cy.go('back'); + }); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, 2); + }); + FileDetails.openInstanceInInventory('Created', 2); + InventoryInstance.checkIsInstancePresented( + addedInstanceTitle, + collectionOfProfilesForCreate[2].mappingProfile.pernanentLocationUI, + collectionOfProfilesForCreate[3].mappingProfile.status ); - FileDetails.openInstanceInInventory('Updated', rowNumber); - InstanceRecordView.verifyInstanceStatusTerm(collectionOfProfilesForUpdate[0].mappingProfile.statusTerm); - InstanceRecordView.verifyStatisticalCode(collectionOfProfilesForUpdate[0].mappingProfile.statisticalCodeUI); - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => instanceHrids.push(initialInstanceHrId)); - cy.go('back'); - FileDetails.openHoldingsInInventory('Updated', rowNumber); - HoldingsRecordView.checkPermanentLocation(collectionOfProfilesForUpdate[1].mappingProfile.permanetLocationUI); - HoldingsRecordView.checkCallNumberType(collectionOfProfilesForUpdate[1].mappingProfile.callNumberType); - cy.go('back'); - FileDetails.openItemInInventory('Updated', rowNumber); - ItemRecordView.verifyMaterialType(collectionOfProfilesForUpdate[2].mappingProfile.materialType); - ItemRecordView.verifyPermanentLoanType(collectionOfProfilesForUpdate[2].mappingProfile.permanentLoanType); - ItemRecordView.verifyItemStatus(collectionOfProfilesForUpdate[2].mappingProfile.status); - cy.go('back'); - }); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName, 2); }); - FileDetails.openInstanceInInventory('Created', 2); - InventoryInstance.checkIsInstancePresented( - addedInstanceTitle, - collectionOfProfilesForCreate[2].mappingProfile.pernanentLocationUI, - collectionOfProfilesForCreate[3].mappingProfile.status - ); - }); + }); }); 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 721c383e21..c98d59824a 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 @@ -38,457 +38,459 @@ import InstanceRecordView from '../../../support/fragments/inventory/instanceRec import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; -describe('ui-data-import', () => { - let instanceHrid; - const recordType = 'MARC_BIBLIOGRAPHIC'; - const holdingsPermanentLocation = 'Annex'; - const itemStatus = ITEM_STATUS_NAMES.AVAILABLE; - 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.${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 ${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC, - mappingDetails: { name: 'holdings', - recordType: 'MARC_BIBLIOGRAPHIC', - marcMappingDetails: [{ - order: 0, - action: 'ADD', - field: { - field: '650', - indicator2: '4', - subfields: [{ - subfield: 'a', - data: { - text: 'Test update' - } - }] - } - }], - marcMappingOption: 'MODIFY' } - } - }; - const instanceMappingProfileForCreate = { - profile:{ - id: '', - name: `C356802 create instance mapping profile ${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - } - }; - const holdingsMappingProfileForCreate = { - profile:{ - id: '', - name: `C356802 create holdings mapping profile ${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - mappingDetails: { name: 'holdings', - recordType: 'HOLDINGS', - mappingFields: [ - { name: 'permanentLocationId', - enabled: true, - path: 'holdings.permanentLocationId', - value: '"Annex (KU/CC/DI/A)"' }] } - } - }; - const itemMappingProfileForCreate = { - profile:{ - id: '', - name: `C356802 create item mapping profile ${getRandomPostfix()}`, - incomingRecordType: recordType, - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - mappingDetails: { name: 'item', - recordType: 'ITEM', - mappingFields: [ - { name: 'materialType.id', - enabled: true, - path: 'item.materialType.id', - value: '"book"', - acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, - { name: 'permanentLoanType.id', - enabled: true, - path: 'item.permanentLoanType.id', - value: '"Can circulate"', - acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, - { name: 'status.name', - enabled: true, - path: 'item.status.name', - value: '"Available"' }] } - } - }; - const marcBibActionProfileForCreate = { - profile: { - id: '', - name: `C356802 create marcBib action profile ${getRandomPostfix()}`, - action: 'MODIFY', - folioRecord: recordType - }, - addedRelations: [ - { - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE +describe('data-import', () => { + describe('Log details', () => { + let instanceHrid; + const recordType = 'MARC_BIBLIOGRAPHIC'; + const holdingsPermanentLocation = 'Annex'; + const itemStatus = ITEM_STATUS_NAMES.AVAILABLE; + 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.${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 ${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC, + mappingDetails: { name: 'holdings', + recordType: 'MARC_BIBLIOGRAPHIC', + marcMappingDetails: [{ + order: 0, + action: 'ADD', + field: { + field: '650', + indicator2: '4', + subfields: [{ + subfield: 'a', + data: { + text: 'Test update' + } + }] + } + }], + marcMappingOption: 'MODIFY' } } - ], - deletedRelations: [] - }; - const instanceActionProfileForCreate = { - profile: { - id: '', - name: `C356802 create instance action profile ${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'INSTANCE' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + }; + const instanceMappingProfileForCreate = { + profile:{ + id: '', + name: `C356802 create instance mapping profile ${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, } - ], - deletedRelations: [] - }; - const holdingsActionProfileForCreate = { - profile: { - id: '', - name: `C356802 create holdings action profile ${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'HOLDINGS' - }, - addedRelations: [ - { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + }; + const holdingsMappingProfileForCreate = { + profile:{ + id: '', + name: `C356802 create holdings mapping profile ${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + mappingDetails: { name: 'holdings', + recordType: 'HOLDINGS', + mappingFields: [ + { name: 'permanentLocationId', + enabled: true, + path: 'holdings.permanentLocationId', + value: '"Annex (KU/CC/DI/A)"' }] } + } + }; + const itemMappingProfileForCreate = { + profile:{ + id: '', + name: `C356802 create item mapping profile ${getRandomPostfix()}`, + incomingRecordType: recordType, + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + mappingDetails: { name: 'item', + recordType: 'ITEM', + mappingFields: [ + { name: 'materialType.id', + enabled: true, + path: 'item.materialType.id', + value: '"book"', + acceptedValues: { '1a54b431-2e4f-452d-9cae-9cee66c9a892': 'book' } }, + { name: 'permanentLoanType.id', + enabled: true, + path: 'item.permanentLoanType.id', + value: '"Can circulate"', + acceptedValues: { '2b94c631-fca9-4892-a730-03ee529ffe27': 'Can circulate' } }, + { name: 'status.name', + enabled: true, + path: 'item.status.name', + value: '"Available"' }] } } - ], - deletedRelations: [] - }; - const itemActionProfileForCreate = { - profile: { - id: '', - name: `C356802 create item action profile ${getRandomPostfix()}`, - action: 'CREATE', - folioRecord: 'ITEM' - }, - addedRelations: [ + }; + const marcBibActionProfileForCreate = { + profile: { + id: '', + name: `C356802 create marcBib action profile ${getRandomPostfix()}`, + action: 'MODIFY', + folioRecord: recordType + }, + addedRelations: [ + { + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const instanceActionProfileForCreate = { + profile: { + id: '', + name: `C356802 create instance action profile ${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'INSTANCE' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const holdingsActionProfileForCreate = { + profile: { + id: '', + name: `C356802 create holdings action profile ${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'HOLDINGS' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const itemActionProfileForCreate = { + profile: { + id: '', + name: `C356802 create item action profile ${getRandomPostfix()}`, + action: 'CREATE', + folioRecord: 'ITEM' + }, + addedRelations: [ + { + masterProfileId: null, + masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, + detailProfileId: '', + detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + } + ], + deletedRelations: [] + }; + const jobProfileForCreate = { + profile: { + name: `C356802 create job profile ${getRandomPostfix()}`, + dataType: ACCEPTED_DATA_TYPE_NAMES.MARC + }, + addedRelations: [], + deletedRelations: [] + }; + // TODO redesine classes inherites + const testData = [ + { mappingProfile: marcBibMappingProfileForCreate, + actionProfile: marcBibActionProfileForCreate }, + { mappingProfile: instanceMappingProfileForCreate, + actionProfile: instanceActionProfileForCreate }, + { mappingProfile: holdingsMappingProfileForCreate, + actionProfile: holdingsActionProfileForCreate }, + { mappingProfile: itemMappingProfileForCreate, + actionProfile: itemActionProfileForCreate }, + ]; + // create Field mapping profile for export + const exportMappingProfile = { + name: `C356802 mapping profile ${getRandomPostfix()}`, + holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, + holdingsMarcField: '901', + subfieldForHoldings:'$h', + itemTransformation: EXPORT_TRANSFORMATION_NAMES.ITEM_HRID, + itemMarcField:'902', + subfieldForItem:'$i' + }; + // profiles for updating instance, holdings, item + const collectionOfMappingAndActionProfiles = [ { - masterProfileId: null, - masterProfileType: PROFILE_TYPE_NAMES.ACTION_PROFILE, - detailProfileId: '', - detailProfileType: PROFILE_TYPE_NAMES.MAPPING_PROFILE + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + 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 ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + 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', + uri: '856$u' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + 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 ${getRandomPostfix()}`, + materialType: MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE, + noteType: '"Electronic bookplate"', + note: '"Smith Family Foundation"', + noteUI: 'Smith Family Foundation', + staffOnly: 'Mark for all affected records', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C356802 update item action profile ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } - ], - deletedRelations: [] - }; - const jobProfileForCreate = { - profile: { - name: `C356802 create job profile ${getRandomPostfix()}`, - dataType: ACCEPTED_DATA_TYPE_NAMES.MARC - }, - addedRelations: [], - deletedRelations: [] - }; - // TODO redesine classes inherites - const testData = [ - { mappingProfile: marcBibMappingProfileForCreate, - actionProfile: marcBibActionProfileForCreate }, - { mappingProfile: instanceMappingProfileForCreate, - actionProfile: instanceActionProfileForCreate }, - { mappingProfile: holdingsMappingProfileForCreate, - actionProfile: holdingsActionProfileForCreate }, - { mappingProfile: itemMappingProfileForCreate, - actionProfile: itemActionProfileForCreate }, - ]; - // create Field mapping profile for export - const exportMappingProfile = { - name: `C356802 mapping profile ${getRandomPostfix()}`, - holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, - holdingsMarcField: '901', - subfieldForHoldings:'$h', - itemTransformation: EXPORT_TRANSFORMATION_NAMES.ITEM_HRID, - itemMarcField:'902', - subfieldForItem:'$i' - }; - // profiles for updating instance, holdings, item - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - 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 ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - 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', - uri: '856$u' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - 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 ${getRandomPostfix()}`, - materialType: MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE, - noteType: '"Electronic bookplate"', - note: '"Smith Family Foundation"', - noteUI: 'Smith Family Foundation', - staffOnly: 'Mark for all affected records', - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, - status: ITEM_STATUS_NAMES.AVAILABLE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - 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 ${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - existingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } - }, - { - matchProfile: { profileName: `C356802 MARC-to-Holdings 901h to Holdings HRID match profile ${getRandomPostfix()}`, - incomingRecordFields: { - field: '901', - subfield: 'h' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.holdingsHrid } - }, - { - matchProfile: { - profileName: `C356802 MARC-to-Item 902i to Item HRID match profile ${getRandomPostfix()}`, - incomingRecordFields: { - field: '902', - subfield: 'i' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemHrid + ]; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C356802 MARC-to-MARC 001 to 001 match profile ${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + existingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } + }, + { + matchProfile: { profileName: `C356802 MARC-to-Holdings 901h to Holdings HRID match profile ${getRandomPostfix()}`, + incomingRecordFields: { + field: '901', + subfield: 'h' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid } + }, + { + matchProfile: { + profileName: `C356802 MARC-to-Item 902i to Item HRID match profile ${getRandomPostfix()}`, + incomingRecordFields: { + field: '902', + subfield: 'i' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemHrid + } } - } - ]; - const jobProfileForUpdate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C356802 update job profile ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C356802 update job profile ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.getAdminToken(); - cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); + before('login', () => { + cy.getAdminToken(); + cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForImportUpdate}`); - FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); - JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); - JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); - }); - ActionProfiles.deleteActionProfile(marcBibActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); - ActionProfiles.deleteActionProfile(itemActionProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.name); - FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForCreate.profile.name); - collectionOfMappingAndActionProfiles.forEach(profile => { - 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); + FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForImportUpdate}`); + FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); + JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); }); - }); + ActionProfiles.deleteActionProfile(marcBibActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(instanceActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(holdingsActionProfileForCreate.profile.name); + ActionProfiles.deleteActionProfile(itemActionProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(marcBibMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(instanceMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfileForCreate.profile.name); + FieldMappingProfiles.deleteFieldMappingProfile(itemMappingProfileForCreate.profile.name); + collectionOfMappingAndActionProfiles.forEach(profile => { + 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('C356802 Check import summary table with "Updated" actions for instance, holding and item (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C356802 Check import summary table with "Updated" actions for instance, holding and item (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create profiles via API - testData.jobProfileForCreate = jobProfileForCreate; + testData.jobProfileForCreate = jobProfileForCreate; - testData.forEach(specialPair => { - cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { - cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); - }); - }); - SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) - .then((bodyWithjobProfile) => { - testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + testData.forEach(specialPair => { + cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { + cy.addJobProfileRelation(testData.jobProfileForCreate.addedRelations, idActionProfile); + }); }); + SettingsJobProfiles.createJobProfileApi(testData.jobProfileForCreate) + .then((bodyWithjobProfile) => { + testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + }); - // 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', nameMarcFileForImportCreate); - JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForImportCreate); + // 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', nameMarcFileForImportCreate); + JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForImportCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFileForImportCreate); - // check the instance is created - FileDetails.openInstanceInInventory(FileDetails.status.created); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + // check the instance is created + FileDetails.openInstanceInInventory(FileDetails.status.created); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; - InventoryInstance.checkIsInstancePresented(instanceTitle, holdingsPermanentLocation, itemStatus); - cy.go('back'); + InventoryInstance.checkIsInstancePresented(instanceTitle, holdingsPermanentLocation, itemStatus); + cy.go('back'); - cy.visit(SettingsMenu.exportMappingProfilePath); - ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); + cy.visit(SettingsMenu.exportMappingProfilePath); + ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); - cy.visit(SettingsMenu.exportJobProfilePath); - ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); + cy.visit(SettingsMenu.exportJobProfilePath); + ExportJobProfiles.createJobProfile(jobProfileNameForExport, exportMappingProfile.name); - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - }); + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + }); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); - ExportFile.downloadExportedMarcFile(nameMarcFileForImportUpdate); + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); + ExportFile.downloadExportedMarcFile(nameMarcFileForImportUpdate); - // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - NewFieldMappingProfile.fillCatalogedDate(collectionOfMappingAndActionProfiles[0].mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfiles[0].mappingProfile.instanceStatus); - NewFieldMappingProfile.addStatisticalCode(collectionOfMappingAndActionProfiles[0].mappingProfile.statisticalCode, 8); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + // create mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.fillCatalogedDate(collectionOfMappingAndActionProfiles[0].mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfiles[0].mappingProfile.instanceStatus); + NewFieldMappingProfile.addStatisticalCode(collectionOfMappingAndActionProfiles[0].mappingProfile.statisticalCode, 8); + 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.fillCallNumberType(`"${collectionOfMappingAndActionProfiles[1].mappingProfile.callNumberType}"`); - NewFieldMappingProfile.fillCallNumber(collectionOfMappingAndActionProfiles[1].mappingProfile.callNumber); - NewFieldMappingProfile.addElectronicAccess(`"${collectionOfMappingAndActionProfiles[1].mappingProfile.relationship}"`, collectionOfMappingAndActionProfiles[1].mappingProfile.uri); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfiles[1].mappingProfile.holdingsType); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); + NewFieldMappingProfile.fillCallNumberType(`"${collectionOfMappingAndActionProfiles[1].mappingProfile.callNumberType}"`); + NewFieldMappingProfile.fillCallNumber(collectionOfMappingAndActionProfiles[1].mappingProfile.callNumber); + NewFieldMappingProfile.addElectronicAccess(`"${collectionOfMappingAndActionProfiles[1].mappingProfile.relationship}"`, collectionOfMappingAndActionProfiles[1].mappingProfile.uri); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - NewFieldMappingProfile.fillMaterialType(`"${collectionOfMappingAndActionProfiles[2].mappingProfile.materialType}"`); - NewFieldMappingProfile.addItemNotes( - collectionOfMappingAndActionProfiles[2].mappingProfile.noteType, - collectionOfMappingAndActionProfiles[2].mappingProfile.note, - collectionOfMappingAndActionProfiles[2].mappingProfile.staffOnly - ); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + NewFieldMappingProfile.fillMaterialType(`"${collectionOfMappingAndActionProfiles[2].mappingProfile.materialType}"`); + NewFieldMappingProfile.addItemNotes( + collectionOfMappingAndActionProfiles[2].mappingProfile.noteType, + collectionOfMappingAndActionProfiles[2].mappingProfile.note, + collectionOfMappingAndActionProfiles[2].mappingProfile.staffOnly + ); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].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 action profiles + collectionOfMappingAndActionProfiles.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); - collectionOfMatchProfiles.forEach(profile => { - MatchProfiles.createMatchProfile(profile.matchProfile); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.createMatchProfile(profile.matchProfile); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - 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(); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); + 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 - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(nameMarcFileForImportUpdate); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForImportUpdate); - Logs.openFileDetails(nameMarcFileForImportUpdate); + // upload the exported marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(nameMarcFileForImportUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForImportUpdate); + Logs.openFileDetails(nameMarcFileForImportUpdate); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - // check Created counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(0, '0'); - // check Updated counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(1, quantityOfItems); - // check No action counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(2, '0'); - // check Error counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(3, '0'); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + // check Created counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(0, '0'); + // check Updated counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(1, quantityOfItems); + // check No action counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(2, '0'); + // check Error counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(3, '0'); - // check instance, holdings, item are updated - FileDetails.openInstanceInInventory(FileDetails.status.updated); - InstanceRecordView.verifyCatalogedDate(collectionOfMappingAndActionProfiles[0].mappingProfile.catalogedDateUi); - InstanceRecordView.verifyInstanceStatusTerm(collectionOfMappingAndActionProfiles[0].mappingProfile.instanceStatus); - InstanceRecordView.verifyStatisticalCode(collectionOfMappingAndActionProfiles[0].mappingProfile.statisticalCodeUI); - cy.go('back'); - FileDetails.openHoldingsInInventory(FileDetails.status.updated); - HoldingsRecordView.checkHoldingsType(collectionOfMappingAndActionProfiles[1].mappingProfile.holdingsType); - HoldingsRecordView.checkPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocationUI); - HoldingsRecordView.checkCallNumberType(collectionOfMappingAndActionProfiles[1].mappingProfile.callNumberType); - HoldingsRecordView.checkCallNumber('-'); - HoldingsRecordView.openAccordion('Electronic access'); - HoldingsRecordView.checkElectronicAccess(collectionOfMappingAndActionProfiles[1].mappingProfile.relationship, 'https://www.test.org/bro/10.230'); - cy.go('back'); - FileDetails.openItemInInventory(FileDetails.status.updated); - ItemRecordView.verifyMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); - ItemRecordView.checkElectronicBookplateNote(collectionOfMappingAndActionProfiles[2].mappingProfile.noteUI); - ItemRecordView.verifyPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); - ItemRecordView.verifyItemStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); - }); + // check instance, holdings, item are updated + FileDetails.openInstanceInInventory(FileDetails.status.updated); + InstanceRecordView.verifyCatalogedDate(collectionOfMappingAndActionProfiles[0].mappingProfile.catalogedDateUi); + InstanceRecordView.verifyInstanceStatusTerm(collectionOfMappingAndActionProfiles[0].mappingProfile.instanceStatus); + InstanceRecordView.verifyStatisticalCode(collectionOfMappingAndActionProfiles[0].mappingProfile.statisticalCodeUI); + cy.go('back'); + FileDetails.openHoldingsInInventory(FileDetails.status.updated); + HoldingsRecordView.checkHoldingsType(collectionOfMappingAndActionProfiles[1].mappingProfile.holdingsType); + HoldingsRecordView.checkPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocationUI); + HoldingsRecordView.checkCallNumberType(collectionOfMappingAndActionProfiles[1].mappingProfile.callNumberType); + HoldingsRecordView.checkCallNumber('-'); + HoldingsRecordView.openAccordion('Electronic access'); + HoldingsRecordView.checkElectronicAccess(collectionOfMappingAndActionProfiles[1].mappingProfile.relationship, 'https://www.test.org/bro/10.230'); + cy.go('back'); + FileDetails.openItemInInventory(FileDetails.status.updated); + ItemRecordView.verifyMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); + ItemRecordView.checkElectronicBookplateNote(collectionOfMappingAndActionProfiles[2].mappingProfile.noteUI); + ItemRecordView.verifyPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); + ItemRecordView.verifyItemStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); + }); + }); }); diff --git a/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js b/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js index b24416ad87..d1f5ba426b 100644 --- a/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js +++ b/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js @@ -24,139 +24,141 @@ import OrderLines from '../../../support/fragments/orders/orderLines'; import Users from '../../../support/fragments/users/users'; import Orders from '../../../support/fragments/orders/orders'; -describe('ui-data-import', () => { - let user; - const orderNumbers = []; - const quantityOfOrders = '3'; - const filePathForCreateOrder = 'marcFileForC375178.mrc'; - const marcFileName = `C375178 autotestFileName ${getRandomPostfix()}`; - const ordersData = [ - { title: 'ROALD DAHL : TELLER OF THE UNEXPECTED : A BIOGRAPHY.', rowNumber: 0 }, - { title: 'CULTURAL HISTORY OF IDEAS', rowNumber: 1 }, - { title: 'BOAT PEOPLE; TRANS. BY VANESSA PERE-ROSARIO.', rowNumber: 2 } - ]; - const mappingProfile = { - name: `C375178 Test Order ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER, - orderStatus: ORDER_STATUSES.PENDING, - approved: true, - vendor: VENDOR_NAMES.GOBI, - reEncumber: 'false', - title: '245$a', - mustAcknowledgeReceivingNote: 'false', - publicationDate: '264$c; else 260$c', - publisher: '264$b; else 260$b', - edition: '250$a', - internalNote: '981$d', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, - receiptStatus: 'Pending', - paymentStatus: 'Pending', - selector: '981$e', - cancellationRestriction: 'false', - rush: '981$h', - receivingWorkflow: 'Synchronized', - accountNumber: '981$g', - physicalUnitPrice: '980$b', - quantityPhysical: '980$g', - currency: 'USD', - materialSupplier: VENDOR_NAMES.GOBI, - createInventory: 'Instance, Holding, Item', - materialType: MATERIAL_TYPE_NAMES.BOOK, - contributor: '100$a', - contributorType: 'Personal name', - productId: '020$a', - qualifier: '020$q', - productIDType: 'ISBN', - vendorReferenceNumber: '980$f', - vendorReferenceType: 'Vendor order reference number', - fundId: '981$b', - expenseClass: '981$c', - value: '100', - type: '%', - locationName: '049$a', - locationQuantityPhysical: '980$g', - volume: '993$a' - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C375178 Test Order ${getRandomPostfix()}` - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C375178 Test Order ${getRandomPostfix()}`, - }; +describe('data-import', () => { + describe('Log details', () => { + let user; + const orderNumbers = []; + const quantityOfOrders = '3'; + const filePathForCreateOrder = 'marcFileForC375178.mrc'; + const marcFileName = `C375178 autotestFileName ${getRandomPostfix()}`; + const ordersData = [ + { title: 'ROALD DAHL : TELLER OF THE UNEXPECTED : A BIOGRAPHY.', rowNumber: 0 }, + { title: 'CULTURAL HISTORY OF IDEAS', rowNumber: 1 }, + { title: 'BOAT PEOPLE; TRANS. BY VANESSA PERE-ROSARIO.', rowNumber: 2 } + ]; + const mappingProfile = { + name: `C375178 Test Order ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER, + orderStatus: ORDER_STATUSES.PENDING, + approved: true, + vendor: VENDOR_NAMES.GOBI, + reEncumber: 'false', + title: '245$a', + mustAcknowledgeReceivingNote: 'false', + publicationDate: '264$c; else 260$c', + publisher: '264$b; else 260$b', + edition: '250$a', + internalNote: '981$d', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, + receiptStatus: 'Pending', + paymentStatus: 'Pending', + selector: '981$e', + cancellationRestriction: 'false', + rush: '981$h', + receivingWorkflow: 'Synchronized', + accountNumber: '981$g', + physicalUnitPrice: '980$b', + quantityPhysical: '980$g', + currency: 'USD', + materialSupplier: VENDOR_NAMES.GOBI, + createInventory: 'Instance, Holding, Item', + materialType: MATERIAL_TYPE_NAMES.BOOK, + contributor: '100$a', + contributorType: 'Personal name', + productId: '020$a', + qualifier: '020$q', + productIDType: 'ISBN', + vendorReferenceNumber: '980$f', + vendorReferenceType: 'Vendor order reference number', + fundId: '981$b', + expenseClass: '981$c', + value: '100', + type: '%', + locationName: '049$a', + locationQuantityPhysical: '980$g', + volume: '993$a' + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C375178 Test Order ${getRandomPostfix()}` + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C375178 Test Order ${getRandomPostfix()}`, + }; - before('login', () => { - cy.loginAsAdmin(); - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createOrderMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + before('login', () => { + cy.loginAsAdmin(); + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createOrderMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create action 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); - - after('delete test data', () => { - Users.deleteViaApi(user.userId); - JobProfiles.deleteJobProfile(jobProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - cy.wrap(orderNumbers).each(number => { - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${number}"` }) - .then(orderId => { - Orders.deleteOrderViaApi(orderId[0].id); + cy.login(userProperties.username, userProperties.password, + { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); }); }); - }); - - it('C375178 Verify the importing of orders with pending status (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForCreateOrder, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - FileDetails.checkOrderQuantityInSummaryTable(quantityOfOrders); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfOrders); - cy.wrap(ordersData).each(order => { - FileDetails.verifyTitle(order.title, FileDetails.columnNameInResultList.title, order.rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, order.rowNumber); - FileDetails.verifyStatusHasLinkToOrder(order.rowNumber); - FileDetails.openOrder('Created', order.rowNumber); - OrderLines.waitLoading(); - OrderLines.verifyOrderTitle(order.title); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + cy.wrap(orderNumbers).each(number => { + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${number}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); }); - cy.go('back'); }); }); + + it('C375178 Verify the importing of orders with pending status (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + FileDetails.checkOrderQuantityInSummaryTable(quantityOfOrders); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfOrders); + cy.wrap(ordersData).each(order => { + FileDetails.verifyTitle(order.title, FileDetails.columnNameInResultList.title, order.rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, order.rowNumber); + FileDetails.verifyStatusHasLinkToOrder(order.rowNumber); + FileDetails.openOrder('Created', order.rowNumber); + OrderLines.waitLoading(); + OrderLines.verifyOrderTitle(order.title); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); + + orderNumbers.push(orderNumber); + }); + cy.go('back'); + }); + }); + }); }); 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 index eb5ce6b065..601cba4b7d 100644 --- 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 @@ -18,90 +18,92 @@ 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 - }; +describe('data-import', () => { + describe('Log details', () => { + 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; + 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); - }); + 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] }, () => { + 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); + 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 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); + // 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); + // 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); }); - 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-details-for-created-imported-order-records.cy.js b/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js index 697e3f4266..5ac1618fd2 100644 --- a/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js +++ b/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js @@ -22,134 +22,136 @@ import OrderLines from '../../../support/fragments/orders/orderLines'; import Orders from '../../../support/fragments/orders/orders'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - const orderNumbers = []; - const quantityOfOrders = '7'; - const filePathForCreateOrder = 'marcFileForC376973.mrc'; - const marcFileName = `C375173 autotestFileName ${getRandomPostfix()}`; - const mappingProfile = { - name: `C376973 mapping profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER, - orderStatus: ORDER_STATUSES.PENDING, - approved: true, - vendor: VENDOR_NAMES.GOBI, - reEncumber: 'false', - title: '245$a', - mustAcknowledgeReceivingNote: 'false', - publicationDate: '264$c; else 260$c', - publisher: '264$b; else 260$b', - edition: '250$a', - internalNote: '981$d', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, - receiptStatus: 'Pending', - paymentStatus: 'Pending', - selector: '981$e', - cancellationRestriction: 'false', - rush: '981$h', - receivingWorkflow: 'Synchronized', - accountNumber: '981$g', - physicalUnitPrice: '980$b', - quantityPhysical: '980$g', - currency: 'USD', - materialSupplier: VENDOR_NAMES.GOBI, - createInventory: 'Instance, Holding, Item', - materialType: MATERIAL_TYPE_NAMES.BOOK, - contributor: '100$a', - contributorType: 'Personal name', - productId: '020$a', - qualifier: '020$q', - productIDType: 'ISBN', - vendorReferenceNumber: '980$f', - vendorReferenceType: 'Vendor order reference number', - fundId: '981$b', - expenseClass: '981$c', - value: '100', - type: '%', - locationName: '049$a', - locationQuantityPhysical: '980$g', - volume: '993$a' - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C376973 action profile ${getRandomPostfix()}` - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C376973 job profile ${getRandomPostfix()}`, - }; +describe('data-import', () => { + describe('Log details', () => { + let user; + const orderNumbers = []; + const quantityOfOrders = '7'; + const filePathForCreateOrder = 'marcFileForC376973.mrc'; + const marcFileName = `C375173 autotestFileName ${getRandomPostfix()}`; + const mappingProfile = { + name: `C376973 mapping profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER, + orderStatus: ORDER_STATUSES.PENDING, + approved: true, + vendor: VENDOR_NAMES.GOBI, + reEncumber: 'false', + title: '245$a', + mustAcknowledgeReceivingNote: 'false', + publicationDate: '264$c; else 260$c', + publisher: '264$b; else 260$b', + edition: '250$a', + internalNote: '981$d', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, + receiptStatus: 'Pending', + paymentStatus: 'Pending', + selector: '981$e', + cancellationRestriction: 'false', + rush: '981$h', + receivingWorkflow: 'Synchronized', + accountNumber: '981$g', + physicalUnitPrice: '980$b', + quantityPhysical: '980$g', + currency: 'USD', + materialSupplier: VENDOR_NAMES.GOBI, + createInventory: 'Instance, Holding, Item', + materialType: MATERIAL_TYPE_NAMES.BOOK, + contributor: '100$a', + contributorType: 'Personal name', + productId: '020$a', + qualifier: '020$q', + productIDType: 'ISBN', + vendorReferenceNumber: '980$f', + vendorReferenceType: 'Vendor order reference number', + fundId: '981$b', + expenseClass: '981$c', + value: '100', + type: '%', + locationName: '049$a', + locationQuantityPhysical: '980$g', + volume: '993$a' + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C376973 action profile ${getRandomPostfix()}` + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C376973 job profile ${getRandomPostfix()}`, + }; - before('login', () => { - cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - // create mapping profile - FieldMappingProfiles.createOrderMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + before('login', () => { + cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + // create mapping profile + FieldMappingProfiles.createOrderMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create action 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.logout(); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + cy.logout(); - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.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); - cy.wrap(orderNumbers).each(number => { - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${number}"` }) - .then(orderId => { - Orders.deleteOrderViaApi(orderId[0].id); + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); }); }); - }); - - it('C376973 Verify the log details for created imported order records (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForCreateOrder, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - FileDetails.checkOrderQuantityInSummaryTable(quantityOfOrders); - FileDetails.verifyRecordColumnHasStandardSequentialNumberingForRecords(); - [0, 1, 2, 3, 4, 5, 6].forEach(rowNumber => { - FileDetails.verifyTitleHasLinkToJsonFile(rowNumber); - FileDetails.verifyStatusHasLinkToOrder(rowNumber); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, rowNumber); - FileDetails.openOrder('Created', rowNumber); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + cy.wrap(orderNumbers).each(number => { + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${number}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); }); - cy.go('back'); }); }); + + it('C376973 Verify the log details for created imported order records (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + FileDetails.checkOrderQuantityInSummaryTable(quantityOfOrders); + FileDetails.verifyRecordColumnHasStandardSequentialNumberingForRecords(); + [0, 1, 2, 3, 4, 5, 6].forEach(rowNumber => { + FileDetails.verifyTitleHasLinkToJsonFile(rowNumber); + FileDetails.verifyStatusHasLinkToOrder(rowNumber); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, rowNumber); + FileDetails.openOrder('Created', rowNumber); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); + + orderNumbers.push(orderNumber); + }); + cy.go('back'); + }); + }); + }); }); 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 62a7431bc1..0deb4d089c 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 @@ -29,183 +29,185 @@ import InstanceRecordView from '../../../support/fragments/inventory/instanceRec import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; -describe('ui-data-import', () => { - let user; - const marcFileName = `C378901autotestFile.${getRandomPostfix()}.mrc`; - const barcodes = ['B(UMLLTTEST3)LLTAMGUT8UGUT_-UM', 'B(UMLLTTEST3)LLTAALIVIAUCO_-UM']; - const firstInstanceTitle = ' Guillelmus de Sancto Theodorico (dubium) [electronic resource]'; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C378901 instance mapping profile ${getRandomPostfix()}`, - catalogedDate: '###TODAY###', - instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C378901 instance action profile ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C378901 holdings mapping profile ${getRandomPostfix()}`, - permanentLocation: `"${LOCATION_NAMES.ONLINE}"`, - permanentLocationUI: LOCATION_NAMES.ONLINE_UI, - callNumberType: '852$t', - callNumber: '852$h', - relationship: '"Resource"', - uri: '856$u', - link: '856$y' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C378901 holdings action profile${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C378901 item mapping profile ${getRandomPostfix()}`, - barcode: '876$a', - materialType: '877$m', - permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, - status: ITEM_STATUS_NAMES.AVAILABLE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C378901 item action profile${getRandomPostfix()}` } - } - ]; - const matchProfile = { - profileName: `C378901 match profile ${getRandomPostfix()}`, - incomingRecordFields: { - field: '034', - in1: '9', - in2: ' ', - subfield: 'a' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.systemControlNumber - }; - const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C378901 job profile ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; +describe('data-import', () => { + describe('Log details', () => { + let user; + const marcFileName = `C378901autotestFile.${getRandomPostfix()}.mrc`; + const barcodes = ['B(UMLLTTEST3)LLTAMGUT8UGUT_-UM', 'B(UMLLTTEST3)LLTAALIVIAUCO_-UM']; + const firstInstanceTitle = ' Guillelmus de Sancto Theodorico (dubium) [electronic resource]'; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C378901 instance mapping profile ${getRandomPostfix()}`, + catalogedDate: '###TODAY###', + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C378901 instance action profile ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C378901 holdings mapping profile ${getRandomPostfix()}`, + permanentLocation: `"${LOCATION_NAMES.ONLINE}"`, + permanentLocationUI: LOCATION_NAMES.ONLINE_UI, + callNumberType: '852$t', + callNumber: '852$h', + relationship: '"Resource"', + uri: '856$u', + link: '856$y' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C378901 holdings action profile${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C378901 item mapping profile ${getRandomPostfix()}`, + barcode: '876$a', + materialType: '877$m', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C378901 item action profile${getRandomPostfix()}` } + } + ]; + const matchProfile = { + profileName: `C378901 match profile ${getRandomPostfix()}`, + incomingRecordFields: { + field: '034', + in1: '9', + in2: ' ', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.systemControlNumber + }; + const jobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `C378901 job profile ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - before('login', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiInventoryViewInstances.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiInventoryViewInstances.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(userProperties.username, userProperties.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(barcodes[0]); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(barcodes[1]); }); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(barcodes[0]); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(barcodes[1]); - }); - const createInstanceMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillCatalogedDate(profile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; - const createHoldingsMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); - NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); - NewFieldMappingProfile.fillCallNumber(profile.callNumber); - NewFieldMappingProfile.addElectronicAccess(profile.relationship, profile.uri, profile.link); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; - const createItemMappingProfile = (profile) => { - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(profile); - NewFieldMappingProfile.fillBarcode(profile.barcode); - NewFieldMappingProfile.fillMaterialType(profile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(profile.permanentLoanType); - NewFieldMappingProfile.fillStatus(profile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); - }; + const createInstanceMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillCatalogedDate(profile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; + const createHoldingsMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); + NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); + NewFieldMappingProfile.fillCallNumber(profile.callNumber); + NewFieldMappingProfile.addElectronicAccess(profile.relationship, profile.uri, profile.link); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; + const createItemMappingProfile = (profile) => { + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(profile); + NewFieldMappingProfile.fillBarcode(profile.barcode); + NewFieldMappingProfile.fillMaterialType(profile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(profile.permanentLoanType); + NewFieldMappingProfile.fillStatus(profile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); + }; - it('C378901 Check log summary counts for inventory records created after NOT matching (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C378901 Check log summary counts for inventory records created after NOT matching (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profiles - createInstanceMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - createItemMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + createInstanceMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + createHoldingsMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + createItemMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].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 action profiles + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndThreeActionProfiles( - matchProfile.profileName, - collectionOfMappingAndActionProfiles[0].actionProfile.name, - collectionOfMappingAndActionProfiles[1].actionProfile.name, - collectionOfMappingAndActionProfiles[2].actionProfile.name, - 1 - ); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchAndThreeActionProfiles( + matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMappingAndActionProfiles[1].actionProfile.name, + collectionOfMappingAndActionProfiles[2].actionProfile.name, + 1 + ); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - // upload .mrc file - cy.visit(TopMenu.dataImportPath); - DataImport.checkIsLandingPageOpened(); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC378901.mrc', marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(marcFileName); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - // check created counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(0, '2'); - // check Updated counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(1, '0'); - // check No action counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(2, '0'); - // check Error counter in the Summary table - FileDetails.checkItemsQuantityInSummaryTable(3, '0'); + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + DataImport.checkIsLandingPageOpened(); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC378901.mrc', marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + // check created counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(0, '2'); + // check Updated counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(1, '0'); + // check No action counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(2, '0'); + // check Error counter in the Summary table + FileDetails.checkItemsQuantityInSummaryTable(3, '0'); - FileDetails.openInstanceInInventory('Created'); - InstanceRecordView.verifyIsInstanceOpened(firstInstanceTitle); - cy.go('back'); - FileDetails.openHoldingsInInventory('Created'); - HoldingsRecordView.checkPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocationUI); - cy.go('back'); - FileDetails.openItemInInventory('Created'); - ItemRecordView.verifyItemStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); - }); + FileDetails.openInstanceInInventory('Created'); + InstanceRecordView.verifyIsInstanceOpened(firstInstanceTitle); + cy.go('back'); + FileDetails.openHoldingsInInventory('Created'); + HoldingsRecordView.checkPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocationUI); + cy.go('back'); + FileDetails.openItemInInventory('Created'); + ItemRecordView.verifyItemStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); + }); + }); }); diff --git a/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js b/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js index 58804c2097..7f94707b35 100644 --- a/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js +++ b/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js @@ -19,179 +19,181 @@ import NewJobProfile from '../../../support/fragments/data_import/job_profiles/n import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; -describe('ui-data-import', () => { - let user; - const fieldProtectionIds = []; - let instanceHRID = null; - const quantityOfItems = '1'; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const marcFileNameForCreate = `C367966 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C367966 editedAutotestFile.${getRandomPostfix()}.mrc`; - const marcFileName = `C367966 autotestFile.${getRandomPostfix()}.mrc`; - const protectedFields = { - firstField: '020', - secondField: '514' - }; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { name: `C367966 Update MARC Bib with protections ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `createInstanceActionProf${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { name: `C367966 Update instance 1 ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - administrativeNote: 'This note was added when the MARC Bib was updated to check field protections', - noteInFile: 'This is the ORIGINAL version of the non-repeatable 514 note' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `createInstanceActionProf${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - } - ]; - const matchProfile = { - profileName: `C367966 001 to 001 MARC Bib ${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - existingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C367966 Update 1: MARC Bib with protections ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Log details', () => { + let user; + const fieldProtectionIds = []; + let instanceHRID = null; + const quantityOfItems = '1'; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const marcFileNameForCreate = `C367966 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C367966 editedAutotestFile.${getRandomPostfix()}.mrc`; + const marcFileName = `C367966 autotestFile.${getRandomPostfix()}.mrc`; + const protectedFields = { + firstField: '020', + secondField: '514' + }; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { name: `C367966 Update MARC Bib with protections ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `createInstanceActionProf${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C367966 Update instance 1 ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + administrativeNote: 'This note was added when the MARC Bib was updated to check field protections', + noteInFile: 'This is the ORIGINAL version of the non-repeatable 514 note' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `createInstanceActionProf${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const matchProfile = { + profileName: `C367966 001 to 001 MARC Bib ${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + existingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C367966 Update 1: MARC Bib with protections ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('login', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, - permissions.inventoryAll.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, - { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); - - after('delete test data', () => { - cy.wrap(fieldProtectionIds).each(id => { - MarcFieldProtection.deleteMarcFieldProtectionViaApi(id); - }); - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); }); - // delete created file in fixtures - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); - it('C367966 Confirm the number of updated instances in the import log does not exceed the number of records in the file (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: 'a', - data: '*', - source: 'USER', - field: protectedFields.firstField - }) - .then((resp) => { - fieldProtectionIds.push(resp.id); - }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field: protectedFields.secondField - }) - .then((resp) => { - fieldProtectionIds.push(resp.id); + after('delete test data', () => { + cy.wrap(fieldProtectionIds).each(id => { + MarcFieldProtection.deleteMarcFieldProtectionViaApi(id); + }); + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + // delete created file in fixtures + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); }); + }); - // create Field mapping profiles - FieldMappingProfiles.createMappingProfileForUpdatesMarc(collectionOfMappingAndActionProfiles[0].mappingProfile); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.createMappingProfileWithNotes(collectionOfMappingAndActionProfiles[1].mappingProfile, - collectionOfMappingAndActionProfiles[1].mappingProfile.administrativeNote); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + it('C367966 Confirm the number of updated instances in the import log does not exceed the number of records in the file (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: 'a', + data: '*', + source: 'USER', + field: protectedFields.firstField + }) + .then((resp) => { + fieldProtectionIds.push(resp.id); + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field: protectedFields.secondField + }) + .then((resp) => { + fieldProtectionIds.push(resp.id); + }); - // create Action profiles - collectionOfMappingAndActionProfiles.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create Field mapping profiles + FieldMappingProfiles.createMappingProfileForUpdatesMarc(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.createMappingProfileWithNotes(collectionOfMappingAndActionProfiles[1].mappingProfile, + collectionOfMappingAndActionProfiles[1].mappingProfile.administrativeNote); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + // create Action profiles + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create Job profiles - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndTwoActionProfiles( - matchProfile.profileName, - collectionOfMappingAndActionProfiles[0].actionProfile.name, - collectionOfMappingAndActionProfiles[1].actionProfile.name - ); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC367966_BeforeOverride.mrc', marcFileNameForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForCreate); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(marcFileNameForCreate); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - FileDetails.openInstanceInInventory('Created'); - InstanceRecordView.verifyInstanceRecordViewOpened(); - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; + // create Job profiles + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchAndTwoActionProfiles( + matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMappingAndActionProfiles[1].actionProfile.name + ); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - InstanceRecordView.viewSource(); - InventoryViewSource.contains('514\t'); - InventoryViewSource.contains(collectionOfMappingAndActionProfiles[1].mappingProfile.noteInFile); - DataImport.editMarcFile('marcFileForC367966_Rev1Protect.mrc', editedMarcFileName, ['in00000000331'], [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('marcFileForC367966_BeforeOverride.mrc', marcFileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForCreate); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(marcFileNameForCreate); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); + FileDetails.openInstanceInInventory('Created'); + InstanceRecordView.verifyInstanceRecordViewOpened(); + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; - // upload an edited marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, marcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileName); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(marcFileName); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); - }); + InstanceRecordView.viewSource(); + InventoryViewSource.contains('514\t'); + InventoryViewSource.contains(collectionOfMappingAndActionProfiles[1].mappingProfile.noteInFile); + DataImport.editMarcFile('marcFileForC367966_Rev1Protect.mrc', editedMarcFileName, ['in00000000331'], [instanceHRID]); + }); + + // upload an edited marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(marcFileName); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); + }); + }); }); 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 30ac9ec386..61013079bb 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 @@ -32,439 +32,441 @@ import ExportFile from '../../../support/fragments/data-export/exportFile'; import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; -describe.skip('ui-data-import', () => { - let user; - const instanceHrids = []; - 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 exportJobProfileName = `Testing titles for import.${getRandomPostfix()}`; - const marcFileForCreateFirstRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; - const marcFileForCreateSecondRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; - const csvFileNameForFirstRecord = `C375109 autotestFile${getRandomPostfix()}.csv`; - const csvFileNameForSecondRecord = `C375109 autotestFile${getRandomPostfix()}.csv`; - const marcFileNameForUpdateFirstRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; - const marcFileNameForUpdateSecondRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; - const firstRecord = { - instanceMappingProfileName: `C375109 instance mapping profile.${getRandomPostfix()}`, - holdingsMappingProfileName: `C375109 holdings mapping profile.${getRandomPostfix()}`, - permanentLocation: LOCATION_NAMES.MAIN_LIBRARY, - itemMappingProfileName: `C375109 item mapping profile.${getRandomPostfix()}`, - instanceActionProfileName: `C375109 instance action profile.${getRandomPostfix()}`, - holdingsActionProfileName: `C375109 holdings action profile.${getRandomPostfix()}`, - itemActionProfileName: `C375109 item action profile.${getRandomPostfix()}`, - jobProfileName: `C375109 job profile.${getRandomPostfix()}` - }; - const secondRecord = { - instanceMappingProfileName: `C375109 instance mapping profile.${getRandomPostfix()}`, - holdingsMappingProfileName: `C375109 holdings mapping profile.${getRandomPostfix()}`, - permanentLocation: LOCATION_NAMES.MAIN_LIBRARY, - itemMappingProfileName: `C375109 item mapping profile.${getRandomPostfix()}`, - instanceActionProfileName: `C375109 instance action profile.${getRandomPostfix()}`, - holdingsActionProfileName: `C375109 holdings action profile.${getRandomPostfix()}`, - itemActionProfileName: `C375109 item action profile.${getRandomPostfix()}`, - jobProfileName: `C375109 job profile.${getRandomPostfix()}` - }; - // profiles for creating the first record - const firstInstanceMappingProfileForCreate = NewFieldMappingProfile.getDefaultInstanceMappingProfile(firstRecord.instanceMappingProfileName); - const firstHoldingsMappingProfileForCreate = NewFieldMappingProfile.getDefaultHoldingsMappingProfile(firstRecord.holdingsMappingProfileName, firstRecord.permanentLocation); - const firstItemMappingProfileForCreate = NewFieldMappingProfile.getDefaultItemMappingProfile(firstRecord.itemMappingProfileName); - const firstInstanceActionProfileForCreate = NewActionProfile.getDefaultInstanceActionProfile(firstRecord.instanceActionProfileName); - const firstHoldingsActionProfileForCreate = NewActionProfile.getDefaultHoldingsActionProfile(firstRecord.holdingsActionProfileName); - const firstItemActionProfileForCreate = NewActionProfile.getDefaultItemActionProfile(firstRecord.itemActionProfileName); - const firstJobProfileForCreate = NewJobProfile.getDefaultJobProfile(firstRecord.jobProfileName); - const firstTestData = [ - { mappingProfile: firstInstanceMappingProfileForCreate, - actionProfile: firstInstanceActionProfileForCreate }, - { mappingProfile: firstHoldingsMappingProfileForCreate, - actionProfile: firstHoldingsActionProfileForCreate }, - { mappingProfile: firstItemMappingProfileForCreate, - actionProfile: firstItemActionProfileForCreate }, - ]; - // profiles for creating the first record - const secondInstanceMappingProfileForCreate = NewFieldMappingProfile.getDefaultInstanceMappingProfile(secondRecord.instanceMappingProfileName); - const secondHoldingsMappingProfileForCreate = NewFieldMappingProfile.getDefaultHoldingsMappingProfile(secondRecord.holdingsMappingProfileName, firstRecord.permanentLocation); - const secondItemMappingProfileForCreate = NewFieldMappingProfile.getDefaultItemMappingProfile(secondRecord.itemMappingProfileName); - const secondInstanceActionProfileForCreate = NewActionProfile.getDefaultInstanceActionProfile(secondRecord.instanceActionProfileName); - const secondHoldingsActionProfileForCreate = NewActionProfile.getDefaultHoldingsActionProfile(secondRecord.holdingsActionProfileName); - const secondItemActionProfileForCreate = NewActionProfile.getDefaultItemActionProfile(secondRecord.itemActionProfileName); - const secondJobProfileForCreate = NewJobProfile.getDefaultJobProfile(secondRecord.jobProfileName); - const secondTestData = [ - { mappingProfile: secondInstanceMappingProfileForCreate, - actionProfile: secondInstanceActionProfileForCreate }, - { mappingProfile: secondHoldingsMappingProfileForCreate, - actionProfile: secondHoldingsActionProfileForCreate }, - { mappingProfile: secondItemMappingProfileForCreate, - actionProfile: secondItemActionProfileForCreate }, - ]; - const exportMappingProfile = { - name: `Testing titles for import.${getRandomPostfix()}`, - holdingsTransformation: 'Holdings - HRID', - holdingsMarcField: '911', - subfieldForHoldings:'$h', - itemTransformation: 'Item - HRID', - itemMarcField:'911', - subfieldForItem:'$i' - }; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `WITH instance match item.${getRandomPostfix()}`, - itemNote: 'Add this to existing', - noteType: 'Provenance', - note: 'Acquired in 2022 from the Arceneaux Trust for Cajun History', - staffOnly: 'Unmark for all affected records' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `WITH instance match item.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `WITHOUT instance match item.${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `WITHOUT instance match item.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `WITH instance match holdings.${getRandomPostfix()}`, - adminNote: 'Purchased with grant funds for Cajun folklore materials; see item record for additional details' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `WITH instance match holdings.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `WITHOUT instance match holdings.${getRandomPostfix()}` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `WITHOUT instance match holdings.${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } - }, - ]; - const collectionOfMatchProfiles = [ - { - matchProfile: { profileName: `WITH instance match instance.${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid } - }, - { - matchProfile: { profileName: `WITH instance match holdings.${getRandomPostfix()}`, - incomingRecordFields: { - field: '911', - subfield: 'h' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.holdingsHrid } - }, - { - matchProfile: { profileName: `WITH instance match item.${getRandomPostfix()}`, - incomingRecordFields: { - field: '911', - subfield: 'i' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemHrid } - }, - { - matchProfile: { profileName: `WITHOUT instance match holdings.${getRandomPostfix()}`, - incomingRecordFields: { - field: '911', - subfield: 'h' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, - holdingsOption: NewMatchProfile.optionsList.holdingsHrid } - }, - { - matchProfile: { profileName: `WITHOUT instance match item.${getRandomPostfix()}`, - incomingRecordFields: { - field: '911', - subfield: 'i' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.ITEM, - itemOption: NewMatchProfile.optionsList.itemHrid } - } - ]; - const jobProfileWithMatch = { ...NewJobProfile.defaultJobProfile, - profileName: `WITH instance match.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - const jobProfileWithoutMatch = { ...NewJobProfile.defaultJobProfile, - profileName: `WITHOUT instance match.${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; +describe('data-import', () => { + describe('Log details', () => { + let user; + const instanceHrids = []; + 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 exportJobProfileName = `Testing titles for import.${getRandomPostfix()}`; + const marcFileForCreateFirstRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; + const marcFileForCreateSecondRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; + const csvFileNameForFirstRecord = `C375109 autotestFile${getRandomPostfix()}.csv`; + const csvFileNameForSecondRecord = `C375109 autotestFile${getRandomPostfix()}.csv`; + const marcFileNameForUpdateFirstRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; + const marcFileNameForUpdateSecondRecord = `C375109 marcFile.${getRandomPostfix()}.mrc`; + const firstRecord = { + instanceMappingProfileName: `C375109 instance mapping profile.${getRandomPostfix()}`, + holdingsMappingProfileName: `C375109 holdings mapping profile.${getRandomPostfix()}`, + permanentLocation: LOCATION_NAMES.MAIN_LIBRARY, + itemMappingProfileName: `C375109 item mapping profile.${getRandomPostfix()}`, + instanceActionProfileName: `C375109 instance action profile.${getRandomPostfix()}`, + holdingsActionProfileName: `C375109 holdings action profile.${getRandomPostfix()}`, + itemActionProfileName: `C375109 item action profile.${getRandomPostfix()}`, + jobProfileName: `C375109 job profile.${getRandomPostfix()}` + }; + const secondRecord = { + instanceMappingProfileName: `C375109 instance mapping profile.${getRandomPostfix()}`, + holdingsMappingProfileName: `C375109 holdings mapping profile.${getRandomPostfix()}`, + permanentLocation: LOCATION_NAMES.MAIN_LIBRARY, + itemMappingProfileName: `C375109 item mapping profile.${getRandomPostfix()}`, + instanceActionProfileName: `C375109 instance action profile.${getRandomPostfix()}`, + holdingsActionProfileName: `C375109 holdings action profile.${getRandomPostfix()}`, + itemActionProfileName: `C375109 item action profile.${getRandomPostfix()}`, + jobProfileName: `C375109 job profile.${getRandomPostfix()}` + }; + // profiles for creating the first record + const firstInstanceMappingProfileForCreate = NewFieldMappingProfile.getDefaultInstanceMappingProfile(firstRecord.instanceMappingProfileName); + const firstHoldingsMappingProfileForCreate = NewFieldMappingProfile.getDefaultHoldingsMappingProfile(firstRecord.holdingsMappingProfileName, firstRecord.permanentLocation); + const firstItemMappingProfileForCreate = NewFieldMappingProfile.getDefaultItemMappingProfile(firstRecord.itemMappingProfileName); + const firstInstanceActionProfileForCreate = NewActionProfile.getDefaultInstanceActionProfile(firstRecord.instanceActionProfileName); + const firstHoldingsActionProfileForCreate = NewActionProfile.getDefaultHoldingsActionProfile(firstRecord.holdingsActionProfileName); + const firstItemActionProfileForCreate = NewActionProfile.getDefaultItemActionProfile(firstRecord.itemActionProfileName); + const firstJobProfileForCreate = NewJobProfile.getDefaultJobProfile(firstRecord.jobProfileName); + const firstTestData = [ + { mappingProfile: firstInstanceMappingProfileForCreate, + actionProfile: firstInstanceActionProfileForCreate }, + { mappingProfile: firstHoldingsMappingProfileForCreate, + actionProfile: firstHoldingsActionProfileForCreate }, + { mappingProfile: firstItemMappingProfileForCreate, + actionProfile: firstItemActionProfileForCreate }, + ]; + // profiles for creating the first record + const secondInstanceMappingProfileForCreate = NewFieldMappingProfile.getDefaultInstanceMappingProfile(secondRecord.instanceMappingProfileName); + const secondHoldingsMappingProfileForCreate = NewFieldMappingProfile.getDefaultHoldingsMappingProfile(secondRecord.holdingsMappingProfileName, firstRecord.permanentLocation); + const secondItemMappingProfileForCreate = NewFieldMappingProfile.getDefaultItemMappingProfile(secondRecord.itemMappingProfileName); + const secondInstanceActionProfileForCreate = NewActionProfile.getDefaultInstanceActionProfile(secondRecord.instanceActionProfileName); + const secondHoldingsActionProfileForCreate = NewActionProfile.getDefaultHoldingsActionProfile(secondRecord.holdingsActionProfileName); + const secondItemActionProfileForCreate = NewActionProfile.getDefaultItemActionProfile(secondRecord.itemActionProfileName); + const secondJobProfileForCreate = NewJobProfile.getDefaultJobProfile(secondRecord.jobProfileName); + const secondTestData = [ + { mappingProfile: secondInstanceMappingProfileForCreate, + actionProfile: secondInstanceActionProfileForCreate }, + { mappingProfile: secondHoldingsMappingProfileForCreate, + actionProfile: secondHoldingsActionProfileForCreate }, + { mappingProfile: secondItemMappingProfileForCreate, + actionProfile: secondItemActionProfileForCreate }, + ]; + const exportMappingProfile = { + name: `Testing titles for import.${getRandomPostfix()}`, + holdingsTransformation: 'Holdings - HRID', + holdingsMarcField: '911', + subfieldForHoldings:'$h', + itemTransformation: 'Item - HRID', + itemMarcField:'911', + subfieldForItem:'$i' + }; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `WITH instance match item.${getRandomPostfix()}`, + itemNote: 'Add this to existing', + noteType: 'Provenance', + note: 'Acquired in 2022 from the Arceneaux Trust for Cajun History', + staffOnly: 'Unmark for all affected records' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `WITH instance match item.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `WITHOUT instance match item.${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `WITHOUT instance match item.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `WITH instance match holdings.${getRandomPostfix()}`, + adminNote: 'Purchased with grant funds for Cajun folklore materials; see item record for additional details' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `WITH instance match holdings.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `WITHOUT instance match holdings.${getRandomPostfix()}` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `WITHOUT instance match holdings.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + ]; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `WITH instance match instance.${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid } + }, + { + matchProfile: { profileName: `WITH instance match holdings.${getRandomPostfix()}`, + incomingRecordFields: { + field: '911', + subfield: 'h' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid } + }, + { + matchProfile: { profileName: `WITH instance match item.${getRandomPostfix()}`, + incomingRecordFields: { + field: '911', + subfield: 'i' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemHrid } + }, + { + matchProfile: { profileName: `WITHOUT instance match holdings.${getRandomPostfix()}`, + incomingRecordFields: { + field: '911', + subfield: 'h' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid } + }, + { + matchProfile: { profileName: `WITHOUT instance match item.${getRandomPostfix()}`, + incomingRecordFields: { + field: '911', + subfield: 'i' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.ITEM, + itemOption: NewMatchProfile.optionsList.itemHrid } + } + ]; + const jobProfileWithMatch = { ...NewJobProfile.defaultJobProfile, + profileName: `WITH instance match.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; + const jobProfileWithoutMatch = { ...NewJobProfile.defaultJobProfile, + profileName: `WITHOUT instance match.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - before(() => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { + before(() => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { // create the first instance - firstTestData.jobProfileForCreate = firstJobProfileForCreate; + firstTestData.jobProfileForCreate = firstJobProfileForCreate; - cy.wrap(firstTestData).each(specialPair => { - cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { - cy.addJobProfileRelation(firstTestData.jobProfileForCreate.addedRelations, idActionProfile); + cy.wrap(firstTestData).each(specialPair => { + cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { + cy.addJobProfileRelation(firstTestData.jobProfileForCreate.addedRelations, idActionProfile); + }); }); - }); - SettingsJobProfiles.createJobProfileApi(firstTestData.jobProfileForCreate) - .then((bodyWithjobProfile) => { - firstTestData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + SettingsJobProfiles.createJobProfileApi(firstTestData.jobProfileForCreate) + .then((bodyWithjobProfile) => { + firstTestData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + }); + + // upload a marc file for creating of the first 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', marcFileForCreateFirstRecord); + JobProfiles.searchJobProfileForImport(firstTestData.jobProfileForCreate.profile.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileForCreateFirstRecord); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileForCreateFirstRecord); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(firstInstanceHrId => { + instanceHrids.push(firstInstanceHrId); }); - // upload a marc file for creating of the first 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', marcFileForCreateFirstRecord); - JobProfiles.searchJobProfileForImport(firstTestData.jobProfileForCreate.profile.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileForCreateFirstRecord); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileForCreateFirstRecord); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(firstInstanceHrId => { - instanceHrids.push(firstInstanceHrId); - }); + // create the second instance + secondTestData.jobProfileForCreate = secondJobProfileForCreate; - // create the second instance - secondTestData.jobProfileForCreate = secondJobProfileForCreate; + cy.wrap(secondTestData).each(specialPair => { + cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { + cy.addJobProfileRelation(secondTestData.jobProfileForCreate.addedRelations, idActionProfile); + }); + }); + SettingsJobProfiles.createJobProfileApi(secondTestData.jobProfileForCreate) + .then((bodyWithjobProfile) => { + secondTestData.jobProfileForCreate.id = bodyWithjobProfile.body.id; + }); - cy.wrap(secondTestData).each(specialPair => { - cy.createOnePairMappingAndActionProfiles(specialPair.mappingProfile, specialPair.actionProfile).then(idActionProfile => { - cy.addJobProfileRelation(secondTestData.jobProfileForCreate.addedRelations, idActionProfile); + // upload a marc file for creating of the first 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', marcFileForCreateSecondRecord); + JobProfiles.searchJobProfileForImport(secondTestData.jobProfileForCreate.profile.name); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileForCreateSecondRecord); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileForCreateSecondRecord); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(secondInstanceHrId => { + instanceHrids.push(secondInstanceHrId); }); + cy.logout(); }); - SettingsJobProfiles.createJobProfileApi(secondTestData.jobProfileForCreate) - .then((bodyWithjobProfile) => { - secondTestData.jobProfileForCreate.id = bodyWithjobProfile.body.id; - }); - // upload a marc file for creating of the first 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', marcFileForCreateSecondRecord); - JobProfiles.searchJobProfileForImport(secondTestData.jobProfileForCreate.profile.name); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileForCreateSecondRecord); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileForCreateSecondRecord); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(secondInstanceHrId => { - instanceHrids.push(secondInstanceHrId); - }); - cy.logout(); - }); + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.dataExportEnableSettings.gui, + permissions.settingsDataImportEnabled.gui, + permissions.dataExportEnableApp.gui + ]) + .then(userProperties => { + user = userProperties; - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.dataExportEnableSettings.gui, - permissions.settingsDataImportEnabled.gui, - permissions.dataExportEnableApp.gui - ]) - .then(userProperties => { - user = userProperties; + cy.login(userProperties.username, userProperties.password); + }); + }); - cy.login(userProperties.username, userProperties.password); + after('delete test data', () => { + JobProfiles.deleteJobProfile(firstRecord.jobProfileName); + ActionProfiles.deleteActionProfile(firstRecord.instanceActionProfileName); + ActionProfiles.deleteActionProfile(firstRecord.holdingsActionProfileName); + ActionProfiles.deleteActionProfile(firstRecord.itemActionProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(firstRecord.instanceMappingProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(firstRecord.holdingsMappingProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(firstRecord.itemMappingProfileName); + JobProfiles.deleteJobProfile(secondRecord.jobProfileName); + ActionProfiles.deleteActionProfile(secondRecord.instanceActionProfileName); + ActionProfiles.deleteActionProfile(secondRecord.holdingsActionProfileName); + ActionProfiles.deleteActionProfile(secondRecord.itemActionProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(secondRecord.instanceMappingProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(secondRecord.holdingsMappingProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(secondRecord.itemMappingProfileName); + JobProfiles.deleteJobProfile(jobProfileWithMatch.profileName); + JobProfiles.deleteJobProfile(jobProfileWithoutMatch.profileName); + cy.wrap(collectionOfMatchProfiles).each(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); + }); + cy.wrap(collectionOfMappingAndActionProfiles).each(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + FileManager.deleteFile(`cypress/fixtures/${marcFileNameForUpdateFirstRecord}`); + FileManager.deleteFile(`cypress/fixtures/${marcFileNameForUpdateSecondRecord}`); + FileManager.deleteFile(`cypress/fixtures/${csvFileNameForFirstRecord}`); + FileManager.deleteFile(`cypress/fixtures/${csvFileNameForSecondRecord}`); + Users.deleteViaApi(user.userId); + cy.wrap(instanceHrids).each(hrid => { + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) + .then((instance) => { + cy.deleteItemViaApi(instance.items[0].id); + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); }); - }); - - after('delete test data', () => { - JobProfiles.deleteJobProfile(firstRecord.jobProfileName); - ActionProfiles.deleteActionProfile(firstRecord.instanceActionProfileName); - ActionProfiles.deleteActionProfile(firstRecord.holdingsActionProfileName); - ActionProfiles.deleteActionProfile(firstRecord.itemActionProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(firstRecord.instanceMappingProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(firstRecord.holdingsMappingProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(firstRecord.itemMappingProfileName); - JobProfiles.deleteJobProfile(secondRecord.jobProfileName); - ActionProfiles.deleteActionProfile(secondRecord.instanceActionProfileName); - ActionProfiles.deleteActionProfile(secondRecord.holdingsActionProfileName); - ActionProfiles.deleteActionProfile(secondRecord.itemActionProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(secondRecord.instanceMappingProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(secondRecord.holdingsMappingProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(secondRecord.itemMappingProfileName); - JobProfiles.deleteJobProfile(jobProfileWithMatch.profileName); - JobProfiles.deleteJobProfile(jobProfileWithoutMatch.profileName); - cy.wrap(collectionOfMatchProfiles).each(profile => { - MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); - }); - cy.wrap(collectionOfMappingAndActionProfiles).each(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); - FileManager.deleteFile(`cypress/fixtures/${marcFileNameForUpdateFirstRecord}`); - FileManager.deleteFile(`cypress/fixtures/${marcFileNameForUpdateSecondRecord}`); - FileManager.deleteFile(`cypress/fixtures/${csvFileNameForFirstRecord}`); - FileManager.deleteFile(`cypress/fixtures/${csvFileNameForSecondRecord}`); - Users.deleteViaApi(user.userId); - cy.wrap(instanceHrids).each(hrid => { - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) - .then((instance) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); - }); }); - }); - it('C375109 When MARC Bib job profile only involves holdings and items, verify that the record title is present in the log details (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C375109 When MARC Bib job profile only involves holdings and items, verify that the record title is present in the log details (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create Field mapping profile for export - cy.visit(SettingsMenu.exportMappingProfilePath); - ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); + cy.visit(SettingsMenu.exportMappingProfilePath); + ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); - // create job profile for export - cy.visit(SettingsMenu.exportJobProfilePath); - ExportJobProfiles.createJobProfile(exportJobProfileName, exportMappingProfile.name); + // create job profile for export + cy.visit(SettingsMenu.exportJobProfilePath); + ExportJobProfiles.createJobProfile(exportJobProfileName, exportMappingProfile.name); - // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); - NewFieldMappingProfile.addAdministrativeNote(collectionOfMappingAndActionProfiles[2].mappingProfile.adminNote, 5); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); - FieldMappingProfileView.duplicate(); - NewFieldMappingProfile.addName(collectionOfMappingAndActionProfiles[3].mappingProfile.name); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[3].mappingProfile.name); + // create mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + NewFieldMappingProfile.addAdministrativeNote(collectionOfMappingAndActionProfiles[2].mappingProfile.adminNote, 5); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfileView.duplicate(); + NewFieldMappingProfile.addName(collectionOfMappingAndActionProfiles[3].mappingProfile.name); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[3].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - NewFieldMappingProfile.addItemNotes( - `"${collectionOfMappingAndActionProfiles[0].mappingProfile.noteType}"`, - `"${collectionOfMappingAndActionProfiles[0].mappingProfile.note}"`, - collectionOfMappingAndActionProfiles[0].mappingProfile.staffOnly - ); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); - FieldMappingProfileView.duplicate(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.addItemNotes( + `"${collectionOfMappingAndActionProfiles[0].mappingProfile.noteType}"`, + `"${collectionOfMappingAndActionProfiles[0].mappingProfile.note}"`, + collectionOfMappingAndActionProfiles[0].mappingProfile.staffOnly + ); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfileView.duplicate(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - // create action profiles - cy.wrap(collectionOfMappingAndActionProfiles).each(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); + // create action profiles + cy.wrap(collectionOfMappingAndActionProfiles).each(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); - // create match profiles - cy.visit(SettingsMenu.matchProfilePath); - collectionOfMatchProfiles.forEach(profile => { - // TODO need to wait until profile will be created in loop - cy.wait(8000); - MatchProfiles.createMatchProfile(profile.matchProfile); + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + collectionOfMatchProfiles.forEach(profile => { // TODO need to wait until profile will be created in loop - cy.wait(8000); - MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); - }); + cy.wait(8000); + MatchProfiles.createMatchProfile(profile.matchProfile); + // TODO need to wait until profile will be created in loop + cy.wait(8000); + MatchProfiles.checkMatchProfilePresented(profile.matchProfile.profileName); + }); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileWithMatch); - NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); - NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[2].actionProfile.name, 2); - NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[2].matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name, 4); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileWithMatch.profileName); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileWithMatch); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[2].actionProfile.name, 2); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[2].matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name, 4); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileWithMatch.profileName); - // need to wait until the first job profile will be created - cy.wait(2500); - JobProfiles.createJobProfile(jobProfileWithoutMatch); - NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[3].matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[3].actionProfile.name); - NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[4].matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name, 2); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileWithoutMatch.profileName); + // need to wait until the first job profile will be created + cy.wait(2500); + JobProfiles.createJobProfile(jobProfileWithoutMatch); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[3].matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[3].actionProfile.name); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[4].matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name, 2); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileWithoutMatch.profileName); - // update the first record - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(csvFileNameForFirstRecord, 'SearchInstanceUUIDs*'); + // update the first record + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[0]); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(csvFileNameForFirstRecord, 'SearchInstanceUUIDs*'); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(csvFileNameForFirstRecord); - ExportFile.exportWithCreatedJobProfile(csvFileNameForFirstRecord, exportJobProfileName); - ExportFile.downloadExportedMarcFile(marcFileNameForUpdateFirstRecord); + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.uploadFile(csvFileNameForFirstRecord); + ExportFile.exportWithCreatedJobProfile(csvFileNameForFirstRecord, exportJobProfileName); + ExportFile.downloadExportedMarcFile(marcFileNameForUpdateFirstRecord); - // upload the exported marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(marcFileNameForUpdateFirstRecord); - JobProfiles.searchJobProfileForImport(jobProfileWithMatch.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForUpdateFirstRecord); - Logs.openFileDetails(marcFileNameForUpdateFirstRecord); - FileDetails.checkHoldingsQuantityInSummaryTable('1', 1); - FileDetails.checkItemQuantityInSummaryTable('1', 1); - FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.instance); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); - FileDetails.verifyTitle(instanceTitle, FileDetails.columnNameInResultList.title); + // upload the exported marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(marcFileNameForUpdateFirstRecord); + JobProfiles.searchJobProfileForImport(jobProfileWithMatch.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForUpdateFirstRecord); + Logs.openFileDetails(marcFileNameForUpdateFirstRecord); + FileDetails.checkHoldingsQuantityInSummaryTable('1', 1); + FileDetails.checkItemQuantityInSummaryTable('1', 1); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.instance); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); + FileDetails.verifyTitle(instanceTitle, FileDetails.columnNameInResultList.title); - FileDetails.openHoldingsInInventory('Updated'); - HoldingsRecordView.checkAdministrativeNote(collectionOfMappingAndActionProfiles[2].mappingProfile.adminNote); - cy.go('back'); - FileDetails.openItemInInventory('Updated'); - ItemRecordView.checkItemNote( - collectionOfMappingAndActionProfiles[0].mappingProfile.note, - 'No', - collectionOfMappingAndActionProfiles[0].mappingProfile.noteType - ); + FileDetails.openHoldingsInInventory('Updated'); + HoldingsRecordView.checkAdministrativeNote(collectionOfMappingAndActionProfiles[2].mappingProfile.adminNote); + cy.go('back'); + FileDetails.openItemInInventory('Updated'); + ItemRecordView.checkItemNote( + collectionOfMappingAndActionProfiles[0].mappingProfile.note, + 'No', + collectionOfMappingAndActionProfiles[0].mappingProfile.noteType + ); - // update the second record - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[1]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(csvFileNameForSecondRecord, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // update the second record + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[1]); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(csvFileNameForSecondRecord, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); - // download exported marc file - cy.visit(TopMenu.dataExportPath); - ExportFile.uploadFile(csvFileNameForSecondRecord); - ExportFile.exportWithCreatedJobProfile(csvFileNameForSecondRecord, exportJobProfileName); - ExportFile.downloadExportedMarcFile(marcFileNameForUpdateSecondRecord); + // download exported marc file + cy.visit(TopMenu.dataExportPath); + ExportFile.uploadFile(csvFileNameForSecondRecord); + ExportFile.exportWithCreatedJobProfile(csvFileNameForSecondRecord, exportJobProfileName); + ExportFile.downloadExportedMarcFile(marcFileNameForUpdateSecondRecord); - // upload the exported marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(marcFileNameForUpdateSecondRecord); - JobProfiles.searchJobProfileForImport(jobProfileWithoutMatch.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFileNameForUpdateSecondRecord); - Logs.openFileDetails(marcFileNameForUpdateSecondRecord); - FileDetails.checkHoldingsQuantityInSummaryTable('1', 1); - FileDetails.checkItemQuantityInSummaryTable('1', 1); - FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.instance); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); - FileDetails.verifyTitle(instanceTitle, FileDetails.columnNameInResultList.title); + // upload the exported marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadExportedFile(marcFileNameForUpdateSecondRecord); + JobProfiles.searchJobProfileForImport(jobProfileWithoutMatch.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForUpdateSecondRecord); + Logs.openFileDetails(marcFileNameForUpdateSecondRecord); + FileDetails.checkHoldingsQuantityInSummaryTable('1', 1); + FileDetails.checkItemQuantityInSummaryTable('1', 1); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.instance); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.item); + FileDetails.verifyTitle(instanceTitle, FileDetails.columnNameInResultList.title); - FileDetails.openHoldingsInInventory('Updated'); - HoldingsRecordView.checkAdministrativeNote(collectionOfMappingAndActionProfiles[2].mappingProfile.adminNote); - cy.go('back'); - FileDetails.openItemInInventory('Updated'); - ItemRecordView.checkItemNote( - collectionOfMappingAndActionProfiles[0].mappingProfile.note, - 'No', - collectionOfMappingAndActionProfiles[0].mappingProfile.noteType - ); - }); + FileDetails.openHoldingsInInventory('Updated'); + HoldingsRecordView.checkAdministrativeNote(collectionOfMappingAndActionProfiles[2].mappingProfile.adminNote); + cy.go('back'); + FileDetails.openItemInInventory('Updated'); + ItemRecordView.checkItemNote( + collectionOfMappingAndActionProfiles[0].mappingProfile.note, + 'No', + collectionOfMappingAndActionProfiles[0].mappingProfile.noteType + ); + }); + }); }); diff --git a/cypress/e2e/data-import/log-details/title-appeared-in-log-details-when-instance-is-not-updated-due-to-non-match.cy.js b/cypress/e2e/data-import/log-details/title-appeared-in-log-details-when-instance-is-not-updated-due-to-non-match.cy.js new file mode 100644 index 0000000000..4d0ce51c24 --- /dev/null +++ b/cypress/e2e/data-import/log-details/title-appeared-in-log-details-when-instance-is-not-updated-due-to-non-match.cy.js @@ -0,0 +1,123 @@ +import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import DateTools from '../../../support/utils/dateTools'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; +import { INSTANCE_STATUS_TERM_NAMES, + FOLIO_RECORD_TYPE, + ACCEPTED_DATA_TYPE_NAMES, + EXISTING_RECORDS_NAMES, + JOB_STATUS_NAMES } from '../../../support/constants'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import Users from '../../../support/fragments/users/users'; + +describe('data-import', () => { + describe('Log details', () => { + let user; + const filePathForUpload = 'oneMarcBib.mrc'; + const fileName = `C400665 autotestFileName.${getRandomPostfix()}`; + const title = '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 matchProfile = { + profileName: `C400665 982a to Instance HRID.${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + in1: '*', + in2: '*', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; + const mappingProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C400665 Update Instance - no match.${getRandomPostfix()}`, + catalogingDate: '###TODAY###', + catalogedDateUi: DateTools.getFormattedDate({ date: new Date() }), + statusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED + }; + const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C400665 Update Instance - no match.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C400665 Update Instance - no match.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); + + it('C400665 Verify that title appeared in log details when Instance is not updated due to non-match (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogingDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatusTerm); + 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 + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, 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.verifyUploadState(); + DataImport.uploadFile(filePathForUpload, fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileName); + FileDetails.verifyTitle(title, FileDetails.columnNameInResultList.title); + FileDetails.checkStatusInColumn(FileDetails.status.dash, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.instance); + // the last step can't be automated because cypress can't work whit 2 tabs + }); + }); +}); 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 2ae37897c3..610af4412b 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 @@ -11,52 +11,54 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - let instanceHrid; - const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; +describe('data-import', () => { + describe('Permissions', () => { + let user; + let instanceHrid; + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; - before('create test data', () => { - cy.getAdminToken() - .then(() => { - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); - }); + before('create test data', () => { + cy.getAdminToken() + .then(() => { + DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); + }); - cy.createTempUser([ - permissions.settingsDataImportView.gui, - permissions.uiInventoryViewInstances.gui, - permissions.remoteStorageView.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, - { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + cy.createTempUser([ + permissions.settingsDataImportView.gui, + permissions.uiInventoryViewInstances.gui, + permissions.remoteStorageView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C356780 A user can view logs but can not import files with "Data import: Can view only" permission (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - DataImport.verifyChooseFileButtonState({ isDisabled: true }); - Logs.openFileDetails(fileName); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(hrId => { - instanceHrid = hrId; + it('C356780 A user can view logs but can not import files with "Data import: Can view only" permission (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + DataImport.verifyChooseFileButtonState({ isDisabled: true }); + Logs.openFileDetails(fileName); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(hrId => { + instanceHrid = hrId; + }); + InventoryInstances.verifyInstanceDetailsView(); + cy.visit(TopMenu.dataImportPath); + Logs.openViewAllLogs(); + LogsViewAll.viewAllIsOpened(); + LogsViewAll.searchWithTerm(fileName); + LogsViewAll.openFileDetails(fileName); + FileDetails.openInstanceInInventory('Created'); + InventoryInstances.verifyInstanceDetailsView(); }); - InventoryInstances.verifyInstanceDetailsView(); - cy.visit(TopMenu.dataImportPath); - Logs.openViewAllLogs(); - LogsViewAll.viewAllIsOpened(); - LogsViewAll.searchWithTerm(fileName); - LogsViewAll.openFileDetails(fileName); - FileDetails.openInstanceInInventory('Created'); - InventoryInstances.verifyInstanceDetailsView(); - }); + }); }); diff --git a/cypress/e2e/data-import/permissions/permission-only-viewing-settings.cy.js b/cypress/e2e/data-import/permissions/permission-only-viewing-settings.cy.js index 3ccb369fb4..6cb9806013 100644 --- a/cypress/e2e/data-import/permissions/permission-only-viewing-settings.cy.js +++ b/cypress/e2e/data-import/permissions/permission-only-viewing-settings.cy.js @@ -21,88 +21,90 @@ import FileExtensions from '../../../support/fragments/settings/dataImport/fileE import MarcFieldProtection from '../../../support/fragments/settings/dataImport/marcFieldProtection'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; +describe('data-import', () => { + describe('Permissions', () => { + let user; - // profile names for creating - const mappingProfileName = `C353645_mapping_profile_${getRandomPostfix()}`; - const actionProfileName = `C353645_action_profile_${getRandomPostfix()}`; - const matchProfileName = `C353645_match_profile_${getRandomPostfix()}`; - const jobProfileName = `C353645_job_profile_${getRandomPostfix()}`; + // profile names for creating + const mappingProfileName = `C353645_mapping_profile_${getRandomPostfix()}`; + const actionProfileName = `C353645_action_profile_${getRandomPostfix()}`; + const matchProfileName = `C353645_match_profile_${getRandomPostfix()}`; + const jobProfileName = `C353645_job_profile_${getRandomPostfix()}`; - before('create test data', () => { - cy.getAdminToken(); - NewFieldMappingProfile.createMappingProfileViaApi(mappingProfileName) - .then((mappingProfileResponse) => { - NewActionProfile.createActionProfileViaApi(actionProfileName, mappingProfileResponse.body.id) - .then((actionProfileResponse) => { - NewMatchProfile.createMatchProfileViaApi(matchProfileName) - .then((matchProfileResponse) => { - NewJobProfile.createJobProfileViaApi(jobProfileName, matchProfileResponse.body.id, actionProfileResponse.body.id); - }); - }); - }); + before('create test data', () => { + cy.getAdminToken(); + NewFieldMappingProfile.createMappingProfileViaApi(mappingProfileName) + .then((mappingProfileResponse) => { + NewActionProfile.createActionProfileViaApi(actionProfileName, mappingProfileResponse.body.id) + .then((actionProfileResponse) => { + NewMatchProfile.createMatchProfileViaApi(matchProfileName) + .then((matchProfileResponse) => { + NewJobProfile.createJobProfileViaApi(jobProfileName, matchProfileResponse.body.id, actionProfileResponse.body.id); + }); + }); + }); - cy.createTempUser([ - permissions.settingsDataImportCanViewOnly.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { path: TopMenu.settingsPath, waiter: SettingsPane.waitLoading }); - }); - }); + cy.createTempUser([ + permissions.settingsDataImportCanViewOnly.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: TopMenu.settingsPath, waiter: SettingsPane.waitLoading }); + }); + }); - after('delete test data', () => { + after('delete test data', () => { // delete generated profiles - JobProfiles.deleteJobProfile(jobProfileName); - MatchProfiles.deleteMatchProfile(matchProfileName); - ActionProfiles.deleteActionProfile(actionProfileName); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileName); - Users.deleteViaApi(user.userId); - }); + JobProfiles.deleteJobProfile(jobProfileName); + MatchProfiles.deleteMatchProfile(matchProfileName); + ActionProfiles.deleteActionProfile(actionProfileName); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileName); + Users.deleteViaApi(user.userId); + }); - it('C353645 Checking the Data import UI permission for only viewing settings (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.checkListOfExistingProfilesIsDisplayed(); - JobProfiles.verifyActionMenuAbsent(); - JobProfiles.searchJobProfileForImport(jobProfileName); - JobProfiles.selectJobProfile(jobProfileName); - JobProfileView.verifyJobProfileOpened(); - JobProfileView.verifyActionMenuAbsent(); + it('C353645 Checking the Data import UI permission for only viewing settings (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.checkListOfExistingProfilesIsDisplayed(); + JobProfiles.verifyActionMenuAbsent(); + JobProfiles.searchJobProfileForImport(jobProfileName); + JobProfiles.selectJobProfile(jobProfileName); + JobProfileView.verifyJobProfileOpened(); + JobProfileView.verifyActionMenuAbsent(); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.checkListOfExistingProfilesIsDisplayed(); - MatchProfiles.verifyActionMenuAbsent(); - MatchProfiles.search(matchProfileName); - MatchProfiles.selectMatchProfileFromList(matchProfileName); - MatchProfileView.verifyMatchProfileOpened(); - MatchProfiles.verifyActionMenuAbsent(matchProfileName); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.checkListOfExistingProfilesIsDisplayed(); + MatchProfiles.verifyActionMenuAbsent(); + MatchProfiles.search(matchProfileName); + MatchProfiles.selectMatchProfileFromList(matchProfileName); + MatchProfileView.verifyMatchProfileOpened(); + MatchProfiles.verifyActionMenuAbsent(matchProfileName); - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.checkListOfExistingProfilesIsDisplayed(); - ActionProfiles.verifyActionMenuAbsent(); - ActionProfiles.search(actionProfileName); - ActionProfiles.selectActionProfileFromList(actionProfileName); - ActionProfileView.verifyActionProfileOpened(); - ActionProfileView.verifyActionMenuAbsent(); + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.checkListOfExistingProfilesIsDisplayed(); + ActionProfiles.verifyActionMenuAbsent(); + ActionProfiles.search(actionProfileName); + ActionProfiles.selectActionProfileFromList(actionProfileName); + ActionProfileView.verifyActionProfileOpened(); + ActionProfileView.verifyActionMenuAbsent(); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.checkListOfExistingProfilesIsDisplayed(); - FieldMappingProfiles.verifyActionMenuAbsent(); - FieldMappingProfiles.search(mappingProfileName); - FieldMappingProfiles.selectMappingProfileFromList(mappingProfileName); - FieldMappingProfileView.verifyMappingProfileOpened(); - FieldMappingProfileView.verifyActionMenuAbsent(); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.checkListOfExistingProfilesIsDisplayed(); + FieldMappingProfiles.verifyActionMenuAbsent(); + FieldMappingProfiles.search(mappingProfileName); + FieldMappingProfiles.selectMappingProfileFromList(mappingProfileName); + FieldMappingProfileView.verifyMappingProfileOpened(); + FieldMappingProfileView.verifyActionMenuAbsent(); - cy.visit(SettingsMenu.fileExtensionsPath); - FileExtensions.verifyListOfExistingFileExtensionsIsDisplayed(); - FileExtensions.verifyActionMenuAbsent(); - FileExtensions.select(); - FileExtensions.verifyActionMenuOnViewPaneAbsent(); + cy.visit(SettingsMenu.fileExtensionsPath); + FileExtensions.verifyListOfExistingFileExtensionsIsDisplayed(); + FileExtensions.verifyActionMenuAbsent(); + FileExtensions.select(); + FileExtensions.verifyActionMenuOnViewPaneAbsent(); - cy.visit(SettingsMenu.marcFieldProtectionPath); - MarcFieldProtection.checkListOfExistingProfilesIsDisplayed(); - MarcFieldProtection.verifyNewButtonAbsent(); - }); + cy.visit(SettingsMenu.marcFieldProtectionPath); + MarcFieldProtection.checkListOfExistingProfilesIsDisplayed(); + MarcFieldProtection.verifyNewButtonAbsent(); + }); + }); }); 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 6ad5ea23a7..58d4edf0be 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 @@ -10,39 +10,41 @@ import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll import Users from '../../../support/fragments/users/users'; import { JOB_STATUS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const fileName = `C353641 autotestFile.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Permissions', () => { + let user; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const fileName = `C353641 autotestFile.${getRandomPostfix()}.mrc`; - before('create test data', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - }); - }); + before('create test data', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + }); - it('C353641 A user can not delete import logs with standard Data import: Can upload files, import, and view logs permission (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + it('C353641 A user can not delete import logs with standard Data import: Can upload files, import, and view logs permission (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('oneMarcBib.mrc', fileName); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.verifyCheckboxForMarkingLogsAbsent(); - Logs.actionsButtonClick(); - Logs.verifyDeleteSelectedLogsButtonAbsent(); - Logs.viewAllLogsButtonClick(); - LogsViewAll.viewAllIsOpened(); - LogsViewAll.verifyCheckboxForMarkingLogsAbsent(); - }); + DataImport.verifyUploadState(); + DataImport.uploadFile('oneMarcBib.mrc', fileName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.verifyCheckboxForMarkingLogsAbsent(); + Logs.actionsButtonClick(); + Logs.verifyDeleteSelectedLogsButtonAbsent(); + Logs.viewAllLogsButtonClick(); + LogsViewAll.viewAllIsOpened(); + LogsViewAll.verifyCheckboxForMarkingLogsAbsent(); + }); + }); }); 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 b1b3a83433..91eb5f5c21 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 @@ -22,131 +22,133 @@ 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 firstUser; - let secondUser; - const quantityOfItems = '1'; - const nameMarcFile = `C356841autotestFile.${getRandomPostfix()}.mrc`; - const collectionOfMappingAndActionProfiles = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356841 holdings mapping profile ${getRandomPostfix()}}`, - pernanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356841 holdings action profile ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - 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 ${getRandomPostfix()}` } - } - ]; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C356841 job profile ${getRandomPostfix()}}` - }; +describe('data-import', () => { + describe('Permissions', () => { + let firstUser; + let secondUser; + const quantityOfItems = '1'; + const nameMarcFile = `C356841autotestFile.${getRandomPostfix()}.mrc`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356841 holdings mapping profile ${getRandomPostfix()}}`, + pernanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C356841 holdings action profile ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + 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 ${getRandomPostfix()}` } + } + ]; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C356841 job profile ${getRandomPostfix()}}` + }; - before('create test data', () => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - firstUser = userProperties; - }); + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + firstUser = userProperties; + }); - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportCanViewOnly.gui - ]) - .then(userProperties => { - secondUser = userProperties; - }); - }); + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportCanViewOnly.gui + ]) + .then(userProperties => { + secondUser = userProperties; + }); + }); - after(() => { - Users.deleteViaApi(firstUser.userId); - Users.deleteViaApi(secondUser.userId); - // delete generated profiles - JobProfiles.deleteJobProfile(jobProfile.profileName); - collectionOfMappingAndActionProfiles.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + after(() => { + Users.deleteViaApi(firstUser.userId); + Users.deleteViaApi(secondUser.userId); + // delete generated profiles + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); }); - }); - it('C356841 Confirm a user with limited Data Import permissions can import a file (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - cy.login(firstUser.username, firstUser.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - // create mapping profiles - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[1].mappingProfile.materialType); - NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLoanType); - NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[1].mappingProfile.status); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + it('C356841 Confirm a user with limited Data Import permissions can import a file (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.login(firstUser.username, firstUser.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + // create mapping profiles + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[1].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[1].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[0].mappingProfile.pernanentLocation); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[0].mappingProfile.pernanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].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 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('Default - Create instance'); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); - NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.logout(); - cy.login(secondUser.username, secondUser.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - FieldMappingProfiles.checkListOfExistingProfilesIsDisplayed(); - FieldMappingProfiles.verifyActionMenuAbsent(); - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.checkListOfExistingProfilesIsDisplayed(); - ActionProfiles.verifyActionMenuAbsent(); - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.checkListOfExistingProfilesIsDisplayed(); - MatchProfiles.verifyActionMenuAbsent(); - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.checkListOfExistingProfilesIsDisplayed(); - JobProfiles.verifyActionMenuAbsent(); - cy.visit(SettingsMenu.fileExtensionsPath); - FileExtensions.verifyListOfExistingFileExtensionsIsDisplayed(); - FileExtensions.verifyActionMenuAbsent(); + cy.logout(); + cy.login(secondUser.username, secondUser.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + FieldMappingProfiles.checkListOfExistingProfilesIsDisplayed(); + FieldMappingProfiles.verifyActionMenuAbsent(); + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.checkListOfExistingProfilesIsDisplayed(); + ActionProfiles.verifyActionMenuAbsent(); + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.checkListOfExistingProfilesIsDisplayed(); + MatchProfiles.verifyActionMenuAbsent(); + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.checkListOfExistingProfilesIsDisplayed(); + JobProfiles.verifyActionMenuAbsent(); + cy.visit(SettingsMenu.fileExtensionsPath); + FileExtensions.verifyListOfExistingFileExtensionsIsDisplayed(); + FileExtensions.verifyActionMenuAbsent(); - 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(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFile); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFile); - [FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - FileDetails.columnNameInResultList.holdings, - FileDetails.columnNameInResultList.item - ].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + 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(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFile); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFile); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + FileDetails.columnNameInResultList.item + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkItemQuantityInSummaryTable(quantityOfItems); }); - FileDetails.checkItemQuantityInSummaryTable(quantityOfItems); - }); + }); }); 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 fdb9fa2db6..77ebb75596 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 @@ -11,53 +11,55 @@ import FieldMappingProfileView from '../../../support/fragments/data_import/mapp import ActionProfileEdit from '../../../support/fragments/data_import/action_profiles/actionProfileEdit'; import ConfirmRemoval from '../../../support/fragments/data_import/action_profiles/modals/confirmRemoval'; -describe('ui-data-import', () => { - const mappingProfile = { - name: `C11115 autotest mapping profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE - }; - - const actionProfile = { - name: `C11115 autotest action profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE - }; - - before('login', () => { - cy.loginAsAdmin(); - cy.getAdminToken(); - }); +describe('data-import', () => { + describe('Settings', () => { + const mappingProfile = { + name: `C11115 autotest mapping profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE + }; - after('delete test data', () => { - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - }); + const actionProfile = { + name: `C11115 autotest action profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE + }; + + before('login', () => { + cy.loginAsAdmin(); + cy.getAdminToken(); + }); + + after('delete test data', () => { + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); + + it('C11115 Attach/Remove a field mapping profile to an action profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + ActionProfileView.verifyLinkedFieldMappingProfile(mappingProfile.name); + ActionProfileView.openFieldMappingProfileView(); + FieldMappingProfileView.verifyLinkedActionProfile(actionProfile.name); + FieldMappingProfileView.openAssociatedActionProfile(); + ActionProfiles.verifyActionProfileOpened(); - it('C11115 Attach/Remove a field mapping profile to an action profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); - - ActionProfileView.verifyLinkedFieldMappingProfile(mappingProfile.name); - ActionProfileView.openFieldMappingProfileView(); - FieldMappingProfileView.verifyLinkedActionProfile(actionProfile.name); - FieldMappingProfileView.openAssociatedActionProfile(); - ActionProfiles.verifyActionProfileOpened(); - - ActionProfileView.edit(); - ActionProfileEdit.unlinkFieldMappingProfile(); - ConfirmRemoval.cancelRemoveFieldMappingProfile(); - ActionProfileEdit.fieldMappingProfilePresented(mappingProfile.name); - ActionProfileEdit.unlinkFieldMappingProfile(); - ConfirmRemoval.confirmRemovefieldMappingProfile(); - ActionProfileEdit.fieldMappingProfileAbsent(); - ActionProfileEdit.save(); - ActionProfileView.verifyLinkedFieldMappingProfileAbsent(mappingProfile.name); + ActionProfileView.edit(); + ActionProfileEdit.unlinkFieldMappingProfile(); + ConfirmRemoval.cancelRemoveFieldMappingProfile(); + ActionProfileEdit.fieldMappingProfilePresented(mappingProfile.name); + ActionProfileEdit.unlinkFieldMappingProfile(); + ConfirmRemoval.confirmRemovefieldMappingProfile(); + ActionProfileEdit.fieldMappingProfileAbsent(); + ActionProfileEdit.save(); + ActionProfileView.verifyLinkedFieldMappingProfileAbsent(mappingProfile.name); + }); }); }); 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 0b5faf28f7..5ee3ffc593 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 @@ -14,70 +14,72 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; import ConfirmChanges from '../../../support/fragments/data_import/action_profiles/modals/confirmChanges'; -describe('ui-data-import', () => { - let user; - const mappingProfile = { - name: `C367994 autotest mapping profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C367994 autotest action profile ${getRandomPostfix()}` - }; - const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C367994 autotest job profile${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; +describe('data-import', () => { + describe('Settings', () => { + let user; + const mappingProfile = { + name: `C367994 autotest mapping profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C367994 autotest action profile ${getRandomPostfix()}` + }; + const jobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `C367994 autotest job profile${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; - before('create user', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + before('create user', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - // create Field mapping profile - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - FieldMappingProfiles.saveProfile(); + // create Field mapping profile + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + FieldMappingProfiles.saveProfile(); - // create Action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create Action 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - }); - }); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - JobProfiles.deleteJobProfile(jobProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); - it('C367994 Edit an existing action profile with associated job profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.checkListOfExistingProfilesIsDisplayed(); - ActionProfiles.search(actionProfile.name); - ActionProfiles.verifyActionProfileOpened(actionProfile.name); - ActionProfileView.edit(); - ActionProfileEdit.verifyScreenName(actionProfile.name); - ActionProfileEdit.changeAction(); - ActionProfileEdit.save(); - ConfirmChanges.cancelChanges(); - ActionProfileEdit.verifyScreenName(actionProfile.name); - ActionProfileEdit.changesNotSaved(); - ActionProfileEdit.save(); - ConfirmChanges.confirmChanges(); - ActionProfiles.checkListOfExistingProfilesIsDisplayed(); - ActionProfiles.checkCalloutMessage(actionProfile.name); - ActionProfileView.verifyAction(); + it('C367994 Edit an existing action profile with associated job profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.checkListOfExistingProfilesIsDisplayed(); + ActionProfiles.search(actionProfile.name); + ActionProfiles.verifyActionProfileOpened(actionProfile.name); + ActionProfileView.edit(); + ActionProfileEdit.verifyScreenName(actionProfile.name); + ActionProfileEdit.changeAction(); + ActionProfileEdit.save(); + ConfirmChanges.cancelChanges(); + ActionProfileEdit.verifyScreenName(actionProfile.name); + ActionProfileEdit.changesNotSaved(); + ActionProfileEdit.save(); + ConfirmChanges.confirmChanges(); + ActionProfiles.checkListOfExistingProfilesIsDisplayed(); + ActionProfiles.checkCalloutMessage(actionProfile.name); + ActionProfileView.verifyAction(); + }); }); }); 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 37e2b188cf..5709299e04 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 @@ -10,42 +10,44 @@ import Users from '../../../support/fragments/users/users'; import ActionProfileEdit from '../../../support/fragments/data_import/action_profiles/actionProfileEdit'; import ActionProfileView from '../../../support/fragments/data_import/action_profiles/actionProfileView'; -describe('ui-data-import', () => { - let user; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C2348 autotest action profile ${getRandomPostfix()}` - }; +describe('data-import', () => { + describe('Settings', () => { + let user; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C2348 autotest action profile ${getRandomPostfix()}` + }; - before('create user', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { path: SettingsMenu.actionProfilePath, waiter: ActionProfiles.waitLoading }); + before('create user', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: SettingsMenu.actionProfilePath, waiter: ActionProfiles.waitLoading }); - ActionProfiles.createWithoutLinkedMappingProfile(actionProfile); - InteractorsTools.closeCalloutMessage(); - ActionProfileView.closeViewModeForMatchProfile(); - }); - }); + ActionProfiles.createWithoutLinkedMappingProfile(actionProfile); + InteractorsTools.closeCalloutMessage(); + ActionProfileView.closeViewModeForMatchProfile(); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - ActionProfiles.deleteActionProfile(actionProfile.name); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + ActionProfiles.deleteActionProfile(actionProfile.name); + }); - it('C2348 Edit an existing action profile without associated job profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - ActionProfiles.checkListOfExistingProfilesIsDisplayed(); - ActionProfiles.search(actionProfile.name); - ActionProfiles.verifyActionProfileOpened(actionProfile.name); - ActionProfileView.edit(); - ActionProfileEdit.verifyScreenName(actionProfile.name); - ActionProfileEdit.changeAction(); - ActionProfileEdit.save(); - ActionProfiles.checkListOfExistingProfilesIsDisplayed(); - ActionProfiles.checkCalloutMessage(actionProfile.name); - ActionProfileView.verifyAction(); + it('C2348 Edit an existing action profile without associated job profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + ActionProfiles.checkListOfExistingProfilesIsDisplayed(); + ActionProfiles.search(actionProfile.name); + ActionProfiles.verifyActionProfileOpened(actionProfile.name); + ActionProfileView.edit(); + ActionProfileEdit.verifyScreenName(actionProfile.name); + ActionProfileEdit.changeAction(); + ActionProfileEdit.save(); + ActionProfiles.checkListOfExistingProfilesIsDisplayed(); + ActionProfiles.checkCalloutMessage(actionProfile.name); + ActionProfileView.verifyAction(); + }); }); }); diff --git a/cypress/e2e/data-import/settings/edit-existing-job-profile-adding-long-name.cy.js b/cypress/e2e/data-import/settings/edit-existing-job-profile-adding-long-name.cy.js index 59b3acd5b6..efe60dedbb 100644 --- a/cypress/e2e/data-import/settings/edit-existing-job-profile-adding-long-name.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-job-profile-adding-long-name.cy.js @@ -9,39 +9,41 @@ import JobProfileView from '../../../support/fragments/data_import/job_profiles/ import JobProfileEdit from '../../../support/fragments/data_import/job_profiles/jobProfileEdit'; import { ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - const jobProfileLongName = `C2332_autotest_job_profile_long_name_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}`; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C2332 autotest job profile ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; +describe('data-import', () => { + describe('Settings', () => { + const jobProfileLongName = `C2332_autotest_job_profile_long_name_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}_${getRandomPostfix()}`; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C2332 autotest job profile ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test data', () => { - cy.loginAsAdmin(); - cy.getAdminToken(); + before('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken(); - // create Job profiles - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.saveAndClose(); - InteractorsTools.closeCalloutMessage(); - JobProfiles.closeJobProfile(jobProfile.profileName); - }); + // create Job profiles + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.saveAndClose(); + InteractorsTools.closeCalloutMessage(); + JobProfiles.closeJobProfile(jobProfile.profileName); + }); - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfileLongName); - }); + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfileLongName); + }); - it('C2332 Edit an existing job profile by adding a long name (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - JobProfiles.checkListOfExistingProfilesIsDisplayed(); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfileView.edit(); - JobProfileEdit.verifyScreenName(jobProfile.profileName); - JobProfileEdit.changeProfileName(jobProfileLongName); - JobProfileEdit.saveAndClose(); - JobProfileView.verifyJobProfileOpened(); - JobProfileView.verifyJobProfileName(jobProfileLongName); - JobProfiles.checkCalloutMessage(jobProfileLongName); + it('C2332 Edit an existing job profile by adding a long name (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + JobProfiles.checkListOfExistingProfilesIsDisplayed(); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfileView.edit(); + JobProfileEdit.verifyScreenName(jobProfile.profileName); + JobProfileEdit.changeProfileName(jobProfileLongName); + JobProfileEdit.saveAndClose(); + JobProfileView.verifyJobProfileOpened(); + JobProfileView.verifyJobProfileName(jobProfileLongName); + JobProfiles.checkCalloutMessage(jobProfileLongName); + }); }); }); 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 ad5da61e0f..40061bc846 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 @@ -11,43 +11,45 @@ import FieldMappingProfileEdit from '../../../support/fragments/data_import/mapp import InteractorsTools from '../../../support/utils/interactorsTools'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - const mappingProfile = { - name: `C2351 autotest mapping profile ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE - }; - const instanceStatusTerm = '"Batch Loaded"'; +describe('data-import', () => { + describe('Settings', () => { + let user; + const mappingProfile = { + name: `C2351 autotest mapping profile ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE + }; + const instanceStatusTerm = '"Batch Loaded"'; - before('create test data', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + before('create test data', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - // create field mapping profile - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - FieldMappingProfiles.saveProfile(); - InteractorsTools.closeCalloutMessage(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - }); - }); + // create field mapping profile + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + FieldMappingProfiles.saveProfile(); + InteractorsTools.closeCalloutMessage(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); - it('C2351 Edit an existing field mapping profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - FieldMappingProfiles.search(mappingProfile.name); - FieldMappingProfileView.editMappingProfile(); - FieldMappingProfileEdit.verifyScreenName(mappingProfile.name); - FieldMappingProfileEdit.fillInstanceStatusTerm(instanceStatusTerm); - FieldMappingProfileEdit.save(); - FieldMappingProfileView.checkCalloutMessage(mappingProfile.name); - FieldMappingProfileView.verifyInstanceStatusTerm(instanceStatusTerm); + it('C2351 Edit an existing field mapping profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + FieldMappingProfiles.search(mappingProfile.name); + FieldMappingProfileView.editMappingProfile(); + FieldMappingProfileEdit.verifyScreenName(mappingProfile.name); + FieldMappingProfileEdit.fillInstanceStatusTerm(instanceStatusTerm); + FieldMappingProfileEdit.save(); + FieldMappingProfileView.checkCalloutMessage(mappingProfile.name); + FieldMappingProfileView.verifyInstanceStatusTerm(instanceStatusTerm); + }); }); }); 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 34ec6d338a..527e9e65dd 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 @@ -11,48 +11,50 @@ import MatchProfileEdit from '../../../support/fragments/data_import/match_profi import InteractorsTools from '../../../support/utils/interactorsTools'; import { EXISTING_RECORDS_NAMES } from '../../../support/constants'; -describe('ui-data-import', () => { - let user; - const matchProfile = { - profileName: `C2339 autotest MatchProf${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid - }; +describe('data-import', () => { + describe('Settings', () => { + let user; + const matchProfile = { + profileName: `C2339 autotest MatchProf${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; - before('create test data', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password); + before('create test data', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - InteractorsTools.closeCalloutMessage(); - MatchProfileView.closeViewModeForMatchProfile(); - }); - }); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + InteractorsTools.closeCalloutMessage(); + MatchProfileView.closeViewModeForMatchProfile(); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + }); - it('C2339 Edit an existing match profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - MatchProfiles.checkListOfExistingProfilesIsDisplayed(); - MatchProfiles.search(matchProfile.profileName); - MatchProfiles.selectMatchProfileFromList(matchProfile.profileName); - MatchProfileView.edit(); - MatchProfileEdit.verifyScreenName(matchProfile.profileName); - MatchProfileEdit.changeExistingInstanceRecordField(); - MatchProfileEdit.save(); - MatchProfiles.checkCalloutMessage(matchProfile.profileName); - MatchProfileView.verifyExistingInstanceRecordField(); + it('C2339 Edit an existing match profile (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + MatchProfiles.checkListOfExistingProfilesIsDisplayed(); + MatchProfiles.search(matchProfile.profileName); + MatchProfiles.selectMatchProfileFromList(matchProfile.profileName); + MatchProfileView.edit(); + MatchProfileEdit.verifyScreenName(matchProfile.profileName); + MatchProfileEdit.changeExistingInstanceRecordField(); + MatchProfileEdit.save(); + MatchProfiles.checkCalloutMessage(matchProfile.profileName); + MatchProfileView.verifyExistingInstanceRecordField(); + }); }); }); diff --git a/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js b/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js index 8c362b3bde..7a04d7d3bd 100644 --- a/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js +++ b/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js @@ -23,266 +23,268 @@ import FieldMappingProfileView from '../../../support/fragments/data_import/mapp import FieldMappingProfileEdit from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfileEdit'; import Orders from '../../../support/fragments/orders/orders'; -describe('ui-data-import', () => { - let user; - const orderNumbers = []; - const filePathForCreateOrder = 'marcFileForC376975.mrc'; - const firstMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; - const secondMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; - const thirdMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; - const forthMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; - const fundAndExpenseClassData = [ - { - fund: 'History(HIST)', - expenseClass: 'No value set-', - value: '100%', - amount: '$19.95' - }, - { - fund: 'African History(AFRICAHIST)', - expenseClass: 'Electronic', - value: '100%', - amount: '$19.95' - } - ]; - const dataForChangeFundAndExpenseClass = [ - { +describe('data-import', () => { + describe('Settings', () => { + let user; + const orderNumbers = []; + const filePathForCreateOrder = 'marcFileForC376975.mrc'; + const firstMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; + const secondMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; + const thirdMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; + const forthMarcFileName = `C376975 autotestFileName ${getRandomPostfix()}`; + const fundAndExpenseClassData = [ + { + fund: 'History(HIST)', + expenseClass: 'No value set-', + value: '100%', + amount: '$19.95' + }, + { + fund: 'African History(AFRICAHIST)', + expenseClass: 'Electronic', + value: '100%', + amount: '$19.95' + } + ]; + const dataForChangeFundAndExpenseClass = [ + { + fundId: '981$b', + expenseClass: '"Electronic (Elec)"', + value: '100' + }, + { + fundId: '982$b; else "History (HIST)"', + expenseClass: '982$c', + value: '100' + }, + { + fundId: '"African History (AFRICAHIST)"', + expenseClass: '982$c; else "Electronic (Elec)"', + value: '100' + } + ]; + const mappingProfile = { + name: `C376975 Check fund & expense class mappings in Orders ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.ORDER, + orderStatus: ORDER_STATUSES.PENDING, + approved: true, + vendor: VENDOR_NAMES.GOBI, + title: '245$a', + publicationDate: '264$c; else 260$c', + publisher: '264$b; else 260$b', + internalNote: '981$d', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, + selector: '981$e', + receivingWorkflow: 'Synchronized', + physicalUnitPrice: '980$b', + quantityPhysical: '980$g', + currency: 'USD', + createInventory: 'None', + contributor: '100$a', + contributorType: 'Personal name', + productId: '028$a " " 028$b', + productIDType: 'Publisher or distributor number', + vendorReferenceNumber: '980$f', + vendorReferenceType: 'Vendor order reference number', fundId: '981$b', - expenseClass: '"Electronic (Elec)"', - value: '100' - }, - { - fundId: '982$b; else "History (HIST)"', - expenseClass: '982$c', - value: '100' - }, - { - fundId: '"African History (AFRICAHIST)"', - expenseClass: '982$c; else "Electronic (Elec)"', - value: '100' - } - ]; - const mappingProfile = { - name: `C376975 Check fund & expense class mappings in Orders ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.ORDER, - orderStatus: ORDER_STATUSES.PENDING, - approved: true, - vendor: VENDOR_NAMES.GOBI, - title: '245$a', - publicationDate: '264$c; else 260$c', - publisher: '264$b; else 260$b', - internalNote: '981$d', - acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, - orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, - selector: '981$e', - receivingWorkflow: 'Synchronized', - physicalUnitPrice: '980$b', - quantityPhysical: '980$g', - currency: 'USD', - createInventory: 'None', - contributor: '100$a', - contributorType: 'Personal name', - productId: '028$a " " 028$b', - productIDType: 'Publisher or distributor number', - vendorReferenceNumber: '980$f', - vendorReferenceType: 'Vendor order reference number', - fundId: '981$b', - expenseClass: '981$c', - value: '100', - type: '%' - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.ORDER, - name: `C376975 Check fund & expense class mappings in Orders ${getRandomPostfix()}` - }; - const jobProfile = { - ...NewJobProfile.defaultJobProfile, - profileName: `C376975 Check fund & expense class mappings in Orders ${getRandomPostfix()}`, - }; + expenseClass: '981$c', + value: '100', + type: '%' + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C376975 Check fund & expense class mappings in Orders ${getRandomPostfix()}` + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C376975 Check fund & expense class mappings in Orders ${getRandomPostfix()}`, + }; - before('login', () => { - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.moduleDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrganizationsView.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(userProperties.username, userProperties.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); - cy.wrap(orderNumbers).each(number => { - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${number}"` }) - .then(orderId => { - Orders.deleteOrderViaApi(orderId[0].id); + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrganizationsView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); }); }); - }); - it('C376975 Order field mapping profile: Check fund and expense class mappings (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + cy.wrap(orderNumbers).each(number => { + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${number}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); + }); + }); + }); + + it('C376975 Order field mapping profile: Check fund and expense class mappings (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // create mapping profile - FieldMappingProfiles.createOrderMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + FieldMappingProfiles.createOrderMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create action 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.linkActionProfile(actionProfile); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + 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(filePathForCreateOrder, firstMarcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(firstMarcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(firstMarcFileName); - // check Fund and Expense class populated in the first POL - FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, firstMarcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(firstMarcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(firstMarcFileName); + // check Fund and Expense class populated in the first POL + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); - }); - OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[0]); - cy.go('back'); - // check Fund and Expense class populated in the second POL - FileDetails.openOrder('Created', 1); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); + orderNumbers.push(orderNumber); + }); + OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[0]); + cy.go('back'); + // check Fund and Expense class populated in the second POL + FileDetails.openOrder('Created', 1); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); - }); - OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); + orderNumbers.push(orderNumber); + }); + OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.search(mappingProfile.name); - FieldMappingProfileView.editMappingProfile(); - FieldMappingProfileEdit.fillFundDistriction(dataForChangeFundAndExpenseClass[0]); - FieldMappingProfileEdit.save(); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.search(mappingProfile.name); + FieldMappingProfileView.editMappingProfile(); + FieldMappingProfileEdit.fillFundDistriction(dataForChangeFundAndExpenseClass[0]); + FieldMappingProfileEdit.save(); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForCreateOrder, secondMarcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(secondMarcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); - Logs.openFileDetails(secondMarcFileName); - FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.order); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, 1); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, secondMarcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(secondMarcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); + Logs.openFileDetails(secondMarcFileName); + FileDetails.checkStatusInColumn(FileDetails.status.noAction, FileDetails.columnNameInResultList.order); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, 1); - // check Fund and Expense class populated in the second POL - FileDetails.openOrder('Created', 1); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); + // check Fund and Expense class populated in the second POL + FileDetails.openOrder('Created', 1); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); - }); - OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); + orderNumbers.push(orderNumber); + }); + OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.search(mappingProfile.name); - FieldMappingProfileView.editMappingProfile(); - FieldMappingProfileEdit.fillFundDistriction(dataForChangeFundAndExpenseClass[1]); - FieldMappingProfileEdit.save(); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.search(mappingProfile.name); + FieldMappingProfileView.editMappingProfile(); + FieldMappingProfileEdit.fillFundDistriction(dataForChangeFundAndExpenseClass[1]); + FieldMappingProfileEdit.save(); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForCreateOrder, thirdMarcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(thirdMarcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(thirdMarcFileName); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, 1); - // check Fund and Expense class populated in the first POL - FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, thirdMarcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(thirdMarcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(thirdMarcFileName); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, 1); + // check Fund and Expense class populated in the first POL + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); - }); - OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[0]); - cy.go('back'); - // check Fund and Expense class populated in the second POL - FileDetails.openOrder('Created', 1); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); + orderNumbers.push(orderNumber); + }); + OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[0]); + cy.go('back'); + // check Fund and Expense class populated in the second POL + FileDetails.openOrder('Created', 1); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); - }); - OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[0]); + orderNumbers.push(orderNumber); + }); + OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[0]); - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.search(mappingProfile.name); - FieldMappingProfileView.editMappingProfile(); - FieldMappingProfileEdit.fillFundDistriction(dataForChangeFundAndExpenseClass[2]); - FieldMappingProfileEdit.save(); + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.search(mappingProfile.name); + FieldMappingProfileView.editMappingProfile(); + FieldMappingProfileEdit.fillFundDistriction(dataForChangeFundAndExpenseClass[2]); + FieldMappingProfileEdit.save(); - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathForCreateOrder, forthMarcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(forthMarcFileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(forthMarcFileName); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, 1); - // check Fund and Expense class populated in the first POL - FileDetails.openOrder('Created'); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForCreateOrder, forthMarcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(forthMarcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(forthMarcFileName); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.order, 1); + // check Fund and Expense class populated in the first POL + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); - }); - OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); - cy.go('back'); - // check Fund and Expense class populated in the second POL - FileDetails.openOrder('Created', 1); - OrderLines.waitLoading(); - OrderLines.getAssignedPOLNumber() - .then(initialNumber => { - const orderNumber = initialNumber.replace('-1', ''); + orderNumbers.push(orderNumber); + }); + OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); + cy.go('back'); + // check Fund and Expense class populated in the second POL + FileDetails.openOrder('Created', 1); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber() + .then(initialNumber => { + const orderNumber = initialNumber.replace('-1', ''); - orderNumbers.push(orderNumber); - }); - OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); - }); + orderNumbers.push(orderNumber); + }); + OrderLines.checkFundAndExpenseClassPopulated(fundAndExpenseClassData[1]); + }); + }); }); 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 c37102d84e..9ceaf73bb3 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 @@ -8,75 +8,77 @@ 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 ${getRandomPostfix()}`; +describe('data-import', () => { + describe('Settings', () => { + let user = null; + const mappingProfileName = `C343284 invoice mapping profile ${getRandomPostfix()}`; - before('login', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiOrganizationsView.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiOrganizationsView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); + cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); - after('delete user', () => { - Users.deleteViaApi(user.userId); - }); + after('delete user', () => { + Users.deleteViaApi(user.userId); + }); - it('C343284 Make some of the fields on the Invoice field mapping profile required (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - FieldMappingProfiles.checkListOfExistingProfilesIsDisplayed(); - FieldMappingProfiles.openNewMappingProfileForm(); - FieldMappingProfiles.checkNewMappingProfileFormIsOpened(); + it('C343284 Make some of the fields on the Invoice field mapping profile required (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + FieldMappingProfiles.checkListOfExistingProfilesIsDisplayed(); + FieldMappingProfiles.openNewMappingProfileForm(); + FieldMappingProfiles.checkNewMappingProfileFormIsOpened(); - NewFieldMappingProfile.addName(mappingProfileName); - NewFieldMappingProfile.addIncomingRecordType('EDIFACT invoice'); - NewFieldMappingProfile.addFolioRecordType('Invoice'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Batch group*'); + NewFieldMappingProfile.addName(mappingProfileName); + NewFieldMappingProfile.addIncomingRecordType('EDIFACT invoice'); + NewFieldMappingProfile.addFolioRecordType('Invoice'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Batch group*'); - NewFieldMappingProfile.fillBatchGroup('"FOLIO"'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Vendor invoice number*'); + NewFieldMappingProfile.fillBatchGroup('"FOLIO"'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Vendor invoice number*'); - NewFieldMappingProfile.fillVendorInvoiceNumber('123'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Payment method*'); + NewFieldMappingProfile.fillVendorInvoiceNumber('123'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Payment method*'); - NewFieldMappingProfile.fillPaymentMethod('"Cash"'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Currency*'); + NewFieldMappingProfile.fillPaymentMethod('"Cash"'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Currency*'); - NewFieldMappingProfile.fillCurrency('"USD"'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Description*'); + NewFieldMappingProfile.fillCurrency('"USD"'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Description*'); - NewFieldMappingProfile.fillDescription('abc'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Quantity*'); + NewFieldMappingProfile.fillDescription('abc'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Quantity*'); - NewFieldMappingProfile.fillQuantity('1'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Sub-total*'); + NewFieldMappingProfile.fillQuantity('1'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Sub-total*'); - NewFieldMappingProfile.fillSubTotal('10.00'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Vendor name*'); + NewFieldMappingProfile.fillSubTotal('10.00'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Vendor name*'); - NewFieldMappingProfile.fillVendorName('EBSCO'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfileView.checkErrorMessageIsPresented('Invoice date*'); - NewFieldMappingProfile.fillInvoiceDate('###TODAY###'); - NewFieldMappingProfile.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfileName); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfileName); + NewFieldMappingProfile.fillVendorName('EBSCO'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfileView.checkErrorMessageIsPresented('Invoice date*'); + NewFieldMappingProfile.fillInvoiceDate('###TODAY###'); + NewFieldMappingProfile.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfileName); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfileName); - FieldMappingProfileView.deleteMappingProfile(mappingProfileName); - }); + FieldMappingProfileView.deleteMappingProfile(mappingProfileName); + }); + }); }); 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 9445968235..129ec23a54 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 @@ -32,194 +32,196 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import FileManager from '../../../support/utils/fileManager'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user = null; - let instanceHrid; - const marcFieldProtectionId = []; - const OCLCAuthentication = '100481406/PAOLF'; - const protectedFields = { - firstField: '*', - secondField: '920' - }; - const quantityOfItems = '1'; - const oclcForImport = '830936944'; - // unique file names - const editedMarcFileName = `C356829 editedMarcFile.${getRandomPostfix()}.mrc`; - const nameMarcFileForUpload = `C356829 autotestFile.${getRandomPostfix()}.mrc`; - - const matchProfile = { - profileName: `C356829 001 to Instance HRID ${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid - }; - const mappingProfile = { - name: `C356829 Update instance and check field protections ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - catalogedDate: '###TODAY###', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356829 Update instance and check field protections ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfile = { - profileName: `C356829 Update instance and check field protections ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; - - before('create test user', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui, - permissions.dataExportEnableApp.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui - ]) - .then(userProperties => { - user = userProperties; - - cy.login(user.username, user.password); - }); - }); +describe('data-import', () => { + describe('Settings', () => { + let user = null; + let instanceHrid; + const marcFieldProtectionId = []; + const OCLCAuthentication = '100481406/PAOLF'; + const protectedFields = { + firstField: '*', + secondField: '920' + }; + const quantityOfItems = '1'; + const oclcForImport = '830936944'; + // unique file names + const editedMarcFileName = `C356829 editedMarcFile.${getRandomPostfix()}.mrc`; + const nameMarcFileForUpload = `C356829 autotestFile.${getRandomPostfix()}.mrc`; + + const matchProfile = { + profileName: `C356829 001 to Instance HRID ${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; + const mappingProfile = { + name: `C356829 Update instance and check field protections ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + catalogedDate: '###TODAY###', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C356829 Update instance and check field protections ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfile = { + profileName: `C356829 Update instance and check field protections ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('create test user', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui, + permissions.dataExportEnableApp.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password); + }); + }); - after('delete test data', () => { - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - marcFieldProtectionId.forEach(field => MarcFieldProtection.deleteMarcFieldProtectionViaApi(field)); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + marcFieldProtectionId.forEach(field => MarcFieldProtection.deleteMarcFieldProtectionViaApi(field)); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Users.deleteViaApi(user.userId); + }); + + it('C356829 Test field protections when importing to update instance, after editing the MARC Bib in quickMARC (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.openTargetProfile(); + Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); + Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); + + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '5', + data: 'amb', + source: 'USER', + field: protectedFields.firstField + }) + .then((resp) => { + const id = resp.id; + marcFieldProtectionId.push = id; + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field: protectedFields.secondField + }) + .then((resp) => { + const id = resp.id; + marcFieldProtectionId.push = id; + }); + + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.statusTerm); + 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 + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - it('C356829 Test field protections when importing to update instance, after editing the MARC Bib in quickMARC (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.openTargetProfile(); - Z3950TargetProfiles.editOclcWorldCat(OCLCAuthentication, TARGET_PROFILE_NAMES.OCLC_WORLDCAT); - Z3950TargetProfiles.checkIsOclcWorldCatIsChanged(OCLCAuthentication); - - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '5', - data: 'amb', - source: 'USER', - field: protectedFields.firstField - }) - .then((resp) => { - const id = resp.id; - marcFieldProtectionId.push = id; + cy.visit(TopMenu.inventoryPath); + InventoryInstances.importWithOclc(oclcForImport); + InventoryInstance.editMarcBibliographicRecord(); + [18, 19, 20, 21, 22, 23, 24, 25, 26].forEach(fieldNumber => { + InventoryEditMarcRecord.deleteField(fieldNumber); }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field: protectedFields.secondField - }) - .then((resp) => { - const id = resp.id; - marcFieldProtectionId.push = id; + InventoryEditMarcRecord.editField('$a Louisiana. $2 fast $0 (OCoLC)fst01207035', '$a Louisiana. $2 fast $0 (OCoLC)fst01207035 $5 amb'); + InventoryEditMarcRecord.addField('920', 'This should be a protected field', 28); + InventoryEditMarcRecord.saveAndClose(); + InventoryEditMarcRecord.confirmDeletingField(); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + InventoryInstance.viewSource(); + InventoryViewSource.contains('651\t'); + InventoryViewSource.contains('‡a Louisiana. ‡2 fast ‡0 (OCoLC)fst01207035 ‡5 amb'); + InventoryViewSource.contains('920\t'); + InventoryViewSource.contains('‡a This should be a protected field'); + // The prepared file without fields 651 and 920 is used because it is very difficult + // to remove fields from the exported file along with the special characters of the .mrc file + InventoryViewSource.extructDataFrom999Field() + .then(uuid => { + // change file using uuid for 999 field + DataImport.editMarcFile('mrcFileForC356829.mrc', editedMarcFileName, ['srsUuid', 'instanceUuid', 'hrid'], [uuid[0], uuid[1], instanceHrid]); + }); + InventoryViewSource.close(); + + // export instance + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventorySearchAndFilter.selectResultCheckboxes(1); + InventorySearchAndFilter.exportInstanceAsMarc(); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileName, nameMarcFileForUpload); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForUpload); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFileForUpload); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 1); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); + FileDetails.openInstanceInInventory('Updated'); }); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.statusTerm); - 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 - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - - cy.visit(TopMenu.inventoryPath); - InventoryInstances.importWithOclc(oclcForImport); - InventoryInstance.editMarcBibliographicRecord(); - [18, 19, 20, 21, 22, 23, 24, 25, 26].forEach(fieldNumber => { - InventoryEditMarcRecord.deleteField(fieldNumber); - }); - InventoryEditMarcRecord.editField('$a Louisiana. $2 fast $0 (OCoLC)fst01207035', '$a Louisiana. $2 fast $0 (OCoLC)fst01207035 $5 amb'); - InventoryEditMarcRecord.addField('920', 'This should be a protected field', 28); - InventoryEditMarcRecord.saveAndClose(); - InventoryEditMarcRecord.confirmDeletingField(); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; - + InventoryInstance.checkIsInstanceUpdated(); InventoryInstance.viewSource(); InventoryViewSource.contains('651\t'); InventoryViewSource.contains('‡a Louisiana. ‡2 fast ‡0 (OCoLC)fst01207035 ‡5 amb'); InventoryViewSource.contains('920\t'); InventoryViewSource.contains('‡a This should be a protected field'); - // The prepared file without fields 651 and 920 is used because it is very difficult - // to remove fields from the exported file along with the special characters of the .mrc file - InventoryViewSource.extructDataFrom999Field() - .then(uuid => { - // change file using uuid for 999 field - DataImport.editMarcFile('mrcFileForC356829.mrc', editedMarcFileName, ['srsUuid', 'instanceUuid', 'hrid'], [uuid[0], uuid[1], instanceHrid]); - }); - InventoryViewSource.close(); - - // export instance - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventorySearchAndFilter.selectResultCheckboxes(1); - InventorySearchAndFilter.exportInstanceAsMarc(); - - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, nameMarcFileForUpload); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForUpload); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForUpload); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 1); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); - FileDetails.openInstanceInInventory('Updated'); }); - - InventoryInstance.checkIsInstanceUpdated(); - InventoryInstance.viewSource(); - InventoryViewSource.contains('651\t'); - InventoryViewSource.contains('‡a Louisiana. ‡2 fast ‡0 (OCoLC)fst01207035 ‡5 amb'); - InventoryViewSource.contains('920\t'); - InventoryViewSource.contains('‡a This should be a protected field'); - }); + }); }); 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 1221e18014..1b1c2ffd78 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 @@ -27,185 +27,187 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import Users from '../../../support/fragments/users/users'; -describe('ui-data-import', () => { - let user; - let instanceHrid = null; - const marcFieldProtectionId = []; - const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const quantityOfItems = '1'; - // unique file names - const nameMarcFileForCreate = `C356830 autotestFile.${getRandomPostfix()}.mrc`; - const editedMarcFileName = `C356830 marcFileForMatch.${getRandomPostfix()}.mrc`; +describe('data-import', () => { + describe('Settings', () => { + let user; + let instanceHrid = null; + const marcFieldProtectionId = []; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const quantityOfItems = '1'; + // unique file names + const nameMarcFileForCreate = `C356830 autotestFile.${getRandomPostfix()}.mrc`; + const editedMarcFileName = `C356830 marcFileForMatch.${getRandomPostfix()}.mrc`; - const protectedFields = { - firstField: '*', - secondField: '920' - }; - const matchProfile = { - profileName: `C356830 001 to Instance HRID ${getRandomPostfix()}`, - incomingRecordFields: { - field: '001' - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid - }; - const mappingProfile = { - name: `C356830 Update instance and check field protections ${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - catalogedDate: '###TODAY###', - instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED - }; - const actionProfile = { - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356830 Update instance and check field protections ${getRandomPostfix()}`, - action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' - }; - const jobProfile = { - profileName: `C356830 Update instance and check field protections ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; + const protectedFields = { + firstField: '*', + secondField: '920' + }; + const matchProfile = { + profileName: `C356830 001 to Instance HRID ${getRandomPostfix()}`, + incomingRecordFields: { + field: '001' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid + }; + const mappingProfile = { + name: `C356830 Update instance and check field protections ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + catalogedDate: '###TODAY###', + instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED + }; + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C356830 Update instance and check field protections ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' + }; + const jobProfile = { + profileName: `C356830 Update instance and check field protections ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; - before('create test user', () => { - cy.createTempUser([ - permissions.moduleDataImportEnabled.gui, - permissions.settingsDataImportEnabled.gui, - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui, - permissions.dataExportEnableApp.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); - }); - }); - - after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfile.profileName); - MatchProfiles.deleteMatchProfile(matchProfile.profileName); - ActionProfiles.deleteActionProfile(actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete created files - FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); - Users.deleteViaApi(user.userId); - marcFieldProtectionId.forEach(field => MarcFieldProtection.deleteMarcFieldProtectionViaApi(field)); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); - - it('C356830 Test field protections when importing to update instance, after editing the MARC Bib outside of FOLIO (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '5', - data: 'amb', - source: 'USER', - field: protectedFields.firstField - }) - .then((resp) => { - const id = resp.id; - marcFieldProtectionId.push = id; + before('create test user', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui, + permissions.dataExportEnableApp.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); }); - MarcFieldProtection.createMarcFieldProtectionViaApi({ - indicator1: '*', - indicator2: '*', - subfield: '*', - data: '*', - source: 'USER', - field: protectedFields.secondField - }) - .then((resp) => { - const id = resp.id; - marcFieldProtectionId.push = id; + }); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + Users.deleteViaApi(user.userId); + marcFieldProtectionId.forEach(field => MarcFieldProtection.deleteMarcFieldProtectionViaApi(field)); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); }); + }); - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + it('C356830 Test field protections when importing to update instance, after editing the MARC Bib outside of FOLIO (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '5', + data: 'amb', + source: 'USER', + field: protectedFields.firstField + }) + .then((resp) => { + const id = resp.id; + marcFieldProtectionId.push = id; + }); + MarcFieldProtection.createMarcFieldProtectionViaApi({ + indicator1: '*', + indicator2: '*', + subfield: '*', + data: '*', + source: 'USER', + field: protectedFields.secondField + }) + .then((resp) => { + const id = resp.id; + marcFieldProtectionId.push = id; + }); - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.statusTerm); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.fillCatalogedDate(mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.statusTerm); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - // create job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - // upload a marc file for creating of the new instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC356830.mrc', nameMarcFileForCreate); - JobProfiles.searchJobProfileForImport(jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForCreate); - Logs.openFileDetails(nameMarcFileForCreate); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 0); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 0); - FileDetails.openInstanceInInventory('Created'); + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - // in cypress we can't delete fields in the file that's why using already created file - // need to get instance hrid and uuids for 999 field for changing file - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; + // upload a marc file for creating of the new instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile('marcFileForC356830.mrc', nameMarcFileForCreate); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForCreate); + Logs.openFileDetails(nameMarcFileForCreate); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 0); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 0); + FileDetails.openInstanceInInventory('Created'); - InventoryInstance.viewSource(); - InventoryViewSource.extructDataFrom999Field() - .then(uuid => { + // in cypress we can't delete fields in the file that's why using already created file + // need to get instance hrid and uuids for 999 field for changing file + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + InventoryInstance.viewSource(); + InventoryViewSource.extructDataFrom999Field() + .then(uuid => { // change file using uuid for 999 field - DataImport.editMarcFile( - 'marcFileForC356830_rev.mrc', - editedMarcFileName, - ['instanceHrid', 'srsUuid', 'instanceUuid'], - [instanceHrid, uuid[0], uuid[1]] - ); - }); - }); + DataImport.editMarcFile( + 'marcFileForC356830_rev.mrc', + editedMarcFileName, + ['instanceHrid', 'srsUuid', 'instanceUuid'], + [instanceHrid, uuid[0], uuid[1]] + ); + }); + }); - // upload .mrc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.checkIsLandingPageOpened(); - DataImport.uploadFile(editedMarcFileName); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(editedMarcFileName); - Logs.checkStatusOfJobProfile(); - Logs.openFileDetails(editedMarcFileName); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 1); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.checkIsLandingPageOpened(); + DataImport.uploadFile(editedMarcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(editedMarcFileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(editedMarcFileName); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems, 1); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); - FileDetails.openInstanceInInventory('Updated'); - InventoryInstance.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource('650\t', 'Drawing, Dutch ‡y 21st century ‡v Exhibitions. ‡5 amb'); - InventoryViewSource.verifyFieldInMARCBibSource('920\t', 'This field should be protected'); - }); + FileDetails.openInstanceInInventory('Updated'); + InventoryInstance.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource('650\t', 'Drawing, Dutch ‡y 21st century ‡v Exhibitions. ‡5 amb'); + InventoryViewSource.verifyFieldInMARCBibSource('920\t', 'This field should be protected'); + }); + }); }); diff --git a/cypress/e2e/data-import/settings/view-mode-of-isri-profiles.cy.js b/cypress/e2e/data-import/settings/view-mode-of-isri-profiles.cy.js deleted file mode 100644 index 7ab6a2819e..0000000000 --- a/cypress/e2e/data-import/settings/view-mode-of-isri-profiles.cy.js +++ /dev/null @@ -1,121 +0,0 @@ -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 Z3950TargetProfiles from '../../../support/fragments/settings/inventory/integrations/z39.50TargetProfiles'; -import SettingsMenu from '../../../support/fragments/settingsMenu'; -import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; -import NewActionProfile from '../../../support/fragments/data_import/action_profiles/newActionProfile'; -import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; -import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; -import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; -import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; -import Users from '../../../support/fragments/users/users'; - -const abcProfile = { - createJobProfile: `abc createJobProfile.${getRandomPostfix()}`, - createActionProfile: `abc autotest actionProfile${getRandomPostfix()}`, - createMappingProfile: `abc autotest mappingProfile${getRandomPostfix()}`, - updateJobProfile: `abc updateJobProfile.${getRandomPostfix()}`, - updateActionProfile: `abc autotest actionProfile${getRandomPostfix()}`, - updateMappingProfile: `abc autotest mappingProfile${getRandomPostfix()}` -}; -const adcProfile = { - createJobProfile: `adc createJobProfile.${getRandomPostfix()}`, - createActionProfile: `adc autotest actionProfile${getRandomPostfix()}`, - createMappingProfile: `adc autotest mappingProfile${getRandomPostfix()}`, - updateJobProfile: `adc updateJobProfile.${getRandomPostfix()}`, - updateActionProfile: `adc autotest actionProfile${getRandomPostfix()}`, - updateMappingProfile: `adc autotest mappingProfile${getRandomPostfix()}` -}; -const zbcProfile = { - createJobProfile: `zbc createJobProfile.${getRandomPostfix()}`, - createActionProfile: `zbc autotest actionProfile${getRandomPostfix()}`, - createMappingProfile: `zbc autotest mappingProfile${getRandomPostfix()}`, - updateJobProfile: `zbc updateJobProfile.${getRandomPostfix()}`, - updateActionProfile: `zbc autotest actionProfile${getRandomPostfix()}`, - updateMappingProfile: `zbc autotest mappingProfile${getRandomPostfix()}` -}; -const zdcProfile = { - createJobProfile: `zdc createJobProfile.${getRandomPostfix()}`, - createActionProfile: `zdc autotest actionProfile${getRandomPostfix()}`, - createMappingProfile: `zdc autotest mappingProfile${getRandomPostfix()}`, - updateJobProfile: `zdc updateJobProfile.${getRandomPostfix()}`, - updateActionProfile: `zdc autotest actionProfile${getRandomPostfix()}`, - updateMappingProfile: `zdc autotest mappingProfile${getRandomPostfix()}` -}; - -describe('ui-data-import', () => { - let user; - const createJobProfileIds = []; - const updateJobProfileIds = []; - const targetProfileName = `C374176 autotest profile${getRandomPostfix()}`; - let profileId; - - before('login', () => { - cy.getAdminToken() - .then(() => { - // create job profiles for create - [zbcProfile, adcProfile, zdcProfile, abcProfile].forEach(profile => { - NewFieldMappingProfile.createMappingProfileViaApi(profile.createMappingProfile) - .then((mappingProfileResponse) => { - NewActionProfile.createActionProfileViaApi(profile.createActionProfile, mappingProfileResponse.body.id) - .then((actionProfileResponse) => { - NewJobProfile.createJobProfileWithLinkedActionProfileViaApi(profile.createJobProfile, actionProfileResponse.body.id); - }).then(id => createJobProfileIds.push(id)); - }); - }); - // create job profile for update - [abcProfile, zbcProfile, zdcProfile, adcProfile].forEach(profile => { - NewFieldMappingProfile.createMappingProfileViaApi(profile.updateMappingProfile) - .then((mappingProfileResponse) => { - NewActionProfile.createActionProfileViaApi(profile.updateActionProfile, mappingProfileResponse.body.id, 'UPDATE') - .then((actionProfileResponse) => { - NewJobProfile.createJobProfileWithLinkedActionProfileViaApi(profile.updateJobProfile, actionProfileResponse.body.id); - }).then(id => { - updateJobProfileIds.push(id); - }); - }); - }); - }) - .then(() => { - Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(targetProfileName, createJobProfileIds, updateJobProfileIds) - .then(initialId => { - profileId = initialId; - }); - }); - - cy.createTempUser([ - permissions.settingsDataImportEnabled.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui - ]) - .then(userProperties => { - user = userProperties; - - cy.login(user.username, user.password); - }); - }); - - after('delete test data', () => { - [abcProfile, zbcProfile, zdcProfile, adcProfile].forEach(profile => { - JobProfiles.deleteJobProfile(profile.createJobProfile); - JobProfiles.deleteJobProfile(profile.updateJobProfile); - ActionProfiles.deleteActionProfile(profile.createActionProfile); - ActionProfiles.deleteActionProfile(profile.updateActionProfile); - FieldMappingProfiles.deleteFieldMappingProfile(profile.createMappingProfile); - FieldMappingProfiles.deleteFieldMappingProfile(profile.updateMappingProfile); - }); - Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); - Users.deleteViaApi(user.userId); - }); - - it('C374176 Verify the view mode of ISRI profiles (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.verifyTargetProfileFormOpened(); - Z3950TargetProfiles.openTargetProfile(profileId); - Z3950TargetProfiles.verifyTargetProfileForm(); - Z3950TargetProfiles.verifyCreateInstanceJobProfileList(targetProfileName); - Z3950TargetProfiles.verifyUpdateInstanceJobProfileList(targetProfileName); - }); -}); diff --git a/cypress/e2e/inventory/assign-preceding-title.cy.js b/cypress/e2e/inventory/assign-preceding-title.cy.js index afdad1c3e0..e7104429b0 100644 --- a/cypress/e2e/inventory/assign-preceding-title.cy.js +++ b/cypress/e2e/inventory/assign-preceding-title.cy.js @@ -9,62 +9,64 @@ import TestTypes from '../../support/dictionary/testTypes'; import DevTeams from '../../support/dictionary/devTeams'; import { INSTANCE_SOURCE_NAMES } from '../../support/constants'; -describe('ui-inventory: Assign a Preceding title for an instance', () => { - const instanceIds = []; - const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; - const instanceTitle2 = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; - const precedingTitleValue = `Preceding title test value ${getRandomPostfix()}`; - const isbnValue = `ISBN test value ${getRandomPostfix()}`; - const issnValue = `ISSN test value ${getRandomPostfix()}`; +describe('inventory', () => { + describe('Instance', () => { + const instanceIds = []; + const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; + const instanceTitle2 = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; + const precedingTitleValue = `Preceding title test value ${getRandomPostfix()}`; + const isbnValue = `ISBN test value ${getRandomPostfix()}`; + const issnValue = `ISSN test value ${getRandomPostfix()}`; - before('navigate to Inventory', () => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - cy.getInstanceTypes({ limit: 1 }); - cy.getInstanceIdentifierTypes({ limit: 1 }); - }) - .then(() => { - cy.wrap([ - { - instanceTypeId: Cypress.env('instanceTypes')[0].id, - title: instanceTitle, - source: INSTANCE_SOURCE_NAMES.FOLIO, - }, { - instanceTypeId: Cypress.env('instanceTypes')[0].id, - title: instanceTitle2, - source: INSTANCE_SOURCE_NAMES.FOLIO, - } - ]).each((instance, i) => cy.createInstance({ instance }).then(specialInstanceId => { instanceIds[i] = specialInstanceId; })); - }); + before('navigate to Inventory', () => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + cy.getInstanceTypes({ limit: 1 }); + cy.getInstanceIdentifierTypes({ limit: 1 }); + }) + .then(() => { + cy.wrap([ + { + instanceTypeId: Cypress.env('instanceTypes')[0].id, + title: instanceTitle, + source: INSTANCE_SOURCE_NAMES.FOLIO, + }, { + instanceTypeId: Cypress.env('instanceTypes')[0].id, + title: instanceTitle2, + source: INSTANCE_SOURCE_NAMES.FOLIO, + } + ]).each((instance, i) => cy.createInstance({ instance }).then(specialInstanceId => { instanceIds[i] = specialInstanceId; })); + }); - cy.visit(TopMenu.inventoryPath); - }); + cy.visit(TopMenu.inventoryPath); + }); - after(() => { - cy.getInstanceById(instanceIds[0]) - .then(body => { - const requestBody = body; - requestBody.precedingTitles = []; + after(() => { + cy.getInstanceById(instanceIds[0]) + .then(body => { + const requestBody = body; + requestBody.precedingTitles = []; - // reset precedingTitles to get rid of tables dependencies and be able to delete the instances - cy.updateInstance(requestBody); - }) - .then(() => { - instanceIds.forEach(instanceId => InventoryInstance.deleteInstanceViaApi(instanceId)); - }); - }); + // reset precedingTitles to get rid of tables dependencies and be able to delete the instances + cy.updateInstance(requestBody); + }) + .then(() => { + instanceIds.forEach(instanceId => InventoryInstance.deleteInstanceViaApi(instanceId)); + }); + }); - it('C9215 In Accordion Title --> Test assigning a Preceding title (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); - InventoryInstances.selectInstance(); - InventoryInstance.editInstance(); - InstanceRecordEdit.addPrecedingTitle(0, precedingTitleValue, isbnValue, issnValue); - InstanceRecordEdit.saveAndClose(); - InventoryInstance.checkPrecedingTitle(0, precedingTitleValue, isbnValue, issnValue); - InventoryInstance.editInstance(); - InstanceRecordEdit.addExistingPrecedingTitle(instanceTitle2); - InstanceRecordEdit.saveAndClose(); - InventoryInstance.checkPrecedingTitle(0, instanceTitle2, '', ''); + it('C9215 In Accordion Title --> Test assigning a Preceding title (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); + InventoryInstances.selectInstance(); + InventoryInstance.editInstance(); + InstanceRecordEdit.addPrecedingTitle(0, precedingTitleValue, isbnValue, issnValue); + InstanceRecordEdit.saveAndClose(); + InventoryInstance.checkPrecedingTitle(0, precedingTitleValue, isbnValue, issnValue); + InventoryInstance.editInstance(); + InstanceRecordEdit.addExistingPrecedingTitle(instanceTitle2); + InstanceRecordEdit.saveAndClose(); + InventoryInstance.checkPrecedingTitle(0, instanceTitle2, '', ''); + }); }); }); diff --git a/cypress/e2e/inventory/assing-tags-to-an-instance-record.cy.js b/cypress/e2e/inventory/assing-tags-to-an-instance-record.cy.js index f99e78ffa1..0e5b4d61d4 100644 --- a/cypress/e2e/inventory/assing-tags-to-an-instance-record.cy.js +++ b/cypress/e2e/inventory/assing-tags-to-an-instance-record.cy.js @@ -8,49 +8,51 @@ import Helper from '../../support/fragments/finance/financeHelper'; import DevTeams from '../../support/dictionary/devTeams'; import { INSTANCE_SOURCE_NAMES } from '../../support/constants'; -describe('ui-inventory: Assign tags to an Instance record', () => { - const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; - const tag = { - id: uuid(), - description: uuid(), - label: uuid() - }; - let instanceId; +describe('inventory', () => { + describe('Tags', () => { + const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; + const tag = { + id: uuid(), + description: uuid(), + label: uuid() + }; + let instanceId; - beforeEach(() => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - cy.getInstanceTypes({ limit: 1 }); - cy.getInstanceIdentifierTypes({ limit: 1 }); - }) - .then(() => { - cy.createInstance({ - instance: { - instanceTypeId: Cypress.env('instanceTypes')[0].id, - title: instanceTitle, - source: INSTANCE_SOURCE_NAMES.FOLIO - }, - }).then(specialInstanceId => { instanceId = specialInstanceId; }); - }); + beforeEach(() => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + cy.getInstanceTypes({ limit: 1 }); + cy.getInstanceIdentifierTypes({ limit: 1 }); + }) + .then(() => { + cy.createInstance({ + instance: { + instanceTypeId: Cypress.env('instanceTypes')[0].id, + title: instanceTitle, + source: INSTANCE_SOURCE_NAMES.FOLIO + }, + }).then(specialInstanceId => { instanceId = specialInstanceId; }); + }); - cy.createTagApi(tag).then(tagId => { tag.id = tagId; }); - }); + cy.createTagApi(tag).then(tagId => { tag.id = tagId; }); + }); - after(() => { - cy.deleteTagApi(tag.id); - InventoryInstance.deleteInstanceViaApi(instanceId); - }); + after(() => { + cy.deleteTagApi(tag.id); + InventoryInstance.deleteInstanceViaApi(instanceId); + }); - it('C196769 Assign tags to an Instance record (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); - InventoryInstances.selectInstance(); - InventoryInstance.addTag(tag.label); - InventoryInstances.resetAllFilters(); - InventoryInstances.searchByTag(tag.label); - InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); - InventoryInstance.checkAddedTag(tag.label, instanceTitle); - InventoryInstance.deleteTag(tag.label); + it('C196769 Assign tags to an Instance record (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); + InventoryInstances.selectInstance(); + InventoryInstance.addTag(tag.label); + InventoryInstances.resetAllFilters(); + InventoryInstances.searchByTag(tag.label); + InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); + InventoryInstance.checkAddedTag(tag.label, instanceTitle); + InventoryInstance.deleteTag(tag.label); + }); }); }); 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 d06e0cb4fa..5483c90ff9 100644 --- a/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js +++ b/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js @@ -26,170 +26,172 @@ import ServicePoint from '../../support/fragments/servicePoint/servicePoint'; import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; import { ITEM_STATUS_NAMES } from '../../support/constants'; -describe('orders: Receive piece from Order', () => { - let effectiveLocation; - let orderNumber; - let materialTypeId; - const instanceTitle = `autotestTitle ${Helper.getRandomBarcode()}`; - const itemQuantity = '1'; - const barcode = Helper.getRandomBarcode(); - const caption = 'autotestCaption'; - const firstServicePoint = NewServicePoint.getDefaultServicePoint(`autotestServicePoint ${Helper.getRandomBarcode()}`); - const secondServicePoint = NewServicePoint.getDefaultServicePoint(`autotestServicePoint ${Helper.getRandomBarcode()}`); - let userId; +describe('inventory', () => { + describe('Cataloging', () => { + let effectiveLocation; + let orderNumber; + let materialTypeId; + const instanceTitle = `autotestTitle ${Helper.getRandomBarcode()}`; + const itemQuantity = '1'; + const barcode = Helper.getRandomBarcode(); + const caption = 'autotestCaption'; + const firstServicePoint = NewServicePoint.getDefaultServicePoint(`autotestServicePoint ${Helper.getRandomBarcode()}`); + const secondServicePoint = NewServicePoint.getDefaultServicePoint(`autotestServicePoint ${Helper.getRandomBarcode()}`); + let userId; - before('create test data', () => { - cy.getAdminToken(); - InventoryInteractionsDefaults - .getConfigurationInventoryInteractions({ query: '(module==ORDERS and configName==approvals)' }) - .then((body) => { - if (body.configs.length !== 0) { - const id = body.configs[0].id; + before('create test data', () => { + cy.getAdminToken(); + InventoryInteractionsDefaults + .getConfigurationInventoryInteractions({ query: '(module==ORDERS and configName==approvals)' }) + .then((body) => { + if (body.configs.length !== 0) { + const id = body.configs[0].id; - InventoryInteractionsDefaults.setConfigurationInventoryInteractions({ - id, - module:'ORDERS', - configName:'approvals', - enabled:true, - value:'{"isApprovalRequired":false}' - }); - } - }); - InventoryInteractionsDefaults - .getConfigurationInventoryInteractions({ query: '(module==ORDERS and configName==inventory-loanTypeName)' }) - .then((body) => { - if (body.configs.length !== 0) { - const id = body.configs[0].id; + InventoryInteractionsDefaults.setConfigurationInventoryInteractions({ + id, + module:'ORDERS', + configName:'approvals', + enabled:true, + value:'{"isApprovalRequired":false}' + }); + } + }); + InventoryInteractionsDefaults + .getConfigurationInventoryInteractions({ query: '(module==ORDERS and configName==inventory-loanTypeName)' }) + .then((body) => { + if (body.configs.length !== 0) { + const id = body.configs[0].id; - InventoryInteractionsDefaults.setConfigurationInventoryInteractions({ - id, - module:'ORDERS', - configName:'inventory-loanTypeName', - enabled:true, - value:'Can circulate' - }); - } - }); - cy.getMaterialTypes({ query: 'name="book"' }) - .then(materialType => { - materialTypeId = materialType.id; - }); - ServicePoints.createViaApi(firstServicePoint); - NewLocation.createViaApi(NewLocation.getDefaultLocation(firstServicePoint.id)) - .then((location) => { - effectiveLocation = location; - Orders.createOrderWithOrderLineViaApi( - NewOrder.getDefaultOrder(), - BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id, materialTypeId) - ) - .then(order => { - orderNumber = order; - }); - }); - ServicePoints.createViaApi(secondServicePoint); + InventoryInteractionsDefaults.setConfigurationInventoryInteractions({ + id, + module:'ORDERS', + configName:'inventory-loanTypeName', + enabled:true, + value:'Can circulate' + }); + } + }); + cy.getMaterialTypes({ query: 'name="book"' }) + .then(materialType => { + materialTypeId = materialType.id; + }); + ServicePoints.createViaApi(firstServicePoint); + NewLocation.createViaApi(NewLocation.getDefaultLocation(firstServicePoint.id)) + .then((location) => { + effectiveLocation = location; + Orders.createOrderWithOrderLineViaApi( + NewOrder.getDefaultOrder(), + BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id, materialTypeId) + ) + .then(order => { + orderNumber = order; + }); + }); + ServicePoints.createViaApi(secondServicePoint); - cy.createTempUser([ - permissions.checkinAll.gui, - permissions.uiInventoryViewInstances.gui, - permissions.uiInventoryViewCreateEditItems.gui, - permissions.uiOrdersView.gui, - permissions.uiOrdersEdit.gui, - permissions.uiReceivingViewEditCreate.gui - ]) - .then(userProperties => { - userId = userProperties.userId; + cy.createTempUser([ + permissions.checkinAll.gui, + permissions.uiInventoryViewInstances.gui, + permissions.uiInventoryViewCreateEditItems.gui, + permissions.uiOrdersView.gui, + permissions.uiOrdersEdit.gui, + permissions.uiReceivingViewEditCreate.gui + ]) + .then(userProperties => { + userId = userProperties.userId; - UserEdit.addServicePointsViaApi( - [firstServicePoint.id, secondServicePoint.id], - userId, - firstServicePoint.id - ); - cy.login(userProperties.username, userProperties.password, - { path: TopMenu.ordersPath, waiter: Orders.waitLoading }); + UserEdit.addServicePointsViaApi( + [firstServicePoint.id, secondServicePoint.id], + userId, + firstServicePoint.id + ); + cy.login(userProperties.username, userProperties.password, + { path: TopMenu.ordersPath, waiter: Orders.waitLoading }); - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - Orders.openOrder(); - InteractorsTools.checkCalloutMessage(`The Purchase order - ${orderNumber} has been successfully opened`); - Orders.receiveOrderViaActions(); - Receiving.selectFromResultsList(instanceTitle); - Receiving.receivePieceWithoutBarcode(0, caption); - Receiving.checkReceivedPiece(0, caption, 'No value set-'); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); - }); - }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + Orders.openOrder(); + InteractorsTools.checkCalloutMessage(`The Purchase order - ${orderNumber} has been successfully opened`); + Orders.receiveOrderViaActions(); + Receiving.selectFromResultsList(instanceTitle); + Receiving.receivePieceWithoutBarcode(0, caption); + Receiving.checkReceivedPiece(0, caption, 'No value set-'); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); + }); + }); - after('delete test data', () => { - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(res => { - Orders.deleteOrderViaApi(res[0].id); + after('delete test data', () => { + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(res => { + Orders.deleteOrderViaApi(res[0].id); + }); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(barcode); + UserEdit.changeServicePointPreferenceViaApi(userId, [firstServicePoint.id, secondServicePoint.id]).then(() => { + ServicePoint.deleteViaApi(firstServicePoint.id); + ServicePoint.deleteViaApi(secondServicePoint.id); + Users.deleteViaApi(userId); }); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(barcode); - UserEdit.changeServicePointPreferenceViaApi(userId, [firstServicePoint.id, secondServicePoint.id]).then(() => { - ServicePoint.deleteViaApi(firstServicePoint.id); - ServicePoint.deleteViaApi(secondServicePoint.id); - Users.deleteViaApi(userId); + NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + effectiveLocation.institutionId, + effectiveLocation.campusId, + effectiveLocation.libraryId, + effectiveLocation.id + ); }); - NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - effectiveLocation.institutionId, - effectiveLocation.campusId, - effectiveLocation.libraryId, - effectiveLocation.id - ); - }); - it('C3506 Catalog a new title which has been ordered and received in Orders (folijet)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - InventoryInstances.selectInstance(); - InventoryInstances.verifyInstanceDetailsView(); - InventoryInstance.openHoldings(effectiveLocation.name); - InventoryInstance.verifyItemBarcode('No barcode'); - InventoryInstance.verifyLoan('Can circulate'); - InventoryInstance.openItemByBarcode('No barcode'); - ItemRecordView.waitLoading(); - ItemRecordView.checkBarcode('-'); - ItemActions.edit(); - ItemRecordEdit.waitLoading(instanceTitle); - ItemRecordEdit.addBarcode(barcode); - ItemRecordEdit.save(); - ItemRecordView.checkCalloutMessage(); - ItemRecordView.waitLoading(); - ItemRecordView.checkBarcode(barcode); + it('C3506 Catalog a new title which has been ordered and received in Orders (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + InventoryInstances.selectInstance(); + InventoryInstances.verifyInstanceDetailsView(); + InventoryInstance.openHoldings(effectiveLocation.name); + InventoryInstance.verifyItemBarcode('No barcode'); + InventoryInstance.verifyLoan('Can circulate'); + InventoryInstance.openItemByBarcode('No barcode'); + ItemRecordView.waitLoading(); + ItemRecordView.checkBarcode('-'); + ItemActions.edit(); + ItemRecordEdit.waitLoading(instanceTitle); + ItemRecordEdit.addBarcode(barcode); + ItemRecordEdit.save(); + ItemRecordView.checkCalloutMessage(); + ItemRecordView.waitLoading(); + ItemRecordView.checkBarcode(barcode); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(barcode); - cy.visit(TopMenu.inventoryPath); - 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); - InventoryInstance.checkHoldingsTable(effectiveLocation.name, 0, '-', barcode, ITEM_STATUS_NAMES.AVAILABLE); - InventoryInstance.verifyLoan('Can circulate'); - InventoryInstance.openItemByBarcode(barcode); - ItemRecordView.waitLoading(); - ItemRecordView.checkBarcode(barcode); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(barcode); + cy.visit(TopMenu.inventoryPath); + 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); + InventoryInstance.checkHoldingsTable(effectiveLocation.name, 0, '-', barcode, ITEM_STATUS_NAMES.AVAILABLE); + InventoryInstance.verifyLoan('Can circulate'); + InventoryInstance.openItemByBarcode(barcode); + ItemRecordView.waitLoading(); + ItemRecordView.checkBarcode(barcode); - SwitchServicePoint.switchServicePoint(secondServicePoint.name); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(barcode); - ConfirmItemInModal.confirmInTransitModal(); - 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); - InventoryInstance.checkHoldingsTable(effectiveLocation.name, 0, '-', barcode, 'In transit'); - InventoryInstance.verifyLoan('Can circulate'); - InventoryInstance.openItemByBarcode(barcode); - ItemRecordView.waitLoading(); - ItemRecordView.checkBarcode(barcode); - }); + SwitchServicePoint.switchServicePoint(secondServicePoint.name); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(barcode); + ConfirmItemInModal.confirmInTransitModal(); + 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); + InventoryInstance.checkHoldingsTable(effectiveLocation.name, 0, '-', barcode, 'In transit'); + InventoryInstance.verifyLoan('Can circulate'); + InventoryInstance.openItemByBarcode(barcode); + ItemRecordView.waitLoading(); + ItemRecordView.checkBarcode(barcode); + }); + }); }); diff --git a/cypress/e2e/inventory/create-edit-delete-material-types.cy.js b/cypress/e2e/inventory/create-edit-delete-material-types.cy.js index 5dee2630cd..76c6372a22 100644 --- a/cypress/e2e/inventory/create-edit-delete-material-types.cy.js +++ b/cypress/e2e/inventory/create-edit-delete-material-types.cy.js @@ -7,30 +7,32 @@ import NewMaterialType from '../../support/fragments/settings/inventory/newMater import Users from '../../support/fragments/users/users'; import DevTeams from '../../support/dictionary/devTeams'; -describe('ui-inventory: Create, edit, delete material types', () => { - let userId; - const materialTypeName = `autoTestMaterialType.${getRandomPostfix()}`; - const newMaterialTypeName = `autoTestMaterialType.${getRandomPostfix()}`; +describe('inventory', () => { + describe('Permissions', () => { + let userId; + const materialTypeName = `autoTestMaterialType.${getRandomPostfix()}`; + const newMaterialTypeName = `autoTestMaterialType.${getRandomPostfix()}`; - before(() => { - cy.createTempUser([permissions.uiCreateEditDeleteMaterialTypes.gui]).then(userProperties => { - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password); + before(() => { + cy.createTempUser([permissions.uiCreateEditDeleteMaterialTypes.gui]).then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password); + }); }); - }); - after(() => { - Users.deleteViaApi(userId); - }); + after(() => { + Users.deleteViaApi(userId); + }); - it('C505 Settings (Inventory): Create, edit, delete material types (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.materialTypePath); - MaterialTypes.checkAvailableOptions(); - NewMaterialType.create(materialTypeName); - MaterialTypes.isPresented(materialTypeName); - MaterialTypes.edit(materialTypeName, newMaterialTypeName); - MaterialTypes.delete(newMaterialTypeName); - MaterialTypes.checkIsDeleted(newMaterialTypeName); - MaterialTypes.verifyMessageOfDeteted(newMaterialTypeName); + it('C505 Settings (Inventory): Create, edit, delete material types (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.materialTypePath); + MaterialTypes.checkAvailableOptions(); + NewMaterialType.create(materialTypeName); + MaterialTypes.isPresented(materialTypeName); + MaterialTypes.edit(materialTypeName, newMaterialTypeName); + MaterialTypes.delete(newMaterialTypeName); + MaterialTypes.checkIsDeleted(newMaterialTypeName); + MaterialTypes.verifyMessageOfDeteted(newMaterialTypeName); + }); }); }); diff --git a/cypress/e2e/inventory/create-fast-add-record.cy.js b/cypress/e2e/inventory/create-fast-add-record.cy.js index 33d7cc0e3c..c9775fb8fd 100644 --- a/cypress/e2e/inventory/create-fast-add-record.cy.js +++ b/cypress/e2e/inventory/create-fast-add-record.cy.js @@ -15,86 +15,88 @@ import InventoryInstance from '../../support/fragments/inventory/inventoryInstan import FastAdd from '../../support/fragments/settings/inventory/instance-holdings-item/fastAdd'; import { INSTANCE_STATUS_TERM_NAMES } from '../../support/constants'; -describe('ui-inventory: Create fast add record', () => { - const timeStamp = { - start: null, - end: null, - }; - const instanceStatusCodeValue = INSTANCE_STATUS_TERM_NAMES.UNCATALOGED; - let userId; +describe('inventory', () => { + describe('Fast Add', () => { + const timeStamp = { + start: null, + end: null, + }; + const instanceStatusCodeValue = INSTANCE_STATUS_TERM_NAMES.UNCATALOGED; + let userId; - beforeEach(() => { - cy - .createTempUser([ - permissions.inventoryAll.gui, - permissions.uiInventorySettingsFastAdd.gui - ]) - .then(userProperties => { - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password); + beforeEach(() => { + cy + .createTempUser([ + permissions.inventoryAll.gui, + permissions.uiInventorySettingsFastAdd.gui + ]) + .then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password); - cy.intercept('POST', '/inventory/instances').as('createInstance'); - cy.intercept('POST', '/holdings-storage/holdings').as('createHolding'); - cy.intercept('POST', '/inventory/items').as('createItem'); + cy.intercept('POST', '/inventory/instances').as('createInstance'); + cy.intercept('POST', '/holdings-storage/holdings').as('createHolding'); + cy.intercept('POST', '/inventory/items').as('createItem'); - cy.visit(TopMenu.inventorySettingsFastAddPath); - FastAdd.changeDefaultInstanceStatus(instanceStatusCodeValue); - }); - }); + cy.visit(TopMenu.inventorySettingsFastAddPath); + FastAdd.changeDefaultInstanceStatus(instanceStatusCodeValue); + }); + }); - afterEach('reset "Fast add" setting', () => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(FastAddNewRecord.fastAddNewRecordFormDetails.itemBarcode); - cy.visit(TopMenu.inventorySettingsFastAddPath); - FastAdd.changeDefaultInstanceStatus('Select instance status'); - Users.deleteViaApi(userId); - }); + afterEach('reset "Fast add" setting', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(FastAddNewRecord.fastAddNewRecordFormDetails.itemBarcode); + cy.visit(TopMenu.inventorySettingsFastAddPath); + FastAdd.changeDefaultInstanceStatus('Select instance status'); + Users.deleteViaApi(userId); + }); - it('C15850 Create a fast add record from Inventory. Monograph. (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - cy.visit(TopMenu.inventoryPath); - InventoryActions.openNewFastAddRecordForm(); - FastAddNewRecord.waitLoading(); - FastAddNewRecord.fillFastAddNewRecordForm(FastAddNewRecord.fastAddNewRecordFormDetails); + it('C15850 Create a fast add record from Inventory. Monograph. (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + cy.visit(TopMenu.inventoryPath); + InventoryActions.openNewFastAddRecordForm(); + FastAddNewRecord.waitLoading(); + FastAddNewRecord.fillFastAddNewRecordForm(FastAddNewRecord.fastAddNewRecordFormDetails); - // set starting timestamp right before saving - timeStamp.start = new Date(); - FastAddNewRecord.saveAndClose(); + // set starting timestamp right before saving + timeStamp.start = new Date(); + FastAddNewRecord.saveAndClose(); - cy.wait(['@createInstance', '@createHolding', '@createItem'], getLongDelay()) - .then(() => { + cy.wait(['@createInstance', '@createHolding', '@createItem'], getLongDelay()) + .then(() => { // set ending timestamp after saving - timeStamp.end = new Date(); + timeStamp.end = new Date(); - InteractorsTools.checkCalloutMessage( - FastAdd.calloutMessages.INVENTORY_RECORDS_CREATE_SUCCESS - ); - InventorySearchAndFilter.searchInstanceByTitle(FastAddNewRecord.fastAddNewRecordFormDetails.resourceTitle); - FastAddNewRecord.openRecordDetails(); + InteractorsTools.checkCalloutMessage( + FastAdd.calloutMessages.INVENTORY_RECORDS_CREATE_SUCCESS + ); + InventorySearchAndFilter.searchInstanceByTitle(FastAddNewRecord.fastAddNewRecordFormDetails.resourceTitle); + FastAddNewRecord.openRecordDetails(); - // verify instance details - FastAddNewRecord.verifyRecordCreatedDate(timeStamp); - InstanceRecordView.verifyResourceTitle(FastAddNewRecord.fastAddNewRecordFormDetails.resourceTitle); - InstanceRecordView.verifyInstanceStatusCode( - FastAddNewRecord.fastAddNewRecordFormDetails.instanceStatusCodeValue - ); - InstanceRecordView.verifyResourceType( - FastAddNewRecord.fastAddNewRecordFormDetails.resourceType - ); + // verify instance details + FastAddNewRecord.verifyRecordCreatedDate(timeStamp); + InstanceRecordView.verifyResourceTitle(FastAddNewRecord.fastAddNewRecordFormDetails.resourceTitle); + InstanceRecordView.verifyInstanceStatusCode( + FastAddNewRecord.fastAddNewRecordFormDetails.instanceStatusCodeValue + ); + InstanceRecordView.verifyResourceType( + FastAddNewRecord.fastAddNewRecordFormDetails.resourceType + ); - // verify holdings details - FastAddNewRecord.viewHoldings(); - FastAddNewRecord.verifyRecordCreatedDate(timeStamp); - FastAddNewRecord.verifyPermanentLocation( - FastAddNewRecord.fastAddNewRecordFormDetails.permanentLocationValue - ); - FastAddNewRecord.closeHoldingsRecordView(); + // verify holdings details + FastAddNewRecord.viewHoldings(); + FastAddNewRecord.verifyRecordCreatedDate(timeStamp); + FastAddNewRecord.verifyPermanentLocation( + FastAddNewRecord.fastAddNewRecordFormDetails.permanentLocationValue + ); + FastAddNewRecord.closeHoldingsRecordView(); - // verify item details - InventoryInstance.openHoldings([FastAddNewRecord.fastAddNewRecordFormDetails.permanentLocationValue]); - InventoryInstance.openItemByBarcode(FastAddNewRecord.fastAddNewRecordFormDetails.itemBarcode); - FastAddNewRecord.verifyRecordCreatedDate(timeStamp); - ItemRecordView.verifyPermanentLoanType(FastAddNewRecord.fastAddNewRecordFormDetails.permanentLoanType); - ItemRecordView.verifyItemBarcode(FastAddNewRecord.fastAddNewRecordFormDetails.itemBarcode); - ItemRecordView.verifyNote(FastAddNewRecord.fastAddNewRecordFormDetails.note); - }); + // verify item details + InventoryInstance.openHoldings([FastAddNewRecord.fastAddNewRecordFormDetails.permanentLocationValue]); + InventoryInstance.openItemByBarcode(FastAddNewRecord.fastAddNewRecordFormDetails.itemBarcode); + FastAddNewRecord.verifyRecordCreatedDate(timeStamp); + ItemRecordView.verifyPermanentLoanType(FastAddNewRecord.fastAddNewRecordFormDetails.permanentLoanType); + ItemRecordView.verifyItemBarcode(FastAddNewRecord.fastAddNewRecordFormDetails.itemBarcode); + ItemRecordView.verifyNote(FastAddNewRecord.fastAddNewRecordFormDetails.note); + }); + }); }); }); diff --git a/cypress/e2e/inventory/create-instance-with-add-new.cy.js b/cypress/e2e/inventory/create-instance-with-add-new.cy.js index 22db9b428d..ce167a5b62 100644 --- a/cypress/e2e/inventory/create-instance-with-add-new.cy.js +++ b/cypress/e2e/inventory/create-instance-with-add-new.cy.js @@ -7,25 +7,27 @@ import { MultiColumnListCell } from '../../../interactors'; import DevTeams from '../../support/dictionary/devTeams'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; -describe('ui-inventory: Create new instance with add "New"', () => { - const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; +describe('inventory', () => { + describe('Instance', () => { + const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; - before('navigate to Inventory', () => { - cy.loginAsAdmin({ path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - cy.getAdminToken(); - }); + before('navigate to Inventory', () => { + cy.loginAsAdmin({ path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.getAdminToken(); + }); - after(() => { - InventoryInstances.getInstanceIdApi({ limit: 1, query: `title="${instanceTitle}"` }) - .then((id) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after(() => { + InventoryInstances.getInstanceIdApi({ limit: 1, query: `title="${instanceTitle}"` }) + .then((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it('C598 Create new instance with add "New" (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - InventoryInstances.add(instanceTitle); - InventorySearchAndFilter.searchInstanceByTitle(instanceTitle); + it('C598 Create new instance with add "New" (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + InventoryInstances.add(instanceTitle); + InventorySearchAndFilter.searchInstanceByTitle(instanceTitle); - cy.expect(MultiColumnListCell({ row: 0, content: instanceTitle }).exists()); + cy.expect(MultiColumnListCell({ row: 0, content: instanceTitle }).exists()); + }); }); }); diff --git a/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js b/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js index 64e3893252..7114b0e691 100644 --- a/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js +++ b/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js @@ -9,53 +9,55 @@ import TopMenu from '../../support/fragments/topMenu'; import DevTeams from '../../support/dictionary/devTeams'; import { INSTANCE_SOURCE_NAMES } from '../../support/constants'; -describe('ui-inventory: Enter different type of identifiers', () => { - let instanceTitle; - let instanceId; - let resourceIdentifier; +describe('inventory', () => { + describe('Instance', () => { + let instanceTitle; + let instanceId; + let resourceIdentifier; - beforeEach('navigate to inventory', () => { - instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - cy.getInstanceTypes({ limit: 1 }); - cy.getInstanceIdentifierTypes({ limit: 1 }); - }) - .then(() => { - cy.createInstance({ - instance: { - instanceTypeId: Cypress.env('instanceTypes')[0].id, - title: instanceTitle, - source: INSTANCE_SOURCE_NAMES.FOLIO - }, - }).then(specialInstanceId => { instanceId = specialInstanceId; }); - }); - }); + beforeEach('navigate to inventory', () => { + instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + cy.getInstanceTypes({ limit: 1 }); + cy.getInstanceIdentifierTypes({ limit: 1 }); + }) + .then(() => { + cy.createInstance({ + instance: { + instanceTypeId: Cypress.env('instanceTypes')[0].id, + title: instanceTitle, + source: INSTANCE_SOURCE_NAMES.FOLIO + }, + }).then(specialInstanceId => { instanceId = specialInstanceId; }); + }); + }); - afterEach(() => { - InventoryInstance.deleteInstanceViaApi(instanceId); - }); + afterEach(() => { + InventoryInstance.deleteInstanceViaApi(instanceId); + }); - const searchAndOpenInstance = (parametr, title) => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchByParameter(parametr, title); - InventoryInstances.selectInstance(); - }; + const searchAndOpenInstance = (parametr, title) => { + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchByParameter(parametr, title); + InventoryInstances.selectInstance(); + }; - [ - 'ASIN', - 'BNB' - ].forEach((identifier) => { - it('C609 In Accordion Identifiers --> enter different type of identifiers (folijet) (prokopovych)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - resourceIdentifier = `testResourceIdentifier.${getRandomPostfix()}`; + [ + 'ASIN', + 'BNB' + ].forEach((identifier) => { + it('C609 In Accordion Identifiers --> enter different type of identifiers (folijet) (prokopovych)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + resourceIdentifier = `testResourceIdentifier.${getRandomPostfix()}`; - searchAndOpenInstance('Title (all)', instanceTitle); - InventoryInstance.editInstance(); - InstanceRecordEdit.addIdentifier(identifier, resourceIdentifier); - searchAndOpenInstance('Keyword (title, contributor, identifier, HRID, UUID)', resourceIdentifier); - InventoryInstance.checkInstanceIdentifier(resourceIdentifier); - }); + searchAndOpenInstance('Title (all)', instanceTitle); + InventoryInstance.editInstance(); + InstanceRecordEdit.addIdentifier(identifier, resourceIdentifier); + searchAndOpenInstance('Keyword (title, contributor, identifier, HRID, UUID)', resourceIdentifier); + InventoryInstance.checkInstanceIdentifier(resourceIdentifier); + }); + }); }); }); diff --git a/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js b/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js index 452cb31bcc..e1e3510929 100644 --- a/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js +++ b/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js @@ -7,45 +7,47 @@ import Users from '../../../support/fragments/users/users'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import DevTeams from '../../../support/dictionary/devTeams'; -describe('ui-inventory: Filter instances by tags', () => { - let userId; - let instanceRecord = null; - const testTag = `test_tag_${uuid()}`; - const tagsCount = '1'; +describe('inventory', () => { + describe('Tags', () => { + let userId; + let instanceRecord = null; + const testTag = `test_tag_${uuid()}`; + const tagsCount = '1'; - beforeEach(() => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.uiTagsPermissionAll.gui, - ]).then(({ username, password, userId: id }) => { - userId = id; - cy.login(username, password); - }).then(() => { - InventorySearchAndFilter.createInstanceViaApi().then(({ instanceData }) => { - instanceRecord = instanceData; + beforeEach(() => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.uiTagsPermissionAll.gui, + ]).then(({ username, password, userId: id }) => { + userId = id; + cy.login(username, password); + }).then(() => { + InventorySearchAndFilter.createInstanceViaApi().then(({ instanceData }) => { + instanceRecord = instanceData; + }); }); }); - }); - afterEach(() => { - InventoryInstance.deleteInstanceViaApi(instanceRecord.instanceId); - Users.deleteViaApi(userId); - }); + afterEach(() => { + InventoryInstance.deleteInstanceViaApi(instanceRecord.instanceId); + Users.deleteViaApi(userId); + }); - it('C343215 Filter instances by tags (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.verifyPanesExist(); - InventorySearchAndFilter.searchInstanceByTitle(instanceRecord.instanceTitle); - InventorySearchAndFilter.verifySearchResult(instanceRecord.instanceTitle); - InventorySearchAndFilter.selectFoundInstance(instanceRecord.instanceTitle); - InventorySearchAndFilter.verifyInstanceDetailsView(); - InventorySearchAndFilter.openTagsField(); - InventorySearchAndFilter.verifyTagsView(); - InventorySearchAndFilter.addTag(testTag); - InventorySearchAndFilter.verifyTagCount(tagsCount); - InventorySearchAndFilter.closeInstanceDetailPane(); - InventorySearchAndFilter.resetAllAndVerifyNoResultsAppear(); - InventorySearchAndFilter.filterByTag(testTag); - InventorySearchAndFilter.verifyIsFilteredByTag(instanceRecord.instanceTitle); + it('C343215 Filter instances by tags (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.verifyPanesExist(); + InventorySearchAndFilter.searchInstanceByTitle(instanceRecord.instanceTitle); + InventorySearchAndFilter.verifySearchResult(instanceRecord.instanceTitle); + InventorySearchAndFilter.selectFoundInstance(instanceRecord.instanceTitle); + InventorySearchAndFilter.verifyInstanceDetailsView(); + InventorySearchAndFilter.openTagsField(); + InventorySearchAndFilter.verifyTagsView(); + InventorySearchAndFilter.addTag(testTag); + InventorySearchAndFilter.verifyTagCount(tagsCount); + InventorySearchAndFilter.closeInstanceDetailPane(); + InventorySearchAndFilter.resetAllAndVerifyNoResultsAppear(); + InventorySearchAndFilter.filterByTag(testTag); + InventorySearchAndFilter.verifyIsFilteredByTag(instanceRecord.instanceTitle); + }); }); }); diff --git a/cypress/e2e/inventory/filter/filter-items-with-status.cy.js b/cypress/e2e/inventory/filter/filter-items-with-status.cy.js index d7f2d63dfd..9216863223 100644 --- a/cypress/e2e/inventory/filter/filter-items-with-status.cy.js +++ b/cypress/e2e/inventory/filter/filter-items-with-status.cy.js @@ -19,7 +19,7 @@ const holdingId = uuid(); const title = `Filter items with status test ${Number(new Date())}`; let source; -describe('ui-inventory: items with status', () => { +describe('ui-inventory: Search in Inventory', () => { before('create inventory instance', () => { cy.createTempUser([ permissions.inventoryAll.gui, @@ -80,7 +80,7 @@ describe('ui-inventory: items with status', () => { users.deleteViaApi(userId); }); - it('C11081: Verify item status filters retrieve items with that item status (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + it('C11081: Verify item status filters retrieve items with that item status (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { cy.intercept('GET', '/inventory/items?*').as('getItems'); cy.intercept('GET', '/search/instances?*').as('getInstances'); cy.intercept('GET', '/orders/titles?*').as('getTitles'); diff --git a/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js b/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js index d4d65370cc..eb898674ed 100644 --- a/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js +++ b/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js @@ -11,60 +11,62 @@ import Helper from '../../../support/fragments/finance/financeHelper'; import DevTeams from '../../../support/dictionary/devTeams'; import { INSTANCE_SOURCE_NAMES, LOCATION_NAMES } from '../../../support/constants'; -describe('ui-inventory: Create a Holdings record as another user than the one that created the Instance', () => { - let firstUser; - let secondUser; - const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; - const recordsData = { - instanceTitle, - permanentLocationOption: 'Online (E) ', - permanentLocationValue: LOCATION_NAMES.ONLINE_UI, - source: INSTANCE_SOURCE_NAMES.FOLIO - }; +describe('inventory', () => { + describe('Holdings', () => { + let firstUser; + let secondUser; + const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; + const recordsData = { + instanceTitle, + permanentLocationOption: 'Online (E) ', + permanentLocationValue: LOCATION_NAMES.ONLINE_UI, + source: INSTANCE_SOURCE_NAMES.FOLIO + }; - beforeEach(() => { - cy - .createTempUser([permissions.inventoryAll.gui]) - .then((userProperties) => { - firstUser = userProperties; - }); + beforeEach(() => { + cy + .createTempUser([permissions.inventoryAll.gui]) + .then((userProperties) => { + firstUser = userProperties; + }); - cy - .createTempUser([permissions.inventoryAll.gui]) - .then(userProperties => { - secondUser = userProperties; - cy.login(secondUser.username, secondUser.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - }); - }); + cy + .createTempUser([permissions.inventoryAll.gui]) + .then(userProperties => { + secondUser = userProperties; + cy.login(secondUser.username, secondUser.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); - afterEach(() => { - cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${instanceTitle}"` }) - .then((instance) => { - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - Users.deleteViaApi(firstUser.userId); - Users.deleteViaApi(secondUser.userId); - }); + afterEach(() => { + cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${instanceTitle}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + Users.deleteViaApi(firstUser.userId); + Users.deleteViaApi(secondUser.userId); + }); - it('C1294: Create a Holdings record as another user than the one that created the Instance (folijet) (prokopovych)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - InventoryInstances.add(recordsData.instanceTitle); - InventorySearchAndFilter.searchInstanceByTitle(recordsData.instanceTitle); - cy.expect(MultiColumnListCell({ row: 0, content: recordsData.instanceTitle }).exists()); + it('C1294: Create a Holdings record as another user than the one that created the Instance (folijet) (prokopovych)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + InventoryInstances.add(recordsData.instanceTitle); + InventorySearchAndFilter.searchInstanceByTitle(recordsData.instanceTitle); + cy.expect(MultiColumnListCell({ row: 0, content: recordsData.instanceTitle }).exists()); - // logout and login as a different user - cy.logout(); - cy.login(firstUser.username, firstUser.password); + // logout and login as a different user + cy.logout(); + cy.login(firstUser.username, firstUser.password); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByTitle(recordsData.instanceTitle); - InventoryInstances.selectInstance(); - InventoryInstance.waitLoading(); - InventoryInstance.createHoldingsRecord(recordsData.permanentLocationOption); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByTitle(recordsData.instanceTitle); + InventoryInstances.selectInstance(); + InventoryInstance.waitLoading(); + InventoryInstance.createHoldingsRecord(recordsData.permanentLocationOption); - InventoryInstance.openHoldingView(); - HoldingsRecordView.checkSource(recordsData.source); - HoldingsRecordView.checkPermanentLocation(recordsData.permanentLocationValue); - }); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkSource(recordsData.source); + HoldingsRecordView.checkPermanentLocation(recordsData.permanentLocationValue); + }); + }); }); diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index a507eb9d53..6d4fe38a78 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -42,271 +42,273 @@ import UserEdit from '../../support/fragments/users/userEdit'; import ServicePoint from '../../support/fragments/servicePoint/servicePoint'; import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; -describe('ui-inventory: Item status date updates', () => { - const instanceTitle = `autotestTitle ${Helper.getRandomBarcode()}`; - const itemQuantity = '1'; - let orderNumber; - let effectiveLocationServicePoint; - let notEffectiveLocationServicePoint; - let effectiveLocation; - let userForDeliveryRequest = {}; - const itemBarcode = Helper.getRandomBarcode(); - const userName = Cypress.env('diku_login'); - - before(() => { - cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - cy.getLoanPolicy({ query: `name=="${LOAN_POLICY_NAMES.EXAMPLE_LOAN}"` }); - cy.getRequestPolicy({ query: `name=="${REQUEST_POLICY_NAMES.ALLOW_ALL}"` }); - cy.getNoticePolicy({ query: `name=="${NOTICE_POLICY_NAMES.SEND_NO_NOTICES}"` }); - cy.getOverdueFinePolicy({ query: `name=="${OVERDUE_FINE_POLICY_NAMES.OVERDUE_FINE_POLICY}"` }); - cy.getLostItemFeesPolicy({ query: `name=="${LOST_ITEM_FEES_POLICY_NAMES.LOST_ITEM_FEES_POLICY}"` }); - }).then(() => { - const loanPolicy = Cypress.env(CY_ENV.LOAN_POLICY).id; - const requestPolicyId = Cypress.env(CY_ENV.REQUEST_POLICY)[0].id; - const noticePolicyId = Cypress.env(CY_ENV.NOTICE_POLICY)[0].id; - const overdueFinePolicyId = Cypress.env(CY_ENV.OVERDUE_FINE_POLICY)[0].id; - const lostItemFeesPolicyId = Cypress.env(CY_ENV.LOST_ITEM_FEES_POLICY)[0].id; - const policy = `l ${loanPolicy} r ${requestPolicyId} n ${noticePolicyId} o ${overdueFinePolicyId} i ${lostItemFeesPolicyId}`; - const priority = 'priority: number-of-criteria, criterium (t, s, c, b, a, m, g), last-line'; - const newRule = `${priority}\nfallback-policy: ${policy}`; - - cy.updateCirculationRules({ - rulesAsText: newRule, - }); - ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) - .then((servicePoints) => { - effectiveLocationServicePoint = servicePoints[0]; - NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) - .then((location) => { - effectiveLocation = location; - Orders.createOrderWithOrderLineViaApi( - NewOrder.getDefaultOrder(), - BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id) - ) - .then(order => { - orderNumber = order; - }); - }); - }); - ServicePoints.getViaApi({ limit: 1, query: 'name=="Online"' }) - .then((servicePoints) => { - notEffectiveLocationServicePoint = servicePoints[0]; +describe('inventory', () => { + describe('Item', () => { + const instanceTitle = `autotestTitle ${Helper.getRandomBarcode()}`; + const itemQuantity = '1'; + let orderNumber; + let effectiveLocationServicePoint; + let notEffectiveLocationServicePoint; + let effectiveLocation; + let userForDeliveryRequest = {}; + const itemBarcode = Helper.getRandomBarcode(); + const userName = Cypress.env('diku_login'); + + before(() => { + cy.loginAsAdmin(); + cy.getAdminToken() + .then(() => { + cy.getLoanPolicy({ query: `name=="${LOAN_POLICY_NAMES.EXAMPLE_LOAN}"` }); + cy.getRequestPolicy({ query: `name=="${REQUEST_POLICY_NAMES.ALLOW_ALL}"` }); + cy.getNoticePolicy({ query: `name=="${NOTICE_POLICY_NAMES.SEND_NO_NOTICES}"` }); + cy.getOverdueFinePolicy({ query: `name=="${OVERDUE_FINE_POLICY_NAMES.OVERDUE_FINE_POLICY}"` }); + cy.getLostItemFeesPolicy({ query: `name=="${LOST_ITEM_FEES_POLICY_NAMES.LOST_ITEM_FEES_POLICY}"` }); + }).then(() => { + const loanPolicy = Cypress.env(CY_ENV.LOAN_POLICY).id; + const requestPolicyId = Cypress.env(CY_ENV.REQUEST_POLICY)[0].id; + const noticePolicyId = Cypress.env(CY_ENV.NOTICE_POLICY)[0].id; + const overdueFinePolicyId = Cypress.env(CY_ENV.OVERDUE_FINE_POLICY)[0].id; + const lostItemFeesPolicyId = Cypress.env(CY_ENV.LOST_ITEM_FEES_POLICY)[0].id; + const policy = `l ${loanPolicy} r ${requestPolicyId} n ${noticePolicyId} o ${overdueFinePolicyId} i ${lostItemFeesPolicyId}`; + const priority = 'priority: number-of-criteria, criterium (t, s, c, b, a, m, g), last-line'; + const newRule = `${priority}\nfallback-policy: ${policy}`; + + cy.updateCirculationRules({ + rulesAsText: newRule, }); - }); - - cy.createTempUser([ - permissions.checkoutAll.gui, - permissions.requestsAll.gui, - ]) - .then(userProperties => { - userForDeliveryRequest = userProperties; - - cy.getRequestPreference({ limit: 1, query: `"userId"="${userForDeliveryRequest.userId}"` }) - .then((response) => { - cy.updateRequestPreference(response.body.requestPreferences[0].id, { - defaultDeliveryAddressTypeId: '46ff3f08-8f41-485c-98d8-701ba8404f4f', - defaultServicePointId: null, - delivery: true, - fulfillment: FULFILMENT_PREFERENCES.DELIVERY, - holdShelf: true, - userId: userForDeliveryRequest.userId + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) + .then((servicePoints) => { + effectiveLocationServicePoint = servicePoints[0]; + NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) + .then((location) => { + effectiveLocation = location; + Orders.createOrderWithOrderLineViaApi( + NewOrder.getDefaultOrder(), + BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id) + ) + .then(order => { + orderNumber = order; + }); + }); }); - }); - }); - }); + ServicePoints.getViaApi({ limit: 1, query: 'name=="Online"' }) + .then((servicePoints) => { + notEffectiveLocationServicePoint = servicePoints[0]; + }); + }); - afterEach(() => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(order => Orders.deleteOrderViaApi(order[0].id)); - UserEdit.changeServicePointPreferenceViaApi( - userForDeliveryRequest.userId, - [effectiveLocationServicePoint.id, notEffectiveLocationServicePoint.id] - ) - .then(() => { - ServicePoint.deleteViaApi(effectiveLocationServicePoint.id); - ServicePoint.deleteViaApi(notEffectiveLocationServicePoint.id); - Users.deleteViaApi(userForDeliveryRequest.userId); - }); + cy.createTempUser([ + permissions.checkoutAll.gui, + permissions.requestsAll.gui, + ]) + .then(userProperties => { + userForDeliveryRequest = userProperties; + + cy.getRequestPreference({ limit: 1, query: `"userId"="${userForDeliveryRequest.userId}"` }) + .then((response) => { + cy.updateRequestPreference(response.body.requestPreferences[0].id, { + defaultDeliveryAddressTypeId: '46ff3f08-8f41-485c-98d8-701ba8404f4f', + defaultServicePointId: null, + delivery: true, + fulfillment: FULFILMENT_PREFERENCES.DELIVERY, + holdShelf: true, + userId: userForDeliveryRequest.userId + }); + }); + }); + }); - NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - effectiveLocation.institutionId, - effectiveLocation.campusId, - effectiveLocation.libraryId, - effectiveLocation.id - ); - }); + afterEach(() => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(order => Orders.deleteOrderViaApi(order[0].id)); + UserEdit.changeServicePointPreferenceViaApi( + userForDeliveryRequest.userId, + [effectiveLocationServicePoint.id, notEffectiveLocationServicePoint.id] + ) + .then(() => { + ServicePoint.deleteViaApi(effectiveLocationServicePoint.id); + ServicePoint.deleteViaApi(notEffectiveLocationServicePoint.id); + Users.deleteViaApi(userForDeliveryRequest.userId); + }); - const openItem = (title, itemLocation, barcode) => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchByParameter('Title (all)', title); - InventoryInstances.selectInstance(); - InventoryInstance.openHoldings(itemLocation); - InventoryInstance.openItemByBarcode(barcode); - }; - - const selectOrderWithNumber = (numberOrder) => { - Orders.searchByParameter('PO number', numberOrder); - Orders.selectFromResultsList(numberOrder); - }; - - const fullCheck = (status) => { - ItemRecordView.verifyUpdatedItemDate(); - ItemRecordView.verifyItemStatus(status); - cy.log(`###${status}###`); - }; - - const checkOpenItem = (barcode, status, confirmModal) => { - if (confirmModal) { - confirmModal(); - } - CheckInActions.openItemRecordInInventory(barcode); - fullCheck(status); - }; - - const checkIn = (barcode, status, confirmModal) => { - cy.visit(TopMenu.checkInPath); - // TODO investigate why need 1 min wait before each step - // it's enough to wait 15000 before and after check in - cy.wait(15000); - CheckInActions.checkInItem(barcode); - cy.wait(15000); - checkOpenItem(barcode, status, confirmModal); - }; - - const checkOut = (specialUserName, specialItemBarcode, status, confirmModalCheck) => { - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(specialUserName, specialItemBarcode); - if (confirmModalCheck) { - confirmModalCheck(); - } - CheckOut.openItemRecordInInventory(itemBarcode); - fullCheck(status); - }; - - const openUser = (name) => { - cy.visit(TopMenu.usersPath); - UsersSearchPane.searchByKeywords(name); - UsersSearchPane.selectUserFromList(name); - UsersCard.openLoans(); - UsersCard.showOpenedLoans(); - }; - - // test is looping - it('C9200 Item status date updates (folijet) (prokopovych)', () => { - const caption = `autotest_caption_${getRandomPostfix()}`; - const numberOfPieces = '3'; - // open order and create Item - cy.visit(TopMenu.ordersPath); - selectOrderWithNumber(orderNumber); - Orders.openOrder(); - OrdersHelper.verifyOrderDateOpened(); - openItem(instanceTitle, effectiveLocation.name, 'No barcode'); - fullCheck(ItemRecordView.itemStatuses.onOrder); - - // receive item - cy.visit(TopMenu.ordersPath); - selectOrderWithNumber(orderNumber); - Orders.receiveOrderViaActions(); - Receiving.selectFromResultsList(instanceTitle); - Receiving.receivePiece(0, caption, itemBarcode); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.inProcess); - - // check in item at service point assigned to its effective location - SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.available); - - // mark item as missing - ItemActions.markAsMissing(); - ItemActions.confirmMarkAsMissing(); - fullCheck(ItemRecordView.itemStatuses.missing); - - // check in item at service point assigned to its effective location - checkIn(itemBarcode, ItemRecordView.itemStatuses.available, ConfirmItemInModal.confirmMissingModal); - - // check in item at service point assigned to its effective location - checkIn(itemBarcode, ItemRecordView.itemStatuses.available); - - // check in item at service point not assigned to its effective location - SwitchServicePoint.switchServicePoint(notEffectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); - - // check in item at service point not assigned to its effective location - checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); - - // check in item at service point assigned to its effective location - SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.available); - - // create Page request on an item - cy.visit(TopMenu.requestsPath); - NewRequest.createWithUserName({ - itemBarcode, - requesterName: userName, - pickupServicePoint: effectiveLocationServicePoint.name + NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + effectiveLocation.institutionId, + effectiveLocation.campusId, + effectiveLocation.libraryId, + effectiveLocation.id + ); }); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.paged); - - // check in item at a service point other than the pickup service point for the request - SwitchServicePoint.switchServicePoint(notEffectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); - - // check in item at the pickup service point for the page request - SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.awaitingPickup, ConfirmItemInModal.confirmAvaitingPickUpModal); - - // check out item to user for whom page request was created - checkOut(userName, itemBarcode, ItemRecordView.itemStatuses.checkedOut, ConfirmItemInModal.confirmAvaitingPickupCheckInModal); - - // declare item lost - openUser(userName); - UserLoans.declareLoanLost(itemBarcode); - ConfirmItemStatusModal.confirmItemStatus(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.declaredLost); - - // renew item (through override) - openUser(userName); - UserLoans.renewItem(itemBarcode); - RenewConfirmationModal.confirmRenewOverrideItem(); - OverrideAndRenewModal.confirmOverrideItem(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.checkedOut); - - // edit item record so that it has multiple pieces - InventoryInstance.edit(); - ItemRecordView.addPieceToItem(numberOfPieces); - fullCheck(ItemRecordView.itemStatuses.checkedOut); - - // create delivery request (hold or recall) on item - cy.visit(TopMenu.requestsPath); - NewRequest.createDeliveryRequest({ - itemBarcode, - itemTitle: null, - requesterBarcode: userForDeliveryRequest.barcode, - requestType: REQUEST_TYPES.HOLD + + const openItem = (title, itemLocation, barcode) => { + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchByParameter('Title (all)', title); + InventoryInstances.selectInstance(); + InventoryInstance.openHoldings(itemLocation); + InventoryInstance.openItemByBarcode(barcode); + }; + + const selectOrderWithNumber = (numberOrder) => { + Orders.searchByParameter('PO number', numberOrder); + Orders.selectFromResultsList(numberOrder); + }; + + const fullCheck = (status) => { + ItemRecordView.verifyUpdatedItemDate(); + ItemRecordView.verifyItemStatus(status); + cy.log(`###${status}###`); + }; + + const checkOpenItem = (barcode, status, confirmModal) => { + if (confirmModal) { + confirmModal(); + } + CheckInActions.openItemRecordInInventory(barcode); + fullCheck(status); + }; + + const checkIn = (barcode, status, confirmModal) => { + cy.visit(TopMenu.checkInPath); + // TODO investigate why need 1 min wait before each step + // it's enough to wait 15000 before and after check in + cy.wait(15000); + CheckInActions.checkInItem(barcode); + cy.wait(15000); + checkOpenItem(barcode, status, confirmModal); + }; + + const checkOut = (specialUserName, specialItemBarcode, status, confirmModalCheck) => { + cy.visit(TopMenu.checkOutPath); + CheckOutActions.checkOutItemWithUserName(specialUserName, specialItemBarcode); + if (confirmModalCheck) { + confirmModalCheck(); + } + CheckOut.openItemRecordInInventory(itemBarcode); + fullCheck(status); + }; + + const openUser = (name) => { + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords(name); + UsersSearchPane.selectUserFromList(name); + UsersCard.openLoans(); + UsersCard.showOpenedLoans(); + }; + + // test is looping + it('C9200 Item status date updates (folijet) (prokopovych)', () => { + const caption = `autotest_caption_${getRandomPostfix()}`; + const numberOfPieces = '3'; + // open order and create Item + cy.visit(TopMenu.ordersPath); + selectOrderWithNumber(orderNumber); + Orders.openOrder(); + OrdersHelper.verifyOrderDateOpened(); + openItem(instanceTitle, effectiveLocation.name, 'No barcode'); + fullCheck(ItemRecordView.itemStatuses.onOrder); + + // receive item + cy.visit(TopMenu.ordersPath); + selectOrderWithNumber(orderNumber); + Orders.receiveOrderViaActions(); + Receiving.selectFromResultsList(instanceTitle); + Receiving.receivePiece(0, caption, itemBarcode); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.inProcess); + + // check in item at service point assigned to its effective location + SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); + checkIn(itemBarcode, ItemRecordView.itemStatuses.available); + + // mark item as missing + ItemActions.markAsMissing(); + ItemActions.confirmMarkAsMissing(); + fullCheck(ItemRecordView.itemStatuses.missing); + + // check in item at service point assigned to its effective location + checkIn(itemBarcode, ItemRecordView.itemStatuses.available, ConfirmItemInModal.confirmMissingModal); + + // check in item at service point assigned to its effective location + checkIn(itemBarcode, ItemRecordView.itemStatuses.available); + + // check in item at service point not assigned to its effective location + SwitchServicePoint.switchServicePoint(notEffectiveLocationServicePoint.name); + checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); + + // check in item at service point not assigned to its effective location + checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); + + // check in item at service point assigned to its effective location + SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); + checkIn(itemBarcode, ItemRecordView.itemStatuses.available); + + // create Page request on an item + cy.visit(TopMenu.requestsPath); + NewRequest.createWithUserName({ + itemBarcode, + requesterName: userName, + pickupServicePoint: effectiveLocationServicePoint.name + }); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.paged); + + // check in item at a service point other than the pickup service point for the request + SwitchServicePoint.switchServicePoint(notEffectiveLocationServicePoint.name); + checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); + + // check in item at the pickup service point for the page request + SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); + checkIn(itemBarcode, ItemRecordView.itemStatuses.awaitingPickup, ConfirmItemInModal.confirmAvaitingPickUpModal); + + // check out item to user for whom page request was created + checkOut(userName, itemBarcode, ItemRecordView.itemStatuses.checkedOut, ConfirmItemInModal.confirmAvaitingPickupCheckInModal); + + // declare item lost + openUser(userName); + UserLoans.declareLoanLost(itemBarcode); + ConfirmItemStatusModal.confirmItemStatus(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.declaredLost); + + // renew item (through override) + openUser(userName); + UserLoans.renewItem(itemBarcode); + RenewConfirmationModal.confirmRenewOverrideItem(); + OverrideAndRenewModal.confirmOverrideItem(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.checkedOut); + + // edit item record so that it has multiple pieces + InventoryInstance.edit(); + ItemRecordView.addPieceToItem(numberOfPieces); + fullCheck(ItemRecordView.itemStatuses.checkedOut); + + // create delivery request (hold or recall) on item + cy.visit(TopMenu.requestsPath); + NewRequest.createDeliveryRequest({ + itemBarcode, + itemTitle: null, + requesterBarcode: userForDeliveryRequest.barcode, + requestType: REQUEST_TYPES.HOLD + }); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(itemBarcode); + ConfirmItemInModal.confirmMultipieceCheckInModal(); + cy.visit(TopMenu.checkOutPath); + CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + CheckOutActions.cancelMultipleCheckOutModal(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + + // check out item to user with delivery request + checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut); + + // check in item at service point assigned to its effective location + SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); + cy.visit(TopMenu.checkInPath); + CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.available); }); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(itemBarcode); - ConfirmItemInModal.confirmMultipieceCheckInModal(); - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - CheckOutActions.cancelMultipleCheckOutModal(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - - // check out item to user with delivery request - checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut); - - // check in item at service point assigned to its effective location - SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); - cy.visit(TopMenu.checkInPath); - CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.available); }); }); diff --git a/cypress/e2e/inventory/item/incorrect-service-point-displayed-in-inventory-circulation-history-for-checked-in-loan.cy.js b/cypress/e2e/inventory/item/incorrect-service-point-displayed-in-inventory-circulation-history-for-checked-in-loan.cy.js index 6724615ae4..175ee57725 100644 --- a/cypress/e2e/inventory/item/incorrect-service-point-displayed-in-inventory-circulation-history-for-checked-in-loan.cy.js +++ b/cypress/e2e/inventory/item/incorrect-service-point-displayed-in-inventory-circulation-history-for-checked-in-loan.cy.js @@ -20,111 +20,113 @@ import FilterItems from '../../../support/fragments/inventory/filterItems'; import SwitchServicePoint from '../../../support/fragments/servicePoint/switchServicePoint'; describe('inventory', () => { - let user; - const itemStatus = 'Checked out'; - const todayDate = moment(new Date()).format('M/D/YYYY'); - const itemData = { - barcode: uuid(), - instanceTitle: `autotestInstance ${getRandomPostfix()}`, - }; - const holdingsPermanentLocation = LOCATION_NAMES.ONLINE_UI; - const firstServicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation('firstServicePoint', uuid()); - const secondServicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation('secondServicePoint', uuid()); - const testData = [ - ITEM_STATUS_NAMES.AVAILABLE, - itemData.barcode, - ]; + describe('Item', () => { + let user; + const itemStatus = 'Checked out'; + const todayDate = moment(new Date()).format('M/D/YYYY'); + const itemData = { + barcode: uuid(), + instanceTitle: `autotestInstance ${getRandomPostfix()}`, + }; + const holdingsPermanentLocation = LOCATION_NAMES.ONLINE_UI; + const firstServicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation('firstServicePoint', uuid()); + const secondServicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation('secondServicePoint', uuid()); + const testData = [ + ITEM_STATUS_NAMES.AVAILABLE, + itemData.barcode, + ]; - before('create test data and login', () => { - cy.getAdminToken() - .then(() => { - ServicePoints.createViaApi(firstServicePoint); - ServicePoints.createViaApi(secondServicePoint); + before('create test data and login', () => { + cy.getAdminToken() + .then(() => { + ServicePoints.createViaApi(firstServicePoint); + ServicePoints.createViaApi(secondServicePoint); - cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { itemData.instanceTypeId = instanceTypes[0].id; }); - cy.getHoldingTypes({ limit: 1 }).then((res) => { itemData.holdingTypeId = res[0].id; }); - cy.getLocations({ query: `name="${holdingsPermanentLocation}"` }).then((locations) => { - testData.locationsId = locations.id; - }); - cy.getLoanTypes({ limit: 1 }).then((res) => { itemData.loanTypeId = res[0].id; }); - cy.getMaterialTypes({ limit: 1 }).then((res) => { itemData.materialTypeId = res.id; }); - }) - .then(() => { - InventoryInstances.createFolioInstanceViaApi({ instance: { - instanceTypeId: itemData.instanceTypeId, - title: itemData.instanceTitle, - }, - holdings: [{ - holdingsTypeId: itemData.holdingTypeId, - permanentLocationId: testData.locationsId, - }], - items:[{ - barcode: itemData.barcode, - status: { name: ITEM_STATUS_NAMES.AVAILABLE }, - permanentLoanType: { id: itemData.loanTypeId }, - materialType: { id: itemData.materialTypeId }, - }] }).then(specialInstanceIds => { - itemData.testInstanceIds = specialInstanceIds; - }); + cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { itemData.instanceTypeId = instanceTypes[0].id; }); + cy.getHoldingTypes({ limit: 1 }).then((res) => { itemData.holdingTypeId = res[0].id; }); + cy.getLocations({ query: `name="${holdingsPermanentLocation}"` }).then((locations) => { + testData.locationsId = locations.id; + }); + cy.getLoanTypes({ limit: 1 }).then((res) => { itemData.loanTypeId = res[0].id; }); + cy.getMaterialTypes({ limit: 1 }).then((res) => { itemData.materialTypeId = res.id; }); + }) + .then(() => { + InventoryInstances.createFolioInstanceViaApi({ instance: { + instanceTypeId: itemData.instanceTypeId, + title: itemData.instanceTitle, + }, + holdings: [{ + holdingsTypeId: itemData.holdingTypeId, + permanentLocationId: testData.locationsId, + }], + items:[{ + barcode: itemData.barcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: itemData.loanTypeId }, + materialType: { id: itemData.materialTypeId }, + }] }).then(specialInstanceIds => { + itemData.testInstanceIds = specialInstanceIds; + }); - cy.getUsers({ limit: 1, query: '"barcode"="" and "active"="true"' }) - .then((users) => { - Checkout.checkoutItemViaApi({ - itemBarcode: itemData.barcode, - userBarcode: users[0].barcode, - servicePointId: firstServicePoint.id, + cy.getUsers({ limit: 1, query: '"barcode"="" and "active"="true"' }) + .then((users) => { + Checkout.checkoutItemViaApi({ + itemBarcode: itemData.barcode, + userBarcode: users[0].barcode, + servicePointId: firstServicePoint.id, + }); }); - }); - }); + }); - cy.createTempUser([ - permissions.uiInventoryViewInstances.gui, - permissions.checkinAll.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.uiInventoryViewInstances.gui, + permissions.checkinAll.gui + ]) + .then(userProperties => { + user = userProperties; - UserEdit.addServicePointsViaApi([firstServicePoint.id, secondServicePoint.id], user.userId, firstServicePoint.id); - cy.login(userProperties.username, userProperties.password); - cy.visit(TopMenu.inventoryPath); - }); - }); + UserEdit.addServicePointsViaApi([firstServicePoint.id, secondServicePoint.id], user.userId, firstServicePoint.id); + cy.login(userProperties.username, userProperties.password); + cy.visit(TopMenu.inventoryPath); + }); + }); - after('delete test data', () => { - UserEdit.changeServicePointPreferenceViaApi(user.userId, [firstServicePoint.id, secondServicePoint.id]); - ServicePoints.deleteViaApi(firstServicePoint.id); - ServicePoints.deleteViaApi(secondServicePoint.id); - Users.deleteViaApi(user.userId); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemData.barcode); - }); + after('delete test data', () => { + UserEdit.changeServicePointPreferenceViaApi(user.userId, [firstServicePoint.id, secondServicePoint.id]); + ServicePoints.deleteViaApi(firstServicePoint.id); + ServicePoints.deleteViaApi(secondServicePoint.id); + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemData.barcode); + }); - it('C399075 Incorrect service point displayed in Inventory Circulation history for checked in loan (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventorySearchAndFilter.waitLoading(); - InventorySearchAndFilter.switchToItem(); - FilterItems.toggleItemStatusAccordion(); - FilterItems.toggleStatus(itemStatus); - InventorySearchAndFilter.searchInstanceByTitle(itemData.instanceTitle); - InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.ONLINE_UI} >`); + it('C399075 Incorrect service point displayed in Inventory Circulation history for checked in loan (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventorySearchAndFilter.waitLoading(); + InventorySearchAndFilter.switchToItem(); + FilterItems.toggleItemStatusAccordion(); + FilterItems.toggleStatus(itemStatus); + InventorySearchAndFilter.searchInstanceByTitle(itemData.instanceTitle); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.ONLINE_UI} >`); - cy.visit(TopMenu.checkInPath); - CheckInActions.waitLoading(); - CheckInActions.checkInItemGui(itemData.barcode); - ConfirmItemInModal.confirmInTransitModal(); - cy.go('back'); - InventoryInstance.waitInstanceRecordViewOpened(itemData.instanceTitle); - InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.ONLINE_UI} >`); - InventoryInstance.openItemByBarcode(itemData.barcode); - ItemRecordView.waitLoading(); - ItemRecordView.checkItemCirculationHistory(todayDate, firstServicePoint.name, user.username); + cy.visit(TopMenu.checkInPath); + CheckInActions.waitLoading(); + CheckInActions.checkInItemGui(itemData.barcode); + ConfirmItemInModal.confirmInTransitModal(); + cy.go('back'); + InventoryInstance.waitInstanceRecordViewOpened(itemData.instanceTitle); + InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.ONLINE_UI} >`); + InventoryInstance.openItemByBarcode(itemData.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.checkItemCirculationHistory(todayDate, firstServicePoint.name, user.username); - cy.visit(TopMenu.checkInPath); - CheckInActions.waitLoading(); - SwitchServicePoint.switchServicePoint(secondServicePoint.name); - CheckInActions.checkInItemGui(itemData.barcode); - ConfirmItemInModal.confirmInTransitModal(); - cy.go('back'); - ItemRecordView.waitLoading(); - ItemRecordView.checkItemCirculationHistory(todayDate, secondServicePoint.name, user.username); - }); + cy.visit(TopMenu.checkInPath); + CheckInActions.waitLoading(); + SwitchServicePoint.switchServicePoint(secondServicePoint.name); + CheckInActions.checkInItemGui(itemData.barcode); + ConfirmItemInModal.confirmInTransitModal(); + cy.go('back'); + ItemRecordView.waitLoading(); + ItemRecordView.checkItemCirculationHistory(todayDate, secondServicePoint.name, user.username); + }); + }); }); diff --git a/cypress/e2e/inventory/item/no-data-in-circulation-is-populated-on-duplicated-item.cy.js b/cypress/e2e/inventory/item/no-data-in-circulation-is-populated-on-duplicated-item.cy.js index 69705e1f6e..593f5fe97f 100644 --- a/cypress/e2e/inventory/item/no-data-in-circulation-is-populated-on-duplicated-item.cy.js +++ b/cypress/e2e/inventory/item/no-data-in-circulation-is-populated-on-duplicated-item.cy.js @@ -22,110 +22,112 @@ import InstanceRecordView from '../../../support/fragments/inventory/instanceRec import Users from '../../../support/fragments/users/users'; describe('inventory', () => { - let user; - const itemData = { - barcode: uuid(), - instanceTitle: `autotestInstance ${getRandomPostfix()}`, - }; - const holdingsPermanentLocation = LOCATION_NAMES.ONLINE_UI; - const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation('servicePoint', uuid()); - const testData = [ - ITEM_STATUS_NAMES.IN_TRANSIT, - itemData.barcode, - ]; - const newItemBarcode = uuid(); - const todayDate = moment(new Date()).format('M/D/YYYY'); + describe('Item', () => { + let user; + const itemData = { + barcode: uuid(), + instanceTitle: `autotestInstance ${getRandomPostfix()}`, + }; + const holdingsPermanentLocation = LOCATION_NAMES.ONLINE_UI; + const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation('servicePoint', uuid()); + const testData = [ + ITEM_STATUS_NAMES.IN_TRANSIT, + itemData.barcode, + ]; + const newItemBarcode = uuid(); + const todayDate = moment(new Date()).format('M/D/YYYY'); - before('create test data and login', () => { - cy.getAdminToken() - .then(() => { - cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { itemData.instanceTypeId = instanceTypes[0].id; }); - cy.getHoldingTypes({ limit: 1 }).then((res) => { itemData.holdingTypeId = res[0].id; }); - ServicePoints.createViaApi(servicePoint); - cy.getLocations({ query: `name="${holdingsPermanentLocation}"` }).then((locations) => { - testData.locationsId = locations.id; + before('create test data and login', () => { + cy.getAdminToken() + .then(() => { + cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { itemData.instanceTypeId = instanceTypes[0].id; }); + cy.getHoldingTypes({ limit: 1 }).then((res) => { itemData.holdingTypeId = res[0].id; }); + ServicePoints.createViaApi(servicePoint); + cy.getLocations({ query: `name="${holdingsPermanentLocation}"` }).then((locations) => { + testData.locationsId = locations.id; + }); + cy.getLoanTypes({ limit: 1 }).then((res) => { itemData.loanTypeId = res[0].id; }); + cy.getMaterialTypes({ limit: 1 }).then((res) => { itemData.materialTypeId = res.id; }); + }).then(() => { + InventoryInstances.createFolioInstanceViaApi({ instance: { + instanceTypeId: itemData.instanceTypeId, + title: itemData.instanceTitle, + }, + holdings: [{ + holdingsTypeId: itemData.holdingTypeId, + permanentLocationId: testData.locationsId, + }], + items:[{ + barcode: itemData.barcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: itemData.loanTypeId }, + materialType: { id: itemData.materialTypeId }, + }] }); + }).then(specialInstanceIds => { + itemData.testInstanceIds = specialInstanceIds; }); - cy.getLoanTypes({ limit: 1 }).then((res) => { itemData.loanTypeId = res[0].id; }); - cy.getMaterialTypes({ limit: 1 }).then((res) => { itemData.materialTypeId = res.id; }); - }).then(() => { - InventoryInstances.createFolioInstanceViaApi({ instance: { - instanceTypeId: itemData.instanceTypeId, - title: itemData.instanceTitle, - }, - holdings: [{ - holdingsTypeId: itemData.holdingTypeId, - permanentLocationId: testData.locationsId, - }], - items:[{ - barcode: itemData.barcode, - status: { name: ITEM_STATUS_NAMES.AVAILABLE }, - permanentLoanType: { id: itemData.loanTypeId }, - materialType: { id: itemData.materialTypeId }, - }] }); - }).then(specialInstanceIds => { - itemData.testInstanceIds = specialInstanceIds; - }); - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.checkinAll.gui, - permissions.checkoutAll.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.checkinAll.gui, + permissions.checkoutAll.gui + ]) + .then(userProperties => { + user = userProperties; - UserEdit.addServicePointsViaApi([servicePoint.id], user.userId, servicePoint.id); - cy.login(userProperties.username, userProperties.password); - cy.visit(TopMenu.checkInPath); - CheckInActions.waitLoading(); - }); - }); + UserEdit.addServicePointsViaApi([servicePoint.id], user.userId, servicePoint.id); + cy.login(userProperties.username, userProperties.password); + cy.visit(TopMenu.checkInPath); + CheckInActions.waitLoading(); + }); + }); - after('delete test data', () => { - CheckInActions.checkinItemViaApi({ - itemBarcode: itemData.barcode, - servicePointId: servicePoint.id, - checkInDate: new Date().toISOString(), + after('delete test data', () => { + CheckInActions.checkinItemViaApi({ + itemBarcode: itemData.barcode, + servicePointId: servicePoint.id, + checkInDate: new Date().toISOString(), + }); + UserEdit.changeServicePointPreferenceViaApi(user.userId, [servicePoint.id]); + ServicePoints.deleteViaApi(servicePoint.id); + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemData.barcode); }); - UserEdit.changeServicePointPreferenceViaApi(user.userId, [servicePoint.id]); - ServicePoints.deleteViaApi(servicePoint.id); - Users.deleteViaApi(user.userId); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemData.barcode); - }); - it('C397325 Verify that no data in circulation is populated on duplicated Item (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - CheckInActions.checkInItemGui(itemData.barcode); - ConfirmItemInModal.confirmInTransitModal(); - CheckInPane.checkResultsInTheRow(testData); - CheckInActions.endCheckInSessionAndCheckDetailsOfCheckInAreCleared(); + it('C397325 Verify that no data in circulation is populated on duplicated Item (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + CheckInActions.checkInItemGui(itemData.barcode); + ConfirmItemInModal.confirmInTransitModal(); + CheckInPane.checkResultsInTheRow(testData); + CheckInActions.endCheckInSessionAndCheckDetailsOfCheckInAreCleared(); - cy.visit(TopMenu.checkOutPath); - Checkout.waitLoading(); - // without this waiter, the user will not be found by username - cy.wait(4000); - CheckOutActions.checkOutUser(user.barcode, user.username); - CheckOutActions.checkOutItem(itemData.barcode); - CheckOutActions.checkItemInfo(itemData.barcode, itemData.instanceTitle); - CheckOutActions.endCheckOutSession(); - CheckOutActions.checkDetailsOfCheckOUTAreCleared(); + cy.visit(TopMenu.checkOutPath); + Checkout.waitLoading(); + // without this waiter, the user will not be found by username + cy.wait(4000); + CheckOutActions.checkOutUser(user.barcode, user.username); + CheckOutActions.checkOutItem(itemData.barcode); + CheckOutActions.checkItemInfo(itemData.barcode, itemData.instanceTitle); + CheckOutActions.endCheckOutSession(); + CheckOutActions.checkDetailsOfCheckOUTAreCleared(); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByTitle(itemData.instanceTitle); - InventoryInstance.openHoldingsAccordion(`${holdingsPermanentLocation} >`); - InventoryInstance.openItemByBarcode(itemData.barcode); - ItemRecordView.waitLoading(); - ItemRecordView.checkStatus('Checked out'); - ItemRecordView.checkItemCirculationHistory(todayDate, servicePoint.name, user.username); - ItemRecordView.duplicateItem(); - ItemRecordNew.waitLoading(itemData.instanceTitle); - ItemRecordNew.addBarcode(newItemBarcode); - ItemRecordNew.save(); - ItemRecordView.verifyCalloutMessage(); - ItemRecordView.closeDetailView(); - InstanceRecordView.verifyInstanceRecordViewOpened(); - InventoryInstance.openHoldingsAccordion(`${holdingsPermanentLocation} >`); - InventoryInstance.openItemByBarcode(newItemBarcode); - ItemRecordView.checkItemCirculationHistory('-', '-', '-'); - }); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByTitle(itemData.instanceTitle); + InventoryInstance.openHoldingsAccordion(`${holdingsPermanentLocation} >`); + InventoryInstance.openItemByBarcode(itemData.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.checkStatus('Checked out'); + ItemRecordView.checkItemCirculationHistory(todayDate, servicePoint.name, user.username); + ItemRecordView.duplicateItem(); + ItemRecordNew.waitLoading(itemData.instanceTitle); + ItemRecordNew.addBarcode(newItemBarcode); + ItemRecordNew.save(); + ItemRecordView.verifyCalloutMessage(); + ItemRecordView.closeDetailView(); + InstanceRecordView.verifyInstanceRecordViewOpened(); + InventoryInstance.openHoldingsAccordion(`${holdingsPermanentLocation} >`); + InventoryInstance.openItemByBarcode(newItemBarcode); + ItemRecordView.checkItemCirculationHistory('-', '-', '-'); + }); + }); }); diff --git a/cypress/e2e/inventory/keyboard-shortcuts.cy.js b/cypress/e2e/inventory/keyboard-shortcuts.cy.js index 71b4cb3314..b03b866c46 100644 --- a/cypress/e2e/inventory/keyboard-shortcuts.cy.js +++ b/cypress/e2e/inventory/keyboard-shortcuts.cy.js @@ -18,7 +18,7 @@ const issnValue = `ISSN test value ${getRandomPostfix()}`; const hotKeys = InventoryHotkeys.hotKeys; const instanceTitle = `Instance_Test_Title_${getRandomPostfix()}`; -describe('ui-inventory: keyboard shortcut', () => { +describe('ui-inventory: Keyboard shortcut (NEW)', () => { beforeEach('navigate to inventory', () => { cy.createTempUser([ permissions.inventoryAll.gui diff --git a/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js b/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js index 6af1fef0bc..3b237fc6a3 100644 --- a/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js +++ b/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js @@ -13,88 +13,90 @@ import InventoryInstances from '../../../support/fragments/inventory/inventoryIn import Helper from '../../../support/fragments/finance/financeHelper'; import { ITEM_STATUS_NAMES } from '../../../support/constants'; -describe('ui-inventory: Update the effective location for the item', () => { - const itemData = { - instanceTitle: `autoTestInstanceTitle ${Helper.getRandomBarcode()}`, - itemBarcode: GenerateItemBarcode() - }; - const anotherPermanentLocation = 'Main Library'; - let testInstanceId; - let instanceHrid; - let user; +describe('inventory', () => { + describe('Cataloging', () => { + const itemData = { + instanceTitle: `autoTestInstanceTitle ${Helper.getRandomBarcode()}`, + itemBarcode: GenerateItemBarcode() + }; + const anotherPermanentLocation = 'Main Library'; + let testInstanceId; + let instanceHrid; + let user; - before(() => { - cy.getAdminToken() - .then(() => { - cy.getLoanTypes({ limit: 1 }).then((res) => { itemData.loanTypeId = res[0].id; }); - cy.getMaterialTypes({ limit: 1 }).then((res) => { itemData.materialTypeId = res.id; }); - cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { itemData.instanceTypeId = instanceTypes[0].id; }); - cy.getLocations({ limit: 1, query: 'name="Online"' }).then((res) => { itemData.locationId = res.id; }); - cy.getHoldingTypes({ limit: 1 }).then((res) => { itemData.holdingTypeId = res[0].id; }); - }) - .then(() => { - InventoryInstances.createFolioInstanceViaApi({ - instance: { - instanceTypeId: itemData.instanceTypeId, - title: itemData.instanceTitle, - }, - holdings: [{ - holdingsTypeId: itemData.holdingTypeId, - permanentLocationId: itemData.locationId - }], - items: [ - { - barcode: itemData.itemBarcode, - status: { name: ITEM_STATUS_NAMES.AVAILABLE }, - permanentLoanType: { id: itemData.loanTypeId }, - materialType: { id: itemData.materialTypeId } - }] + before(() => { + cy.getAdminToken() + .then(() => { + cy.getLoanTypes({ limit: 1 }).then((res) => { itemData.loanTypeId = res[0].id; }); + cy.getMaterialTypes({ limit: 1 }).then((res) => { itemData.materialTypeId = res.id; }); + cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { itemData.instanceTypeId = instanceTypes[0].id; }); + cy.getLocations({ limit: 1, query: 'name="Online"' }).then((res) => { itemData.locationId = res.id; }); + cy.getHoldingTypes({ limit: 1 }).then((res) => { itemData.holdingTypeId = res[0].id; }); }) - .then(specialInstanceIds => { - testInstanceId = specialInstanceIds; - }); - }); + .then(() => { + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId: itemData.instanceTypeId, + title: itemData.instanceTitle, + }, + holdings: [{ + holdingsTypeId: itemData.holdingTypeId, + permanentLocationId: itemData.locationId + }], + items: [ + { + barcode: itemData.itemBarcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: itemData.loanTypeId }, + materialType: { id: itemData.materialTypeId } + }] + }) + .then(specialInstanceIds => { + testInstanceId = specialInstanceIds; + }); + }); - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.remoteStorageView.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.remoteStorageView.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', itemData.instanceTitle); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); - InventorySearchAndFilter.resetAll(); - }); - }); + cy.login(user.username, user.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', itemData.instanceTitle); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; }); + InventorySearchAndFilter.resetAll(); + }); + }); - afterEach(() => { - cy.wrap(testInstanceId.holdingIds.forEach(holdingsId => { - cy.wrap(holdingsId.itemIds.forEach(itemId => { - cy.deleteItemViaApi(itemId); + afterEach(() => { + cy.wrap(testInstanceId.holdingIds.forEach(holdingsId => { + cy.wrap(holdingsId.itemIds.forEach(itemId => { + cy.deleteItemViaApi(itemId); + })).then(() => { + cy.deleteHoldingRecordViaApi(holdingsId.id); + }); })).then(() => { - cy.deleteHoldingRecordViaApi(holdingsId.id); + InventoryInstance.deleteInstanceViaApi(testInstanceId.instanceId); }); - })).then(() => { - InventoryInstance.deleteInstanceViaApi(testInstanceId.instanceId); + Users.deleteViaApi(user.userId); }); - Users.deleteViaApi(user.userId); - }); - it('C3501 An item is being moved from one library location to another. Update the effective location for the item (folijet) (prokopovych)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventorySearchAndFilter.selectSearchResultItem(); - InventoryInstance.openHoldingView(); - HoldingsRecordView.edit(); - HoldingsRecordEdit.changePermanentLocation(anotherPermanentLocation); - HoldingsRecordEdit.saveAndClose(); - HoldingsRecordView.waitLoading(); - HoldingsRecordView.close(); - InventoryInstance.openHoldings([anotherPermanentLocation]); - InventorySearchAndFilter.switchToItem(); - InventorySearchAndFilter.searchByParameter('Barcode', itemData.itemBarcode); - ItemRecordView.verifyEffectiveLocation(anotherPermanentLocation); - }); + it('C3501 An item is being moved from one library location to another. Update the effective location for the item (folijet) (prokopovych)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.openHoldingView(); + HoldingsRecordView.edit(); + HoldingsRecordEdit.changePermanentLocation(anotherPermanentLocation); + HoldingsRecordEdit.saveAndClose(); + HoldingsRecordView.waitLoading(); + HoldingsRecordView.close(); + InventoryInstance.openHoldings([anotherPermanentLocation]); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', itemData.itemBarcode); + ItemRecordView.verifyEffectiveLocation(anotherPermanentLocation); + }); + }); }); 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 83b0071df3..a448b4e94b 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js @@ -12,122 +12,124 @@ import ItemRecordView from '../../../support/fragments/inventory/item/itemRecord 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 = {}; - let defaultServicePointId = ''; - const requesterIds = []; - let instanceData = {}; - const createdRequestsIds = []; - let createdItems = []; - let materialType = ''; - let addedCirculationRule; - let originalCirculationRules; +describe('inventory', () => { + describe('Item', () => { + let user = {}; + let defaultServicePointId = ''; + const requesterIds = []; + let instanceData = {}; + 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}` }); + 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(() => { - ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) - .then((res) => { - defaultServicePointId = res[0].id; - }); - }) - .then(() => { - cy.createTempUser([ - permissions.uiInventoryMarkAsMissing.gui, - permissions.uiRequestsView.gui, - ]); - }) - .then(userProperties => { - user = userProperties; - UserEdit.addServicePointViaApi(defaultServicePointId, user.userId); - }) - .then(() => { - cy.login(user.username, user.password); - }) - .then(() => { - MarkItemAsMissing - .createItemsForGivenStatusesApi() - .then(({ items, instanceRecordData, materialTypeValue }) => { - createdItems = items; - instanceData = instanceRecordData; - materialType = materialTypeValue; - MarkItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { - const requestStatus = MarkItemAsMissing.itemToRequestMap[item.status.name]; - MarkItemAsMissing - .createRequestForGivenItemApi(item, instanceRecordData, requestStatus) - .then(({ createdUserId, createdRequestId }) => { - createdRequestsIds.push(createdRequestId); - requesterIds.push(createdUserId); - }); + beforeEach(() => { + cy.getAdminToken() + .then(() => { + ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) + .then((res) => { + defaultServicePointId = res[0].id; }); - }); - }); - }); - - after(() => { - CirculationRules.deleteRuleViaApi(addedCirculationRule); - }); - - afterEach(() => { - createdItems.forEach(item => { - cy.deleteItemViaApi(item.itemId); - }); - cy.deleteHoldingRecordViaApi(instanceData.holdingId); - InventoryInstance.deleteInstanceViaApi(instanceData.instanceId); - createdRequestsIds.forEach(id => { - Requests.deleteRequestViaApi(id); + }) + .then(() => { + cy.createTempUser([ + permissions.uiInventoryMarkAsMissing.gui, + permissions.uiRequestsView.gui, + ]); + }) + .then(userProperties => { + user = userProperties; + UserEdit.addServicePointViaApi(defaultServicePointId, user.userId); + }) + .then(() => { + cy.login(user.username, user.password); + }) + .then(() => { + MarkItemAsMissing + .createItemsForGivenStatusesApi() + .then(({ items, instanceRecordData, materialTypeValue }) => { + createdItems = items; + instanceData = instanceRecordData; + materialType = materialTypeValue; + MarkItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { + const requestStatus = MarkItemAsMissing.itemToRequestMap[item.status.name]; + MarkItemAsMissing + .createRequestForGivenItemApi(item, instanceRecordData, requestStatus) + .then(({ createdUserId, createdRequestId }) => { + createdRequestsIds.push(createdRequestId); + requesterIds.push(createdUserId); + }); + }); + }); + }); }); - Users.deleteViaApi(user.userId); - requesterIds.forEach(id => Users.deleteViaApi(id)); - }); - it('C714 Mark an item as Missing (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - cy.visit(TopMenu.inventoryPath); - MarkItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); - MarkItemAsMissing.getItemsToMarkAsMissing(createdItems).forEach(item => { - MarkItemAsMissing.openHoldingsAccordion(instanceData.holdingId); - MarkItemAsMissing.openItem(item.barcode); - MarkItemAsMissing.checkIsMarkAsMissingExist(true); - ItemActions.markAsMissing(); - MarkItemAsMissing.checkIsConfirmItemMissingModalExist(instanceData.instanceTitle, item.barcode, materialType); - ItemActions.cancelMarkAsMissing(); - ItemRecordView.verifyItemStatusInPane(item.status.name); - ItemActions.markAsMissing(); - ItemActions.confirmMarkAsMissing(); - ItemRecordView.verifyItemStatusInPane('Missing'); - MarkItemAsMissing.verifyItemStatusUpdatedDate(); - ItemRecordView.closeDetailView(); + after(() => { + CirculationRules.deleteRuleViaApi(addedCirculationRule); }); - cy.visit(TopMenu.requestsPath); - MarkItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { - Requests.findCreatedRequest(item.barcode); - Requests.selectFirstRequest(item.barcode); - MarkItemAsMissing.verifyRequestStatus('Open - Not yet filled'); + afterEach(() => { + createdItems.forEach(item => { + cy.deleteItemViaApi(item.itemId); + }); + cy.deleteHoldingRecordViaApi(instanceData.holdingId); + InventoryInstance.deleteInstanceViaApi(instanceData.instanceId); + createdRequestsIds.forEach(id => { + Requests.deleteRequestViaApi(id); + }); + Users.deleteViaApi(user.userId); + requesterIds.forEach(id => Users.deleteViaApi(id)); }); - cy.visit(TopMenu.inventoryPath); - MarkItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); - MarkItemAsMissing.getItemsNotToMarkAsMissing(createdItems).forEach(item => { - MarkItemAsMissing.openHoldingsAccordion(instanceData.holdingId); - MarkItemAsMissing.openItem(item.barcode); - MarkItemAsMissing.checkIsMarkAsMissingExist(false); - ItemRecordView.closeDetailView(); + it('C714 Mark an item as Missing (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + cy.visit(TopMenu.inventoryPath); + MarkItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); + MarkItemAsMissing.getItemsToMarkAsMissing(createdItems).forEach(item => { + MarkItemAsMissing.openHoldingsAccordion(instanceData.holdingId); + MarkItemAsMissing.openItem(item.barcode); + MarkItemAsMissing.checkIsMarkAsMissingExist(true); + ItemActions.markAsMissing(); + MarkItemAsMissing.checkIsConfirmItemMissingModalExist(instanceData.instanceTitle, item.barcode, materialType); + ItemActions.cancelMarkAsMissing(); + ItemRecordView.verifyItemStatusInPane(item.status.name); + ItemActions.markAsMissing(); + ItemActions.confirmMarkAsMissing(); + ItemRecordView.verifyItemStatusInPane('Missing'); + MarkItemAsMissing.verifyItemStatusUpdatedDate(); + ItemRecordView.closeDetailView(); + }); + + cy.visit(TopMenu.requestsPath); + MarkItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { + Requests.findCreatedRequest(item.barcode); + Requests.selectFirstRequest(item.barcode); + MarkItemAsMissing.verifyRequestStatus('Open - Not yet filled'); + }); + + cy.visit(TopMenu.inventoryPath); + MarkItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); + MarkItemAsMissing.getItemsNotToMarkAsMissing(createdItems).forEach(item => { + MarkItemAsMissing.openHoldingsAccordion(instanceData.holdingId); + MarkItemAsMissing.openItem(item.barcode); + MarkItemAsMissing.checkIsMarkAsMissingExist(false); + ItemRecordView.closeDetailView(); + }); }); }); }); 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 33de4bc57d..fffaabf0d6 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js @@ -12,128 +12,130 @@ 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 = {}; - let defaultServicePointId = ''; - const requesterIds = []; - let instanceData = {}; - const createdRequestsIds = []; - let createdItems = []; - let materialType = ''; - let addedCirculationRule; - let originalCirculationRules; +describe('inventory', () => { + describe('Item', () => { + let user = {}; + let defaultServicePointId = ''; + const requesterIds = []; + let instanceData = {}; + 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}` }); + 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(() => { - ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) - .then((res) => { - defaultServicePointId = res[0].id; - }); - }) - .then(() => { - cy.createTempUser([ - permissions.uiInventoryMarkItemsWithdrawn.gui, - permissions.uiRequestsCreate.gui, - permissions.uiInventoryViewInstances.gui, - ]); - }) - .then(userProperties => { - user = userProperties; - UserEdit.addServicePointViaApi(defaultServicePointId, user.userId); - }) - .then(() => { - cy.login(user.username, user.password); - }) - .then(() => { - markItemAsMissing - .createItemsForGivenStatusesApi.call(markItemAsWithdrawn) - .then(({ items, instanceRecordData, materialTypeValue }) => { - createdItems = items; - instanceData = instanceRecordData; - materialType = materialTypeValue; - markItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { - const requestStatus = markItemAsMissing.itemToRequestMap[item.status.name]; - markItemAsMissing - .createRequestForGivenItemApi(item, instanceRecordData, requestStatus) - .then(({ createdUserId, createdRequestId }) => { - createdRequestsIds.push(createdRequestId); - requesterIds.push(createdUserId); - }); + beforeEach(() => { + cy.getAdminToken() + .then(() => { + ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) + .then((res) => { + defaultServicePointId = res[0].id; }); - }); - }); - }); - - after(() => { - CirculationRules.deleteRuleViaApi(addedCirculationRule); - }); - - afterEach(() => { - createdItems.forEach(item => { - cy.deleteItemViaApi(item.itemId); - }); - cy.deleteHoldingRecordViaApi(instanceData.holdingId); - InventoryInstance.deleteInstanceViaApi(instanceData.instanceId); - createdRequestsIds.forEach(id => { - Requests.deleteRequestViaApi(id); + }) + .then(() => { + cy.createTempUser([ + permissions.uiInventoryMarkItemsWithdrawn.gui, + permissions.uiRequestsCreate.gui, + permissions.uiInventoryViewInstances.gui, + ]); + }) + .then(userProperties => { + user = userProperties; + UserEdit.addServicePointViaApi(defaultServicePointId, user.userId); + }) + .then(() => { + cy.login(user.username, user.password); + }) + .then(() => { + markItemAsMissing + .createItemsForGivenStatusesApi.call(markItemAsWithdrawn) + .then(({ items, instanceRecordData, materialTypeValue }) => { + createdItems = items; + instanceData = instanceRecordData; + materialType = materialTypeValue; + markItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { + const requestStatus = markItemAsMissing.itemToRequestMap[item.status.name]; + markItemAsMissing + .createRequestForGivenItemApi(item, instanceRecordData, requestStatus) + .then(({ createdUserId, createdRequestId }) => { + createdRequestsIds.push(createdRequestId); + requesterIds.push(createdUserId); + }); + }); + }); + }); }); - Users.deleteViaApi(user.userId); - requesterIds.forEach(id => Users.deleteViaApi(id)); - }); - it('C10930: Mark items as withdrawn (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { - cy.visit(TopMenu.inventoryPath); - markItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); - markItemAsMissing.getItemsToMarkAsMissing.call(markItemAsWithdrawn, createdItems).forEach(item => { - markItemAsMissing.openHoldingsAccordion(instanceData.holdingId); - markItemAsMissing.openItem(item.barcode); - markItemAsWithdrawn.checkActionButtonExists({ isExist: true, button: markItemAsWithdrawn.withdrawItemButton }); - markItemAsWithdrawn.clickMarkAsWithdrawn(); - markItemAsWithdrawn.checkIsconfirmItemWithdrawnModalExist(instanceData.instanceTitle, item.barcode, materialType); - markItemAsWithdrawn.cancelModal(); - markItemAsMissing.verifyItemStatus(item.status.name); - markItemAsWithdrawn.clickMarkAsWithdrawn(); - markItemAsWithdrawn.confirmModal(); - markItemAsMissing.verifyItemStatus('Withdrawn'); - markItemAsMissing.verifyItemStatusUpdatedDate(); - ItemRecordView.closeDetailView(); + after(() => { + CirculationRules.deleteRuleViaApi(addedCirculationRule); }); - cy.visit(TopMenu.requestsPath); - markItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { - Requests.findCreatedRequest(item.barcode); - Requests.selectFirstRequest(item.barcode); - markItemAsMissing.verifyRequestStatus('Open - Not yet filled'); + afterEach(() => { + createdItems.forEach(item => { + cy.deleteItemViaApi(item.itemId); + }); + cy.deleteHoldingRecordViaApi(instanceData.holdingId); + InventoryInstance.deleteInstanceViaApi(instanceData.instanceId); + createdRequestsIds.forEach(id => { + Requests.deleteRequestViaApi(id); + }); + Users.deleteViaApi(user.userId); + requesterIds.forEach(id => Users.deleteViaApi(id)); }); - cy.visit(TopMenu.inventoryPath); - markItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); - markItemAsMissing.getItemsNotToMarkAsMissing.call(markItemAsWithdrawn, createdItems).forEach(item => { + it('C10930: Mark items as withdrawn (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + cy.visit(TopMenu.inventoryPath); + markItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); + markItemAsMissing.getItemsToMarkAsMissing.call(markItemAsWithdrawn, createdItems).forEach(item => { + markItemAsMissing.openHoldingsAccordion(instanceData.holdingId); + markItemAsMissing.openItem(item.barcode); + markItemAsWithdrawn.checkActionButtonExists({ isExist: true, button: markItemAsWithdrawn.withdrawItemButton }); + markItemAsWithdrawn.clickMarkAsWithdrawn(); + markItemAsWithdrawn.checkIsconfirmItemWithdrawnModalExist(instanceData.instanceTitle, item.barcode, materialType); + markItemAsWithdrawn.cancelModal(); + markItemAsMissing.verifyItemStatus(item.status.name); + markItemAsWithdrawn.clickMarkAsWithdrawn(); + markItemAsWithdrawn.confirmModal(); + markItemAsMissing.verifyItemStatus('Withdrawn'); + markItemAsMissing.verifyItemStatusUpdatedDate(); + ItemRecordView.closeDetailView(); + }); + + cy.visit(TopMenu.requestsPath); + markItemAsMissing.getItemsToCreateRequests(createdItems).forEach(item => { + Requests.findCreatedRequest(item.barcode); + Requests.selectFirstRequest(item.barcode); + markItemAsMissing.verifyRequestStatus('Open - Not yet filled'); + }); + + cy.visit(TopMenu.inventoryPath); + markItemAsMissing.findAndOpenInstance(instanceData.instanceTitle); + markItemAsMissing.getItemsNotToMarkAsMissing.call(markItemAsWithdrawn, createdItems).forEach(item => { + markItemAsMissing.openHoldingsAccordion(instanceData.holdingId); + markItemAsMissing.openItem(item.barcode); + markItemAsWithdrawn.checkActionButtonExists({ isExist: false, button: markItemAsWithdrawn.withdrawItemButton }); + ItemRecordView.closeDetailView(); + }); + markItemAsMissing.openHoldingsAccordion(instanceData.holdingId); - markItemAsMissing.openItem(item.barcode); - markItemAsWithdrawn.checkActionButtonExists({ isExist: false, button: markItemAsWithdrawn.withdrawItemButton }); + markItemAsMissing.openItem(markItemAsWithdrawn.getWithdrawnItem(createdItems).barcode); + markItemAsWithdrawn.checkActionButtonExists({ isExist: false, button: markItemAsWithdrawn.newRequestButton }); ItemRecordView.closeDetailView(); }); - - markItemAsMissing.openHoldingsAccordion(instanceData.holdingId); - markItemAsMissing.openItem(markItemAsWithdrawn.getWithdrawnItem(createdItems).barcode); - markItemAsWithdrawn.checkActionButtonExists({ isExist: false, button: markItemAsWithdrawn.newRequestButton }); - ItemRecordView.closeDetailView(); }); }); diff --git a/cypress/e2e/inventory/settings/create-edit-mode-for-isri-profiles.cy.js b/cypress/e2e/inventory/settings/create-edit-mode-for-isri-profiles.cy.js index c01903b5ae..56c95d198e 100644 --- a/cypress/e2e/inventory/settings/create-edit-mode-for-isri-profiles.cy.js +++ b/cypress/e2e/inventory/settings/create-edit-mode-for-isri-profiles.cy.js @@ -8,69 +8,71 @@ import NewTargetProfile from '../../../support/fragments/settings/inventory/inte import EditTargetProfile from '../../../support/fragments/settings/inventory/integrations/editTargetProfile'; import Users from '../../../support/fragments/users/users'; -describe('ui-inventory', () => { - let user; - const targetProfileName = `C374178 autotest targetProfileName ${getRandomPostfix()}`; - const newTargetProfileName = `C374178 autotest targetProfileName ${getRandomPostfix()}`; - const firstCreateProfileName = 'Inventory Single Record - Default Create Instance (d0ebb7b0-2f0f-11eb-adc1-0242ac120002)'; - const secondCreateProfileName = 'Default - Create instance and SRS MARC Bib (e34d7b92-9b83-11eb-a8b3-0242ac130003)'; - const firstRow = 1; - const secondRow = 2; - const firstUpdateProfileName = 'Inventory Single Record - Default Update Instance (91f9b8d6-d80e-4727-9783-73fb53e3c786)'; +describe('inventory', () => { + describe('Settings', () => { + let user; + const targetProfileName = `C374178 autotest targetProfileName ${getRandomPostfix()}`; + const newTargetProfileName = `C374178 autotest targetProfileName ${getRandomPostfix()}`; + const firstCreateProfileName = 'Inventory Single Record - Default Create Instance (d0ebb7b0-2f0f-11eb-adc1-0242ac120002)'; + const secondCreateProfileName = 'Default - Create instance and SRS MARC Bib (e34d7b92-9b83-11eb-a8b3-0242ac130003)'; + const firstRow = 1; + const secondRow = 2; + const firstUpdateProfileName = 'Inventory Single Record - Default Update Instance (91f9b8d6-d80e-4727-9783-73fb53e3c786)'; - before('create test data', () => { - cy.createTempUser([ - permissions.uiInventorySingleRecordImport.gui, - permissions.settingsDataImportEnabled.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui - ]) - .then(userProperties => { - user = userProperties; + before('create test data', () => { + cy.createTempUser([ + permissions.uiInventorySingleRecordImport.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password); - }); - }); + cy.login(user.username, user.password); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - Z3950TargetProfiles.getTargetProfileIdViaApi({ query: `name="${newTargetProfileName}"` }) - .then(profileId => { - Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); - }); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + Z3950TargetProfiles.getTargetProfileIdViaApi({ query: `name="${newTargetProfileName}"` }) + .then(profileId => { + Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); + }); + }); - it('C374178 Verify the create/edit mode for ISRI profiles (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.create(); - NewTargetProfile.newFormContains(); - NewTargetProfile.fillName(targetProfileName); - NewTargetProfile.save(); - NewTargetProfile.verifyErrorMessageIsPresented(); - NewTargetProfile.verifyJobProfileForImportCreateAccordion(); - NewTargetProfile.selectJobProfileForImportCreate(firstCreateProfileName); - NewTargetProfile.addJobProfileForImportCreate(); - NewTargetProfile.selectJobProfileForImportCreate(secondCreateProfileName, firstRow, 1); - NewTargetProfile.setDefaultJobProfileForCreate(firstRow); - NewTargetProfile.removeJobProfileForImportCreate(secondCreateProfileName, secondRow); - NewTargetProfile.verifyJobProfileForImportCreateIsRemoved(); - NewTargetProfile.setDefaultJobProfileForCreate(); + it('C374178 Verify the create/edit mode for ISRI profiles (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.create(); + NewTargetProfile.newFormContains(); + NewTargetProfile.fillName(targetProfileName); + NewTargetProfile.save(); + NewTargetProfile.verifyErrorMessageIsPresented(); + NewTargetProfile.verifyJobProfileForImportCreateAccordion(); + NewTargetProfile.selectJobProfileForImportCreate(firstCreateProfileName); + NewTargetProfile.addJobProfileForImportCreate(); + NewTargetProfile.selectJobProfileForImportCreate(secondCreateProfileName, firstRow, 1); + NewTargetProfile.setDefaultJobProfileForCreate(firstRow); + NewTargetProfile.removeJobProfileForImportCreate(secondCreateProfileName, secondRow); + NewTargetProfile.verifyJobProfileForImportCreateIsRemoved(); + NewTargetProfile.setDefaultJobProfileForCreate(); - NewTargetProfile.addJobProfileForOverlayUpdate(); - NewTargetProfile.verifyJobProfileForOverlayUpdateAccordion(); - NewTargetProfile.selectJobProfileForOverlayUpdate(firstUpdateProfileName); - NewTargetProfile.selectJobProfileForOverlayUpdate(secondCreateProfileName, firstRow, 1); - NewTargetProfile.setDefaultJobProfileForUpdate(firstRow); - NewTargetProfile.removeJobProfileForImportCreate(secondCreateProfileName, secondRow); - NewTargetProfile.verifyJobProfileForImportCreateIsRemoved(); - NewTargetProfile.setDefaultJobProfileForUpdate(); - NewTargetProfile.save(); - Z3950TargetProfiles.verifyTargetProfileIsCreated(targetProfileName); + NewTargetProfile.addJobProfileForOverlayUpdate(); + NewTargetProfile.verifyJobProfileForOverlayUpdateAccordion(); + NewTargetProfile.selectJobProfileForOverlayUpdate(firstUpdateProfileName); + NewTargetProfile.selectJobProfileForOverlayUpdate(secondCreateProfileName, firstRow, 1); + NewTargetProfile.setDefaultJobProfileForUpdate(firstRow); + NewTargetProfile.removeJobProfileForImportCreate(secondCreateProfileName, secondRow); + NewTargetProfile.verifyJobProfileForImportCreateIsRemoved(); + NewTargetProfile.setDefaultJobProfileForUpdate(); + NewTargetProfile.save(); + Z3950TargetProfiles.verifyTargetProfileIsCreated(targetProfileName); - Z3950TargetProfiles.edit(`✕ ${targetProfileName}`); - EditTargetProfile.verifyTargetProfileFormOpened(); - EditTargetProfile.fillName(newTargetProfileName); - EditTargetProfile.save(targetProfileName); - Z3950TargetProfiles.verifyTargetProfileIsUpdated(targetProfileName, newTargetProfileName); - }); + Z3950TargetProfiles.edit(`✕ ${targetProfileName}`); + EditTargetProfile.verifyTargetProfileFormOpened(); + EditTargetProfile.fillName(newTargetProfileName); + EditTargetProfile.save(targetProfileName); + Z3950TargetProfiles.verifyTargetProfileIsUpdated(targetProfileName, newTargetProfileName); + }); + }); }); diff --git a/cypress/e2e/inventory/settings/view-mode-of-isri-profiles.cy.js b/cypress/e2e/inventory/settings/view-mode-of-isri-profiles.cy.js new file mode 100644 index 0000000000..de88f48c25 --- /dev/null +++ b/cypress/e2e/inventory/settings/view-mode-of-isri-profiles.cy.js @@ -0,0 +1,123 @@ +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 Z3950TargetProfiles from '../../../support/fragments/settings/inventory/integrations/z39.50TargetProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import NewActionProfile from '../../../support/fragments/data_import/action_profiles/newActionProfile'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import Users from '../../../support/fragments/users/users'; + +const abcProfile = { + createJobProfile: `abc createJobProfile.${getRandomPostfix()}`, + createActionProfile: `abc autotest actionProfile${getRandomPostfix()}`, + createMappingProfile: `abc autotest mappingProfile${getRandomPostfix()}`, + updateJobProfile: `abc updateJobProfile.${getRandomPostfix()}`, + updateActionProfile: `abc autotest actionProfile${getRandomPostfix()}`, + updateMappingProfile: `abc autotest mappingProfile${getRandomPostfix()}` +}; +const adcProfile = { + createJobProfile: `adc createJobProfile.${getRandomPostfix()}`, + createActionProfile: `adc autotest actionProfile${getRandomPostfix()}`, + createMappingProfile: `adc autotest mappingProfile${getRandomPostfix()}`, + updateJobProfile: `adc updateJobProfile.${getRandomPostfix()}`, + updateActionProfile: `adc autotest actionProfile${getRandomPostfix()}`, + updateMappingProfile: `adc autotest mappingProfile${getRandomPostfix()}` +}; +const zbcProfile = { + createJobProfile: `zbc createJobProfile.${getRandomPostfix()}`, + createActionProfile: `zbc autotest actionProfile${getRandomPostfix()}`, + createMappingProfile: `zbc autotest mappingProfile${getRandomPostfix()}`, + updateJobProfile: `zbc updateJobProfile.${getRandomPostfix()}`, + updateActionProfile: `zbc autotest actionProfile${getRandomPostfix()}`, + updateMappingProfile: `zbc autotest mappingProfile${getRandomPostfix()}` +}; +const zdcProfile = { + createJobProfile: `zdc createJobProfile.${getRandomPostfix()}`, + createActionProfile: `zdc autotest actionProfile${getRandomPostfix()}`, + createMappingProfile: `zdc autotest mappingProfile${getRandomPostfix()}`, + updateJobProfile: `zdc updateJobProfile.${getRandomPostfix()}`, + updateActionProfile: `zdc autotest actionProfile${getRandomPostfix()}`, + updateMappingProfile: `zdc autotest mappingProfile${getRandomPostfix()}` +}; + +describe('inventory', () => { + describe('Settings', () => { + let user; + const createJobProfileIds = []; + const updateJobProfileIds = []; + const targetProfileName = `C374176 autotest profile${getRandomPostfix()}`; + let profileId; + + before('login', () => { + cy.getAdminToken() + .then(() => { + // create job profiles for create + [zbcProfile, adcProfile, zdcProfile, abcProfile].forEach(profile => { + NewFieldMappingProfile.createMappingProfileViaApi(profile.createMappingProfile) + .then((mappingProfileResponse) => { + NewActionProfile.createActionProfileViaApi(profile.createActionProfile, mappingProfileResponse.body.id) + .then((actionProfileResponse) => { + NewJobProfile.createJobProfileWithLinkedActionProfileViaApi(profile.createJobProfile, actionProfileResponse.body.id); + }).then(id => createJobProfileIds.push(id)); + }); + }); + // create job profile for update + [abcProfile, zbcProfile, zdcProfile, adcProfile].forEach(profile => { + NewFieldMappingProfile.createMappingProfileViaApi(profile.updateMappingProfile) + .then((mappingProfileResponse) => { + NewActionProfile.createActionProfileViaApi(profile.updateActionProfile, mappingProfileResponse.body.id, 'UPDATE') + .then((actionProfileResponse) => { + NewJobProfile.createJobProfileWithLinkedActionProfileViaApi(profile.updateJobProfile, actionProfileResponse.body.id); + }).then(id => { + updateJobProfileIds.push(id); + }); + }); + }); + }) + .then(() => { + Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(targetProfileName, createJobProfileIds, updateJobProfileIds) + .then(initialId => { + profileId = initialId; + }); + }); + + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password); + }); + }); + + after('delete test data', () => { + [abcProfile, zbcProfile, zdcProfile, adcProfile].forEach(profile => { + JobProfiles.deleteJobProfile(profile.createJobProfile); + JobProfiles.deleteJobProfile(profile.updateJobProfile); + ActionProfiles.deleteActionProfile(profile.createActionProfile); + ActionProfiles.deleteActionProfile(profile.updateActionProfile); + FieldMappingProfiles.deleteFieldMappingProfile(profile.createMappingProfile); + FieldMappingProfiles.deleteFieldMappingProfile(profile.updateMappingProfile); + }); + Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); + Users.deleteViaApi(user.userId); + }); + + it('C374176 Verify the view mode of ISRI profiles (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.verifyTargetProfileFormOpened(); + Z3950TargetProfiles.openTargetProfile(profileId); + Z3950TargetProfiles.verifyTargetProfileForm(); + Z3950TargetProfiles.verifyCreateInstanceJobProfileList(targetProfileName); + Z3950TargetProfiles.verifyUpdateInstanceJobProfileList(targetProfileName); + }); + }); +}); diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js index 3b1889aeb5..4ebe9489cf 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js @@ -28,69 +28,75 @@ const oclcRecordData = { notes: { noteType: 'General note', noteContent: 'Description based upon print version of record' } }; -describe('ui-inventory: import by OCLC', () => { - before('create test data', () => { - cy.getAdminToken() - .then(() => { - Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); - InventorySearchAndFilter.createInstanceViaApi() - .then(({ instanceData }) => { - instanceRecord = instanceData; - }); - }); +describe('inventory', () => { + describe('Single record import', () => { + before('create test data', () => { + cy.getAdminToken() + .then(() => { + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); + InventorySearchAndFilter.createInstanceViaApi() + .then(({ instanceData }) => { + instanceRecord = instanceData; + }); + }); - cy.createTempUser([ - permissions.uiInventoryViewCreateEditInstances.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.uiInventorySettingsConfigureSingleRecordImport.gui, - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - permissions.remoteStorageView.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password); - }); - }); + cy.createTempUser([ + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.uiInventorySettingsConfigureSingleRecordImport.gui, + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + permissions.remoteStorageView.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password); + }); + }); - after('delete test data', () => { - InventoryInstance.deleteInstanceViaApi(instanceRecord.instanceId); - Users.deleteViaApi(user.userId); - Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); - }); + after('delete test data', () => { + InventoryInstance.deleteInstanceViaApi(instanceRecord.instanceId); + Users.deleteViaApi(user.userId); + Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); + }); + + it('C343349 Overlay existing Source = FOLIO Instance by import of single MARC Bib record from OCLC (folijet)', + { tags: [testTypes.smoke, DevTeams.folijet] }, () => { + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceRecord.instanceTitle); + InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.startOverlaySourceBibRecord(); + InventoryInstance.importWithOclc(oclcRecordData.oclc); + InventoryInstance.checkCalloutMessage(`Record ${oclcRecordData.oclc} updated. Results may take a few moments to become visible in Inventory`); - it('C343349 Overlay existing Source = FOLIO Instance by import of single MARC Bib record from OCLC (folijet)', { tags: [testTypes.smoke, DevTeams.folijet] }, () => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceRecord.instanceTitle); - InventorySearchAndFilter.selectSearchResultItem(); - InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.overlayWithOclc(oclcRecordData.oclc); - InventoryInstance.checkCalloutMessage(`Record ${oclcRecordData.oclc} updated. Results may take a few moments to become visible in Inventory`); - cy.reload(); - InventoryInstance.waitInstanceRecordViewOpened(oclcRecordData.title); - InventoryInstance.verifyLastUpdatedDate(); - InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); - InventoryInstance.verifyInstanceTitle(oclcRecordData.title); - InventoryInstance.verifyInstanceLanguage(oclcRecordData.language); - InventoryInstance.verifyInstancePublisher(0, 0, oclcRecordData.publisher); - InventoryInstance.verifyInstancePublisher(0, 2, oclcRecordData.placeOfPublication); - InventoryInstance.verifyInstancePublisher(0, 3, oclcRecordData.publicationDate); - InventoryInstance.verifyInstancePhysicalcyDescription(oclcRecordData.physicalDescription); - InventoryInstance.verifyResourceIdentifier('ISBN', oclcRecordData.isbn1, 4); - InventoryInstance.verifyResourceIdentifier('ISBN', oclcRecordData.isbn2, 5); - InventoryInstance.verifyInstanceSubject(0, 0, oclcRecordData.subject); - InventoryInstance.checkInstanceNotes(oclcRecordData.notes.noteType, oclcRecordData.notes.noteContent); + // need to wait because after the import the data in the instance is displayed for a long time + // https://issues.folio.org/browse/MODCPCT-73 + cy.wait(10000); + InventoryInstance.waitInstanceRecordViewOpened(oclcRecordData.title); + InventoryInstance.verifyLastUpdatedDate(); + InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); + InventoryInstance.verifyInstanceTitle(oclcRecordData.title); + InventoryInstance.verifyInstanceLanguage(oclcRecordData.language); + InventoryInstance.verifyInstancePublisher(0, 0, oclcRecordData.publisher); + InventoryInstance.verifyInstancePublisher(0, 2, oclcRecordData.placeOfPublication); + InventoryInstance.verifyInstancePublisher(0, 3, oclcRecordData.publicationDate); + InventoryInstance.verifyInstancePhysicalcyDescription(oclcRecordData.physicalDescription); + InventoryInstance.verifyResourceIdentifier('ISBN', oclcRecordData.isbn1, 4); + InventoryInstance.verifyResourceIdentifier('ISBN', oclcRecordData.isbn2, 5); + InventoryInstance.verifyInstanceSubject(0, 0, oclcRecordData.subject); + InventoryInstance.checkInstanceNotes(oclcRecordData.notes.noteType, oclcRecordData.notes.noteContent); - InventoryInstance.viewSource(); - InventoryViewSource.contains('020\t'); - InventoryViewSource.contains(oclcRecordData.isbn1); - InventoryViewSource.contains('020\t'); - InventoryViewSource.contains(oclcRecordData.isbn2); - InventoryViewSource.contains('245\t'); - InventoryViewSource.contains(oclcRecordData.title); - InventoryViewSource.contains('300\t'); - InventoryViewSource.contains(oclcRecordData.physicalDescription); - InventoryViewSource.contains('650\t'); - InventoryViewSource.contains(oclcRecordData.subject); + InventoryInstance.viewSource(); + InventoryViewSource.contains('020\t'); + InventoryViewSource.contains(oclcRecordData.isbn1); + InventoryViewSource.contains('020\t'); + InventoryViewSource.contains(oclcRecordData.isbn2); + InventoryViewSource.contains('245\t'); + InventoryViewSource.contains(oclcRecordData.title); + InventoryViewSource.contains('300\t'); + InventoryViewSource.contains(oclcRecordData.physicalDescription); + InventoryViewSource.contains('650\t'); + InventoryViewSource.contains(oclcRecordData.subject); + }); }); }); diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js index 0f658ef57c..b22ff38ed6 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js @@ -13,44 +13,46 @@ let user; const oclc = '1007797324'; const OCLCAuthentication = '100481406/PAOLF'; -describe('ui-inventory: import by OCLC', () => { - before('create user', () => { - cy.createTempUser([ - permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; - cy.login(user.username, user.password); +describe('inventory', () => { + describe('Single record import', () => { + before('create user', () => { + cy.createTempUser([ + permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password); - Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); - }); - }); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); + }); + }); - beforeEach('navigate to inventory', () => { - cy.visit(TopMenu.inventoryPath); - }); + beforeEach('navigate to inventory', () => { + cy.visit(TopMenu.inventoryPath); + }); - after('delete test data', () => { - cy.getInstance({ limit: 1, expandAll: true, query: `"oclc"=="${oclc}"` }) - .then(instance => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - Users.deleteViaApi(user.userId); - }); + after('delete test data', () => { + cy.getInstance({ limit: 1, expandAll: true, query: `"oclc"=="${oclc}"` }) + .then(instance => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + Users.deleteViaApi(user.userId); + }); - it('C193953 Overlay existing Source = MARC Instance by import of single MARC Bib record from OCLC (folijet) (prokopovych))', { tags: [testTypes.smoke, DevTeams.folijet] }, () => { - InventoryActions.import(oclc); - InventoryInstance.viewSource(); - InventoryViewSource.contains('999\tf f\t‡s'); - }); + it('C193953 Overlay existing Source = MARC Instance by import of single MARC Bib record from OCLC (folijet) (prokopovych))', { tags: [testTypes.smoke, DevTeams.folijet] }, () => { + InventoryActions.import(oclc); + InventoryInstance.viewSource(); + InventoryViewSource.contains('999\tf f\t‡s'); + }); - it('C193952 Create Instance by import of single MARC Bib record from OCLC (folijet) (prokopovych)', { tags: [testTypes.smoke, DevTeams.folijet] }, () => { - InventorySearchAndFilter.searchByParameter('OCLC number, normalized', oclc); - InventorySearchAndFilter.selectSearchResultItem(); - InventoryInstance.viewSource(); - InventoryViewSource.contains('999\tf f\t‡s'); + it('C193952 Create Instance by import of single MARC Bib record from OCLC (folijet) (prokopovych)', { tags: [testTypes.smoke, DevTeams.folijet] }, () => { + InventorySearchAndFilter.searchByParameter('OCLC number, normalized', oclc); + InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.viewSource(); + InventoryViewSource.contains('999\tf f\t‡s'); + }); }); }); diff --git a/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js b/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js index 262ef836c1..fa996fc28b 100644 --- a/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js +++ b/cypress/e2e/inventory/single-record-import/modal-for-isri-in-inventory-instance-details-menu-for-multiple-target-profiles.cy.js @@ -18,97 +18,99 @@ import InteractorsTools from '../../../support/utils/interactorsTools'; import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import Users from '../../../support/fragments/users/users'; -describe('ui-inventory', () => { - let user; - let instanceHRID; - let profileId; - const OCLCAuthentication = '100481406/PAOLF'; - const fileName = `C375126 autotestFile.${getRandomPostfix()}.mrc`; - const newTargetProfileName = `C375126 autotest profile${getRandomPostfix()}`; - const OCLCWorldCatTargetProfileName = 'OCLC WorldCat'; - const profileForOverlay = 'Inventory Single Record - Default Update Instance (Default)'; - const targetProfile = { - name: 'OCLC WorldCat', - url: 'zcat.oclc.org/OLUCWorldCat', - authentification: OCLCAuthentication, - externalId: '@attr 1=1211 $identifier', - internalId: '999ff$i' - }; - const testIdentifier = '1234567'; - const successCalloutMessage = 'Record 1234567 updated. Results may take a few moments to become visible in Inventory'; - const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; +describe('inventory', () => { + describe('Single record import', () => { + let user; + let instanceHRID; + let profileId; + const OCLCAuthentication = '100481406/PAOLF'; + const fileName = `C375126 autotestFile.${getRandomPostfix()}.mrc`; + const newTargetProfileName = `C375126 autotest profile${getRandomPostfix()}`; + const OCLCWorldCatTargetProfileName = 'OCLC WorldCat'; + const profileForOverlay = 'Inventory Single Record - Default Update Instance (Default)'; + const targetProfile = { + name: 'OCLC WorldCat', + url: 'zcat.oclc.org/OLUCWorldCat', + authentification: OCLCAuthentication, + externalId: '@attr 1=1211 $identifier', + internalId: '999ff$i' + }; + const testIdentifier = '1234567'; + const successCalloutMessage = 'Record 1234567 updated. Results may take a few moments to become visible in Inventory'; + const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; - before('create test data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - cy.getAdminToken().then(() => { - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); - JobProfiles.waitFileIsImported(fileName); - Logs.openFileDetails(fileName); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; + before('create test data', () => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + cy.getAdminToken().then(() => { + DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); + JobProfiles.waitFileIsImported(fileName); + Logs.openFileDetails(fileName); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + }); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); + Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(newTargetProfileName) + .then(initialId => { profileId = initialId; }); + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.openTargetProfile(); + ViewTargetProfile.verifyTargetProfileForm( + targetProfile.name, + targetProfile.url, + targetProfile.authentification, + targetProfile.externalId, + targetProfile.internalId + ); + Z3950TargetProfiles.openTargetProfile(profileId); + ViewTargetProfile.verifyTargetProfileForm( + targetProfile.name, + targetProfile.url, + targetProfile.authentification, + targetProfile.externalId, + targetProfile.internalId + ); }); - Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); - Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(newTargetProfileName) - .then(initialId => { profileId = initialId; }); - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.openTargetProfile(); - ViewTargetProfile.verifyTargetProfileForm( - targetProfile.name, - targetProfile.url, - targetProfile.authentification, - targetProfile.externalId, - targetProfile.internalId - ); - Z3950TargetProfiles.openTargetProfile(profileId); - ViewTargetProfile.verifyTargetProfileForm( - targetProfile.name, - targetProfile.url, - targetProfile.authentification, - targetProfile.externalId, - targetProfile.internalId - ); - }); - cy.logout(); + cy.logout(); - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password, - { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - }); - }); + cy.login(user.username, user.password, + { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C375126 Verify the modal window for ISRI In inventory instance details menu for multiple target profiles (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.startOverlaySourceBibRecord(); + ReImportModal.verifyModalWithSeveralTargetProfiles(); + ReImportModal.verifyExternalTargetField(newTargetProfileName); + ReImportModal.selectExternalTarget(OCLCWorldCatTargetProfileName); + ReImportModal.selectTheProfileToBeUsedToOverlayTheCurrentData(profileForOverlay); + ReImportModal.fillEnterTheTargetIdentifier(testIdentifier); + ReImportModal.import(); + // need to wait because after the import the data in the instance is displayed for a long time + // https://issues.folio.org/browse/MODCPCT-73 + cy.wait(7000); + InteractorsTools.checkCalloutMessage(successCalloutMessage); + InstanceRecordView.verifyIsInstanceOpened(instanceTitle); }); }); - - it('C375126 Verify the modal window for ISRI In inventory instance details menu for multiple target profiles (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); - cy.wait(1000); - InventorySearchAndFilter.selectSearchResultItem(); - InventoryInstance.startOverlaySourceBibRecord(); - ReImportModal.verifyModalWithSeveralTargetProfiles(); - ReImportModal.verifyExternalTargetField(newTargetProfileName); - ReImportModal.selectExternalTarget(OCLCWorldCatTargetProfileName); - ReImportModal.selectTheProfileToBeUsedToOverlayTheCurrentData(profileForOverlay); - ReImportModal.fillEnterTheTargetIdentifier(testIdentifier); - ReImportModal.import(); - // need to wait because after the import the data in the instance is displayed for a long time - // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(7000); - InteractorsTools.checkCalloutMessage(successCalloutMessage); - InstanceRecordView.verifyIsInstanceOpened(instanceTitle); - }); }); diff --git a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-multiple-target-profiles.cy.js b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-multiple-target-profiles.cy.js index 3235a31b4a..ab426e53e8 100644 --- a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-multiple-target-profiles.cy.js +++ b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-multiple-target-profiles.cy.js @@ -18,75 +18,77 @@ import FieldMappingProfiles from '../../../support/fragments/data_import/mapping import Users from '../../../support/fragments/users/users'; import SingleRecordImportModal from '../../../support/fragments/inventory/singleRecordImportModal'; -describe('ui-inventory', () => { - let user; - let profileId; - let createJobProfileId; - let instanceHRID; - const profile = { - createJobProfile: `autotest jobProfileForCreate.${getRandomPostfix()}`, - createActionProfile: `autotest actionProfileForCreate${getRandomPostfix()}`, - createMappingProfile: `autotest mappingProfileForCreate${getRandomPostfix()}`, - }; - const targetProfileName = `C375122 autotest profile${getRandomPostfix()}`; - const testIdentifier = '1234567'; - const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; +describe('inventory', () => { + describe('Single record import', () => { + let user; + let profileId; + let createJobProfileId; + let instanceHRID; + const profile = { + createJobProfile: `autotest jobProfileForCreate.${getRandomPostfix()}`, + createActionProfile: `autotest actionProfileForCreate${getRandomPostfix()}`, + createMappingProfile: `autotest mappingProfileForCreate${getRandomPostfix()}`, + }; + const targetProfileName = `C375122 autotest profile${getRandomPostfix()}`; + const testIdentifier = '1234567'; + const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; - before('create test data', () => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - // create job profile for create - NewFieldMappingProfile.createMappingProfileViaApi(profile.createMappingProfile) - .then((mappingProfileResponse) => { - NewActionProfile.createActionProfileViaApi(profile.createActionProfile, mappingProfileResponse.body.id) - .then((actionProfileResponse) => { - NewJobProfile.createJobProfileWithLinkedActionProfileViaApi(profile.createJobProfile, actionProfileResponse.body.id); - }).then(id => { - createJobProfileId = id; + // create job profile for create + NewFieldMappingProfile.createMappingProfileViaApi(profile.createMappingProfile) + .then((mappingProfileResponse) => { + NewActionProfile.createActionProfileViaApi(profile.createActionProfile, mappingProfileResponse.body.id) + .then((actionProfileResponse) => { + NewJobProfile.createJobProfileWithLinkedActionProfileViaApi(profile.createJobProfile, actionProfileResponse.body.id); + }).then(id => { + createJobProfileId = id; - Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(targetProfileName, [createJobProfileId]) - .then(initialId => { profileId = initialId; }); - }); + Z3950TargetProfiles.createNewZ3950TargetProfileViaApi(targetProfileName, [createJobProfileId]) + .then(initialId => { profileId = initialId; }); + }); - cy.login(user.username, user.password, - { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - }); - }); - }); + cy.login(user.username, user.password, + { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + }); - after('delete test data', () => { - JobProfiles.deleteJobProfile(profile.createJobProfile); - ActionProfiles.deleteActionProfile(profile.createActionProfile); - FieldMappingProfiles.deleteFieldMappingProfile(profile.createMappingProfile); - Users.deleteViaApi(user.userId); - Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + JobProfiles.deleteJobProfile(profile.createJobProfile); + ActionProfiles.deleteActionProfile(profile.createActionProfile); + FieldMappingProfiles.deleteFieldMappingProfile(profile.createMappingProfile); + Users.deleteViaApi(user.userId); + Z3950TargetProfiles.deleteTargetProfileViaApi(profileId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C375122 Verify the modal window for ISRI Import/Create in inventory main actions menu for multiple target profiles (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventoryActions.openSingleReportImportModal(); - SingleRecordImportModal.verifyInventorySingleRecordModalWithSeveralTargetProfiles(); - SingleRecordImportModal.selectExternalTarget(targetProfileName); - SingleRecordImportModal.selectTheProfileToBeUsed(profile.createJobProfile); - SingleRecordImportModal.fillEnterTestIdentifier(testIdentifier); - SingleRecordImportModal.import(); - InstanceRecordView.verifyCalloutMessage(testIdentifier); - // need to wait because after the import the data in the instance is displayed for a long time - // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(10000); - InstanceRecordView.verifyIsInstanceOpened(instanceTitle); - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; + it('C375122 Verify the modal window for ISRI Import/Create in inventory main actions menu for multiple target profiles (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventoryActions.openSingleReportImportModal(); + SingleRecordImportModal.verifyInventorySingleRecordModalWithSeveralTargetProfiles(); + SingleRecordImportModal.selectExternalTarget(targetProfileName); + SingleRecordImportModal.selectTheProfileToBeUsed(profile.createJobProfile); + SingleRecordImportModal.fillEnterTestIdentifier(testIdentifier); + SingleRecordImportModal.import(); + InstanceRecordView.verifyCalloutMessage(testIdentifier); + // need to wait because after the import the data in the instance is displayed for a long time + // https://issues.folio.org/browse/MODCPCT-73 + cy.wait(10000); + InstanceRecordView.verifyIsInstanceOpened(instanceTitle); + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + }); }); - }); + }); }); diff --git a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js index 2ca636c8c6..ba4b1b4f4f 100644 --- a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js +++ b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-import-create-for-single-target-profiles.cy.js @@ -10,53 +10,55 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import Users from '../../../support/fragments/users/users'; import SingleRecordImportModal from '../../../support/fragments/inventory/singleRecordImportModal'; -describe('ui-inventory', () => { - let user; - let instanceHRID; - const OCLCAuthentication = '100481406/PAOLF'; - const profileForImport = 'Inventory Single Record - Default Create Instance (Default)'; - const testIdentifier = '1234567'; - const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; +describe('inventory', () => { + describe('Single record import', () => { + let user; + let instanceHRID; + const OCLCAuthentication = '100481406/PAOLF'; + const profileForImport = 'Inventory Single Record - Default Create Instance (Default)'; + const testIdentifier = '1234567'; + const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; - before('login', () => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + before('login', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); - cy.login(user.username, user.password, - { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - }); - }); + cy.login(user.username, user.password, + { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }); - }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); - it('C375145 Verify the modal window for ISRI Import/Create in inventory main actions menu for single target profiles (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventoryActions.openSingleReportImportModal(); - SingleRecordImportModal.verifyInventorySingleRecordModalWithOneTargetProfile(); - SingleRecordImportModal.verifySelectTheProfileToBeUsedField(profileForImport); - SingleRecordImportModal.selectTheProfileToBeUsed(profileForImport); - SingleRecordImportModal.fillEnterTestIdentifier(testIdentifier); - SingleRecordImportModal.import(); - InstanceRecordView.verifyCalloutMessage(testIdentifier); - // need to wait because after the import the data in the instance is displayed for a long time - // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(10000); - InstanceRecordView.verifyIsInstanceOpened(instanceTitle); - InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; + it('C375145 Verify the modal window for ISRI Import/Create in inventory main actions menu for single target profiles (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventoryActions.openSingleReportImportModal(); + SingleRecordImportModal.verifyInventorySingleRecordModalWithOneTargetProfile(); + SingleRecordImportModal.verifySelectTheProfileToBeUsedField(profileForImport); + SingleRecordImportModal.selectTheProfileToBeUsed(profileForImport); + SingleRecordImportModal.fillEnterTestIdentifier(testIdentifier); + SingleRecordImportModal.import(); + InstanceRecordView.verifyCalloutMessage(testIdentifier); + // need to wait because after the import the data in the instance is displayed for a long time + // https://issues.folio.org/browse/MODCPCT-73 + cy.wait(10000); + InstanceRecordView.verifyIsInstanceOpened(instanceTitle); + InstanceRecordView.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + }); }); - }); + }); }); diff --git a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js index 36f938e47d..644b27ba82 100644 --- a/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js +++ b/cypress/e2e/inventory/single-record-import/modal-window-for-isri-in-inventory-instance-details-menu-for-single-target-profile-update.cy.js @@ -18,82 +18,84 @@ import InstanceRecordView from '../../../support/fragments/inventory/instanceRec import Users from '../../../support/fragments/users/users'; import ReImportModal from '../../../support/fragments/inventory/reImportModal'; -describe('ui-inventory', () => { - let user; - let instanceHRID; - const OCLCAuthentication = '100481406/PAOLF'; - const profileForImport = 'Inventory Single Record - Default Update Instance (Default)'; - const fileName = `C375146autotestFile.${getRandomPostfix()}.mrc`; - const targetIdentifier = '1234567'; - const targetProfile = { - name: 'OCLC WorldCat', - url: 'zcat.oclc.org/OLUCWorldCat', - authentification: OCLCAuthentication, - externalId: '@attr 1=1211 $identifier', - internalId: '999ff$i' - }; - const successCalloutMessage = 'Record 1234567 updated. Results may take a few moments to become visible in Inventory'; - const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; +describe('inventory', () => { + describe('Single record import', () => { + let user; + let instanceHRID; + const OCLCAuthentication = '100481406/PAOLF'; + const profileForImport = 'Inventory Single Record - Default Update Instance (Default)'; + const fileName = `C375146autotestFile.${getRandomPostfix()}.mrc`; + const targetIdentifier = '1234567'; + const targetProfile = { + name: 'OCLC WorldCat', + url: 'zcat.oclc.org/OLUCWorldCat', + authentification: OCLCAuthentication, + externalId: '@attr 1=1211 $identifier', + internalId: '999ff$i' + }; + const successCalloutMessage = 'Record 1234567 updated. Results may take a few moments to become visible in Inventory'; + const instanceTitle = 'The Gospel according to Saint Mark : Evangelistib Markusib aglangit.'; - before('login', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - cy.getAdminToken() - .then(() => { - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); - JobProfiles.waitFileIsImported(fileName); - Logs.openFileDetails(fileName); - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHRID = initialInstanceHrId; + before('login', () => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + cy.getAdminToken() + .then(() => { + DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); + JobProfiles.waitFileIsImported(fileName); + Logs.openFileDetails(fileName); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + }); + Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); + cy.visit(SettingsMenu.targetProfilesPath); + Z3950TargetProfiles.openTargetProfile(); + ViewTargetProfile.verifyTargetProfileForm( + targetProfile.name, + targetProfile.url, + targetProfile.authentification, + targetProfile.externalId, + targetProfile.internalId + ); }); - Z3950TargetProfiles.changeOclcWorldCatValueViaApi(OCLCAuthentication); - cy.visit(SettingsMenu.targetProfilesPath); - Z3950TargetProfiles.openTargetProfile(); - ViewTargetProfile.verifyTargetProfileForm( - targetProfile.name, - targetProfile.url, - targetProfile.authentification, - targetProfile.externalId, - targetProfile.internalId - ); - }); - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.uiInventorySingleRecordImport.gui, - permissions.settingsDataImportEnabled.gui - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.uiInventorySingleRecordImport.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; - cy.login(user.username, user.password, - { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); - }); - }); + cy.login(user.username, user.password, + { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); - after('delete test data', () => { - Users.deleteViaApi(user.userId); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) - .then((instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C375146 Verify the modal window for ISRI In inventory instance details menu for single target profile (update) (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + cy.wait(1000); + InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.startOverlaySourceBibRecord(); + ReImportModal.verifyModalWithOneTargetProfile(); + ReImportModal.verifySelectTheProfileToBeUsedToOverlayTheCurrentDataField(profileForImport); + ReImportModal.selectTheProfileToBeUsedToOverlayTheCurrentData(profileForImport); + ReImportModal.fillEnterTheTargetIdentifier(targetIdentifier); + ReImportModal.import(); + // need to wait because after the import the data in the instance is displayed for a long time + // https://issues.folio.org/browse/MODCPCT-73 + cy.wait(7000); + InteractorsTools.checkCalloutMessage(successCalloutMessage); + InstanceRecordView.verifyIsInstanceOpened(instanceTitle); }); }); - - it('C375146 Verify the modal window for ISRI In inventory instance details menu for single target profile (update) (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); - cy.wait(1000); - InventorySearchAndFilter.selectSearchResultItem(); - InventoryInstance.startOverlaySourceBibRecord(); - ReImportModal.verifyModalWithOneTargetProfile(); - ReImportModal.verifySelectTheProfileToBeUsedToOverlayTheCurrentDataField(profileForImport); - ReImportModal.selectTheProfileToBeUsedToOverlayTheCurrentData(profileForImport); - ReImportModal.fillEnterTheTargetIdentifier(targetIdentifier); - ReImportModal.import(); - // need to wait because after the import the data in the instance is displayed for a long time - // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(7000); - InteractorsTools.checkCalloutMessage(successCalloutMessage); - InstanceRecordView.verifyIsInstanceOpened(instanceTitle); - }); }); 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 5a55499934..5f09a98ae8 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -27,7 +27,6 @@ const errorsAccordion = Accordion('Errors'); const recordIdentifierDropdown = Select('Record identifier'); const recordTypesAccordion = Accordion({ label: 'Record types' }); const actions = Button('Actions'); -const radioItems = RadioButton('Inventory - items'); const fileButton = Button('or choose file'); const bulkEditPane = Pane(including('Bulk edit')); const usersRadio = RadioButton('Users'); @@ -54,7 +53,6 @@ const errorsCommittingBtn = DropdownMenu().find(Button('File with errors encount const buildQueryButton = Button('Build query'); const buildQueryModal = Modal('Build query'); const logsActionButton = Button({ icon: 'ellipsis' }); -const startBulkEditLocalButton = Button('Start bulk edit (Local)'); export default { waitLoading() { diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 705e96954b..0fbe8d1e5f 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -158,15 +158,6 @@ export default { ]); }, - addTrunsferTo: (fund) => { - cy.do([ - actionsButton.click(), - Button('Edit').click(), - MultiSelect({ label: 'Transfer to' }).select([fund]), - saveAndCloseButton.click() - ]); - }, - checkAddGroupToFund: (group) => { cy.expect(Pane({ id: 'pane-fund-details' }).exists()); cy.expect( diff --git a/cypress/support/fragments/finance/ledgers/ledgers.js b/cypress/support/fragments/finance/ledgers/ledgers.js index 9ec539419e..9cfc6ddd87 100644 --- a/cypress/support/fragments/finance/ledgers/ledgers.js +++ b/cypress/support/fragments/finance/ledgers/ledgers.js @@ -27,9 +27,6 @@ const numberOfSearchResultsHeader = const rolloverButton = Button('Rollover'); const continueButton = Button('Continue'); const confirmButton = Button('Confirm'); -const ledgertab = Button('Ledger'); -const fundtab = Button('Fund'); -const fiscalYearTab = Button('Fiscal year'); const zeroResultsFoundText = '0 records found'; const fiscalYearCss = 'select[name^="fiscalYearOneId"]'; const rolloverConfirmButton = Button({ From 89087e9948dca152f99aa1b576a8bc44b82e5e85 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 15 Aug 2023 09:55:08 +0300 Subject: [PATCH 046/437] Fat 7336 c347926 (#1485) * deleted waiter * added test * added after block * fixed linter issue --- ...bulk-edit-in-app-user-barcodes-error.cy.js | 2 +- .../e2e/edi-import-large-invoice-file.cy.js | 3 +- ...scription-is-incorrectly-constructed.cy.js | 119 ++++++++++++++++++ cypress/fixtures/ediFileForC347926.edi | 1 + .../fragments/data_import/logs/fileDetails.js | 31 ++++- .../newFieldMappingProfile.js | 30 +++-- .../inventory/inventorySearchAndFilter.js | 1 - .../support/fragments/invoices/invoiceView.js | 4 +- 8 files changed, 177 insertions(+), 14 deletions(-) create mode 100644 cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js create mode 100644 cypress/fixtures/ediFileForC347926.edi diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js index 76d6fb62bd..ee53fc0283 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js @@ -22,7 +22,7 @@ describe('bulk-edit', () => { .then(userProperties => { user = userProperties; cy.login(user.username, user.password, { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading }); - + FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, user.barcode); FileManager.createFile(`cypress/fixtures/${userBarcodesFileNameWithDuplicates}`, `${user.barcode}\r\n${user.barcode}\r\n${getRandomPostfix()}`); diff --git a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js index 8c6ae73f1f..24322f74c0 100644 --- a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js @@ -21,6 +21,7 @@ import InvoiceView from '../../../support/fragments/invoices/invoiceView'; describe('data-import', () => { describe('End to end scenarios', () => { + const quantityOfInvoiceLines = '1,104'; const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.harrassowitz; const fileName = `C347615autotestFile.${getRandomPostfix()}.edi`; const mappingProfile = { @@ -86,7 +87,7 @@ describe('data-import', () => { Logs.checkStatusOfJobProfile(); Logs.checkQuantityRecordsInFile(Logs.quantityRecordsInInvoice.firstQuantity); Logs.openFileDetails(fileName); - InvoiceView.checkQuantityInvoiceLinesInRecord(); + InvoiceView.checkQuantityInvoiceLinesInRecord(quantityOfInvoiceLines); }); }); }); diff --git a/cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js b/cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js new file mode 100644 index 0000000000..70ac3561fe --- /dev/null +++ b/cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js @@ -0,0 +1,119 @@ +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 FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import { FOLIO_RECORD_TYPE, + PAYMENT_METHOD, + BATCH_GROUP, + ACCEPTED_DATA_TYPE_NAMES, + VENDOR_NAMES } from '../../../support/constants'; +import TopMenu from '../../../support/fragments/topMenu'; +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 FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import Users from '../../../support/fragments/users/users'; +import InvoiceView from '../../../support/fragments/invoices/invoiceView'; + +describe('data-import', () => { + describe('Importing EDIFACT files', () => { + let user; + const quantityOfInvoices = '5'; + const quantityOfInvoiceLines = '122'; + const invoiceNumbers = ['263056', '263057', '263058', '263059', '263061']; + const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.harrassowitz; + const filePathForUpload = 'ediFileForC347926.edi'; + const fileName = `C347926autotestFile.${getRandomPostfix()}.edi`; + const mappingProfile = { + name:`C347926 Import Harrassowitz invoice.${getRandomPostfix()}`, + description: '', + batchGroup: BATCH_GROUP.FOLIO, + lockTotalAmount: 'MOA+9?4[2]', + organizationName: VENDOR_NAMES.HARRASSOWITZ, + paymentMethod: PAYMENT_METHOD.CASH, + invoiceLinePOlDescription: '{POL_title}; else IMD++050+[4-5]', + polNumber: 'RFF+SNA[2]', + polVendorReferenceNumber: 'RFF+SLI[2]', + incomingRecordType: NewFieldMappingProfile.incomingRecordType.edifact, + existingRecordType: FOLIO_RECORD_TYPE.INVOICE + }; + const actionProfile = { + name: `C347926 Import Harrassowitz invoice.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INVOICE + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `autoTestJobProf.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT + }; + + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.uiOrganizationsViewEditCreate.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + invoiceNumbers.forEach(number => { + cy.getInvoiceIdApi({ query: `vendorInvoiceNo="${number}"` }) + .then(id => cy.deleteInvoiceFromStorageViaApi(id)); + }); + Users.deleteViaApi(user.userId); + }); + + it('C347926 Check EDIFACT invoice import when Invoice line description is incorrectly constructed (folijet)', + { tags: [TestTypes.extendedPath, DevTeams.folijet] }, () => { + // create Field mapping profile + FieldMappingProfiles.waitLoading(); + FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); + 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.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + 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(filePathForUpload, fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.selectJobProfile(); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkImportFile(jobProfile.profileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(fileName); + FileDetails.verifyEachInvoiceStatusInColunm('Created'); + FileDetails.verifyEachInvoiceTitleInColunm(); + FileDetails.clickNextPaginationButton(); + FileDetails.verifyEachInvoiceStatusInColunm('Created'); + FileDetails.verifyEachInvoiceTitleInColunm(); + Logs.checkQuantityRecordsInFile(quantityOfInvoices); + InvoiceView.checkQuantityInvoiceLinesInRecord(quantityOfInvoiceLines); + }); + }); +}); diff --git a/cypress/fixtures/ediFileForC347926.edi b/cypress/fixtures/ediFileForC347926.edi new file mode 100644 index 0000000000..b848e20524 --- /dev/null +++ b/cypress/fixtures/ediFileForC347926.edi @@ -0,0 +1 @@ +UNA:+.? 'UNB+UNOC:3+HARRASSOWITZ:ZZ+3463621:ZZ+211206:1237+294'UNH+1+INVOIC:D:96A:UN:EAN008'BGM+380+263056+43'DTM+137:20210930:102'NAD+SU+++OTTO HARRASSOWITZ:BOOKSELLERS & SUBSCRIPTION AGENTS:::BLO+KREUZBERGER RING 7C-D+WIESBADEN+GERMANY+65174+DE'RFF+API:HARRAS'NAD+BY+++Books Receiving - 1059:MSU Libraries:Michigan State University+366 W Circle Drive+East Lansing, MI+MI+488241048+US'RFF+API:0088041'CUX+2:USD:4'ALC+C++++PAB'MOA+8:147.14'LIN+1++9783825347406:EN'PIA+1+har200391067:SA'IMD++010+:::Genazino'IMD++050+:::Die Angst vor der Penetranz des Wik:lichen'IMD++109+:::Universitaetsverlag Winter'IMD++110+:::Heidelberg'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:11.78'PRI+AAB:11.78'RFF+SNA:84390261'RFF+SLI:har200391067'LIN+2++9783205212485:EN'PIA+1+har200544624:SA'IMD++010+:::Bischof'IMD++050+:::Auftrag Zukunft?: 3000 Zeichen fuer:Gedenken, Toleranz und Demokratie'IMD++109+:::Boehlau Verlag'IMD++110+:::Wien'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:41.22'PRI+AAB:41.22'RFF+SNA:84120452'RFF+SLI:har200544624'LIN+3++9783848765669:EN'PIA+1+har200385349:SA'IMD++050+:::Belgisch-deutsche Kontaktraeume in:Rheinland und Westfalen, 1945-1995'IMD++100+:::1. Auflage'IMD++109+:::Nomos'IMD++110+:::Baden-Baden'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:51.81'PRI+AAB:51.81'RFF+SNA:84338362'RFF+SLI:har200385349'LIN+4++9783835338623:EN'PIA+1+har200551324:SA'IMD++010+:::Kerr'IMD++050+:::Berlin wird Berlin'IMD++109+:::Wallstein'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::cloth in slipcase'QTY+47:1'MOA+203:150.73'PRI+AAB:150.73'RFF+SNA:84560765'RFF+SLI:har200551324'LIN+5++9783110675429:EN'PIA+1+har190611499:SA'IMD++050+:::Centralverein deutscher Staatsbuerg:er juedischen Glaubens'IMD++109+:::De Gruyter Oldenbourg'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:94.15'PRI+AAB:94.15'RFF+SNA:84338351'RFF+SLI:har190611499'LIN+6++9783428181650:EN'PIA+1+har200554938:SA'IMD++010+:::Pohl'IMD++050+:::Europa in der Tradition Habsburgs??'IMD++109+:::Duncker & Humblot'IMD++110+:::Berlin'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:94.09'PRI+AAB:94.09'RFF+SNA:84331865'RFF+SLI:har200554938'LIN+7++9783847112884:EN'PIA+1+har200550644:SA'IMD++010+:::Czezior'IMD++050+:::Die Figur des Philisters'IMD++109+:::V&R Unipress'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:41.22'PRI+AAB:41.22'RFF+SNA:84309090'RFF+SLI:har200550644'LIN+8++9783847112709:EN'PIA+1+har200478578:SA'IMD++050+:::Frei-Zeit in der Gegenwartsliteratu:r'IMD++109+:::V&R unipress'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:47.1'PRI+AAB:47.1'RFF+SNA:84294330'RFF+SLI:har200478578'LIN+9++9783826059025:EN'PIA+1+har150492518:SA'IMD++010+:::Ota'IMD++050+:::Der freie Gebrauch des Eigenen'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:52.99'PRI+AAB:52.99'RFF+SNA:84349789'RFF+SLI:har150492518'LIN+10++9783955654122:EN'PIA+1+har200294629:SA'IMD++010+:::Schoeps'IMD++050+:::Gabriel Riesser'IMD++100+:::1. Auflage'IMD++109+:::Hentrich & Hentrich'IMD++110+:::Berlin'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:11.66'PRI+AAB:11.66'RFF+SNA:84503369'RFF+SLI:har200294629'LIN+11++9783110681543:EN'PIA+1+har200387725:SA'IMD++010+:::Meier'IMD++050+:::Hermann Dietrich'IMD++109+:::De Gruyter Oldenbourg'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:70.6'PRI+AAB:70.6'RFF+SNA:84365203'RFF+SLI:har200387725'LIN+12++9783525360989:EN'PIA+1+har200182980:SA'IMD++010+:::Postert'IMD++050+:::Die Hitlerjugend'IMD++109+:::Vandenhoeck & Ruprecht'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:45.93'PRI+AAB:45.93'RFF+SNA:84365785'RFF+SLI:har200182980'LIN+13++9783825347338:EN'PIA+1+har200391064:SA'IMD++010+:::Berner'IMD++050+:::Inszenierte Volkstuemlichkeit in Ba:lladen von 1800 bis 1850'IMD++109+:::Universitaetsverlag Winter'IMD++110+:::Heidelberg'IMD++170+:::2020'IMD++220+:::hardbound'QTY+47:1'MOA+203:80.08'PRI+AAB:80.08'RFF+SNA:84390288'RFF+SLI:har200391064'LIN+14++9783825369453:EN'PIA+1+har210123209:SA'IMD++050+:::Johann von Besser (1654-1729)'IMD++080+:::Band 5'IMD++109+:::Universitaetsverlag Winter'IMD++110+:::Heidelberg'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:42.39'PRI+AAB:42.39'RFF+SNA:84503131'RFF+SLI:har210123209'LIN+15++9783847112228:EN'PIA+1+har200386493:SA'IMD++050+:::Literarisierung der Gesellschaft im:Wandel'IMD++109+:::V & R unipress'IMD++110+:::Goettingen'IMD++170+:::2020'IMD++220+:::hardbound'QTY+47:1'MOA+203:52.99'PRI+AAB:52.99'RFF+SNA:84244675'RFF+SLI:har200386493'LIN+16++9783847112396:EN'PIA+1+har210063407:SA'IMD++050+:::Literatur und Kultur zwischen West:und Ost'IMD++109+:::V&R unipress'IMD++110+:::Goettingen'IMD++170+:::2020'IMD++220+:::hardbound'QTY+47:1'MOA+203:47.1'PRI+AAB:47.1'RFF+SNA:84294373'RFF+SLI:har210063407'LIN+17++9783847112792:EN'PIA+1+har200512875:SA'IMD++050+:::Macht und Herrschaft im Siegel- und:Muenzbild'IMD++109+:::V&R Unipress, Bonn University Press'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:58.88'PRI+AAB:58.88'RFF+SNA:84781688'RFF+SLI:har200512875'LIN+18++9783847112198:EN'PIA+1+har200386502:SA'IMD++050+:::Mapping Ransmayr'IMD++109+:::V&R unipress'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:47.1'PRI+AAB:47.1'RFF+SNA:84244626'RFF+SLI:har200386502'LIN+19++9783957862792:EN'PIA+1+har210169379:SA'IMD++050+:::"Mit jedem Leben, das wir retteten,:bekaempften wir Hitler!"'IMD++109+:::Wissner-Verlag'IMD++110+:::Augsburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:21.08'PRI+AAB:21.08'RFF+SNA:84740735'RFF+SLI:har210169379'LIN+20++9783948552091:EN'PIA+1+har210001909:SA'IMD++010+:::Madaus'IMD++050+:::Mythos - Ritus - Kunst'IMD++100+:::Originalausgabe, 1. Auflage'IMD++109+:::Pohlmann Verlag'IMD++110+:::Bad Laer'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:19.78'PRI+AAB:19.78'RFF+SNA:84308807'RFF+SLI:har210001909'LIN+21++9783706910873:EN'PIA+1+har200099227:SA'IMD++010+:::Schenkermayr'IMD++050+:::Ritus, Schrift und Machtgefuege'IMD++109+:::Praesens Verlag'IMD++110+:::Wien'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:32.03'PRI+AAB:32.03'RFF+SNA:84395860'RFF+SLI:har200099227'LIN+22++9783506760128:EN'PIA+1+har200554948:SA'IMD++010+:::Gehlen'IMD++050+:::Die Thyssen-Bornemisza-Gruppe'IMD++109+:::Brill / Ferdinand Schoeningh'IMD++110+:::Paderborn'IMD++170+:::2021'IMD++220+:::half cloth'QTY+47:1'MOA+203:81.25'PRI+AAB:81.25'RFF+SNA:83683005'RFF+SLI:har200554948'LIN+23++9783961382422:EN'PIA+1+har200544713:SA'IMD++010+:::Deterding'IMD++050+:::UEber die Raeume und Zeiten hinweg'IMD++109+:::WVB, Wissenschaftlicher Verlag Berl:in'IMD++110+:::'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:47.11'PRI+AAB:47.11'RFF+SNA:84395883'RFF+SLI:har200544713'LIN+24++9783447116022:EN'PIA+1+har210084430:SA'IMD++050+:::Das verbotene Purim-Spiel'IMD++109+:::Harrassowitz Verlag'IMD++110+:::Wiesbaden'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:68.3'PRI+AAB:68.3'RFF+SNA:84482664'RFF+SLI:har210084430'LIN+25++9783034340427:EN'PIA+1+har200389303:SA'IMD++010+:::Pechota'IMD++050+:::Verleiblichung bei Peter Stamm und:Annie Ernaux in "Nacht ist der Tag"'IMD++109+:::Peter Lang'IMD++110+:::Bern'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:70.6'PRI+AAB:70.6'RFF+SNA:83802237'RFF+SLI:har200389303'LIN+26++9783942901444:EN'PIA+1+har210001354:SA'IMD++010+:::Schwarz'IMD++050+:::Werke, Briefe, Dokumente'IMD++080+:::Band 1'IMD++100+:::1. Auflage'IMD++109+:::Reinecke & Voss'IMD++110+:::Leipzig'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:47.1'PRI+AAB:47.1'RFF+SNA:84503090'RFF+SLI:har210001354'LIN+27++9783412521202:EN'PIA+1+har200478368:SA'IMD++010+:::Thiessen'IMD++050+:::Das Zeitalter der Ambiguitaet'IMD++109+:::Boehlau Verlag'IMD++110+:::Koeln'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:70.66'PRI+AAB:70.66'RFF+SNA:84390301'RFF+SLI:har200478368'UNS+S'CNT+1:27'CNT+2:27'MOA+9:1646.87:USD:4'MOA+79:1646.87:USD:4'UNT+363+1'UNH+2+INVOIC:D:96A:UN:EAN008'BGM+380+263057+43'DTM+137:20210930:102'NAD+SU+++OTTO HARRASSOWITZ:BOOKSELLERS & SUBSCRIPTION AGENTS:::BLO+KREUZBERGER RING 7C-D+WIESBADEN+GERMANY+65174+DE'RFF+API:HARRAS'NAD+BY+++Books Receiving - 1059:MSU Libraries:Michigan State University+366 W Circle Drive+East Lansing, MI+MI+488241048+US'RFF+API:0088041'CUX+2:USD:4'ALC+C++++PAB'MOA+8:147.24'LIN+1++9783110715057:EN'PIA+1+har200343736:SA'IMD++050+:::Akten zur Auswaertigen Politik der:Bundesrepublik Deutschland--1990'IMD++080+:::1990'IMD++109+:::De Gruyter Oldenbourg'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:182.47'PRI+AAB:182.47'RFF+SNA:84560548'RFF+SLI:har200343736'LIN+2++9783835339453:EN'PIA+1+har200551032:SA'IMD++010+:::Berning'IMD++050+:::Anemonenschwert und Lydditgranate'IMD++109+:::Wallstein Verlag'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:57.7'PRI+AAB:57.7'RFF+SNA:84560594'RFF+SLI:har200551032'LIN+3++9783849817213:EN'PIA+1+har215006186:SA'IMD++010+:::Sill'IMD++050+:::Apropos Fontane'IMD++109+:::Aisthesis Verlag'IMD++110+:::Bielefeld'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:28.26'PRI+AAB:28.26'RFF+SNA:84443502'RFF+SLI:har215006186'LIN+4++9783476057631:EN'PIA+1+har200475186:SA'IMD++050+:::Der deutschsprachige Nachkriegsroma:n und die Tradition des unzuverlaes'IMD++109+:::J.B. Metzler, ein Teil von Springer:Nature'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:50.39'PRI+AAB:50.39'RFF+SNA:84365242'RFF+SLI:har200475186'LIN+5++9783412521608:EN'PIA+1+har200505665:SA'IMD++050+:::Erzaehlweisen des Sagbaren und Unsa:gbaren'IMD++109+:::Boehlau Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:76.54'PRI+AAB:76.54'RFF+SNA:84773926'RFF+SLI:har200505665'LIN+6++9783506760432:EN'PIA+1+har200554724:SA'IMD++010+:::Bismarck'IMD++050+:::Gesammelte Werke'IMD++080+:::Band 9'IMD++109+:::Ferdinand Schoeningh, Brill Deutsch:and'IMD++110+:::Paderborn'IMD++170+:::2021'IMD++220+:::cloth'QTY+47:1'MOA+203:73.01'PRI+AAB:73.01'RFF+SNA:84631405'RFF+SLI:har200554724'LIN+7++9783849815936:EN'PIA+1+har200436496:SA'IMD++010+:::Boehme'IMD++050+:::Goethe?: was hat er uns heute zu sag:en??'IMD++109+:::Aisthesis Verlag'IMD++110+:::Bielefeld'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:17.66'PRI+AAB:17.66'RFF+SNA:84338627'RFF+SLI:har200436496'LIN+8++9783849817497:EN'PIA+1+har215013545:SA'IMD++010+:::Anderegg'IMD++050+:::Goethes "Faust" lesen'IMD++109+:::Aisthesis Verlag'IMD++110+:::Bielefeld'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:29.44'PRI+AAB:29.44'RFF+SNA:84931244'RFF+SLI:har215013545'LIN+9++9783110738995:EN'PIA+1+har210035482:SA'IMD++010+:::Luetzeler'IMD++050+:::Hermann Broch und die Menschenrecht:e'IMD++109+:::De Gruyter'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:47.05'PRI+AAB:47.05'RFF+SNA:84580439'RFF+SLI:har210035482'LIN+10++9783205212348:EN'PIA+1+har200479898:SA'IMD++010+:::Baur'IMD++050+:::Literatur in OEsterreich 1938-1945'IMD++080+:::Band 5'IMD++109+:::Boehlau Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::cloth'QTY+47:1'MOA+203:76.54'PRI+AAB:76.54'RFF+SNA:84619821'RFF+SLI:har200479898'LIN+11++9783959484985:EN'PIA+1+har210003794:SA'IMD++010+:::Miller'IMD++050+:::Die Maschine im Fruehwerk Ernst Jue:ngers'IMD++109+:::Verlag Traugott Bautz GmbH'IMD++110+:::Nordhausen'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:9.42'PRI+AAB:9.42'RFF+SNA:84395924'RFF+SLI:har210003794'LIN+12++9783835339132:EN'PIA+1+har200551289:SA'IMD++050+:::Richten - strafen - erinnern'IMD++109+:::Wallstein Verlag'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:35.33'PRI+AAB:35.33'RFF+SNA:84631597'RFF+SLI:har200551289'LIN+13++9783706910620:EN'PIA+1+har200473051:SA'IMD++050+:::Sehnsucht nach dem Leben'IMD++109+:::Praesens Verlag'IMD++110+:::'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:30.85'PRI+AAB:30.85'RFF+SNA:84503283'RFF+SLI:har200473051'LIN+14++9783257071016:EN'PIA+1+har200181232:SA'IMD++010+:::Duerrenmatt'IMD++050+:::Das Stoffe-Projekt'IMD++109+:::Diogenes'IMD++110+:::Zuerich'IMD++170+:::2021'IMD++220+:::cloth in slipcase'QTY+47:1'MOA+203:471.04'PRI+AAB:471.04'RFF+SNA:84634191'RFF+SLI:har200181232'LIN+15++9783849812867:EN'PIA+1+har180386230:SA'IMD++010+:::Sill'IMD++050+:::Theodor Fontane - neu gelesen'IMD++109+:::Aisthesis Verlag'IMD++110+:::Bielefeld'IMD++170+:::2019'IMD++220+:::paperback'QTY+47:1'MOA+203:23.32'PRI+AAB:23.32'RFF+SNA:84443524'RFF+SLI:har180386230'LIN+16++9783867323543:EN'PIA+1+har200041470:SA'IMD++050+:::Zwischen Pflicht und Freiheit'IMD++080+:::2'IMD++100+:::1. Auflage'IMD++109+:::Lukas Verlag'IMD++110+:::Berlin'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:23.32'PRI+AAB:23.32'RFF+SNA:84740761'RFF+SLI:har200041470'UNS+S'CNT+1:16'CNT+2:16'MOA+9:1379.58:USD:4'MOA+79:1379.58:USD:4'UNT+223+2'UNH+3+INVOIC:D:96A:UN:EAN008'BGM+380+263058+43'DTM+137:20210930:102'NAD+SU+++OTTO HARRASSOWITZ:BOOKSELLERS & SUBSCRIPTION AGENTS:::BLO+KREUZBERGER RING 7C-D+WIESBADEN+GERMANY+65174+DE'RFF+API:HARRAS'NAD+BY+++Books Receiving - 1059:MSU Libraries:Michigan State University+366 W Circle Drive+East Lansing, MI+MI+488241048+US'RFF+API:0088041'CUX+2:USD:4'ALC+C++++PAB'MOA+8:147.1'LIN+1++9783643250124:EN'PIA+1+har210194762:SA'IMD++010+:::Benedikter'IMD++050+:::100 Jahre moderne Territorialautono:mie - Autonomie weltweit'IMD++109+:::Lit'IMD++110+:::Muenster'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:35.21'PRI+AAB:35.21'RFF+SNA:85072369'RFF+SLI:har210194762'LIN+2++9783455406030:EN'PIA+1+har190068324:SA'IMD++010+:::Lenz'IMD++050+:::Die Auflehnung'IMD++080+:::Band 13'IMD++100+:::1. Auflage'IMD++109+:::Hoffmann und Campe'IMD++110+:::Hamburg'IMD++170+:::2021'IMD++220+:::cloth'QTY+47:1'MOA+203:51.81'PRI+AAB:51.81'RFF+SNA:84734190'RFF+SLI:har190068324'LIN+3++9783959485067:EN'PIA+1+har210035790:SA'IMD++010+:::Braun-Yousefi'IMD++050+:::Clara Viebig im Kontext'IMD++109+:::Traugott Bautz'IMD++110+:::Nordhausen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:52.99'PRI+AAB:52.99'RFF+SNA:84631578'RFF+SLI:har210035790'LIN+4++9783039260133:EN'PIA+1+har200554699:SA'IMD++010+:::Duvanel'IMD++050+:::Fern von hier'IMD++109+:::Limmat Verlag'IMD++110+:::Zuerich'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:45.93'PRI+AAB:45.93'RFF+SNA:84418106'RFF+SLI:har200554699'LIN+5++9783843612463:EN'PIA+1+har200513228:SA'IMD++050+:::Goethe und der Koran'IMD++109+:::Patmos Verlag'IMD++110+:::Ostfildern'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:57.7'PRI+AAB:57.7'RFF+SNA:84919389'RFF+SLI:har200513228'LIN+6++9783412505134:EN'PIA+1+har210092058:SA'IMD++010+:::North'IMD++050+:::Das Goldene Zeitalter global'IMD++109+:::Boehlau Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:41.22'PRI+AAB:41.22'RFF+SNA:85087650'RFF+SLI:har210092058'LIN+7++9783849817121:EN'PIA+1+har210031861:SA'IMD++010+:::Baroth'IMD++050+:::Hans Dieter Baroth - Lesebuch'IMD++109+:::Nyland-Stiftung, im Aisthesis Verla:g'IMD++110+:::Koeln'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:10.01'PRI+AAB:10.01'RFF+SNA:84332078'RFF+SLI:har210031861'LIN+8++9783034016339:EN'PIA+1+har200554952:SA'IMD++050+:::Herrschaft und Repraesentation'IMD++109+:::Chronos'IMD++110+:::Zuerich'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:56.52'PRI+AAB:56.52'RFF+SNA:84774091'RFF+SLI:har200554952'LIN+9++9783835339255:EN'PIA+1+har200551322:SA'IMD++010+:::Rispoli'IMD++050+:::Hofmannsthal und die Kunst des Lese:ns'IMD++109+:::Wallstein Verlag'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:40.04'PRI+AAB:40.04'RFF+SNA:84930957'RFF+SLI:har200551322'LIN+10++9783835339804:EN'PIA+1+har210135871:SA'IMD++010+:::Schnath'IMD++050+:::In des Teufels Kueche'IMD++109+:::Wallstein Verlag'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:35.21'PRI+AAB:35.21'RFF+SNA:84919324'RFF+SLI:har210135871'LIN+11++9783854768890:EN'PIA+1+har200292584:SA'IMD++010+:::Preiser-Kapeller'IMD++050+:::Der lange Sommer und die kleine Eis:zeit'IMD++109+:::Mandelbaum Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:29.44'PRI+AAB:29.44'RFF+SNA:84322493'RFF+SLI:har200292584'LIN+12++9783518429877:EN'PIA+1+har200504027:SA'IMD++010+:::Brecht'IMD++050+:::Notizbuecher--Band 5. 16-20 (1924-1:926)'IMD++080+:::Band 5'IMD++100+:::Erste Auflage'IMD++109+:::Suhrkamp Verlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:68.3'PRI+AAB:68.3'RFF+SNA:84790437'RFF+SLI:har200504027'LIN+13++9783412521172:EN'PIA+1+har200479146:SA'IMD++010+:::Ludwig'IMD++050+:::Otto Ludwig - Romanstudien'IMD++109+:::Boehlau Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:100.1'PRI+AAB:100.1'RFF+SNA:85059015'RFF+SLI:har200479146'LIN+14++9783487159379:EN'PIA+1+har210162102:SA'IMD++010+:::Saechtig'IMD++050+:::Rekonstruktionsversuche'IMD++109+:::Georg Olms Verlag'IMD++110+:::Hildesheim'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:68.3'PRI+AAB:68.3'RFF+SNA:84697575'RFF+SLI:har210162102'LIN+15++9783835338388:EN'PIA+1+har200207356:SA'IMD++050+:::Sinti und Roma'IMD++109+:::Wallstein Verlag'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:23.55'PRI+AAB:23.55'RFF+SNA:84580410'RFF+SLI:har200207356'LIN+16++9783487160221:EN'PIA+1+har210164544:SA'IMD++010+:::Lindgaerde'IMD++050+:::Sophia Elisabet Brenner (1659-1730)'IMD++109+:::Georg Olms Verlag'IMD++110+:::Hildesheim'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:91.85'PRI+AAB:91.85'RFF+SNA:84713073'RFF+SLI:har210164544'LIN+17++9783100483270:EN'PIA+1+9783100483256:EN'PIA+1+9783100483263:EN'PIA+1+har200507438:SA'IMD++010+:::Mann'IMD++050+:::Spaete Erzaehlungen'IMD++080+:::Band 6, 1-2'IMD++109+:::S. Fischer Verlag'IMD++110+:::Frankfurt a. M.'IMD++170+:::2021'IMD++220+:::cloth in slipcase'QTY+47:1'FTX+LIN+1++in slipcase'MOA+203:167.22'PRI+AAB:167.22'RFF+SNA:84478406'RFF+SLI:har200507438'LIN+18++9783552072336:EN'PIA+1+har200480334:SA'IMD++050+:::Stefan Zweig, Weltautor'IMD++109+:::Paul Zsolnay Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:34.15'PRI+AAB:34.15'RFF+SNA:84651751'RFF+SLI:har200480334'LIN+19++9783837658057:EN'PIA+1+har210058292:SA'IMD++010+:::Hayer'IMD++050+:::Utopielyrik'IMD++109+:::Transcript'IMD++110+:::Bielefeld'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:70.66'PRI+AAB:70.66'RFF+SNA:84930911'RFF+SLI:har210058292'LIN+20++9783837657777:EN'PIA+1+har210123045:SA'IMD++010+:::Goggio'IMD++050+:::Der Verleger als literarische Figur'IMD++109+:::Transcript'IMD++110+:::Bielefeld'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:56.52'PRI+AAB:56.52'RFF+SNA:84931762'RFF+SLI:har210123045'LIN+21++9783662628959:EN'PIA+1+har200545682:SA'IMD++010+:::Zumbusch'IMD++050+:::Was keine Geschichte ist'IMD++109+:::J.B. Metzler, ein Teil von Springer:Nature'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:76.53'PRI+AAB:76.53'RFF+SNA:84819179'RFF+SLI:har200545682'LIN+22++9783948682125:EN'PIA+1+har210005085:SA'IMD++050+:::"... was wir mitgenommen haben ist:das Erinnern."'IMD++109+:::Verlag Ralf Liebe'IMD++110+:::Weilerswist'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:23.55'PRI+AAB:23.55'RFF+SNA:84773842'RFF+SLI:har210005085'LIN+23++9783506760661:EN'PIA+1+har210135490:SA'IMD++050+:::Wende, Wandel, Weitermachen??'IMD++109+:::Brill / Ferdinand Schoeningh'IMD++110+:::Paderborn'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:104.81'PRI+AAB:104.81'RFF+SNA:85087682'RFF+SLI:har210135490'LIN+24++9783825348137:EN'PIA+1+har210088156:SA'IMD++050+:::Wenn die Waffen sprechen, schweigen:die Musen nicht'IMD++109+:::Universitaetsverlag Winter'IMD++110+:::Heidelberg'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:42.39'PRI+AAB:42.39'RFF+SNA:84358382'RFF+SLI:har210088156'LIN+25++9783957324788:EN'PIA+1+har200553952:SA'IMD++050+:::Wolfgang Hilbig und die (ganze) Mod:erne'IMD++100+:::1. Auflage'IMD++109+:::Verbrecher Verlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:28.26'PRI+AAB:28.26'RFF+SNA:84338478'RFF+SLI:har200553952'LIN+26++9783957324771:EN'PIA+1+har200554006:SA'IMD++050+:::Wolfgang Hilbigs Lyrik'IMD++100+:::1. Auflage'IMD++109+:::Verbrecher Verlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:30.62'PRI+AAB:30.62'RFF+SNA:84338446'RFF+SLI:har200554006'UNS+S'CNT+1:26'CNT+2:26'MOA+9:1589.99:USD:4'MOA+79:1589.99:USD:4'UNT+355+3'UNH+4+INVOIC:D:96A:UN:EAN008'BGM+380+263059+43'DTM+137:20210930:102'NAD+SU+++OTTO HARRASSOWITZ:BOOKSELLERS & SUBSCRIPTION AGENTS:::BLO+KREUZBERGER RING 7C-D+WIESBADEN+GERMANY+65174+DE'RFF+API:HARRAS'NAD+BY+++Books Receiving - 1059:MSU Libraries:Michigan State University+366 W Circle Drive+East Lansing, MI+MI+488241048+US'RFF+API:0088041'CUX+2:USD:4'ALC+C++++PAB'MOA+8:147.14'LIN+1++9783826072123:EN'PIA+1+har210126894:SA'IMD++010+:::Henning'IMD++050+:::Auf den Faehrten des Volks'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:51.81'PRI+AAB:51.81'RFF+SNA:85029099'RFF+SLI:har210126894'LIN+2++9783757400569:EN'PIA+1+har200549099:SA'IMD++010+:::Pott'IMD++050+:::Aufklaerung ueber Religion'IMD++109+:::Schwabe Verlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:80.08'PRI+AAB:80.08'RFF+SNA:84858281'RFF+SLI:har200549099'LIN+3++9783826074424:EN'PIA+1+har215014971:SA'IMD++010+:::Heise'IMD++050+:::Carl Georg Heise, Viktor Mann, Manf:red Sturmann'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:23.32'PRI+AAB:23.32'RFF+SNA:85015032'RFF+SLI:har215014971'LIN+4++9783854769569:EN'PIA+1+9783854765882:EN'PIA+1+har210001689:SA'IMD++010+:::Parin'IMD++050+:::Eine Sonnenuhr fuer beide Hemisphae:ren'IMD++080+:::Band 11'IMD++109+:::Mandelbaum Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:23.55'PRI+AAB:23.55'RFF+SNA:84883205'RFF+SLI:har210001689'LIN+5++9783826072604:EN'PIA+1+har210036998:SA'IMD++010+:::Luserke-Jaqui'IMD++050+:::Faust'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:41.1'PRI+AAB:41.1'RFF+SNA:85028964'RFF+SLI:har210036998'LIN+6++9783826072802:EN'PIA+1+har210057836:SA'IMD++010+:::Kanani'IMD++050+:::Hafis?' Liebeslyrik im Spiegel der d:eutschen Dichtung, oder, Hafis und'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:68.3'PRI+AAB:68.3'RFF+SNA:85029131'RFF+SLI:har210057836'LIN+7++9783100022622:EN'PIA+1+har175012275:SA'IMD++050+:::Heinrich Mann - Thomas Mann'IMD++100+:::Erweiterte Neuausgabe'IMD++109+:::S. Fischer'IMD++110+:::Frankfurt am Main'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:37.68'PRI+AAB:37.68'RFF+SNA:85037165'RFF+SLI:har175012275'LIN+8++9783867323987:EN'PIA+1+har215008221:SA'IMD++010+:::Berger'IMD++050+:::Ich gebe zu, dass mir manchmal die:Haende zittern'IMD++100+:::1. Auflage'IMD++109+:::Lukas Verlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:29.44'PRI+AAB:29.44'RFF+SNA:84942894'RFF+SLI:har215008221'LIN+9++9783770565665:EN'PIA+1+har210155709:SA'IMD++050+:::Joseph Roth unterwegs in Europa'IMD++109+:::Brill / Wilhelm Fink'IMD++110+:::Paderborn'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:93.03'PRI+AAB:93.03'RFF+SNA:84864582'RFF+SLI:har210155709'LIN+10++9783945424919:EN'PIA+1+har210166124:SA'IMD++010+:::Huebner'IMD++050+:::Die Leben des Paul Zech'IMD++109+:::Morio Verlag'IMD++110+:::Heidelberg'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:56.52'PRI+AAB:56.52'RFF+SNA:85047628'RFF+SLI:har210166124'LIN+11++9783847110842:EN'PIA+1+har190594268:SA'IMD++050+:::Machterhalt und Herrschaftssicherun:g'IMD++109+:::V & R Unipress, Bonn University Pre:ss im Verlag V & R Unipress GmbH'IMD++110+:::Goettingen'IMD++170+:::2019'IMD++220+:::hardbound'QTY+47:1'MOA+203:58.88'PRI+AAB:58.88'RFF+SNA:82950956'RFF+SLI:har190594268'LIN+12++9783737101059:EN'PIA+1+har200544185:SA'IMD++010+:::Muenkler'IMD++050+:::Marx, Wagner, Nietzsche'IMD++100+:::Originalausgabe'IMD++109+:::Rowohlt Berlin'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:40.04'PRI+AAB:40.04'RFF+SNA:85015189'RFF+SLI:har200544185'LIN+13++9783865994691:EN'PIA+1+har200342817:SA'IMD++010+:::Steiner'IMD++050+:::Metatopos'IMD++109+:::Kulturverlag Kadmos Berlin'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:29.32'PRI+AAB:29.32'RFF+SNA:84919356'RFF+SLI:har200342817'LIN+14++9783847112440:EN'PIA+1+har200436396:SA'IMD++050+:::Migration - Kommunikation - Transfe:r'IMD++109+:::V & R Unipress'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:47.1'PRI+AAB:47.1'RFF+SNA:84801807'RFF+SLI:har200436396'LIN+15++9783205209287:EN'PIA+1+har190669817:SA'IMD++050+:::OEsterreichische Zeitgeschichte - Z:eitgeschichte in OEsterreich'IMD++109+:::Boehlau Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:76.54'PRI+AAB:76.54'RFF+SNA:84995311'RFF+SLI:har190669817'LIN+16++9783849817565:EN'PIA+1+har215013273:SA'IMD++010+:::Dressel'IMD++050+:::Oscar Welden'IMD++109+:::Aisthesis Verlag'IMD++110+:::Bielefeld'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:17.66'PRI+AAB:17.66'RFF+SNA:84877502'RFF+SLI:har215013273'LIN+17++9783959084284:EN'PIA+1+har210038012:SA'IMD++050+:::Ottokar II. redivivus'IMD++109+:::Thelem'IMD++110+:::Dresden'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:46.87'PRI+AAB:46.87'RFF+SNA:84715661'RFF+SLI:har210038012'LIN+18++9783863315450:EN'PIA+1+har200389892:SA'IMD++050+:::Die Revolution 1918/19 und der Frie:dhof der Maerzgefallenen'IMD++109+:::Metropol Verlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:22.37'PRI+AAB:22.37'RFF+SNA:85055127'RFF+SLI:har200389892'LIN+19++9783931954376:EN'PIA+1+har200474296:SA'IMD++010+:::Kowalzick'IMD++050+:::Der Seekrieg 1939-1944 in der polit:ischen Karikatur Erich Ohsers'IMD++100+:::Erste Auflage, Originalausgabe'IMD++109+:::Kerschensteiner Verlag'IMD++110+:::Lappersdorf'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:20.61'PRI+AAB:20.61'RFF+SNA:85079738'RFF+SLI:har200474296'LIN+20++9783631843062:EN'PIA+1+har215011294:SA'IMD++010+:::Nienhaus'IMD++050+:::Das Spiel mit der Liebe?: Liebesentw:uerfe in der Gegenwartsliteratur im'IMD++109+:::Peter Lang'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:76.49'PRI+AAB:76.49'RFF+SNA:84634490'RFF+SLI:har215011294'LIN+21++9783799568920:EN'PIA+1+har210163922:SA'IMD++050+:::Staendische Grenzueberschreitungen'IMD++109+:::Jan Thorbecke Verlag'IMD++110+:::Ostfildern'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:47.1'PRI+AAB:47.1'RFF+SNA:84995327'RFF+SLI:har210163922'LIN+22++9783631658666:EN'PIA+1+har210170254:SA'IMD++010+:::Gesche'IMD++050+:::Stockholmer literarische Entscheidu:ngen'IMD++109+:::Peter Lang'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:58.82'PRI+AAB:58.82'RFF+SNA:84846961'RFF+SLI:har210170254'LIN+23++9783867302104:EN'PIA+1+har210162235:SA'IMD++010+:::Wogatzki'IMD++050+:::Unter der Sonne von Saint-Tropez'IMD++109+:::Faber & Faber'IMD++110+:::'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:23.55'PRI+AAB:23.55'RFF+SNA:84986994'RFF+SLI:har210162235'LIN+24++9783901015755:EN'PIA+1+har210029395:SA'IMD++010+:::Kaminskaja'IMD++050+:::... Verwandlungen ...'IMD++100+:::1. Auflage'IMD++109+:::Edition CH'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:34.15'PRI+AAB:34.15'RFF+SNA:85015289'RFF+SLI:har210029395'LIN+25++9783451385964:EN'PIA+1+har200147685:SA'IMD++010+:::Benz'IMD++050+:::Vom Vorurteil zur Gewalt'IMD++109+:::Herder'IMD++110+:::Freiburg'IMD++170+:::2020'IMD++220+:::hardbound'QTY+47:1'MOA+203:30.62'PRI+AAB:30.62'RFF+SNA:84773736'RFF+SLI:har200147685'LIN+26++9783525311233:EN'PIA+1+har200435005:SA'IMD++050+:::Die Wiederkehr der "res publica"'IMD++109+:::Vandenhoeck & Ruprecht'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:70.66'PRI+AAB:70.66'RFF+SNA:84802131'RFF+SLI:har200435005'LIN+27++9783732907700:EN'PIA+1+har210170804:SA'IMD++010+:::Hrdlicková'IMD++050+:::Zweiter Weltkrieg und Shoah in der:deutschsprachigen hermetischen Lyri'IMD++109+:::Frank & Timme, Verlag fuer wissensc:aftliche Literatur'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:58.64'PRI+AAB:58.64'RFF+SNA:84819383'RFF+SLI:har210170804'UNS+S'CNT+1:27'CNT+2:27'MOA+9:1411.39:USD:4'MOA+79:1411.39:USD:4'UNT+365+4'UNH+5+INVOIC:D:96A:UN:EAN008'BGM+380+263061+43'DTM+137:20210930:102'NAD+SU+++OTTO HARRASSOWITZ:BOOKSELLERS & SUBSCRIPTION AGENTS:::BLO+KREUZBERGER RING 7C-D+WIESBADEN+GERMANY+65174+DE'RFF+API:HARRAS'NAD+BY+++Books Receiving - 1059:MSU Libraries:Michigan State University+366 W Circle Drive+East Lansing, MI+MI+488241048+US'RFF+API:0088041'CUX+2:USD:4'ALC+C++++PAB'MOA+8:147.1'LIN+1++9783518587638:EN'PIA+1+har200504045:SA'IMD++010+:::Sarasin'IMD++050+:::1977'IMD++100+:::Erste Auflage'IMD++109+:::Suhrkamp'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:37.68'PRI+AAB:37.68'RFF+SNA:84702561'RFF+SLI:har200504045'LIN+2++9783827500670:EN'PIA+1+har200515575:SA'IMD++010+:::Longerich'IMD++050+:::Antisemitismus?: eine deutsche Gesch:ichte'IMD++100+:::1. Auflage'IMD++109+:::Siedler'IMD++110+:::Muenchen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:40.04'PRI+AAB:40.04'RFF+SNA:85005322'RFF+SLI:har200515575'LIN+3++9783412505714:EN'PIA+1+har210123463:SA'IMD++010+:::Wadauer'IMD++050+:::Der Arbeit nachgehen??'IMD++109+:::Boehlau Verlag, ein Imprint der Bri:l-Gruppe'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:70.66'PRI+AAB:70.66'RFF+SNA:85015147'RFF+SLI:har210123463'LIN+4++9783835337329:EN'PIA+1+har200551053:SA'IMD++010+:::Wedekind'IMD++050+:::Briefwechsel mit den Eltern 1868-19:15'IMD++109+:::Wallstein Verlag'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::cloth in slipcase'QTY+47:1'MOA+203:81.25'PRI+AAB:81.25'RFF+SNA:84755304'RFF+SLI:har200551053'LIN+5++9783863315368:EN'PIA+1+har200292238:SA'IMD++050+:::Dark Tourism'IMD++109+:::Metropol'IMD++110+:::Berlin'IMD++170+:::2020'IMD++220+:::hardbound'QTY+47:1'MOA+203:28.26'PRI+AAB:28.26'RFF+SNA:84986701'RFF+SLI:har200292238'LIN+6'PIA+5+har190284554:SA'IMD++010+:::Bodenstedt'IMD++050+:::"... dass ich Dir schon wieder schr:eibe"'IMD++109+:::Stadt Peine, Stadtarchiv'IMD++110+:::Peine'IMD++170+:::2019'IMD++220+:::paperback'QTY+47:1'MOA+203:34.15'PRI+AAB:34.15'RFF+SNA:85093794'RFF+SLI:har190284554'LIN+7++9783732907786:EN'PIA+1+har215013775:SA'IMD++010+:::Majorossy'IMD++050+:::"Dô sante got von himelrîch / dar e:in kleine vogelîn"'IMD++109+:::Frank & Timme, Verlag fuer wissensc:aftliche Literatur'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:58.64'PRI+AAB:58.64'RFF+SNA:85047673'RFF+SLI:har215013775'LIN+8++9783896937612:EN'PIA+1+har215010556:SA'IMD++050+:::Drama, Mythos und Geschichte'IMD++109+:::Weidler Buchverlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:44.75'PRI+AAB:44.75'RFF+SNA:84657728'RFF+SLI:har215010556'LIN+9++9783962891169:EN'PIA+1+har200550707:SA'IMD++010+:::Duerr'IMD++050+:::Erzberger'IMD++100+:::1. Auflage'IMD++109+:::Ch. Links Verlag'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:29.44'PRI+AAB:29.44'RFF+SNA:84713131'RFF+SLI:har200550707'LIN+10++9783826071225:EN'PIA+1+har210030979:SA'IMD++050+:::Experience'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:75.37'PRI+AAB:75.37'RFF+SNA:85058873'RFF+SLI:har210030979'LIN+11++9783826070518:EN'PIA+1+har210057832:SA'IMD++010+:::Jurgensen'IMD++050+:::Hans Mayers "gelebte Literatur"'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:75.37'PRI+AAB:75.37'RFF+SNA:85059192'RFF+SLI:har210057832'LIN+12++9783613716063:EN'PIA+1+har200200029:SA'IMD++010+:::Reimer'IMD++050+:::Kolonne'IMD++100+:::1. Auflage'IMD++109+:::Transpress'IMD++110+:::Stuttgart'IMD++170+:::2020'IMD++220+:::hardbound'QTY+47:1'MOA+203:35.21'PRI+AAB:35.21'RFF+SNA:84322723'RFF+SLI:har200200029'LIN+13++9783428183944:EN'PIA+1+har210135536:SA'IMD++010+:::Machtan'IMD++050+:::Der Kronprinz und die Nazis'IMD++109+:::Duncker & Humblot'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:35.21'PRI+AAB:35.21'RFF+SNA:84995370'RFF+SLI:har210135536'LIN+14++9783863931117:EN'PIA+1+har200555629:SA'IMD++010+:::Hacke'IMD++050+:::Liberale Demokratie in schwierigen:Zeiten'IMD++109+:::Europaeische Verlagsanstalt'IMD++110+:::Hamburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:25.91'PRI+AAB:25.91'RFF+SNA:84687191'RFF+SLI:har200555629'LIN+15++9783962891176:EN'PIA+1+har200550798:SA'IMD++010+:::Lange'IMD++050+:::Der Nahschuss'IMD++100+:::1. Auflage'IMD++109+:::Ch. Links Verlag, eine Marke der Au:fbau Verlage GmbH & Co. KG'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:25.91'PRI+AAB:25.91'RFF+SNA:84713104'RFF+SLI:har200550798'LIN+16++9783412522018:EN'PIA+1+har210031342:SA'IMD++010+:::Glasner'IMD++050+:::Narrheit und AEsthetik'IMD++109+:::Boehlau'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:82.43'PRI+AAB:82.43'RFF+SNA:85005400'RFF+SLI:har210031342'LIN+17++9783826073106:EN'PIA+1+har210061155:SA'IMD++010+:::Lorey'IMD++050+:::Nelly Mann'IMD++109+:::Koenigshausen & Neumann'IMD++110+:::Wuerzburg'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:30.62'PRI+AAB:30.62'RFF+SNA:85059182'RFF+SLI:har210061155'LIN+18++9783038500698:EN'PIA+1+har190091337:SA'IMD++010+:::Brambach'IMD++050+:::"Nichts und niemand kann dich erset:zen"'IMD++109+:::Nimbus, Kunst und Buecher'IMD++110+:::Waedenswil'IMD++170+:::2021'IMD++220+:::half cloth'QTY+47:1'MOA+203:51.81'PRI+AAB:51.81'RFF+SNA:84755348'RFF+SLI:har190091337'LIN+19++9783643510327:EN'PIA+1+har215012893:SA'IMD++050+:::Otto Neurath liest Stefan Zweigs "D:ie Welt von Gestern"'IMD++109+:::Lit'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:41.1'PRI+AAB:41.1'RFF+SNA:84903442'RFF+SLI:har215012893'LIN+20++9783896937476:EN'PIA+1+har200293123:SA'IMD++050+:::Peter Weiss erinnernd - Ansichten u:nd Einsichten'IMD++109+:::Weidler Buchverlag'IMD++110+:::Berlin'IMD++170+:::2020'IMD++220+:::paperback'QTY+47:1'MOA+203:37.68'PRI+AAB:37.68'RFF+SNA:84657734'RFF+SLI:har200293123'LIN+21++9783990272121:EN'PIA+1+har210122961:SA'IMD++010+:::Musil'IMD++050+:::Projekte 1900-1942'IMD++080+:::Band 12'IMD++109+:::Jung und Jung'IMD++110+:::Salzburg'IMD++170+:::2021'IMD++220+:::cloth'QTY+47:1'MOA+203:36.31'PRI+AAB:36.31'RFF+SNA:85064214'RFF+SLI:har210122961'LIN+22++9783456860725:EN'PIA+1+har210171163:SA'IMD++050+:::Psychologie als Instrument der SED-:Diktatur'IMD++100+:::1. Auflage'IMD++109+:::Hogrefe'IMD++110+:::Bern'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:43.51'PRI+AAB:43.51'RFF+SNA:85005435'RFF+SLI:har210171163'LIN+23++9783848770403:EN'PIA+1+har210058886:SA'IMD++050+:::Radikalitaet und Zukunft des Kriege:s'IMD++100+:::1. Auflage'IMD++109+:::Nomos'IMD++110+:::Baden-Baden'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:40.04'PRI+AAB:40.04'RFF+SNA:85059029'RFF+SLI:har210058886'LIN+24++9783835335783:EN'PIA+1+har190078907:SA'IMD++010+:::Davidis'IMD++050+:::Schiller und die Seinen'IMD++109+:::Wallstein Verlag'IMD++110+:::Goettingen'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:41.1'PRI+AAB:41.1'RFF+SNA:84755263'RFF+SLI:har190078907'LIN+25++9783631851173:EN'PIA+1+har215014967:SA'IMD++010+:::Pretzl'IMD++050+:::Sprechen im Maerchen'IMD++109+:::Peter Lang'IMD++110+:::Berlin'IMD++170+:::2021'IMD++220+:::hardbound'QTY+47:1'MOA+203:94.15'PRI+AAB:94.15'RFF+SNA:85015000'RFF+SLI:har215014967'LIN+26++9783854769552:EN'PIA+1+9783854765882:EN'PIA+1+har210001709:SA'IMD++010+:::Parin'IMD++050+:::Wissensfluesse'IMD++080+:::Band 9'IMD++109+:::Mandelbaum Verlag'IMD++110+:::Wien'IMD++170+:::2021'IMD++220+:::paperback'QTY+47:1'MOA+203:40.04'PRI+AAB:40.04'RFF+SNA:85117826'RFF+SLI:har210001709'UNS+S'CNT+1:26'CNT+2:26'MOA+9:1383.74:USD:4'MOA+79:1383.74:USD:4'UNT+357+5'UNZ+5+294' \ No newline at end of file diff --git a/cypress/support/fragments/data_import/logs/fileDetails.js b/cypress/support/fragments/data_import/logs/fileDetails.js index e7bee5d438..3214c34c5a 100644 --- a/cypress/support/fragments/data_import/logs/fileDetails.js +++ b/cypress/support/fragments/data_import/logs/fileDetails.js @@ -5,7 +5,8 @@ import { MultiColumnListHeader, MultiColumnListRow, Link, - PaneHeader + PaneHeader, + Button } from '../../../../../interactors'; import LogsViewAll from './logsViewAll'; @@ -13,6 +14,7 @@ const invoiceNumberFromEdifactFile = '94999'; const resultsList = MultiColumnList({ id:'search-results-list' }); const jobSummaryTable = MultiColumnList({ id: 'job-summary-table' }); +const nextButton = Button({ id:'search-results-list-next-paging-button' }); const columnNameInResultList = { srsMarc: resultsList.find(MultiColumnListHeader({ id:'list-column-srsmarcstatus' })), @@ -49,7 +51,8 @@ const visibleColumnsInResultsList = { INSTANCE: { columnIndex: 4 }, HOLDINGS: { columnIndex: 5 }, ITEM: { columnIndex: 6 }, - ORDER: { columnIndex: 7 } + ORDER: { columnIndex: 7 }, + INVOICE: { columnIndex: 8 } }; const checkSrsRecordQuantityInSummaryTable = (quantity, row = 0) => { @@ -227,6 +230,10 @@ export default { .click()); }, + clickNextPaginationButton:() => { + cy.do(nextButton.click()); + }, + checkStatusByTitle:(title, itemStatus) => { cy.do(resultsList.find(MultiColumnListCell({ content: title })).perform( element => { @@ -320,5 +327,25 @@ export default { .find(MultiColumnListCell({ columnIndex: 1 })) .find(Link({ href: including('/data-import/log') })) .exists()); + }, + + verifyEachInvoiceTitleInColunm:() => { + // TODO redesign with interactors + cy.get('#search-results-list') + .find('[data-row-index]').each($row => { + cy.get('[class*="mclCell-"]:nth-child(2)', { withinSubject: $row }) + .invoke('text') + .should('not.be.empty'); + }); + }, + + verifyEachInvoiceStatusInColunm:(invoiceStatus) => { + // TODO redesign with interactors + cy.get('#search-results-list') + .find('[data-row-index]').each($row => { + cy.get('[class*="mclCell-"]:nth-child(9)', { withinSubject: $row }) + .invoke('text') + .should('eq', invoiceStatus); + }); } }; diff --git a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js index 94e50f231e..483000e727 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js +++ b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js @@ -341,19 +341,35 @@ export default { }, fillInvoiceMappingProfile:(profile) => { + // Summary section cy.do([ nameField.fillIn(profile.name), incomingRecordTypeField.choose(profile.incomingRecordType), existingRecordType.choose(profile.existingRecordType), - TextArea({ name:'profile.description' }).fillIn(''), - batchGroupField.fillIn(profile.batchGroup), - organizationLookUpButton.click() + Accordion('Summary').find(TextArea({ name:'profile.description' })).fillIn('') ]); + // Invoice information section + cy.do(batchGroupField.fillIn(profile.batchGroup)); + if (profile.lockTotalAmount) { + cy.do(TextField('Lock total amount').fillIn(profile.lockTotalAmount)); + } + // Vendor information section + cy.do(organizationLookUpButton.click()); selectOrganizationByName(profile.organizationName); - cy.do([ - paymentMethodField.fillIn(profile.paymentMethod), - saveButton.click(), - ]); + // Extended information section + cy.do(paymentMethodField.fillIn(profile.paymentMethod)); + // Invoice line information section + if (profile.invoiceLinePOlDescription) { + cy.do(Accordion('Invoice line information') + .find(TextField('Description*')).fillIn(profile.invoiceLinePOlDescription)); + } + if (profile.polNumber) { + cy.do(TextField('PO line number').fillIn(profile.polNumber)); + } + if (profile.polVendorReferenceNumber) { + cy.do(TextField('Vendor reference number').fillIn(profile.polVendorReferenceNumber)); + } + cy.do(saveButton.click()); }, fillMappingProfileForMatch:(specialMappingProfile = defaultMappingProfile) => { diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 01817d147a..ac6e07cc7d 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -17,7 +17,6 @@ import { SearchField, Section, Select, - Spinner, TextField, TextInput } from '../../../../interactors'; diff --git a/cypress/support/fragments/invoices/invoiceView.js b/cypress/support/fragments/invoices/invoiceView.js index 43617e3a88..e1a4427882 100644 --- a/cypress/support/fragments/invoices/invoiceView.js +++ b/cypress/support/fragments/invoices/invoiceView.js @@ -29,8 +29,8 @@ export default { })); }, - checkQuantityInvoiceLinesInRecord:() => { - cy.expect(Pane({ id:'pane-results' }).find(HTML(including('1,104 records found'))).exists()); + checkQuantityInvoiceLinesInRecord:(quantity) => { + cy.expect(Pane({ id:'pane-results' }).find(HTML(including(`${quantity} records found`))).exists()); }, vendorInvoiceNumber, From eb24715d422ab416947224178a73b144d0b80aa1 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Tue, 15 Aug 2023 18:09:33 +0300 Subject: [PATCH 047/437] FAT-7486-C400616 (#1479) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7372: precondition added * FAT-7372: test implemented * FAT-7372: methods updated * FAT-7486: precondition, methods added * FAT-7486: test implemented --- .../search/advanced-search-in-inventory.cy.js | 58 +++++++++++++++++-- cypress/fixtures/marcBibFileC400616.mrc | 1 + .../fragments/inventory/holdingsRecordEdit.js | 4 ++ .../fragments/inventory/inventoryInstance.js | 5 ++ 4 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 cypress/fixtures/marcBibFileC400616.mrc diff --git a/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js b/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js index 4b37c36b39..95d115cd7e 100644 --- a/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js +++ b/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js @@ -11,11 +11,19 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import { JOB_STATUS_NAMES } from '../../../support/constants'; +import HoldingsRecordEdit from '../../../support/fragments/inventory/holdingsRecordEdit'; +import InventoryNewHoldings from '../../../support/fragments/inventory/inventoryNewHoldings'; describe('Inventory -> Advanced search', () => { const testData = { advSearchOption: 'Advanced search', - expectedSearchResult: 'The Beatles in mono. Adv search 001' + expectedSearchResult: 'The Beatles in mono. Adv search 001', + callNumberValue: 'YCN002003400616', + itemBarcode: 'ITBRCC400616', + expectedSearchResultsC400616: [ + 'Humans and machines Adv Search 003', + 'Mediterranean conference on medical and biological engineering and computing 2013 Adv Search 003' + ] }; const createdRecordIDs = []; @@ -25,6 +33,12 @@ describe('Inventory -> Advanced search', () => { fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create instance and SRS MARC Bib', numberOfRecords: 2 + }, + { + marc: 'marcBibFileC400616.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numberOfRecords: 4 } ]; @@ -49,14 +63,33 @@ describe('Inventory -> Advanced search', () => { } }); }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstance.searchByTitle(createdRecordIDs[3]); + InventoryInstances.selectInstance(); + InventoryInstance.pressAddHoldingsButton(); + InventoryNewHoldings.fillRequiredFields(); + HoldingsRecordEdit.fillCallNumber(testData.callNumberValue); + InventoryNewHoldings.saveAndClose(); + InventoryInstance.waitLoading(); + // wait to make sure holdings created - otherwise added item might not be saved + cy.wait(1500); + InventoryInstance.addItem(); + InventoryInstance.fillItemRequiredFields(); + InventoryInstance.fillItemBarcode(testData.itemBarcode); + InventoryInstance.saveItemDataAndVerifyExistence('-'); + }); }); }); + beforeEach('Logging in', () => { + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + after('Deleting data', () => { Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach(id => { - InventoryInstance.deleteInstanceViaApi(id); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(testData.itemBarcode); + createdRecordIDs.forEach((id, index) => { + if (index !== 3) InventoryInstance.deleteInstanceViaApi(id); }); }); @@ -78,4 +111,21 @@ describe('Inventory -> Advanced search', () => { InventorySearchAndFilter.verifySearchResult(testData.expectedSearchResult); InventorySearchAndFilter.checkRowsCount(1); }); + + it('C400616 Search Instances using advanced search with a combination of operators (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstances.clickAdvSearchButton(); + InventoryInstances.fillAdvSearchRow(0, '(OCoLC)on1100023840001116', 'Exact phrase', 'OCLC number, normalized'); + InventoryInstances.checkAdvSearchModalValues(0, '(OCoLC)on1100023840001116', 'Exact phrase', 'OCLC number, normalized'); + InventoryInstances.fillAdvSearchRow(1, 'YCN00200300487', 'Contains all', 'Effective call number (item), shelving order', 'NOT'); + InventoryInstances.checkAdvSearchModalValues(1, 'YCN00200300487', 'Contains all', 'Effective call number (item), shelving order', 'NOT'); + InventoryInstances.fillAdvSearchRow(2, createdRecordIDs[4], 'Exact phrase', 'Instance UUID', 'AND'); + InventoryInstances.checkAdvSearchModalValues(2, createdRecordIDs[4], 'Exact phrase', 'Instance UUID', 'AND'); + InventoryInstances.fillAdvSearchRow(3, 'Adv search subj 003 Roa Romero, Laura', 'Starts with', 'Contributor', 'OR'); + InventoryInstances.checkAdvSearchModalValues(3, 'Adv search subj 003 Roa Romero, Laura', 'Starts with', 'Contributor', 'OR'); + InventoryInstances.clickSearchBtnInAdvSearchModal(); + InventoryInstances.checkAdvSearchModalAbsence(); + InventoryInstances.verifySelectedSearchOption(testData.advSearchOption); + testData.expectedSearchResultsC400616.forEach(expectedResult => InventorySearchAndFilter.verifySearchResult(expectedResult)); + InventorySearchAndFilter.checkRowsCount(2); + }); }); diff --git a/cypress/fixtures/marcBibFileC400616.mrc b/cypress/fixtures/marcBibFileC400616.mrc new file mode 100644 index 0000000000..8ce6b1292f --- /dev/null +++ b/cypress/fixtures/marcBibFileC400616.mrc @@ -0,0 +1 @@ +03778cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035003000107040007600137019001500213020003600228020003300264020001500297020001800312035004100330050001000371082001800381130005100399245003200450246002100482250002300503264004900526264001100575300003900586336002600625337002600651338003600677588002600713500004600739500006500785500002200850520036700872505060101239505038901840520020902229630002002438630003402458630002202492630003702514655002202551655005302573710003202626776012902658856010702787856010802894938004503002938002903047938004103076994001403117948004503131nin00009530419190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023840001116 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 Adv Search 00314aESV 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.06aBiblevPrieÌ€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 HOLDINGS01216cam a2200325 4500001001000000003000400010005001700014008004100031010001900072035003000091040001700121041000800138050001500146100005100161245006300212300003700275440007000312504004100382530008300423650001600506650002400522650006400546650007100610830006200681856009400743903001500837903000900852035001900861903001000880in1070103ICU20021022111100.0900712s1916 enka b 00010 eng u a16022168 //r90 a(OCoLC)on1100023840001116 aDLC/ICUcICU0 aeng00aQA192b.M21 aMacaulay, F. S.q(Francis Sowerby),d1862-193714aThe algebraic theory of non-modular systems Adv Search 003 axiv, 112 p. :bdiagrs. ;c22 cm. 0aEdinburgh tracts in mathematics and mathematical physics.vno. 19 a"List of references": p. [xiii]-xiv. aAlso available on the Internet from the Cornell historic math book collection. 0aElimination 0aForms (Mathematics) 7aElimination.2fast0http://id.worldcat.org/fast/fst00908107 7aForms (Mathematics)2fast0http://id.worldcat.org/fast/fst00932975 0aEdinburgh tracts in mathematicsvno. 19.tMathematicss#141uhttp://cdl.library.cornell.edu/Hunter/hunter.pl?handle=cornell.library.math/05190001&id=9 aRECON/MARC aSMON a(OCoLC)5624967 aHathi01293nam a2200325 a 4500001000900000003000400009005001700013008004100030010002200071020001500093035003000108035002000138040002300158041000800181050001900189082001900208111008400227245003900311260004700350300003400397490004700431504004100478650004200519650007100561650007800632650010600710655008600816700002400902811004100926in659473ICU20090311084500.0850311s1985 njua b 10110 eng u a 84020359 //r90 a0893912727 a(OCoLC)on1100023840001116 a(OCoLC)11159214 aDLCaDLCcDLCdDLC0 aeng00aP98b.D39 198200a410/.28/542192 aDelaware Symposium on Language Studiesn(4th :d1982 :cUniversity of Delaware)10aHumans and machines Adv Search 0030 aNorwood, N.J. :bAblex Pub. Corp.,cc1985. axiv, 292 p. :bill. ;c24 cm.1 aDelaware symposia on language studies ;v4 aIncludes bibliographies and indexes. 0aComputational linguisticsvCongresses 0aLanguage and languagesxComputer-assisted instructionxCongresses. 7aComputational linguistics.2fast0http://id.worldcat.org/fast/fst00871998 7aLanguage and languagesxComputer-assisted instruction.2fast0http://id.worldcat.org/fast/fst00992166 7aConference papers and proceedings.2fast0http://id.worldcat.org/fast/fst0142377210aWilliams, Stephanie2 aSymposium on Lang. Studiesv4.f198449585cam 2201117 i 4500001001500000008004100015006001900056007001500075005001700090035003000107040020700137066000700344019003600351020003600387020003300423020001800456020001800474020001500492024003500507035007500542050001200617072002500629072002500654072002500679072002500704072002500729072002500754072002500779072002500804082001500829111011500844245010100959264003101060264001101091300002201102336002601124337002601150338003601176490003501212500002801247500002201275520137301297505016502670505018702835505357303022505828306595505725214878505180622130505352823936505310027464505635330564505187136917505100238788505394339790505175843733588002645491504005345517650004045570650003645610650003745646650003945683650003945722650004245761650004445803650003145847650003045878650004945908650004145957650003445998650002546032650005446057650005046111655001346161655002246174655001146196655006546207655004646272655003146318700004546349776025246394830003646646856010846682856010646790856012246896856006047018856005447078880110147132938004548233938002848278938004148306029002148347029002148368029001848389994001448407948004648421nin00009530416131021t20132014sz ob 101 0 eng dm o d cr cnu---unuuu20230104083356.1 a(OCoLC)on1100023840001116 aGW5XEbengerdaepncGW5XEdN$TdYDXCPdCOOdOCLCOdOCLCFdBEDGEdOCLCQdZMCdEBLCPdOCLCOdDEBSZdOCLCOdOCLdOHIdOCLCOdCUVdDIBIBdOCLCOdOCLCQdCEFdOCLCQdYOUdOCLCQdAJSdOCLCQdOCLCOdCOMdOCLCO c(S a861559051a900002969a960026055 a9783319008462q(electronic bk.) a3319008463q(electronic bk.) z9783319008455 z9780199948512 z01999485187 a10.1007/978-3-319-00846-22doi a(OCoLC)861183006z(OCoLC)861559051z(OCoLC)900002969z(OCoLC)960026055 4aR856.A2 7aHEAx0120002bisacsh 7aHEAx0200002bisacsh 7aMEDx0040002bisacsh 7aMEDx1010002bisacsh 7aMEDx1090002bisacsh 7aMEDx0290002bisacsh 7aMEDx0400002bisacsh 7aMEDx0920002bisacsh04a610.282232 aMediterranean Conference on Medical and Biological Engineering and Computingn(13th :d2013 :cSeville, Spain)10aMediterranean conference on medical and biological engineering and computing 2013 Adv Search 003 1aCham :bSpringer,c[2013?] 4c©2014 a1 online resource atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier1 aIFMBE proceedings ;vvolume 41 aConference proceedings. aIncludes indexes. aThe general theme of MEDICON 2013 is "Research and Development of Technology for Sustainable Healthcare". This decade is being characterized by the appearance and use of emergent technologies under development. This situation has produced a tremendous impact on Medicine and Biology from which it is expected an unparalleled evolution in these disciplines towards novel concept and practices. The consequence will be a significant improvement in health care and well-fare, i.e. the shift from a reactive medicine to a preventive medicine. This shift implies that the citizen will play an important role in the healthcare delivery process, what requires a comprehensive and personalized assistance. In this context, society will meet emerging media, incorporated to all objects, capable of providing a seamless, adaptive, anticipatory, unobtrusive and pervasive assistance. The challenge will be to remove current barriers related to the lack of knowledge required to produce new opportunities for all the society, while new paradigms are created for this inclusive society to be socially and economically sustainable, and respectful with the environment. In this way, these proceedings focus on the convergence of biomedical engineering topics ranging from formalized theory through experimental science and technological development to practical clinical applications00gVolume 1. Part I:tKeynote Speakers.tDesign, Development, Training and Use of Medical Devices with Practical Examples from Cardiovascular Medicine and Surgery.80gPart II: Invited Presentations.tDavid Dewhurst -- Biomedical Engineer and IFMBE Pioneer --tDid Jan Swammerdam Do the First Electric Stimulation over 100 Years before Luigi Galvani?80gPart III: Biomechanics, Robotics and Minimal Invasive Surgery.tShear Stress Rapidly Alters the Physical Properties of Vascular Endothelial Cell Membranes by Decreasing Their Lipid Order and Increasing Their Fluidity --tAn In Vitro Analysis of the Influence of the Arterial Stiffness on the Aortic Flow Using Three-Dimensional Particle Tracking Velocimetry --tA New Method for Coronary Artery Mechanical Properties --tNumerical Analysis of a Novel External Support Device for Vein Bypass Grafts --tHemodynamical Aspects of Endovascular Repair for Aortic Arch Aneurisms --tOptical Tracking System Integration into IORT Treatment Planning System --tComparative Study of Two Laparoscopic Instrument Tracker Designs for Motion Analysis and Image-Guided Surgery:tA Technical Evaluation --tA Decision Support System Applied to Lipodystrophy Based on Virtual Reality and Rapid Prototyping --tComparison between Optical and MRI Trajectories in Stereotactic Neurosurgery --tEVA: Endoscopic Video Analysis of the Surgical Scene for the Assessment of MIS Psychomotor Skills --tQuantitative Evaluation of a Real-Time Non-rigid Registration of a Parametric Model of the Aorta for a VR-Based Catheterization Guidance System --tTranstibial Amputee Gait: Kinematics and Temporal-Spatial Analysis --tDevelopment and User Assessment of a Body-Machine Interface for a Hybrid-Controlled 6-Degree of Freedom Robotic Arm (MERCURY) --tEMG and Kinematics Assessment of Postural Responses during Balance Perturbation on a 3D Robotic Platform: Preliminary Results in Children with Hemiplegia --tSimulation-Based Planification Tool for an Assistance-as-Needed Upper Limb Neurorehabilitation Robotic Orthosis --tTotal Joint Replacement: Biomaterials for Application in the Temporomandibular Joint --tKinematic Indexes' Reproducibility of Horizontal Reaching Movements --tHandling Disturbances on Planned Trajectories in Robotic Rehabilitation Therapies --tComputational Modelling of the Shape Deviations of the Sphere Surfaces of Ceramic Heads of Hip Joint Replacement --tAn Innovative Multisensor Controlled Prosthetic Hand --tRobot-Assisted Surgical Platform for Controlled Bone Drilling: Experiment s on Temperature Monitoring for Assessment of Thermal Bone Necrosis --tA Kinematic Analysis of the Hand Function --tSingle Incision Laparoscopic Surgery Using a Miniature Robotic System --tCharacterization of Anastomosis Techniques for Robot Assisted Surgery --tConsidering Civil Liability as a Safety Criteria for Cognitive Surgical Robots --tKinematic Quantification of Gait Asymmetry in Patients with Elastic Ankle Wrap Based on Cyclograms --tFat Percentage Equation for Children with Cerebral Palsy: A Novel Approach --tFunctional and Structural of the Erector Spinae Muscle during Isometric Lumbar Extension --tOn Evaluation of Shoulder Roundness by Use of Single Camera Photogrammetry --tEffects of Superimposed Electrical Stimulation Training on Vertical Jump Performance: A Comparison Study between Men and Women --tAttentional Focus and Functional Connectivity in Cycling: An EEG Case Study --tERD/ERS Patterns of Shooting Performance within the Multi-Action Plan Model --tUpper Limb Joint Torque Distribution Resulting from the Flat Tennis Serve Impact Force --tThe Fatigue Vector: A New Bi-dimensional Parameter for Muscular Fatigue Analysis --tKinetic Analysis of Manual Wheelchair Propulsion in Athletes and Users with Spinal Cord Injury --tMultimodal MRI Evaluation of Physiological Changes on Leg Muscles due to Fatigue after Intense Exercise.80gPart IV:tBiomedical Imaging and Processing.tDesign and Implementation of a Bipolar Current Source for MREIT Applications --tAutomatic Detection of Heart Center in Late Gadolinium Enhanced MRI --tThe Application of Highly Accelerated MR Acquisition Techniques to Imaging the Peripheral Vasculature --tA New Label Fusion Method Using Graph Cuts: Application to Hippocampus Segmentation --tComputer Aided Decision Support Tool for Rectal Cancer TNM Staging Using MRI --tVolume of Tissue Activated in Patients with Parkinson's Disease from West-Center Region of Colombia Treated with Deep Brain Stimulation --tComputer-Aided Diagnosis of Abdominal Aortic Aneurysm after Endovascular Repair Using Active Learning Segmentation and Texture Analysis --tAssessment of Magnetic Field in the Surroundings of Magnetic Resonance Systems: Risks for Professional Staff --tMorphological Characterization of the Human Calvarium in Relation to the Diploic and Cranial Thickness Utilizing X-Ray Computed Microtomography --tA Programmable Current Source for MRCDI and MREIT Applications --tHow Does Compressed Sensing Affect Activation Maps in Rat fMRI? --tResting State Functional Connectivity Analysis of Multiple Sclerosis and Neuromyelitis Optica Using Graph Theory --tQuantitative Evaluation of Patient-Specific Conforming Hexahedral Meshes of Abdominal Aortic Aneurysms and Intraluminal Thrombus Generated from MRI --tCompressed Sensing for Cardiac MRI Cine Sequences: A Real Implementation on a Small-Animal Scanner --tThe Importance of a Valid Reference Region for Intensity Normalization of Perfusion MR Studies in Early Alzheimer's Disease --tA Full Automatic Method for the Soft tissues Sarcoma Treatment Response Based on Fuzzy Logic --tReconstruction of DSC-MRI Data from Sparse Data Exploiting Temporal Redundancy and Contrast Localization --tThe Influence of Slice Orientation in 3D CBCT Images on Measurements of Anatomical Structures --tA Prior-Based Image Variation (PRIVA) Approach Applied to Motion-Based Compressed Sensing Cardiac Cine MRI --tSymmetry Based Computer Aided Segmentation of Occluded Cerebral Arteries on CT Angiography --tAutomatic Segmentation of Gray Matter Multiple Sclerosis Lesions on DIR Images --tCalibration of a C-arm X-Ray System for Its Use in Tomography --tQuantitative Assessment of Prenatal Aortic Wall Thickness in Gestational Diabetes --tFast Anisotropic Speckle Filter for Ultrasound Medical Images --tParallel Implementation of a X-Ray Tomography Reconstruction Algorithm for High-Resolution Studies --tStacked Models for Efficient Annotation of Brain Tissues in MR Volumes --tMumford-Shah Based Unsupervised Segmentation of Brain Tissue on MR Images --tValidation of a Computer Aided Segmentation System for Retinography --tComputer-Assisted System for Hypertensive Risk Determination through Fundus Image Processing --tInterventional 2D-3D Registration in the Presence of Occlusion --tMarker-Controlled Watershed for Volume Countouring in PET images --tPredictive and Populational Model for Alzheimer's Disease Using Structural Neuroimaging --tAccurate Cortical Bone Detection in Peripheral Quantitative Computed Tomography Images --tSpatial Aliasing and EMG Amplitude in Time and Space: Simulated Action Potential Maps --tLacunarity-Based Inherent Texture Correlation Approach for Wireless Capsule Endoscopy Image Analysis --tTracer Kinetic Modeling with R for Batch Processing of Dynamic PET Studies --tTensor Radial Lengths for Mammographic Image Enhancement --tMagnetic Resonance Texture Analysis: Optimal Feature Selection in Classifying Child Brain Tumors --tImage Segmentation for Treatment Planning of Electroporation-Based Treatments of Tumors --tDetection of Retinal Vessel Bifurcations by Means of Multiple Orientation Estimation Based on Regularized Morphological Openings --tSegmentation of Basal Nuclei and Anatomical Brain Structures Using Support Vector Machines --tColor Analysis in Retinography: Glaucoma Image Detection --tAn Image Analysis System for the Assessment of Retinal Microcirculation in Hypertension and Its Clinical Evaluation --tAutomatic Selection of CT Perfusion Datasets Unsuitable for CTP Analysis due to Head Movement --tAn In-Vitro Model of Cardiac Fibrillation with Different Degrees of Complexity --tSemi-automatic Segmentation of Sacrum in Computer Tomography Studies for Intraoperative Radiation Therapy --tAnatomical Discovery: Finding Organs in the Neighborhood of the Liver --tA Comparative Study of Different Methods for Pigmented Lesion Classification Based on Color and Texture Features --tAutomatic Burn Depth Estimation from Psychophysical Experiment Data --tSegmentation of Retroperitoneal Tumors Using Fast Continuous Max-Flow Algorithm --tEvaluation of the Visibility of the Color and Monochrome Road Map by the Searching Distance and Time of a Locus of Eye Movement --t3D Segmentation of MRI of the Liver Using Support Vector Machine --tInterpolation Based Deformation Model for Minimally Invasive Beating Heart Surgery --tA Framework for Automatic Detection of Lumen-Endothelium Border in Intracoronary OCT Image Sequences --tLearning Optimal Matched Filters for Retinal Vessel Segmentation with ADA-Boost --tUsing Optical Flow in Motion Analysis for Evaluation of Active Music Therapy --tApplication of Gaussian Mixture Models with Expectation Maximization in Bacterial Colonies Image Segmentation for Automated Counting and Identification --tNeed of Multimodal SPECT/MRI for Tracking of In-Labeled Human Mesenchymal Stem Cells in Neuroblastoma Tumor-Bearing Mice --tFirst Steps towards a USE System for Non-invasive Thyroid Exploration --tRegistration of Small-Animal SPECT/MRI Studies for Tracking Human Mesenchymal Stem Cells --tSegregation of Emotional Function in Subcortical Structures: MEG Evidence --tAFM Multimode Imaging and Nanoindetation Method for Assessing Collagen Nanoscale Thin Films Heterogeneity --tSegmentation of Corneal Endothelial Cells Contour through Classification of Individual Component Signatures --tSplit Bregman-Singular Value Analysis Approach to Solve the Compressed Sensing Problem of Fluorescence Diffuse Optical Tomography --tDevelopment of an Optical Coherence Tomograph for Small Animal Retinal Imaging --tInhomogeneous Modification of Cardiac Electrophysiological Properties Due to Flecainide Administration --tPredictive Analysis of Photoacoustic Tomography Images in Dermatological Liposarcoma --tMonte Carlo Simulation of Radiation through the Human Retina Using Geant4 --tSemiautomatic Evaluation of Crypt Architecture and Vessel Morphology in Confocal Microendoscopy: Application to Ulcerative Colitis --t3D Reconstruction of Skin Surface Using an Improved Shape-from-Shading Technique --tQuantiDOPA: A Quantification Software for Dopaminergic Neurotransmission SPECT --tSpatial Normalization in Voxel-Wise Analysis of FDG-PET Brain Images --tEndoTOFPET-US a High Resolution Endoscopic PET-US Scanner Used for Pancreatic and Prostatic Clinical Exams --tLight Emission Efficiency of Gd_3Al_2Ga_3O_12:Ce (GAGG:Ce) Single Crystal under X-Ray Radiographic Conditions --tCalcification Detection Optimization in Dual Energy Mammography: Influence of the X-Ray Spectra --tX-Ray Spectra for Bone Quality Assessment Using Energy Dispersive Counting and Imaging Detectors with Dual Energy Method --tCDMAM Phantom Optimized for Digital Mammography Quality Control by Automatic Image Readout --tExperimental Evaluation of a High Resolution CMOS Digital Imaging Detector Coupled to Structured CsI Scintillators for Medical Imaging Applications --tEstimation of Contrast Agent Motion from Cerebral Angiograms for Assessing Hemodynamic Alterations Following Aneurysm Treatment by Flow Diversion --tGraphical User Interface for Breast Tomosynthesis Reconstructions: An Application Using Anisotropic Diffusion Filtering --tImage Analysis of Breast Reconstruction with Silicone Gel Implant --tQuantitative Analysis of Marker Segmentation for C-Arm Pose Based Navigation --tIterative Dual-Energy Material Decomposition for Slow kVp Switching: A Compressed Sensing Approach --tBrain Gray -- White Matter Discrimination in Dual Energy CT Imaging: A Simulation Feasibility Study.80gPart V:tBiomedical Signal Processing.tRemoval of Low Frequency Interferences from Electrocardio Signal Based on Transform of TP Segment Samples --tNoise Reduction Using 2D Anisotropic Diffusion Filter in Inverse Electrocardiography --tDetection and Identification of S1 and S2 Heart Sounds Using Wavelet Decomposition and Reconstruction --tEstimation of the Hemoglobin Glycation Rate Constant Based on the Mean Glycemia in Patients with Diabetes --tSpatial Dynamics of the Topographic Representation of Electroencephalogram Spectral Features during General Anesthesia --tThe Properties of the Missing Fundamental of Complex Tones --tSynchrony Analysis of Unipolar Cardiac Mapping during Ventricular Fibrillation --tSymbolic Analysis of Heart Period and QT Interval Variabilities in LQT1 Patients --tMechanical Stimulation and Cardiovascular Control in Parkinson Disease --tVariability of EEG Theta Power Modulation in Type 1 Diabetics Increases during Hypo-glycaemia --tAnalysis of Systematic Inter-channel Time Offsets in FECG from Maternal Abdominal Sensing --tSpatiotemporal Brain Activities on Recalling Names of Body Parts --tElimination of ECG Artefacts in Foetal EEG Using Ensemble Average Subtraction and Wavelet Denoising Methods: A Simulation --tExternal Uterine Contractions Signal Analysis in Relation to Labor Progression and Dystocia --tQuality Based Adaptation of Signal Analysis Software in Pregnancy Home Care System --tA Recovery of FHR Signal in the Embedded Space --tOnline Drawings for Dementia Diagnose: In-Air and Pressure Information Analysis --tSpontaneous Speech and Emotional Response Modeling Based on One-Class Classifier Oriented to Alzheimer Disease Diagnosis --tComplexity of Epileptiform Activity in a Neuronal Network and Pharmacological Intervention --tEvaluation of Different Handwriting Teaching Methods by Kinematic Analysis --tAnalysis of MEG Activity across the Life Span Using Statistical Complexity --tImpact of Device Settings and Spontaneous Breathing during IPV in CF Patients --tEstimation of Respiratory Mechanics Parameters during HFPV --tSignal Source Estimation Inside Brain Using Switching Voltage Divider --tA Phase-Space Based Algorithm for Detecting Different Types of Artefacts --tAutomatic Classification of Respiratory Sounds Phenotypes in COPD Exacerbations --tResponse Detection in Narrow-Band EEG Using Signal-Driven Non-Periodic Stimulation --tEMG-Based Analysis of Treadmill and Ground Walking in Distal Leg Muscles --tTemporal Variation of Local Fluorescence Sources in the Photodynamic Process --tStatistical Analysis of EMG Signal Acquired from Tibialis Anterior during Gait --tAuto-Mutual Information Function for Predicting Pain Responses in EEG Signals during Sedation --tProny's Method for the Analysis of mfVEP Signals --tEEG Denoising Based on Empirical Mode Decomposition and Mutual Information --tDecomposition Analysis of Digital Volume Pulse Signal Using Multi-Model Fitting --tA Neural Minimum Input Model to Reconstruct the Electrical Cortical Activity --tImproved Splines Fitting of Intervertebral Motion by Local Smoothing Variation --tEffects of Wavelets Analysis on Power Spectral Distributions in Laser Doppler Flowmetry Time Series --tOutliers Detection and Processing in CTG Monitoring --tChanges in Heart Rate Variability Associated with Moderate Alcohol Consumption --tEEG Rhythm Analysis Using Stochastic Relevance --tOptimize ncRNA Targeting: A Signal Analysis Based Approach --tMathematical Modelling of Melanoma Collective Cell Migration --tSynthetic Atrial Electrogram Generator --tEMG Topographic Image Enhancement Using Multi Scale Filtering --tModel Based Estimates of Gain between Systolic Blood Pressure and Heart-Rate Obtained from Only Inspiratory or Expiratory Periods --tDielectric Properties of Dentin between 100 Hz and 1 MHz Compared to Electrically Similar Body Tissues --tHypoglycaemia-Related EEG Changes Assessed by Approximate Entropy --tNon-linear Indices of Heart Rate Variability in Heart Failure Patients during Sleep --tDetrended Fluctuation Analysis of EEG in Depression --tCan Distance Measures Based on Lempel-Ziv Complexity Help in the Detection of Alzheimer's Disease from Electroencephalograms? --tPredictive Value on Neurological Outcome of Early EEG Signal Analysis in Brain Injured Patients --tLempel-Ziv Complexity Analysis of Local Field Potentials in Different Vigilance States with Different Coarse-Graining Techniques --tHeart Rate Variability in Pregnant Women before Programmed Cesarean Intervention --tFractal Changes in the Long-Range Correlation and Loss of Signal Complexity in Infant's Heart Rate Variability with Clinical Sepsis --tEstimation of Coupling and Directionality between Signals Applied to Physiological Uterine EMG Model and Real EHG Signals --tDynalets: A New Tool for Biological Signal Processing --tCyclostationarity-Based Estimation of the Foetus Subspace Dimension from ECG Recordings --tFeature Extraction Based on Discriminative Alternating Regression --tInfluence of Signal Preprocessing on ICA-Based EEG Decomposition --tMuscle Synergies Underlying Voluntary Anteroposterior Sway Movements --tRecognition of Brain Structures from MER-Signals Using Dynamic MFCC Analysis and a HMC Classifier --tFeed-Forward Neural Network Architectures Based on Extreme Learning Machine for Parkinson's Disease Diagnosis --tBreast Tissue Microarray Classification Based on Texture and Frequential Features --tFuzzy System for Retrospective Evaluation of the Fetal State --tAdvanced Processing of sEMG Signals for User Independent Gesture Recognition --tAdaptive Classification Framework for Multiclass Motor Imagery-Based BCI --tComputer Program for Automatic Identification of Artifacts in Impedance Cardiography Signals Recorded during Ambulatory Hemodynamic Monitoring --tComparison between Artificial Neural Networks and Discriminant Functions for Automatic Detection of Epileptiform Discharges --tClassification of Early Autism Based on HPLC Data --tFeature Selection Techniques in Uterine Electrohysterography Signal --tStudying Functional Brain Networks to Understand Mathematical Thinking: A Graph-Theoretical Approach --tA Short Review on Emotional Recognition Based on Biosignal Pattern Analysis --tMatching Pursuit with Asymmetric Functions for Signal Decomposition and Parameterization --tAnalysis of Intracranial Pressure Signals Using the Spectral Turbulence --tGraph-Theoretical Analysis in Schizophrenia Performing an Auditory Oddball Task --tSpectral Parameters from Pressure Bed Sensor Respiratory Signal to Discriminate Sleep Epochs with Respiratory Events --tWavelet Energy and Wavelet Entropy as a New Analysis Approach in Spontaneous Fluctuations of Pupil Size Study -- Preliminary Research --tRhythm Extraction Using Spectral-Splitting for Epileptic Seizure Detection --tEEG Metrics Evaluation in Simultaneous EEG-fMRI Olfactory Experiment --tAn Emboli Detection System Based on Dual Tree Complex Wavelet Transform --tNew Indices Extracted from Fetal Heart Rate Signal for the Assessment of Fetal Well-Being --tA Novel Method of Measuring Autonomic Nervous System Pupil Dynamics Using Wavelet Analysis.80gPart VI:tBio-micro and Bio-nano Technologies.tAnalysis Sensitivity by Novel Needle-Type GMR Sensor Used in Biomedical Investigation --tFocusing of Electromagnetic Waves by Non-Spherical, Au-Si Nano-particles --tHybrid Microfluidic Biosensor for Single Cell Flow Impedance Spectroscopy: Theoretical Approach and First Validations --tIntegrating an Electronic Health Record Graphical User Interface into Nanoelectronic-Based Biosensor Technology --tSynthesis of Gadolinium-doped Fluorescent Au/Ag Nanoclusters as Bimodal MRI Contrast Agents --tMicrochannel Modification to Enhance the Sensitivity in Biosensors --tTowards Point-of-Use Dielectrophoretic Methods: A New Portable Multiphase Generator for Bacteria Concentration --tFlagella -- Templates for the Synthesis of Metallic Nanowires --tA Versatile Microfabricated Platform for Single-Cell Studies --tPhotoacoustics of Gold Nanorods under Low Frequency Laser Pulses in Optical Hyperthermia --tDemonstration of an On-Chip Real-Time PCR for the Detection of Trypanosoma Cruzi --tA Stand-Alone Platform for Prolonged Parallel Recordings of Neuronal Activity --tInterdigitated Biosensor for Multiparametric Monitoring of Bacterial Biofilm Development --tHuman Splenon-on-a-chip: Design and Validation of a Microfluidic Model Resembling the Interstitial Slits and the Close/Fast and Open/Slow Microcirculations --tMicrobioreactor Integrated with a Sensor for Monitoring Intracellular Green Fluorescence Protein (GFP) --tSimultaneous Electrochemical Detection of Dopamine, Catechol and Ascorbic Acid at a Poly(acriflavine) Modified Electrode --tInduced Transmembrane Voltage during Cell Electrofusion Using Nanosecond Electric Pulses --tGene Transfer to Adherent Cells by in situ Electroporation with a Spiral Microelectrode Assembly.80gPart VII:tCardiovascular, Respiratory and Endocrine Systems.tEngineering Low Contents of Polyunsaturated Fatty Acids in Cultured Rat Cardiomyocytes --tClassification of Chronic Obstructive Pulmonary Disease (COPD) Using Integrated Software Suite --tMathematical Model of Apico Aortic Conduit in Presence of Steno-Insufficiency --tComputational Hemodynamic Model of the Human Cardiovascular System --tObject-Oriented Modeling and Simulation of the Arterial Pressure Control System by Using MODELICA --tElectrical Remodeling in the Epicardial Border Zone of the Human Infarcted Ventricle --tComparing Hodgkin-Huxley and Markovian Formulations for the Rapid Potassium Current in Cardiac Myocytes: A Simulation Study --tMechanical Properties of Different Airway Stents --tSite-Specific Mechanical Properties of Aortic Bifurcation --tCardiac Autonomic Nervous System Activity on Breathing Training --tContext Aware Contribution in Ambulatory Electrocardiogram Measurements Using Wearable Devices --tA Versatile Synchronization System for Biomedical Sensor Development --tECG Acquisition Using Fluid-Repellent, Wearable Electrodes --tAccuracy of the Oscillometric Fixed-Ratio Blood Pressure Measurement Using Different Methods of Characterization of Oscillometric Pulses --tDifferences in QRS Locations due to ECG Lead: Relationship with Breathing --tSynchrosqueezing Index for Detecting Drowsiness Based on the Respiratory Effort Signal --tApplying Variable Ranking to Oximetric Recordings in Sleep Apnea Diagnosis --tParoxysmal Atrial Fibrillation Termination Prognosis through the Application of Generalized Hurst Exponents --tEvaluation of Laplacian Diaphragm Electromyographic Recordings in a Static Inspiratory Maneuver --tAnalysis of Normal and Continuous Advenitious Sounds for the Assessment of Asthma --tAutomatic Extrasystole Detection Using Photoplethysmographic Signals --tECG Signal Reconstruction Based on Stochastic Joint-Modeling of the ECG and the PPG Signals --tApplication of Impedance Cardiography for Haemodynamic Monitoring in Patients with Ischaemic Stroke --tAR versus ARX Modeling of Heart Rate Sequences Recorded during Stress-Tests --tCancellation of Cardiac Interference in Diaphragm EMG Signals Using an Estimate of ECG Reference Signal --tRelevance of the Atrial Substrate Remodeling during Follow-Up to Predict Preoperatively Atrial Fibrillation Cox-Maze Surgery Outcome --tA New Method to Estimate Atrial Fibrillation Temporal Organization from the Surface Fibrillatory Waves Repetitiveness --tStudy on Atrial Arrhythmias Optimal Organization Assessment with Generalized Hurst Exponents --tNew Sleep Transition Indexes for Describing Altered Sleep in SAHS --tBlood Pressure Variability Analysis in Supine and Sitting Position of Healthy Subjects --tNoninvasive Interdependence Estimation between Atrial and Ventricular Activities in Atrial Fibrillation --tPrototype Development of a Computerized System for Interpretation of Heart Sounds Using Wavelet --tOxygen Dynamics in Microcirculation of Skeletal Muscle --tComputational Study on Aneurysm Hemodynamics Affected by a Deformed Parent Vessel after Stenting --tInflation Tests of Vena Saphena Mangna for Different Loading Rates --tModeling of Stent Implantation in a Human Stenotic Artery --tIn Vitro High Resolution Ultrasonography Measurements of Arterial Bifurcations with and without Stenosis as Inputs for In-Silico CFD Simulations --tStudy on the Dynamic Behavior of Arterial End-to-End Anastomosis.80gVolume 2. Part VIII:tClinical Engineering.tA New Approach for Preventive Maintenance Prioritization of Medical Equipment --t2D and 3D Photogrammetric Models for Respiratory Analysis in Adolescents --tEvaluation of Gastroesophageal Reflux in Infants Treated with Osteopathy Using the I-GERQ-R Questionnaire --tA Comparison of Three Techniques for Wound Area Measurement --tMonitoring Changes of the Tibialis Anterior during Dorsiflexion with Electromyography, Sonomyography, Dynamometry and Kinematic Signals --tAutomation of Analytical Processes in Immunohematology: Hospital Based-HTA Approach --tTotal Laboratory Automation and Clinical Engineering --tDevelopment of Vertebral Metrics -- An Instrument to Analyse the Spinal Column --tGlobal Program for Certification of Local Clinical Engineers: Back to the Future --tEmerging of Human Factor in Risk Analysis of Home Care Service --tSelection and Deployment of a Business Intelligence System (BI) at a Hospital's Clinical Engineering Department --tHealth Technology Assessment Applied to Health Technology Management through Clinical Engineering --tBiomedical Engineering at the Centre for Preclinical Research and Technology --t'E-HCM' Project: Cost Calculation Model for Surgical Procedures --tAnalysis of Combined Ultrasound Therapy and Medium Frequency Current in Abdominal Adiposity --tCooperative Experiential Learning Models for Biomedical Engineering Students --tBiomedical Engineering Research Improves the Health Care Industry --tEffect of Different Visual Feedback Conditions on Maximal Grip-Strength Assessment --tHealth Technology Assessment of Home Monitoring for Patients Suffering from Heart Failure --tMonitoring and Evaluation of Non-pharmacological Anti-smoking Treatment by Monoximetry: The First Three Months --tPatient Satisfaction Evaluation of Telemedicine Applications Is Not Satisfactory --tHospital Based Economic Assessment of Robotic Surgery --tEvaluating Care Coordination and Telehealth Services across Europe through the ACT Programme --tEarly HTA to Inform Medical Device Development Decisions -- The Headroom Method --tAnalysis of Exposure of Social Alarm Devices in Near Field Conditions --tAssessment of Statistical Distribution of Exposure to Electromagnetic Fields from Social Alarm Devices --tIncreased Complexity of Medical Technology and the Need for Human Factors Informed Design and Training --tEffects of Combined Use of a Patient-Tracking System and a Smart Drug-Dispenser on the Overall Risk of the Diagnostic-Therapeutic Process --tRisk Management Process in a Microwave Thermal Ablation System for CE Marking --tMedical Devices Recalls Analysis Focusing on Software Failures during the Last Decade --tEvaluation of Physical Environment Parameters in Healthcare --tManufacturer Training Impact in Heuristic Analysis: Usability Evaluation Applied on Health Devices --tHeuristic Analysis: A Tool to Improve Medical Device Safety and Usability --tMeasurement and Analysis of the Impact of the Environment on the Spread of Ionizing Radiation in Medical Facilities.80gPart IX:tHealth Informatics, E-Health, Telemedicine and Information Technology in Medicine, Bioinformatics.tComparing Two Coaching Systems for Improving Physical Activity of Older Adults --tDetecting and Analyzing Activity Levels for the Wrist Wearable Unit in the USEFIL Project --tHome Monitoring of Elderly for Early Detection of Changes in Activity and Behavior Patterns --tAutomatic Detection of Health Emergency States at Home --tAn Adaptive Home Environment Supporting People with Balance Disorders --tAALUMO: A User Model Ontology for Ambient Assisted Living Services Supported in Next-Generation Networks --tInternet of Things for Wellbeing -- Pilot Case of a Smart Health Cardio Belt --tAdvances in Modelling of Epithelial to Mesenchymal Transition --tGlucose-Level Interpolation for Determining Glucose Distribution Delay --tA Supervised SOM Approach to Stratify Cardiovascular Risk in Dialysis Patients --tLogistic Regression Models for Predicting Resistance to HIV Protease Inhibitor Nelfinavir --tApplication of Special Parametric Methods to Model Survival Data --tProtein Function Prediction Based on Protein-Protein Interactions: A Comparative Study --tInhibitory Regulation by microRNAs and Circular RNAs --tPublic Electronic Health Record Platform Compliant with the ISO EN13606 Standard as Support to Research Groups --tDevelopment of a Visual Editor for the Definition of HL7 CDA Archetypes --thomeRuleML Version 2.1: A Revised and Extended Version of the homeRuleML Concept --tDetailed Clinical Models Governance System in a Regional EHR Project --tAn Extensible Free Software Platform for Managing Image-Based Clinical Trials --tReuse of Clinical Information: Integrating Primary Care and Clinical Research through a Bidirectional Standard Interface. --tArchetype-Based Solution to Tele-Monitor Patients with Chronic Diseases --tConnecting HL7 with Software Analysis: A Model-Based Approach --tIntegrating the EN/ISO 13606 Standards into an EN/ISO 12967 Based Architecture --tDesign of a Semantic Service for Management of Multi-domain Health Alarms --tSILAM: Integrating Laboratory Information System within the Liguria Region Electronic Health Record --tA Model for Measuring Open Access Adoption and Usage Behaviour of Health Sciences Faculty Members --tEHR Anonymising System Based on the ISO/EN 13606 Norm --tThe Status of Information Systems in the Hospitals of the Greek National Health System --tOperating Room Efficiency Improving through Data Management --tA Semantically Enriched Architecture for an Italian Laboratory Terminology System --tA National Electronic Health Record System for Cyprus --tInformation Driven Care Pathways and Procedures --tDecision Making in Screening Diagnostics E-Medicine --tUsing Social Network Apps as Social Sensors for Health Monitoring --tAdvanced Medical Expert Support Tool (A-MEST): EHR-Based Integration of Multiple Risk Assessment Solutions for Congestive Heart Failure Patients --tModeling and Implementing a Signal Persistence Manager for Shared Biosignal Storage and Processing --tHeart Rate Variability for Automatic Assessment of Congestive Heart Failure Severity --tSupport System for the Evaluation of the Posterior Capsule Opacificaction Degree --tA Custom Decision-Support Information System for Structural and Technological Analysis in Healthcare. --tPerformance Assessment of a Clinical Decision Support System for Analysis of Heart Failure --tSelf-reporting for Bipolar Patients through Smartphone --tComorbidities Modeling for Supporting Integrated Care in Chronic Cardiorenal Disease --tOverall Survival Prediction for Women Breast Cancer Using Ensemble Methods and Incomplete Clinical Data --tAutomatic Blood Glucose Classification for Gestational Diabetes with Feature Selection: Decision Trees vs. Neural Networks --tOn the Global Optimization of the Beam Angle Optimization Problem in Intensity-Modulated Radiation Therapy --tEffective Supervised Knowledge Extraction for an mHealth System for Fall Detection --tChemoprophylaxis Application for Meningococcal Disease for Android Devices --tAutomation of Evaluation Protocols of Stand-to-Sit Activity in Expert System --tDigital Diary for Persons with Psychological Disorders Using Interaction Design --tA Novel Data-Mining Platform to Monitor the Outcomes of Erlontinib (Tarceva) Using Social Media --tAdvanced Networked Modular Personal Dosimetry System --tMethods for Personalized Diagnostics --tThe Prediction of Blood Pressure Changes by the Habit of Walking --tParallel Workflows to Personalize Clinical Guidelines Recommendations: Application to Gestational Diabetes Mellitus --tCase Based Reasoning in a Web Based Decision Support System for Thoracic Surgery --tData Mining in Cancer Registries: A Case for Design Studies --tSoftware Prototype for Triage and Instructional for Homecare Patients --tAnalysis and Impact of Breast and Colorectal Cancer Groups on Social Networks --tHealth Apps for the Most Prevalent Conditions --tA Mobile Remote Monitoring Service for Measuring Fetal Heart Rate --tInvestigating Methods for Increasing the Adoption of Social Media amongst Carers for the Elderly --tAMELIE: Authoring Multimedia-Enhanced Learning Interactive Environment for e-Health Contents --tmHealth: Cognitive Telerehabilitation of Patients with Acquired Brain Damage --tMobile Telemedicine Screening Complex --tRadial-Basis-Function Based Prediction of COPD Exacerbations --tResearch Benefits of Using Interoperability Standards in Remote Command and Control to Implement Personal Health Devices --tLow Cost, Modular and Scalable Remote Monitoring Healthcare Platform Using 8-Bit Microcontrollers --tAdaptive Healthcare Pathway for Diabetes Disease Management --tReal Time Health Remote Monitoring Systems in Rural Areas --tDetecting Accelerometer Placement to Improve Activity Classification --tIncorporating the Rehabilitation of Parkinson's Disease in the Play for Health Platform Using a Body Area Network --tActivity Classification Using 3-Axis Accelerometer Wearing on Wrist for the Elderly --tIntelligent Chair Sensor -- Classification and Correction of Sitting Posture --tNon-invasive System for Mechanical Arterial Pulse Wave Measurements --tAutomatic Identification of Sensor Localization on the Upper Extremity.80gPart X:tMedical Devices and Sensors.tA New Device to Assess Gait Velocity at Home --tMagnetic Induction-Based Sensor for Vital Sign Detection --tUnconstrained Night-Time Heart Rate Monitoring with Capacitive Electrodes --tWrist-Worn Accelerometer to Detect Postural Transitions and Walking Patterns --tComparative Measurement of the Head Orientation Using Camera System and Gyroscope System --tA Noninvasive Method of Measuring Force-Frequency Relations to Evaluate Cardiac Contractile State of Patients during Exercise for Cardiac Rehabilitation --tA Phase Lock Loop (PLL) System for Frequency Variation Tracking during General Anesthesia --tEvaluation of Arterial Properties through Acceleration Photoplethysmogram --tComparing over Ground Turning and Walking on Rotating Treadmill --tDisplacement Measurement of a Medical Instrument Inside the Human Body --tAlgorithmically Smart Continuous Glucose Sensor Concept for Diabetes Monitoring --tPiezoresistive Goniometer Network for Sensing Gloves --tPreliminary Study of Pressure Distribution in Diabetic Subjects, in Early Stages --tSystem for Precise Measurement of Head and Shoulders Position --tAn Online Program for the Diagnosis and Rehabilitation of Patients with Cochlear Implants --tAnalysis of Anomalies in Bioimpedance Models for the Estimation of Body Composition --tRisk Analysis and Measurement Uncertainty in the Manufacturing Process of Medical Devices --tDevelopment of an Equipment to Detect and Quantify Muscular Spasticity: SpastiMed -- A New Solution --tComparison between Two Exercise Systems for Rodents --tTripolar Flexible Concentric Ring Electrode Printed with Inkjet Technology for ECG Recording --tMeasurement System for Pupil Size Variability Study --tPatellar Reflex Measurement System with Tapping Force Controlled --tA Bioelectric Model of pH in Wound Healing.80gPart XI:tMolecular, Cellular and Tissue Engineering and Biomaterials.tCompetitive Adsorption of Albumin, Fibronectin and Collagen Type I on Different Biomaterial Surfaces: A QCM-D Study --tBiomimetic Poly(NaSS) Grafted on Ti6Al4V:tEffect of Pre-adsorbed Selected Proteins on the MC3T3-E1 Osteoblastic Development --tBioactive Intraocular Lens -- A Strategy to Control Secondary Cataract --tUltrathin Films by LbL Self-assembly for Biomimetic Coatings of Implants --tNanohelical Shape and Periodicity Dictate Stem Cell Fate in a Synthetic Matrix --tThe Role of Adult Stem Cells on Microvascular Tube Stabilization --tProcesses of Gamma Radiolysis of Soluble Collagen in the Aspect of the Scaffolds Preparation --tBuilding Up and Characterization of Multi-component Collagen-Based Scaffolds --tFabrication of Gelatin/Bioactive Glass Hybrid Scaffolds for Bone Tissue-Engineering --tCollagen-Targeted BMPs for Bone Healing --tLayer by Layer: Designing Scaffolds for Cardiovscular Tissues.80gPart XII:tRehabilitation Engineering Voice Activity Detection from Electrocorticographic Signals.tAssessment of an Assistive P300-Based Brain Computer Interface by Users with Severe Disabilities --tSingle-Trial Detection of the Event-Related Desynchronization to Locate with Temporal Precision the Onset of Voluntary Movements in Stroke Patients --tHybrid Brain Computer Interface Based on Gaming Technology: An Approach with Emotiv EEG and Microsoft Kinect --tRehabilitation Using a Brain Computer Interface Based on Movement Related Cortical Potentials -- A Review --tNumerical Simulation of Deep Transcranial Magnetic Stimulation by Multiple Circular Coils --tVolitional Intention and Proprioceptive Feedback in Healthy and Stroke Subjects --tNonlinear Relationship between Perception of Deep Pain and Medial Prefrontal Cortex Response Is Related to Sympathovagal Balance --tDynamics of Learning in the Open Loop VOR --tNumerical Modeling of Optical Radiation Propagation in a Realistic Model of Adult Human Head --tIndividual Noise Responses and Task Performance and Their Mutual Relationships --tIs the Software Package Embedding Dynamic Causal Modeling Robust? --tThe Focuses of Pathology of Electrical Activity of Brain in Assessment of Origin of Syncope --tNeuroanatomic-Based Detection Algorithm for Automatic Labeling of Brain Structures in Brain Injury --tBrain Activity Characterization Induced by Alcoholic Addiction. Spectral and Causality Analysis of Brain Areas Related to Control and Reinforcement of Impulsivity --tA Novel RMS Method for Presenting the Difference between Evoked Responses in MEG/EEG -- Theory and Simulation --tThe Influence of Neuronal Density on Network Activity: A Methodological Study --tEffective Connectivity Patterns Associated with P300 Unmask Differences in the Level of Attention/Cognition between Normal and Disabled Subjects --tA General Purpose Approach to BCI Feature Computation Based on a Genetic Algorithm: Preliminary Results --tModular Control of Crouch Gait in Spastic Cerebral Palsy --tTime-Frequency Analysis of Error Related Activity in Anterior Cingulate Cortex --tDepth-Sensitive Algorithm to Localize Sources Using Minimum Norm Estimations --tMeasurement of Gait Movements of a Hemiplegic Subject with Wireless Inertial Sensor System before and after Robotic-Assisted Gait Training in a Day --tGlenohumeral Kinetics in Gait with Crutches during Reciprocal and Swing-Through Gait: A Case Study --tA Feasibility Study to Elicit Tactile Sensations by Electrical Stimulation --tDystonia: Altered Sensorimotor Control and Vibro-tactile EMG-Based Biofeedback Effects --tClosed-Loop Modulation of a Notch-Filter Stimulation Strategy for Tremor Management with a Neuroprosthesis --tObjective Metrics for Functional Evaluation of Upper Limb during the ADL of Drinking: Application in SCI --tEfficacy of TtB-Based Visual Biofeedback in Upright Stance Trials --tA Data-Globe and Immersive Virtual Reality Environment for Upper Limb Rehabilitation after Spinal Cord Injury --tWearable Navigation Aids for Visually Impaired People Based on Vibrotactile Skin Stimuli --tBrain Injury MRI Simulator Based on Theoretical Models of Neuroanatomic Damage --tHaptic Feedback Affects Movement Regularity of Upper Extremity Movements in Elderly Adults --tDysfunctional Profile for Patients in Physical Neurorehabilitation of Upper Limb --tVideo-Based Tasks for Emotional Processing Rehabilitation in Schizophrenia --tPreliminary Experiment with a Neglect Test --tA Subject-Driven Arm Exoskeleton to Support Daily Life Activities --tEvaluation of a Novel Modular Upper Limb Neuroprosthesis for Daily Life Support --tEvaluating Spatial Characteristics of Upper-Limb Movements from EMG Signals --tAn Adaptive Rreal-Time Algorithm to Detect Gait Events Using Inertial Sensors --tA Graphical Tool for Designing Interactive Video Cognitive Rehabilitation Therapies.806880-01gPart XIV:tSpecial Sessions.tModels of Arrhythmogenesis in Myocardial Infarction --tMultiscale-Multiphysics Models of Ventricular Electromechanics -- Computational Modeling, Parametrization and Experimental Validation --tEffect of Purkinje-Myocyte Junctions on Transmural Action Potential Duration Profiles --tMorphometry and Characterization of Electrograms in the Cavotricuspid Isthmus in Rabbit Hearts during Autonomic Sinus Rhythm --tCavotricuspid Isthmus: Anatomy and Electrophysiology Features: Its Evaluation before Radiofrequency Ablation --tPreoperative Prognosis of Atrial Fibrillation Concomitant Surgery Outcome after the Blanking Period --tA Decision Support System for Operating Theatre in Hospitals: Improving Safety, Efficiency and Clinical Continuity --tLICENSE: Web Application for Monitoring and Controlling Hospitals' Status with Respect to Legislative Standards --tRelation among Breathing Pattern, Sleep Posture and BMI during Sleep Detected by Body Motion Wave --tSophisticated Rate Control of Respiration and Pulse during Sleep Studied by Body Motion Wave --tA Tool for Patient Data Recovering Aimed to Machine Learning Supervised Training --tThe Potential of Machine-to-Machine Communications for Developing the Next Generation of Mobile Device Monitoring Systems --tA Study on Perception of Managing Diabetes Mellitus through Social Networking in the Kingdom of Saudi Arabia --tValidity of Smartphone Accelerometers for Assessing Energy Expenditure during Fast Running --tMedical Quality of Service Analysis of Ultrasound Video Streaming over LTE Networks --tSmart Social Robotics for 4G-Health Applications --tRegional Cooperation in the Development of Biomedical Engineering for Developing Countries.0 aPrint version record. aIncludes bibliographical references and indexes. 0aBiomedical engineeringvCongresses. 0aMedical technologyvCongresses. 6aGeÌnie biomeÌdicalvCongreÌ€s. 6aTechnologie meÌdicalevCongreÌ€s. 7aHEALTH & FITNESSxHolism.2bisacsh 7aHEALTH & FITNESSxReference.2bisacsh 7aMEDICALxAlternative Medicine.2bisacsh 7aMEDICALxAtlases.2bisacsh 7aMEDICALxEssays.2bisacsh 7aMEDICALxFamily & General Practice.2bisacsh 7aMEDICALxHolistic Medicine.2bisacsh 7aMEDICALxOsteopathy.2bisacsh 7aIngeÌnierie.2eclas 7aBiomedical engineering.2fast0(OCoLC)fst00832568 7aMedical technology.2fast0(OCoLC)fst01014742 2aCongress 4aElectronic books. 4aEbook. 7aConference papers and proceedings.2fast0(OCoLC)fst01423772 7aConference papers and proceedings.2lcgft 7aActes de congreÌ€s.2rvmgf1 a Adv search subj 003 Roa Romero, Laura M08iPrint version:aMediterranean Conference on Medical and Biological Engineering and Computing (13th : 2013).tMediterranean conference on medical and biological engineering and computing 2013.dWien : Springer, 2013z9783319008455w(OCoLC)851827768 0aIFMBE proceedings ;vvolume 41.403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=1466365403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=645480403Scholars Portaluhttp://books.scholarsportal.info/viewdoc.html?id=/ebooks/ebooks3/springer/2014-02-13/1/9783319008462403SpringerLinkuhttps://doi.org/10.1007/978-3-319-00846-2403De Gruyteruhttps://doi.org/10.1515/9783110316704806505-01/(SgPart XIII:tYoung Investigator Competition.tMotion-Related VEPs Elicited by Dynamic Virtual Stimulation --tA Distributed Middleware for the Assistance on the Prevention of Peritonitis in CKD --tBioactive Nanoimprint Lithography: A Study of Human Mesenchymal Stem Cell Behavior and Fate --tAutomated Normalized Cut Segmentation of Aortic Root in CT Angiography --tClassification Methods from Heart Rate Variability to Assist in SAHS Diagnosis --tAdaBoost Classification to Detect Sleep Apnea from Airflow Recordings --tEffect of Electric Field and Temperature in E. Coli Viability --t3D Shape Landmark Correspondence by Minimum Description Length and Local Linear Regularization --tβ-Band Peak in Local Field Potentials as a Marker of Clinical Improvement in Parkinson's Disease after Deep Brain Stimulation --tErgonomics during the Use of LESS Instruments in Basic Tasks: 2 Articulated vs. 1 Straight and 1 Articulated Graspers --tNetwork-Based Modular Markers of Aging Across Different Tissues --tExperimental Characterization of Active Antennas for Body Sensor Networks. aProQuest Ebook CentralbEBLBnEBL1466365 aEBSCOhostbEBSCn645480 aYBP Library ServicesbYANKn112042141 aDEBSZb43548270X1 aDEBSZb4428226421 aNZ1b15317151 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 300 OTHER HOLDINGS \ No newline at end of file diff --git a/cypress/support/fragments/inventory/holdingsRecordEdit.js b/cypress/support/fragments/inventory/holdingsRecordEdit.js index 2d0c84eabb..0fbc26f630 100644 --- a/cypress/support/fragments/inventory/holdingsRecordEdit.js +++ b/cypress/support/fragments/inventory/holdingsRecordEdit.js @@ -4,6 +4,7 @@ const rootForm = HTML({ className: including('holdingsForm-') }); const holdingsHrId = rootForm.find(TextField({ name: 'hrid' })); const sourceSelect = rootForm.find(Select({ name: 'sourceId' })); const readonlyFields = [holdingsHrId, sourceSelect]; +const callNumber = rootForm.find(TextArea({ name: 'callNumber' })); export default { saveAndClose : () => { @@ -35,4 +36,7 @@ export default { TextArea({ ariaLabel: 'Note' }).fillIn(text), ]); }, + fillCallNumber(callNumberValue) { + cy.do(callNumber.fillIn(callNumberValue)); + } }; diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 4149e07ae1..a2f7ed76c8 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -117,6 +117,7 @@ const quickMarcPaneHeader = PaneHeader({ id: 'paneHeaderquick-marc-editor-pane' const detailsPaneContent = PaneContent({ id: 'pane-instancedetails-content' }); const administrativeDataAccordion = Accordion('Administrative data'); const unlinkIconButton = Button({ icon: 'unlink' }); +const itemBarcodeField = TextField({ name: 'barcode' }); const validOCLC = { id:'176116217', // TODO: hardcoded count related with interactors getters issue. Redesign to cy.then(QuickMarkEditor().rowsCount()).then(rowsCount => {...} @@ -842,5 +843,9 @@ export default { checkValueAbsenceInDetailView(accordion, value) { cy.expect(section.find(Button(including(accordion))).exists()); cy.expect(Accordion(accordion).find(MultiColumnListCell(including(value))).absent()); + }, + + fillItemBarcode(barcodeValue) { + cy.do(itemBarcodeField.fillIn(barcodeValue)); } }; From 75c93f48a2915ff37c531fb7ecd3532e229edcc2 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Wed, 16 Aug 2023 08:49:17 +0500 Subject: [PATCH 048/437] added C397329 (#1483) --- ...-enable-or-disable-tags-for-all-apps.cy.js | 78 +++++++++++++++++++ .../support/fragments/invoices/invoiceView.js | 25 +++++- 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/permissions/permission-can-enable-or-disable-tags-for-all-apps.cy.js diff --git a/cypress/e2e/permissions/permission-can-enable-or-disable-tags-for-all-apps.cy.js b/cypress/e2e/permissions/permission-can-enable-or-disable-tags-for-all-apps.cy.js new file mode 100644 index 0000000000..f081690bca --- /dev/null +++ b/cypress/e2e/permissions/permission-can-enable-or-disable-tags-for-all-apps.cy.js @@ -0,0 +1,78 @@ +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 Invoices from '../../support/fragments/invoices/invoices'; +import InvoiceView from '../../support/fragments/invoices/invoiceView'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; + +// 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.uiInvoicesCanViewAndEditInvoicesAndInvoiceLines.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', () => { + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + }); + + it( + 'C397329 Verify that permission: "Settings (Tags): Can enable or disable tags for all apps" works as expected (volaris)', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + TagsGeneral.changeEnableTagsStatus('disable'); + cy.visit(TopMenu.invoicesPath); + Invoices.waitLoading(); + Invoices.selectStatusFilter('Open'); + InvoiceView.selectFirstInvoice(); + InvoiceView.verifyTagsIsAbsent(); + + cy.visit(SettingsMenu.tagsGeneralPath); + TagsGeneral.waitLoading(); + TagsGeneral.changeEnableTagsStatus('enable'); + cy.visit(TopMenu.invoicesPath); + Invoices.waitLoading(); + Invoices.selectStatusFilter('Open'); + InvoiceView.selectFirstInvoice(); + InventorySearchAndFilter.openTagsField(); + InventorySearchAndFilter.verifyTagsView(); + } + ); +}); diff --git a/cypress/support/fragments/invoices/invoiceView.js b/cypress/support/fragments/invoices/invoiceView.js index e1a4427882..b999a79eca 100644 --- a/cypress/support/fragments/invoices/invoiceView.js +++ b/cypress/support/fragments/invoices/invoiceView.js @@ -1,4 +1,14 @@ -import { MultiColumnListCell, Section, including, KeyValue, Pane, HTML, MultiColumnList, Link } from '../../../../interactors'; +import { + MultiColumnListCell, + Section, + including, + KeyValue, + Pane, + HTML, + MultiColumnList, + Link, + Button, +} from '../../../../interactors'; import invoices from './invoices'; import TopMenu from '../topMenu'; @@ -8,6 +18,15 @@ const expectedInvoiceStatus = 'Open'; const expectedInvoiceSource = 'EDI'; export default { + selectFirstInvoice: () => { + cy.do( + MultiColumnList({ id: 'invoices-list' }) + .find(MultiColumnListCell({ row: 0, columnIndex: 0 })) + .find(Link()) + .click() + ); + }, + checkInvoiceDetails:(invoiceNumber) => { cy.do(Section().find(MultiColumnListCell(including(invoiceNumber))).perform(element => { const invoiceOfNumber = element.innerText.split('-')[0]; @@ -33,5 +52,9 @@ export default { cy.expect(Pane({ id:'pane-results' }).find(HTML(including(`${quantity} records found`))).exists()); }, + verifyTagsIsAbsent: () => { + cy.expect(Pane({ id: 'pane-invoiceDetails' }).find(Button({ icon: 'tag' })).absent()); + }, + vendorInvoiceNumber, }; From 24decc96cbd929b2b8e6081223af2dff9ac34f4c Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Wed, 16 Aug 2023 09:00:29 +0500 Subject: [PATCH 049/437] added C402342 (#1484) --- ...-view-all-settings-works-as-expected.cy.js | 30 +++++++++++++++++++ cypress/support/dictionary/permissions.js | 1 + .../settings/users/permissionSets.js | 27 +++++++++++++++-- 3 files changed, 56 insertions(+), 2 deletions(-) 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 index e2fe039af6..cc716424ab 100644 --- 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 @@ -17,6 +17,7 @@ import UsersSettingsGeneral from '../../../support/fragments/settings/users/user import Departments from '../../../support/fragments/settings/users/departments'; import Conditions from '../../../support/fragments/settings/users/conditions'; import Limits from '../../../support/fragments/settings/users/limits'; +import PermissionSets from '../../../support/fragments/settings/users/permissionSets'; describe('Permission Sets', () => { let userData; @@ -42,6 +43,16 @@ describe('Permission Sets', () => { }; const waiveReason = WaiveReasons.getDefaultNewWaiveReason(uuid()); const refundReason = RefundReasons.getDefaultNewRefundReason(uuid()); + const permissionSetBody = { + displayName: getTestEntityValue('setName'), + description: getTestEntityValue('setDescription'), + subPermissions: [ + permissions.uiUsersViewPermissionSets.internal, + permissions.uiUsersViewAllSettings.internal, + ], + mutable: true, + id: uuid(), + }; before('Preconditions', () => { cy.getAdminToken().then(() => { @@ -57,6 +68,7 @@ describe('Permission Sets', () => { PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { patronGroup.id = patronGroupResponse; }); + PermissionSets.createPermissionSetViaApi(permissionSetBody); cy.createTempUser([permissions.uiUsersViewAllSettings.gui], patronGroup.name).then((userProperties) => { userData = userProperties; UserEdit.addServicePointViaApi( @@ -70,6 +82,7 @@ describe('Permission Sets', () => { }); after('Deleting created entities', () => { + PermissionSets.deletePermissionSetViaApi(permissionSetBody.id); UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); ServicePoints.deleteViaApi(testData.userServicePoint.id); Users.deleteViaApi(userData.userId); @@ -81,6 +94,23 @@ describe('Permission Sets', () => { UsersOwners.deleteViaApi(ownerBody.id); }); + it( + 'C402342 Verify that Creating and Editing options are disabled for users with "Setting (Users): View all settings" permission scenario 1 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.permissionSets); + PermissionSets.waitLoading(); + PermissionSets.checkNewButtonNotAvailable(); + PermissionSets.chooseFromList(permissionSetBody.displayName); + PermissionSets.checkPermissionSet({ + name: permissionSetBody.displayName, + description: permissionSetBody.description, + permissions: [permissions.uiUsersViewPermissionSets.gui, permissions.uiUsersViewAllSettings.gui], + }); + PermissionSets.checkEditButtonNotAvailable(); + } + ); + it( 'C402752 Verify that "Settings (Users): View all settings" works as expected Scenario 2 (volaris)', { tags: [TestTypes.extendedPath, devTeams.volaris] }, diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index b4c381308c..4c25719e6e 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -115,6 +115,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' }, + uiUsersViewPermissionSets: { internal: 'ui-users.settings.permsets.view', gui: 'Settings (Users): Can view permission sets' }, 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' }, diff --git a/cypress/support/fragments/settings/users/permissionSets.js b/cypress/support/fragments/settings/users/permissionSets.js index 4507258d49..d73123ab19 100644 --- a/cypress/support/fragments/settings/users/permissionSets.js +++ b/cypress/support/fragments/settings/users/permissionSets.js @@ -9,6 +9,7 @@ import { KeyValue, ListItem, TextArea, + NavListItem, } from '../../../../../interactors'; import InteractorsTools from '../../../utils/interactorsTools'; @@ -21,6 +22,9 @@ export default { waitLoading() { cy.expect(PaneHeader('Permission sets').exists()); }, + chooseFromList(permissionSetName) { + cy.do(NavListItem(permissionSetName).click()); + }, addPermissions(permissions) { cy.do(Button({ id: 'clickable-add-permission' }).click()); cy.expect(selectPermissionsModal.exists()); @@ -41,8 +45,7 @@ export default { this.addPermissions(values.permissions); cy.do(Button({ id: 'clickable-save-permission-set' }).click()); }, - checkAfterSaving(values) { - InteractorsTools.checkCalloutMessage(`The permission set ${values.name} was successfully created.`); + checkPermissionSet(values) { cy.expect([ generalInformation.find(KeyValue('Permission set name', { value: values.name })).exists(), generalInformation.find(KeyValue('Description', { value: values.description })).exists(), @@ -52,6 +55,26 @@ export default { cy.expect(Section({ id: 'assignedPermissions' }).find(ListItem(permission)).exists()); }); }, + checkAfterSaving(values) { + InteractorsTools.checkCalloutMessage(`The permission set ${values.name} was successfully created.`); + this.checkPermissionSet(); + }, + checkNewButtonNotAvailable() { + cy.expect(Button({ id: 'clickable-create-entry' }).absent()); + }, + checkEditButtonNotAvailable() { + cy.expect(Button({ id: 'clickable-edit-item', disabled: true }).exists()); + }, + createPermissionSetViaApi(body) { + return cy + .okapiRequest({ + method: 'POST', + path: 'perms/permissions', + body, + isDefaultSearchParamsRequired: false, + }) + .then((response) => response.body); + }, deletePermissionSetViaApi(permSetId) { return cy.okapiRequest({ method: 'DELETE', From 84442e6e19059dca80c25e5f4b001c1ef554944b Mon Sep 17 00:00:00 2001 From: nayimovag Date: Wed, 16 Aug 2023 14:10:26 +0500 Subject: [PATCH 050/437] FAT-1236 (#1486) --- ...dit-in-app-user-custom-fields-recent.cy.js | 5 +- ...-edit-logs-csv-users-view-permission.cy.js | 1 - .../circulation-log/claimed-returned.cy.js | 7 + .../export-manager/search-filter-verify.cy.js | 1 - .../data-export/dataExportResults.js | 166 ++++++++++-------- .../inventory/inventorySearchAndFilter.js | 17 +- 6 files changed, 107 insertions(+), 90 deletions(-) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js index 265421586a..fccbc55711 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js @@ -39,13 +39,16 @@ describe('bulk-edit', () => { permissions.uiUsersPermissionsView.gui, permissions.uiUsersCustomField.gui, permissions.uiUserEdit.gui, - ], 'faculty') + ]) .then(userProperties => { user = userProperties; cy.login(user.username, user.password, { path: SettingsMenu.customFieldsPath, waiter: CustomFields.waitLoading }); + cy.getUsers({ limit: 1, query: `username=${user.username}` }).then((users) => { + cy.updateUser({ ...users[0], patronGroup: '503a81cd-6c26-400f-b620-14c08943697c' }); + }); FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, user.barcode); CustomFields.addMultiSelectCustomField(customFieldData); cy.visit(TopMenu.usersPath); diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js index e53131e00b..27f7c866e2 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-view-permission.cy.js @@ -69,7 +69,6 @@ describe('Bulk Edit - Logs', () => { permissions.uiUserEdit.gui ]); UserEdit.saveAndClose(); - cy.pause(); UsersCard.verifyPermissions([ permissions.bulkEditLogsView.gui, permissions.bulkEditCsvView.gui, diff --git a/cypress/e2e/circulation-log/claimed-returned.cy.js b/cypress/e2e/circulation-log/claimed-returned.cy.js index b879936cea..78ce1bd35c 100644 --- a/cypress/e2e/circulation-log/claimed-returned.cy.js +++ b/cypress/e2e/circulation-log/claimed-returned.cy.js @@ -16,6 +16,7 @@ import UserLoans from '../../support/fragments/users/loans/userLoans'; import ConfirmClaimReturnedModal from '../../support/fragments/users/loans/confirmClaimReturnedModal'; import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; +let user; let userId; let servicePointId; const item = { @@ -31,6 +32,7 @@ describe('circulation-log', () => { permissions.usersViewRequests.gui ]) .then(userProperties => { + user = userProperties; userId = userProperties.userId; cy.login(userProperties.username, userProperties.password, { path: TopMenu.circulationLogPath, waiter: SearchPane.waitLoading }); ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) @@ -91,4 +93,9 @@ describe('circulation-log', () => { circAction: 'Claimed returned', }); }); + + it('C16998 Check the Actions button from filtering Circulation log by claimed returned (firebird)', { tags: [TestTypes.criticalPath, devTeams.firebird] }, () => { + SearchPane.setFilterOptionFromAccordion('loan', 'Claimed returned'); + SearchPane.checkActionButtonAfterFiltering(user.firstName, item.ITEM_BARCODE); + }); }); diff --git a/cypress/e2e/export-manager/search-filter-verify.cy.js b/cypress/e2e/export-manager/search-filter-verify.cy.js index 5b9ff1254b..69d0a940c4 100644 --- a/cypress/e2e/export-manager/search-filter-verify.cy.js +++ b/cypress/e2e/export-manager/search-filter-verify.cy.js @@ -88,7 +88,6 @@ describe('export manager', () => { }); after('check in item, delete instance, user and files', () => { - FileManager.deleteFileFromDownloadsByMask('CIRCULATION_LOG*'); CheckInActions.checkinItemViaApi({ checkInDate: moment.utc().format(), servicePointId: testData.servicepointId, diff --git a/cypress/support/fragments/data-export/dataExportResults.js b/cypress/support/fragments/data-export/dataExportResults.js index fb0cb51533..29b20a4691 100644 --- a/cypress/support/fragments/data-export/dataExportResults.js +++ b/cypress/support/fragments/data-export/dataExportResults.js @@ -1,7 +1,9 @@ import { MultiColumnListCell } from '../../../../interactors'; +import { MultiColumnListRow } from '../../../../interactors/multi-column-list'; import DateTools from '../../utils/dateTools'; const getSearchResult = (row = 0, col = 0) => MultiColumnListCell({ 'row': row, 'columnIndex': col }); +const getRowByContent = (content) => MultiColumnListCell(content).row(); const quickExportFileNameMask = /quick-export-\d{1,3}.mrc/gm; export default { @@ -17,94 +19,102 @@ export default { }, verifySuccessExportResultCells(resultFileName, recordsCount, jobId, userName = null, jobType = 'instances') { - const resultRow = { - fileName: MultiColumnListCell({ 'row': 0, columnIndex: 0 }), - status: MultiColumnListCell({ 'row': 0, columnIndex: 1 }), - total: MultiColumnListCell({ 'row': 0, columnIndex: 2 }), - exported: MultiColumnListCell({ 'row': 0, columnIndex: 3 }), - failed: MultiColumnListCell({ 'row': 0, columnIndex: 4 }), - jobProfile: MultiColumnListCell({ 'row': 0, columnIndex: 5 }), - endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), - runBy: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), - id: MultiColumnListCell({ 'row': 0, columnIndex: 9 }), - }; - cy.getAdminToken().then(() => { - cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { - const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; - cy.do([ - resultRow.status.is({ content: 'Completed' }), - resultRow.total.is({ content: recordsCount.toString() }), - resultRow.exported.is({ content: recordsCount.toString() }), - resultRow.failed.is({ content: '' }), - resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), - resultRow.runBy.is({ content: userNameToVerify }), - resultRow.id.is({ content: jobId.toString() }) - ]); + getRowByContent(resultFileName).then((row) => { + const exportRow = MultiColumnListRow({ index: row }); + + const resultRow = { + fileName: exportRow.find(MultiColumnListCell({ columnIndex: 0 })), + status: exportRow.find(MultiColumnListCell({ columnIndex: 1 })), + total: exportRow.find(MultiColumnListCell({ columnIndex: 2 })), + exported: exportRow.find(MultiColumnListCell({ columnIndex: 3 })), + failed: exportRow.find(MultiColumnListCell({ columnIndex: 4 })), + jobProfile: exportRow.find(MultiColumnListCell({ columnIndex: 5 })), + endedRunning: exportRow.find(MultiColumnListCell({ columnIndex: 7 })), + runBy: exportRow.find(MultiColumnListCell({ columnIndex: 8 })), + id: exportRow.find(MultiColumnListCell({ columnIndex: 9 })), + }; + cy.getAdminToken().then(() => { + cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { + const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; + cy.do([ + resultRow.status.is({ content: 'Completed' }), + resultRow.total.is({ content: recordsCount.toString() }), + resultRow.exported.is({ content: recordsCount.toString() }), + resultRow.failed.is({ content: '' }), + resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), + resultRow.runBy.is({ content: userNameToVerify }), + resultRow.id.is({ content: jobId.toString() }) + ]); + }); }); - }); - // verify file name - cy.do( - resultRow.fileName.perform(element => { - expect(element.innerText).to.equal(resultFileName); - expect(element.innerText).to.include(`-${jobId}.mrc`); - }) - ); + // verify file name + cy.do( + resultRow.fileName.perform(element => { + expect(element.innerText).to.equal(resultFileName); + expect(element.innerText).to.include(`-${jobId}.mrc`); + }) + ); - // verify date (ended running) - const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; - cy.do(resultRow.endedRunning.perform(element => { - const actualDate = element.innerText; - expect(actualDate).to.match(dateString); + // verify date (ended running) + const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; + cy.do(resultRow.endedRunning.perform(element => { + const actualDate = element.innerText; + expect(actualDate).to.match(dateString); - const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); - DateTools.verifyDate(dateWithUTC, 180000); - })); + const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); + DateTools.verifyDate(dateWithUTC, 180000); + })); + }); }, verifyFailedExportResultCells(resultFileName, recordsCount, jobId, userName = null, jobType = 'instances') { - const resultRow = { - fileName: MultiColumnListCell({ 'row': 0, columnIndex: 0 }), - status: MultiColumnListCell({ 'row': 0, columnIndex: 1 }), - total: MultiColumnListCell({ 'row': 0, columnIndex: 2 }), - exported: MultiColumnListCell({ 'row': 0, columnIndex: 3 }), - failed: MultiColumnListCell({ 'row': 0, columnIndex: 4 }), - jobProfile: MultiColumnListCell({ 'row': 0, columnIndex: 5 }), - endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), - runBy: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), - id: MultiColumnListCell({ 'row': 0, columnIndex: 9 }), - }; - cy.getAdminToken().then(() => { - cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { - const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; - cy.do([ - resultRow.status.is({ content: 'Fail' }), - resultRow.total.is({ content: recordsCount.toString() }), - resultRow.exported.is({ content: '' }), - resultRow.failed.is({ content: recordsCount.toString() }), - resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), - resultRow.runBy.is({ content: userNameToVerify }), - resultRow.id.is({ content: jobId.toString() }) - ]); + getRowByContent(resultFileName).then((row) => { + const exportRow = MultiColumnListRow({ index: row }); + + const resultRow = { + fileName: exportRow.find(MultiColumnListCell({ columnIndex: 0 })), + status: exportRow.find(MultiColumnListCell({ columnIndex: 1 })), + total: exportRow.find(MultiColumnListCell({ columnIndex: 2 })), + exported: exportRow.find(MultiColumnListCell({ columnIndex: 3 })), + failed: exportRow.find(MultiColumnListCell({ columnIndex: 4 })), + jobProfile: exportRow.find(MultiColumnListCell({ columnIndex: 5 })), + endedRunning: exportRow.find(MultiColumnListCell({ columnIndex: 7 })), + runBy: exportRow.find(MultiColumnListCell({ columnIndex: 8 })), + id: exportRow.find(MultiColumnListCell({ columnIndex: 9 })), + }; + cy.getAdminToken().then(() => { + cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { + const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; + cy.do([ + resultRow.status.is({ content: 'Fail' }), + resultRow.total.is({ content: recordsCount.toString() }), + resultRow.exported.is({ content: '' }), + resultRow.failed.is({ content: recordsCount.toString() }), + resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), + resultRow.runBy.is({ content: userNameToVerify }), + resultRow.id.is({ content: jobId.toString() }) + ]); + }); }); - }); - // verify file name - cy.do( - resultRow.fileName.perform(element => { - expect(element.innerText).to.equal(resultFileName); - expect(element.innerText).to.include(`-${jobId}.mrc`); - }) - ); + // verify file name + cy.do( + resultRow.fileName.perform(element => { + expect(element.innerText).to.equal(resultFileName); + expect(element.innerText).to.include(`-${jobId}.mrc`); + }) + ); - // verify date (ended running) - const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; - cy.do(resultRow.endedRunning.perform(element => { - const actualDate = element.innerText; - expect(actualDate).to.match(dateString); + // verify date (ended running) + const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; + cy.do(resultRow.endedRunning.perform(element => { + const actualDate = element.innerText; + expect(actualDate).to.match(dateString); - const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); - DateTools.verifyDate(dateWithUTC, 180000); - })); + const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); + DateTools.verifyDate(dateWithUTC, 180000); + })); + }); }, }; diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index ac6e07cc7d..ca18d62c9c 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -192,12 +192,11 @@ export default { }, byEffectiveLocation(values) { - return cy.do([ - effectiveLocationInput.clickHeader(), - effectiveLocationInput - .find(Checkbox(values ?? this.effectiveLocation.mainLibrary)) - .click(), - ]); + cy.do(effectiveLocationInput.clickHeader()); + // wait to avoid robotic clicks + cy.wait(2000); + cy.do(effectiveLocationInput.find(Checkbox(values ?? this.effectiveLocation.mainLibrary)).click()); + cy.expect(effectiveLocationInput.find(Checkbox(values ?? this.effectiveLocation.mainLibrary)).has({ checked: true })); }, byLanguage(lang) { @@ -630,8 +629,8 @@ export default { ]); }, - filterHoldingsByPermanentLocation:(location) => { - cy.do(Button({ id:'accordion-toggle-button-holdingsPermanentLocation' }).click()); + filterHoldingsByPermanentLocation: (location) => { + cy.do(Button({ id: 'accordion-toggle-button-holdingsPermanentLocation' }).click()); // need to wait until data will be loaded cy.wait(1000); cy.do( @@ -642,7 +641,7 @@ export default { holdingsPermanentLocationAccordion.find(TextField()).click(); cy.do(holdingsPermanentLocationAccordion.find(Checkbox(location)).click()); }, - checkRowsCount:(expectedRowsCount) => { + checkRowsCount: (expectedRowsCount) => { cy.expect([ instancesList.find(MultiColumnListRow({ index: expectedRowsCount - 1 })).exists(), instancesList.find(MultiColumnListRow({ index: expectedRowsCount })).absent() From 79428bc3ac234a7bf9d46bff37afba638f0d7cf1 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:17:38 +0300 Subject: [PATCH 051/437] Fat 7407 (#1482) * added method for waiting * added reload * changed methos with checking status * fixed C359209 * deleted line * fixed * fixed linter issue * added cy.reload --- ...mport-file-for-create-invoice-record.cy.js | 8 ++--- .../e2e/field-protection-overrides.cy.js | 2 ++ .../e2e/match-on-holdings-856-u.cy.js | 4 ++- .../e2e/mrc-import-with-matching-999ff.cy.js | 4 ++- ...ndling-for-new-and-update-srs-record.cy.js | 4 +++ ...it-file-and-reimport-to-update-items.cy.js | 27 +++++++------- .../field-protection-modification.cy.js | 2 ++ ...stopping-running-job-and-deleting-it.cy.js | 2 +- .../match-on-oclc-and-update-instance.cy.js | 2 ++ ...-records-do-or-do-not-have-999-field.cy.js | 35 ++++++++++++------- ...t-summury-table-for-updating-actions.cy.js | 1 + ...ile-only-involves-holdings-and-items.cy.js | 3 ++ ...-limited-permissions-can-import-file.cy.js | 2 +- .../update-effective-location-for-item.cy.js | 2 +- .../import-by-oclc-source-folio.cy.js | 6 ++-- .../data_import/job_profiles/newJobProfile.js | 1 + .../fragments/data_import/logs/fileDetails.js | 4 +-- .../fragments/inventory/instanceRecordView.js | 9 +++-- .../fragments/inventory/inventoryInstance.js | 1 + .../inventory/inventorySearchAndFilter.js | 3 -- 20 files changed, 76 insertions(+), 46 deletions(-) diff --git a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js index b58a9d04d4..260714ed39 100644 --- a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js @@ -23,12 +23,12 @@ import Users from '../../../support/fragments/users/users'; describe('data-import', () => { describe('End to end scenarios', () => { const quantityOfItems = '1'; - const fileName = `C343338autotestFile.${getRandomPostfix()}.edi`; + const fileName = `C343338 autotestFile.${getRandomPostfix()}.edi`; const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.gobi; let user = {}; const mappingProfile = { - name:`autoTestMappingProf.${getRandomPostfix()}`, + name:`C343338 autoTestMappingProf.${getRandomPostfix()}`, incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, existingRecordType:FOLIO_RECORD_TYPE.INVOICE, description:'', @@ -37,12 +37,12 @@ describe('data-import', () => { paymentMethod: PAYMENT_METHOD.CASH }; const actionProfile = { - name: `autoTestActionProf.${getRandomPostfix()}`, + name: `C343338 autoTestActionProf.${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INVOICE }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `autoTestJobProf.${getRandomPostfix()}`, + profileName: `C343338 autoTestJobProf.${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT }; 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 4e1f832bb4..7e3409be55 100644 --- a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js @@ -283,6 +283,7 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); InstanceRecordView.verifyAdministrativeNote(administrativeNote); InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 2); @@ -313,6 +314,7 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); InstanceRecordView.verifyAdministrativeNote(administrativeNote); InstanceRecordView.verifyAdministrativeNote(updatedAdministativeNote); resourceIdentifiers.forEach(element => { 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 5d0c8cf07b..cfd3981e0e 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 @@ -22,6 +22,7 @@ import TopMenu from '../../../support/fragments/topMenu'; 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 InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; describe('data-import', () => { describe('End to end scenarios', () => { @@ -180,7 +181,8 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); - InventoryInstance.openHoldingView(); + InstanceRecordView.verifyInstancePaneExists(); + InstanceRecordView.openHoldingView(); HoldingsRecordView.checkCallNumber('ONLINE'); }); }); 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 312756ab29..f889c47738 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 @@ -15,6 +15,7 @@ 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 InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; describe('data-import', () => { @@ -125,6 +126,7 @@ describe('data-import', () => { // download .csv file cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.saveUUIDs(); ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); FileManager.deleteFolder(Cypress.config('downloadsFolder')); @@ -170,7 +172,7 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); - + InstanceRecordView.verifyInstancePaneExists(); // ensure the fields created in Field mapping profile exists in inventory InventorySearchAndFilter.checkInstanceDetails(); }); 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 bca180da2e..6e0e83c111 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 @@ -22,6 +22,7 @@ import InventoryViewSource from '../../../support/fragments/inventory/inventoryV import ExportFile from '../../../support/fragments/data-export/exportFile'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import FileManager from '../../../support/utils/fileManager'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; describe('data-import', () => { describe('Importing MARC Bib files', () => { @@ -137,6 +138,7 @@ describe('data-import', () => { // check fields are absent in the view source cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); 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 @@ -199,6 +201,7 @@ describe('data-import', () => { // check instance is updated cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); InventoryInstance.checkIsInstanceUpdated(); // verify table data in marc bibliographic source InventoryInstance.viewSource(); @@ -210,6 +213,7 @@ describe('data-import', () => { // export instance cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHridForReimport); + InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.closeInstanceDetailPane(); InventorySearchAndFilter.selectResultCheckboxes(1); InventorySearchAndFilter.exportInstanceAsMarc(); 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 61dca2e2d2..fde8ae5aa5 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 @@ -22,17 +22,21 @@ import NewJobProfile from '../../../support/fragments/data_import/job_profiles/n import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import FileManager from '../../../support/utils/fileManager'; import ExportFile from '../../../support/fragments/data-export/exportFile'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import GenerateIdentifierCode from '../../../support/utils/generateIdentifierCode'; describe('data-import', () => { describe('Importing MARC Bib files', () => { let instanceHrid; const quantityOfItems = '1'; + const uniqSubject = `35678123678${GenerateIdentifierCode.getRandomIdentifierCode()}`; + const filePathForUpload = 'mrcFileForC11123.mrc'; const instance = { instanceTitle: 'Love enough / Dionne Brand.', - instanceSubject: '35678123678', + instanceSubject: uniqSubject, holdingsLocation: `${LOCATION_NAMES.MAIN_LIBRARY_UI} >`, itemStatus: ITEM_STATUS_NAMES.AVAILABLE }; @@ -40,6 +44,7 @@ describe('data-import', () => { const recordType = 'MARC_BIBLIOGRAPHIC'; const note = 'Test administrative note for item'; // unique file name + const editedMarcFileNameForCreate = `C11123 autotestFile.${getRandomPostfix()}.mrc`; const marcFileForCreate = `C11123 autoTestFile.${getRandomPostfix()}.mrc`; const nameForCSVFile = `C11123 autotestFile${getRandomPostfix()}.csv`; const nameMarcFileForUpload = `C11123 autotestFile.${getRandomPostfix()}.mrc`; @@ -201,17 +206,6 @@ describe('data-import', () => { cy.loginAsAdmin(); cy.getAdminToken() .then(() => { - InventorySearchAndFilter.getInstancesBySubjectViaApi(instance.instanceSubject) - .then(instances => { - if (instances) { - instances.forEach(({ id }) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(id); - }); - } - }); - testData.jobProfileForCreate = jobProfileForCreate; testData.forEach(specialPair => { @@ -223,11 +217,16 @@ describe('data-import', () => { .then((bodyWithjobProfile) => { testData.jobProfileForCreate.id = bodyWithjobProfile.body.id; }); + + // change file to add uniq subject + DataImport.editMarcFile(filePathForUpload, editedMarcFileNameForCreate, + ['35678123678'], [uniqSubject]); + // 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('mrcFileForC11123.mrc', marcFileForCreate); + DataImport.uploadFile(editedMarcFileNameForCreate, marcFileForCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(marcFileForCreate); @@ -278,6 +277,7 @@ describe('data-import', () => { ItemRecordView.closeDetailView(); InventorySearchAndFilter.searchByParameter('Subject', instance.instanceSubject); + InventorySearchAndFilter.selectResultCheckboxes(1); InventorySearchAndFilter.saveUUIDs(); ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); @@ -334,6 +334,7 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); InventoryInstance.openHoldingsAccordion(`${LOCATION_NAMES.MAIN_LIBRARY_UI} >`); InventoryInstance.openItemByBarcode('No barcode'); ItemRecordView.checkItemAdministrativeNote(note); 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 942f7cc943..ba0aca9129 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 @@ -18,6 +18,7 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; import Users from '../../../support/fragments/users/users'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; describe('data-import', () => { describe('Importing MARC Bib files', () => { @@ -148,6 +149,7 @@ describe('data-import', () => { // check fields are absent in the view source cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); // verify table data in marc bibliographic source InventoryInstance.viewSource(); fieldsForDelete.forEach(fieldNumber => { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js index a104388358..9313b8f7bd 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js @@ -58,7 +58,7 @@ describe('data-import', () => { DataImport.openDeleteImportLogsModal(); DataImport.confirmDeleteImportLogs(); InteractorsTools.checkCalloutMessage(`${numberOfLogsToDelete} data import logs have been successfully deleted.`); - + cy.reload(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); DataImport.uploadFile('oneMarcBib.mrc', smallFileName); 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 c68ecb77e5..b30d331b2f 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 @@ -166,6 +166,7 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); InstanceRecordView.verifyCatalogedDate(itemsForCreateInstance.catalogedDateUi); InstanceRecordView.verifyInstanceStatusTerm(itemsForCreateInstance.statusTerm); InstanceRecordView.verifyStatisticalCode(itemsForCreateInstance.statisticalCodeUI); @@ -216,6 +217,7 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); InstanceRecordView.verifyInstanceStatusTerm(itemsForUpdateInstance.statusTerm); InstanceRecordView.verifyStatisticalCode(itemsForUpdateInstance.statisticalCodeUI); 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 16be3903a8..e057a5c593 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 @@ -15,11 +15,28 @@ describe('data-import', () => { describe('Importing MARC Holdings files', () => { let user; let instanceHrid; - const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + const filePathForUpload = 'oneMarcBib.mrc'; + const fileName = `C359209 autotestFileName.${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', () => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + // upload a marc file for creating of the new instance, holding and item + DataImport.uploadFile(filePathForUpload, fileName); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.openFileDetails(fileName); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); + cy.logout(); + cy.createTempUser([ permissions.inventoryAll.gui, permissions.moduleDataImportEnabled.gui, @@ -30,11 +47,7 @@ describe('data-import', () => { .then(userProperties => { user = userProperties; - DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); cy.login(user.username, user.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - JobProfiles.waitFileIsImported(fileName); - Logs.openFileDetails(fileName); - FileDetails.openInstanceInInventory('Created'); }); }); @@ -45,14 +58,10 @@ describe('data-import', () => { it('C359209 Checking the import to Create MARC Holdings records, when some incoming records do or do not have 999 ff fields (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; - - DataImport.editMarcFile('marcFileForC359209.mrc', - editedMarcFileName, - ['test1', 'test2', 'test3', 'test4'], - [instanceHrid, instanceHrid, instanceHrid, instanceHrid]); - }); + DataImport.editMarcFile('marcFileForC359209.mrc', + editedMarcFileName, + ['test1', 'test2', 'test3', 'test4'], + [instanceHrid, instanceHrid, instanceHrid, instanceHrid]); // upload a marc file for creating holdings cy.visit(TopMenu.dataImportPath); 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 c98d59824a..25aaebd303 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 @@ -382,6 +382,7 @@ describe('data-import', () => { // download .csv file cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.saveUUIDs(); ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); }); 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 61013079bb..a0b7582793 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 @@ -31,6 +31,7 @@ import FileManager from '../../../support/utils/fileManager'; import ExportFile from '../../../support/fragments/data-export/exportFile'; import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; describe('data-import', () => { describe('Log details', () => { @@ -392,6 +393,7 @@ describe('data-import', () => { // update the first record cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[0]); + InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.saveUUIDs(); ExportFile.downloadCSVFile(csvFileNameForFirstRecord, 'SearchInstanceUUIDs*'); @@ -431,6 +433,7 @@ describe('data-import', () => { // update the second record cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[1]); + InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.saveUUIDs(); ExportFile.downloadCSVFile(csvFileNameForSecondRecord, 'SearchInstanceUUIDs*'); FileManager.deleteFolder(Cypress.config('downloadsFolder')); 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 91eb5f5c21..2cfb360cd3 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 @@ -70,7 +70,7 @@ describe('data-import', () => { }); }); - after(() => { + after('delete test data', () => { Users.deleteViaApi(firstUser.userId); Users.deleteViaApi(secondUser.userId); // delete generated profiles diff --git a/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js b/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js index 3b237fc6a3..0296e8cf24 100644 --- a/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js +++ b/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js @@ -86,7 +86,7 @@ describe('inventory', () => { it('C3501 An item is being moved from one library location to another. Update the effective location for the item (folijet) (prokopovych)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventorySearchAndFilter.selectSearchResultItem(); + InventoryInstance.waitInstanceRecordViewOpened(itemData.instanceTitle); InventoryInstance.openHoldingView(); HoldingsRecordView.edit(); HoldingsRecordEdit.changePermanentLocation(anotherPermanentLocation); diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js index 4ebe9489cf..eb2145b92f 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js @@ -66,12 +66,10 @@ describe('inventory', () => { InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceRecord.instanceTitle); InventorySearchAndFilter.selectSearchResultItem(); InventoryInstance.startOverlaySourceBibRecord(); - InventoryInstance.importWithOclc(oclcRecordData.oclc); + InventoryInstance.overlayWithOclc(oclcRecordData.oclc); InventoryInstance.checkCalloutMessage(`Record ${oclcRecordData.oclc} updated. Results may take a few moments to become visible in Inventory`); - // need to wait because after the import the data in the instance is displayed for a long time - // https://issues.folio.org/browse/MODCPCT-73 - cy.wait(10000); + cy.reload(); InventoryInstance.waitInstanceRecordViewOpened(oclcRecordData.title); InventoryInstance.verifyLastUpdatedDate(); InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); diff --git a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js index f2713682f1..8de5cffbc4 100644 --- a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js +++ b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js @@ -50,6 +50,7 @@ function linkMatchProfileForSubMatches(matchProfileName, forMatchesOrder = 0) { } function linkActionProfileForMatches(actionProfileName, forMatchesOrder = 0) { + cy.wait(3000); cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(actionProfileName); diff --git a/cypress/support/fragments/data_import/logs/fileDetails.js b/cypress/support/fragments/data_import/logs/fileDetails.js index 3214c34c5a..67440cbc8e 100644 --- a/cypress/support/fragments/data_import/logs/fileDetails.js +++ b/cypress/support/fragments/data_import/logs/fileDetails.js @@ -131,7 +131,7 @@ const checkStatusInColumn = (specialStatus, specialColumnName, rowIndex = 0) => cy.then(() => specialColumnName.index()) .then((index) => cy.expect(resultsList.find(MultiColumnListRow({ index: rowIndex })) .find(MultiColumnListCell({ columnIndex: index })) - .has({ content: specialStatus }))); + .has({ content: including(specialStatus) }))); }; function checkItemsStatusesInResultList(rowIndex, itemStatuses) { @@ -140,7 +140,7 @@ function checkItemsStatusesInResultList(rowIndex, itemStatuses) { itemStatuses.forEach((itemStatus, columnIndex) => { cy.expect(resultsList .find(MultiColumnListRow({ index: rowIndex })) - .find(MultiColumnListCell({ columnIndex: indexes[columnIndex], content: itemStatus })) + .find(MultiColumnListCell({ columnIndex: indexes[columnIndex], content: including(itemStatus) })) .exists()); }); } diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index 10e0b04c1e..14b4984952 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -24,6 +24,7 @@ const viewSourceButton = Button('View source'); const instanceAdministrativeNote = MultiColumnList({ id: 'administrative-note-list' }); const instanceNote = MultiColumnList({ id: 'list-instance-notes-0' }); const electronicAccessAccordion = Accordion('Electronic access'); +const instanceDetailsPane = Pane({ id:'pane-instancedetails' }); const verifyResourceTitle = value => { cy.expect(KeyValue('Resource title').has({ value })); @@ -93,7 +94,7 @@ const verifyNatureOfContent = (value) => { }; const verifyInstanceRecordViewOpened = () => { - cy.expect(Pane({ id:'pane-instancedetails' }).exists()); + cy.expect(instanceDetailsPane.exists()); }; const verifyElectronicAccess = (uriValue, linkText = 'No value set-', rowNumber = 0) => { @@ -143,9 +144,13 @@ export default { cy.expect(Accordion({ label: including(`Holdings: ${holdingToBeOpened}`) }).exists()); }, verifyIsInstanceOpened:(title) => { - cy.expect(Pane({ id:'pane-instancedetails' }).exists()); + cy.expect(instanceDetailsPane.exists()); cy.expect(Pane({ titleLabel: including(title) }).exists()); }, + verifyInstancePaneExists:() => { + cy.wait(1500); + cy.expect(instanceDetailsPane.exists()); + }, verifyCalloutMessage: (number) => { cy.expect(Callout({ textContent: including(`Record ${number} created. Results may take a few moments to become visible in Inventory`) }) .exists()); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index a2f7ed76c8..1567e55d77 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -210,6 +210,7 @@ const checkInstanceNotes = (noteType, noteContent) => { }; const waitInstanceRecordViewOpened = (title) => { + cy.wait(1500); cy.expect(instanceDetailsPane.exists()); cy.expect(Pane({ titleLabel: including(title) }).exists()); }; diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index ca18d62c9c..126a7d2ef9 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -72,9 +72,6 @@ const searchInstanceByHRID = (id) => { TextField({ id: 'input-inventory-search' }).fillIn(id), searchButton.click(), ]); - cy.wait(1000); - cy.do(searchButton.click()); - InventoryInstances.waitLoading(); }; const searchHoldingsByHRID = (hrid) => { From bcbd81aa4cc049019345ba38c4c47e8a6e878f5f Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Thu, 17 Aug 2023 19:22:02 +0300 Subject: [PATCH 052/437] FAT-7532-Fixes (#1490) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7532: waits added * FAT-7532: more waits added, precondition updated * FAT-7532: removed steps to delete import logs from Spitfire tests * FAT-7532: updated methods * FAT-7532: alt upload method * FAT-7532: updated method added to export * FAT-7532: removed method * FAT-7532: updated import method added * FAT-7532: changed back URLs * FAT-7532: import method updated * FAT-7532: added comment to C683 * FAT-7532: unused import removed --- .../importing-marc-authority-files.cy.js | 7 ------ ...-edit-derive-bib-with-minimum-fields.cy.js | 4 ---- .../e2e/ideyalabs/eholdings/G_eholdings.cy.js | 2 ++ .../holdings/create-new-marc-holdings.cy.js | 4 ---- .../holdings/edit-marc-holdings.cy.js | 4 ---- .../search/browse-contributors-linked.cy.js | 6 ----- .../search/browse-deleted-contributors.cy.js | 5 ---- .../search/browse-in-inventory.cy.js | 4 ---- .../search/search-in-inventory-linked.cy.js | 18 ++++++--------- .../search/search-in-inventory.cy.js | 7 ------ .../e2e/inventory/search/subject-browse.cy.js | 4 ---- .../marc-authority-update.cy.js | 6 ----- ...e_two_marc_bib_linked_marc_authority.cy.js | 7 ------ ...d100-to-authority100-with-subfield-0.cy.js | 4 ---- ...d240-to-authority100-with-subfield-t.cy.js | 4 ---- .../marc-authority-advanced-search.cy.js | 5 ---- .../marc-authority-delete.cy.js | 7 ------ .../marc-authority-edit-linked.cy.js | 23 +++++++++++-------- .../marc-authority/marc-authority-edit.cy.js | 5 ---- .../marc-authority-import.cy.js | 7 ------ .../marc-authority/marc-authority-sort.cy.js | 5 ---- .../marc-authority/marc-authority-view.cy.js | 5 ---- .../e2e/marc-authority/marc-authority.cy.js | 5 ---- .../marc-authority/marc-bibliographic.cy.js | 5 ---- .../modify-marc-file-of-deleted-user.cy.js | 5 ---- ...110-field-using-number-of-title-link.cy.js | 7 ------ ...130-field-using-number-of-title-link.cy.js | 7 ------ ...610-field-using-number-of-title-link.cy.js | 7 ------ ...650-field-using-number-of-title-link.cy.js | 7 ------ ...711-field-using-number-of-title-link.cy.js | 7 ------ ...n-marc-authority-browse-by-corporate.cy.js | 5 ---- ...ug-in-marc-authority-browse-by-genre.cy.js | 5 ---- ...-authority-browse-by-geographic-name.cy.js | 5 ---- ...-marc-authority-browse-by-name-title.cy.js | 5 ---- ...rc-authority-browse-by-personal-name.cy.js | 5 ---- ...-in-marc-authority-browse-by-subject.cy.js | 7 ------ ...rc-authority-browse-by-uniform-title.cy.js | 5 ---- ...-search-by-childrens-subject-heading.cy.js | 5 ---- ...ug-in-marc-authority-search-by-genre.cy.js | 5 ---- ...-in-marc-authority-search-by-subject.cy.js | 5 ---- .../plug-in-marc-authority-search.cy.js | 4 ---- cypress/e2e/quickmark/holding-quickmark.cy.js | 7 +----- .../fragments/data_import/dataImport.js | 18 +++++++++++++++ .../fragments/inventory/inventoryInstance.js | 7 ++++-- .../fragments/marcAuthority/marcAuthority.js | 2 ++ cypress/support/fragments/quickMarcEditor.js | 5 +++- 46 files changed, 52 insertions(+), 236 deletions(-) diff --git a/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js index 84cceff019..9d73f9f5e2 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/importing-marc-authority-files.cy.js @@ -47,13 +47,6 @@ describe('data-import', () => { cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); }); - afterEach('Deleting data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - }); - after('Deleting data', () => { createdAuthorityIDs.forEach(id => { MarcAuthority.deleteViaAPI(id); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js index 565461af46..2c98495fa3 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-edit-derive-bib-with-minimum-fields.cy.js @@ -47,10 +47,6 @@ describe('data-import', () => { createdRecordIDs.forEach(recordID => { InventoryInstance.deleteInstanceViaApi(recordID); }); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C387435 Import and edit/derive "MARC Bib" record having only required fields (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js index ffa4176100..5551752393 100644 --- a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js +++ b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js @@ -21,6 +21,8 @@ describe.skip('Create a custom package', () => { after('Deleting created Package', () => { eHolding.deletePackage(); }); + // test below is implemented in scope of FAT-1303 in: + // cypress/e2e/eholdings/eholdings-packages-search.cy.js it( 'C683 Search packages for [JSTOR]. Filter results to only show selected packages (spitfire)', { tags: [testTypes.ideaLabsTests] }, diff --git a/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js b/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js index 40c332cb54..3fdf558696 100644 --- a/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js +++ b/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js @@ -53,10 +53,6 @@ describe('Create holding records with MARC source', () => { Users.deleteViaApi(user.userId); cy.deleteHoldingRecordViaApi(recordIDs[1]); InventoryInstance.deleteInstanceViaApi(recordIDs[0]); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C387450 "008" field existence validation when create new "MARC Holdings" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire], retries: 1 }, () => { diff --git a/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js index effc0de4ea..f8c1535799 100644 --- a/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js +++ b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js @@ -67,10 +67,6 @@ describe('MARC -> MARC Holdings', () => { 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] }, () => { diff --git a/cypress/e2e/inventory/search/browse-contributors-linked.cy.js b/cypress/e2e/inventory/search/browse-contributors-linked.cy.js index 7582825205..687a802b14 100644 --- a/cypress/e2e/inventory/search/browse-contributors-linked.cy.js +++ b/cypress/e2e/inventory/search/browse-contributors-linked.cy.js @@ -110,12 +110,6 @@ describe('Inventory: Contributors Browse', () => { createdRecordIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(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('C359596 Verify that contributors with the same "Name", "Name type" and different "authorityID" will display in different rows in the response (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire], retries: 1 }, () => { diff --git a/cypress/e2e/inventory/search/browse-deleted-contributors.cy.js b/cypress/e2e/inventory/search/browse-deleted-contributors.cy.js index f6c4d8f59e..5593dcb952 100644 --- a/cypress/e2e/inventory/search/browse-deleted-contributors.cy.js +++ b/cypress/e2e/inventory/search/browse-deleted-contributors.cy.js @@ -54,11 +54,6 @@ describe('Inventory -> Contributors Browse', () => { after('Deleting created user and record', () => { Users.deleteViaApi(testData.userProperties.userId); InventoryInstance.deleteInstanceViaApi(importedInstanceID[0]); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C357021 Verify that deleted Contributor from "MARC Bibliographic" record not displayed at browse result list (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/inventory/search/browse-in-inventory.cy.js b/cypress/e2e/inventory/search/browse-in-inventory.cy.js index e8540511f6..7d54a0cd27 100644 --- a/cypress/e2e/inventory/search/browse-in-inventory.cy.js +++ b/cypress/e2e/inventory/search/browse-in-inventory.cy.js @@ -100,10 +100,6 @@ describe('Browse in Inventory', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C388531 Verify that contributors with the same "Name" , "Name type" and "authorityID" will display as one row (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js index ba93a81df6..b39a2a3141 100644 --- a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js +++ b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js @@ -38,13 +38,13 @@ describe('Search in Inventory', () => { const marcFiles = [ { marc: 'marcBibFileC375256.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC375256.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create instance and SRS MARC Bib', numberOfRecords: 4 }, { marc: 'marcAuthFileC375256_1.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC375256.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'Bible. Polish. Biblia PÅ‚ocka C375256', authority010FieldValue: 'n92085235375256', @@ -52,7 +52,7 @@ describe('Search in Inventory', () => { }, { marc: 'marcAuthFileC375256_2.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC375256.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'Abraham, Angela, C375256 Hosanna Bible', authority010FieldValue: 'n99036055375256', @@ -69,8 +69,7 @@ describe('Search in Inventory', () => { testData.userProperties = createdUserProperties; marcFiles.forEach(marcFile => { cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { - DataImport.uploadFile(marcFile.marc, marcFile.fileName); - JobProfiles.waitLoadingList(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(marcFile.fileName); @@ -88,6 +87,8 @@ describe('Search in Inventory', () => { InventoryInstances.waitContentLoading(); InventoryInstance.searchByTitle(createdRecordIDs[0]); InventoryInstances.selectInstance(); + // here and below - wait for detail view to be fully loaded + cy.wait(1500); InventoryInstance.editMarcBibliographicRecord(); InventoryInstance.verifyAndClickLinkIcon(testData.tag130); MarcAuthorities.switchToSearch(); @@ -100,6 +101,7 @@ describe('Search in Inventory', () => { QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.searchByTitle(createdRecordIDs[1]); InventoryInstances.selectInstance(); + cy.wait(1500); InventoryInstance.editMarcBibliographicRecord(); InventoryInstance.verifyAndClickLinkIcon(testData.tag240); MarcAuthorities.switchToSearch(); @@ -122,12 +124,6 @@ describe('Search in Inventory', () => { 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] }, () => { diff --git a/cypress/e2e/inventory/search/search-in-inventory.cy.js b/cypress/e2e/inventory/search/search-in-inventory.cy.js index b83ebc0529..6a522be504 100644 --- a/cypress/e2e/inventory/search/search-in-inventory.cy.js +++ b/cypress/e2e/inventory/search/search-in-inventory.cy.js @@ -30,13 +30,6 @@ describe('Search in Inventory', () => { cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); }); - afterEach('Deleting data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - }); - after('Deleting data', () => { Users.deleteViaApi(testData.userProperties.userId); createdInstanceIDs.forEach(id => { diff --git a/cypress/e2e/inventory/search/subject-browse.cy.js b/cypress/e2e/inventory/search/subject-browse.cy.js index ac6d1766cc..8762c7cc6d 100644 --- a/cypress/e2e/inventory/search/subject-browse.cy.js +++ b/cypress/e2e/inventory/search/subject-browse.cy.js @@ -51,10 +51,6 @@ describe('Inventory > Subject Browse', () => { InventoryInstance.deleteInstanceViaApi(id); }); Users.deleteViaApi(testData.user.userId); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C350387 Verify the "Browse subjects" result list (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js b/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js index 7c690e9c58..d8e0ad30a1 100644 --- a/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js +++ b/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js @@ -152,12 +152,6 @@ describe('Data Import - Update MARC Authority files', () => { 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(); - } FileManager.deleteFolder(Cypress.config('downloadsFolder')); FileManager.deleteFile(`cypress/fixtures/${testData.modifiedMarcFile}`); diff --git a/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js b/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js index 0cc67ed1ad..69208896f4 100644 --- a/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js +++ b/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js @@ -133,13 +133,6 @@ describe('MARC -> MARC Authority', () => { InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[i]) } MarcAuthority.deleteViaAPI(createdAuthorityIDs[2]); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - for (let i = 0; i < 2; i++) { - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - } }); it('C369084 Delete authorized "MARC Authority" record that has two linked field in different "MARC Bib" records (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js b/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js index 35cdc799ab..bc430a2f52 100644 --- a/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js +++ b/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js @@ -80,10 +80,6 @@ describe('Manual Linking Bib field to Authority 1XX', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C365134 Link "MARC Bib" field without "$0" subfield to "MARC Authority" record. "Authority source file" value from the pre-defined list (100 field to 100) (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js b/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js index 346b137485..542b01f0b7 100644 --- a/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js +++ b/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js @@ -80,10 +80,6 @@ describe('Manual Linking Bib field to Authority 1XX', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C369092 Link the "240" of "MARC Bib" field with "100" field with a "$t" of "MARC Authority" record. (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js b/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js index c286cd3754..6b7015d6a0 100644 --- a/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js @@ -64,11 +64,6 @@ describe('MARC Authority - Advanced Search', () => { }); after(() => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - createdAuthorityID.forEach(id => { MarcAuthority.deleteViaAPI(id); }); Users.deleteViaApi(testData.userProperties.userId); }); diff --git a/cypress/e2e/marc-authority/marc-authority-delete.cy.js b/cypress/e2e/marc-authority/marc-authority-delete.cy.js index 0eb0fb5252..9ee9de9a78 100644 --- a/cypress/e2e/marc-authority/marc-authority-delete.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-delete.cy.js @@ -37,13 +37,6 @@ describe('MARC Authority Delete', () => { cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); }); - afterEach('Deleting data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - }); - after('Deleting created user', () => { Users.deleteViaApi(testData.userProperties.userId); }); 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 afea570264..45f655f476 100644 --- a/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js @@ -41,32 +41,32 @@ describe('MARC Authority -> Edit linked Authority record', () => { const marcFiles = [ { marc: 'marcBibFileC376596.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC376596.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create instance and SRS MARC Bib', instanceTitle: 'The coronation of Queen Elizabeth II C376596' }, { marc: 'marcBibFileC374159.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC374159.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create instance and SRS MARC Bib', instanceTitle: 'Titanic / written and directed by James Cameron. C374159' }, { marc: 'marcBibFileC375173.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC375173.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create instance and SRS MARC Bib', instanceTitle: 'C375173 Farnese book of hours : MS M.69 of the Pierpont Morgan Library New York / commentary, William M. Voelkle, Ivan Golub.' }, { marc: 'marcAuthFileC376596.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC376596.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'Elizabeth C376596', authority010FieldValue: 'n80126296376596', }, { marc: 'marcAuthFileC374159.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC374159.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'Drama C374159', authority010FieldValue: 'gf2014026297374159', @@ -74,7 +74,7 @@ describe('MARC Authority -> Edit linked Authority record', () => { }, { marc: 'marcAuthFileC375173.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `testMarcFileC375173.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'C375173 Clovio, Giulio, 1498-1578', authority001FieldValue: 'n83073672375173', @@ -97,8 +97,7 @@ describe('MARC Authority -> Edit linked Authority record', () => { marcFiles.forEach(marcFile => { cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { - DataImport.uploadFile(marcFile.marc, marcFile.fileName); - JobProfiles.waitLoadingList(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(marcFile.fileName); @@ -114,6 +113,8 @@ describe('MARC Authority -> Edit linked Authority record', () => { InventoryInstances.waitContentLoading(); InventoryInstance.searchByTitle(createdRecordIDs[0]); InventoryInstances.selectInstance(); + // here and below - wait for detail view to be fully loaded + cy.wait(1500); InventoryInstance.editMarcBibliographicRecord(); InventoryInstance.verifyAndClickLinkIcon(testData.tag700); MarcAuthorities.switchToSearch(); @@ -127,6 +128,7 @@ describe('MARC Authority -> Edit linked Authority record', () => { InventoryInstance.searchByTitle(createdRecordIDs[1]); InventoryInstances.selectInstance(); + cy.wait(1500); InventoryInstance.editMarcBibliographicRecord(); InventoryInstance.verifyAndClickLinkIcon(testData.tag655); MarcAuthorities.switchToSearch(); @@ -140,6 +142,7 @@ describe('MARC Authority -> Edit linked Authority record', () => { InventoryInstance.searchByTitle(createdRecordIDs[2]); InventoryInstances.selectInstance(); + cy.wait(1500); InventoryInstance.editMarcBibliographicRecord(); InventoryInstance.verifyAndClickLinkIcon(testData.tag600); MarcAuthorities.switchToSearch(); @@ -222,14 +225,14 @@ describe('MARC Authority -> Edit linked Authority record', () => { MarcAuthorities.searchBy('Keyword', marcFiles[5].authorityHeading); MarcAuthorities.selectTitle(marcFiles[5].authorityHeading); MarcAuthority.edit(); - // wait untill record is fully loaded - cy.wait(1500); QuickMarcEditor.updateExistingField(testData.tag100, testData.updated100FieldValue); QuickMarcEditor.updateExistingTagValue(5, testData.updatedTagName); QuickMarcEditor.checkContent(testData.updated100FieldValue, 8); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.deleteFieldAndCheck(5, testData.updatedTagName); QuickMarcEditor.afterDeleteNotification(testData.updatedTagName); + // if clicked too fast, delete modal might not appear + cy.wait(1000); QuickMarcEditor.clickSaveAndCloseThenCheck(1); QuickMarcEditor.clickRestoreDeletedField(); QuickMarcEditor.checkDeleteModalClosed(); diff --git a/cypress/e2e/marc-authority/marc-authority-edit.cy.js b/cypress/e2e/marc-authority/marc-authority-edit.cy.js index a51ec73515..dea38321b7 100644 --- a/cypress/e2e/marc-authority/marc-authority-edit.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-edit.cy.js @@ -91,11 +91,6 @@ describe('MARC Authority -> Edit Authority record', () => { }); after('', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - createdAuthorityID.forEach(id => { MarcAuthority.deleteViaAPI(id); }); Users.deleteViaApi(testData.userProperties.userId); marcFieldProtectionRules.forEach(ruleID => { diff --git a/cypress/e2e/marc-authority/marc-authority-import.cy.js b/cypress/e2e/marc-authority/marc-authority-import.cy.js index 9936dd9cd9..36a25e48f9 100644 --- a/cypress/e2e/marc-authority/marc-authority-import.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-import.cy.js @@ -43,13 +43,6 @@ describe('Data Import - Importing MARC Authority files', () => { cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); }); - afterEach('Deleting data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - }); - after('Deleting data', () => { Users.deleteViaApi(testData.userProperties.userId); createdAuthorityIDs.forEach(id => { diff --git a/cypress/e2e/marc-authority/marc-authority-sort.cy.js b/cypress/e2e/marc-authority/marc-authority-sort.cy.js index 6e1f404b0a..4830a5e728 100644 --- a/cypress/e2e/marc-authority/marc-authority-sort.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-sort.cy.js @@ -94,11 +94,6 @@ describe('MARC Authority Sort', () => { }); after(() => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - createdAuthorityIDs.forEach(id => { MarcAuthority.deleteViaAPI(id); }); Users.deleteViaApi(testData.userProperties.userId); }); diff --git a/cypress/e2e/marc-authority/marc-authority-view.cy.js b/cypress/e2e/marc-authority/marc-authority-view.cy.js index 28ecf26146..fb2ec56aea 100644 --- a/cypress/e2e/marc-authority/marc-authority-view.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-view.cy.js @@ -31,11 +31,6 @@ describe('MARC Authority management', () => { Users.deleteViaApi(userData.id); InventoryInstance.deleteInstanceViaApi(instanceID); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C350967 quickMARC: View MARC bibliographic record (spitfire)', { tags: [TestTypes.smoke, Features.authority, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/marc-authority.cy.js b/cypress/e2e/marc-authority/marc-authority.cy.js index 5bb5e4334d..45506025a8 100644 --- a/cypress/e2e/marc-authority/marc-authority.cy.js +++ b/cypress/e2e/marc-authority/marc-authority.cy.js @@ -79,11 +79,6 @@ describe('Importing MARC Authority files', () => { }); after('Deleting data', () => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - JobProfiles.deleteJobProfile(createdJobProfile.profileName); if (createdAuthorityID) MarcAuthority.deleteViaAPI(createdAuthorityID); Users.deleteViaApi(testData.userProperties.userId); diff --git a/cypress/e2e/marc-authority/marc-bibliographic.cy.js b/cypress/e2e/marc-authority/marc-bibliographic.cy.js index 742607e375..92409e808d 100644 --- a/cypress/e2e/marc-authority/marc-bibliographic.cy.js +++ b/cypress/e2e/marc-authority/marc-bibliographic.cy.js @@ -42,11 +42,6 @@ describe('MARC -> MARC Bibliographic', () => { }); after(() => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - if (createdInstanceID) InventoryInstance.deleteInstanceViaApi(createdInstanceID); Users.deleteViaApi(testData.userProperties.userId); }); diff --git a/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js index e7820a29cb..36f38872b8 100644 --- a/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js +++ b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js @@ -79,11 +79,6 @@ describe('MARC -> MARC Authority', () => { after('Deleting created user', () => { Users.deleteViaApi(user.userBProperties.userId); MarcAuthority.deleteViaAPI(createdAuthorityIDs[0]); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C358994 Verify that user has access to "quickMARC" when user who imported MARC record has been deleted (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/open-marc-bib-110-field-using-number-of-title-link.cy.js b/cypress/e2e/marc-authority/open-marc-bib-110-field-using-number-of-title-link.cy.js index bb1914815a..4596f77b2e 100644 --- a/cypress/e2e/marc-authority/open-marc-bib-110-field-using-number-of-title-link.cy.js +++ b/cypress/e2e/marc-authority/open-marc-bib-110-field-using-number-of-title-link.cy.js @@ -91,13 +91,6 @@ describe('MARC -> MARC Authority', () => { 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('C375261 "Number of titles" link in "MARC authority" app opens linked "MARC bib" record with controlled "110" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/open-marc-bib-130-field-using-number-of-title-link.cy.js b/cypress/e2e/marc-authority/open-marc-bib-130-field-using-number-of-title-link.cy.js index 1841d1e1eb..5d392722a5 100644 --- a/cypress/e2e/marc-authority/open-marc-bib-130-field-using-number-of-title-link.cy.js +++ b/cypress/e2e/marc-authority/open-marc-bib-130-field-using-number-of-title-link.cy.js @@ -90,13 +90,6 @@ describe('MARC -> MARC Authority', () => { 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('C375268 "Number of titles" link in "MARC authority" app opens linked "MARC bib" record with controlled "130" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/open-marc-bib-610-field-using-number-of-title-link.cy.js b/cypress/e2e/marc-authority/open-marc-bib-610-field-using-number-of-title-link.cy.js index f233f9485c..cfc55bb30a 100644 --- a/cypress/e2e/marc-authority/open-marc-bib-610-field-using-number-of-title-link.cy.js +++ b/cypress/e2e/marc-authority/open-marc-bib-610-field-using-number-of-title-link.cy.js @@ -91,13 +91,6 @@ describe('MARC -> MARC Authority', () => { 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('C375269 "Number of titles" link in "MARC authority" app opens linked "MARC bib" record with controlled "610" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { 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 index 0435319539..86ac4dc199 100644 --- 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 @@ -90,13 +90,6 @@ describe('MARC -> MARC Authority', () => { 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] }, () => { diff --git a/cypress/e2e/marc-authority/open-marc-bib-711-field-using-number-of-title-link.cy.js b/cypress/e2e/marc-authority/open-marc-bib-711-field-using-number-of-title-link.cy.js index b347d7dcd9..de99306fbb 100644 --- a/cypress/e2e/marc-authority/open-marc-bib-711-field-using-number-of-title-link.cy.js +++ b/cypress/e2e/marc-authority/open-marc-bib-711-field-using-number-of-title-link.cy.js @@ -90,13 +90,6 @@ describe('MARC -> MARC Authority', () => { 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('C375265 "Number of titles" link in "MARC authority" app opens linked "MARC bib" record with controlled "711" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js index ffa2c57498..9dcb50ea77 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js @@ -78,11 +78,6 @@ describe('plug-in MARC authority | Browse', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380552 MARC Authority plug-in | Browse using "Corporate/Conference name" option returns only records with the same "Type of heading" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js index 56a0413a89..2398bf3539 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js @@ -75,11 +75,6 @@ describe('plug-in MARC authority | Browse', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380557 MARC Authority plug-in | Browse using "Genre" option returns only records with the same "Type of heading" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js index 59facc5869..9b82465555 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js @@ -74,11 +74,6 @@ describe('plug-in MARC authority | Browse', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380553 MARC Authority plug-in | Browse using "Geographic name" option returns only records with the same "Type of heading" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js index fcae1a685e..d56d76b651 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js @@ -82,11 +82,6 @@ describe('plug-in MARC authority | Browse', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380554 MARC Authority plug-in | Browse using "Name-title" option returns only records with the same "Type of heading" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js index a3e0b88dd4..2af68f80bc 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js @@ -75,11 +75,6 @@ describe('plug-in MARC authority | Browse', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380551 MARC Authority plug-in | Browse using "Personal name" option returns only records with the same "Type of heading" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-subject.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-subject.cy.js index 8175036052..4b6a772743 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-subject.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-subject.cy.js @@ -77,13 +77,6 @@ describe('plug-in MARC authority | Browse', () => { 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('C380556 MARC Authority plug-in | Browse using "Subject" option returns only records with the same "Type of heading" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js index d4e21db55c..29383d2ebd 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js @@ -74,11 +74,6 @@ describe('plug-in MARC authority | Browse', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380555 MARC Authority plug-in | Browse using "Uniform title" option returns only records with the same "Type of heading" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-childrens-subject-heading.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-childrens-subject-heading.cy.js index dd8cc248e3..f679365848 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-childrens-subject-heading.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-childrens-subject-heading.cy.js @@ -80,11 +80,6 @@ describe('plug-in MARC authority | Search', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C359233 MARC Authority plug-in | Search using "Children\'s subject heading" option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js index 6912701656..fcfceb68a1 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js @@ -74,11 +74,6 @@ describe('plug-in MARC authority | Search', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380572 MARC Authority plug-in | Search using "Genre" option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js index 7850dba3d4..6d10f3f50e 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js @@ -80,11 +80,6 @@ describe('plug-in MARC authority | Search', () => { for (let i = 1; i < 65; i++) { MarcAuthority.deleteViaAPI(createdAuthorityIDs[i]); } - - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380571 MARC Authority plug-in | Search using "Subject" option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js index 341a96dfb8..da5022136c 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js @@ -144,10 +144,6 @@ describe('plug-in MARC authority | Search', () => { createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); }); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); }); it('C380565 MARC Authority plug-in | Search for MARC authority records when the user clicks on the "Link" icon (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { diff --git a/cypress/e2e/quickmark/holding-quickmark.cy.js b/cypress/e2e/quickmark/holding-quickmark.cy.js index 23fddddf3a..840da69300 100644 --- a/cypress/e2e/quickmark/holding-quickmark.cy.js +++ b/cypress/e2e/quickmark/holding-quickmark.cy.js @@ -61,12 +61,7 @@ describe('MARC -> MARC Holdings', () => { }); after(() => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); - DataImport.selectLog(); - DataImport.openDeleteImportLogsModal(); - DataImport.confirmDeleteImportLogs(); - - cy.visit(TopMenu.inventoryPath); + cy.loginAsAdmin({ path: TopMenu.inventoryPath, waiter: InventorySearchAndFilter.waitLoading }); InventorySearchAndFilter.searchInstanceByTitle(instanceID); InventorySearchAndFilter.selectViewHoldings(); HoldingsRecordView.delete(); diff --git a/cypress/support/fragments/data_import/dataImport.js b/cypress/support/fragments/data_import/dataImport.js index 12bacfac69..e341fcabd5 100644 --- a/cypress/support/fragments/data_import/dataImport.js +++ b/cypress/support/fragments/data_import/dataImport.js @@ -398,5 +398,23 @@ export default { waitFileIsUploaded:() => { // TODO need to wait until big file is uploaded cy.wait(10000); + }, + + uploadFileAndRetry(filePathName, fileName, maxRetries = 10) { + let retryCount = 0; + function upload() { + waitLoading(); + cy.then(() => DataImportUploadFile().isDeleteFilesButtonExists()).then(isDeleteFilesButtonExists => { + if (isDeleteFilesButtonExists && retryCount < maxRetries) { + cy.reload(); + cy.wait(4000); + retryCount++; + upload(); + } else { + uploadFile(filePathName, fileName); + } + }); + } + upload(); } }; diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 1567e55d77..2f967279f5 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -262,7 +262,10 @@ export default { deriveNewMarcBibRecord:() => { cy.do(actionsButton.click()); cy.do(deriveNewMarcBibRecord.click()); - cy.expect(QuickMarcEditor().exists()); + cy.expect([ + QuickMarcEditor().exists(), + QuickMarcEditorRow({ tagValue: '999' }).exists() + ]); }, viewSource: () => { @@ -300,7 +303,7 @@ export default { editMarcBibliographicRecord:() => { cy.do(actionsButton.click()); cy.do(editMARCBibRecordButton.click()); - cy.expect(Pane({ id: 'quick-marc-editor-pane' }).exists()); + cy.expect(QuickMarcEditorRow({ tagValue: '999' }).exists()); }, importInstance() { diff --git a/cypress/support/fragments/marcAuthority/marcAuthority.js b/cypress/support/fragments/marcAuthority/marcAuthority.js index b49ff44bb6..28a0b5aa74 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthority.js +++ b/cypress/support/fragments/marcAuthority/marcAuthority.js @@ -9,6 +9,7 @@ import { MultiColumnListHeader, Callout } from '../../../../interactors'; +import QuickMarcEditorWindow from '../quickMarcEditor'; const defaultCreateJobProfile = 'Default - Create SRS MARC Authority'; const defaultUpdateJobProfile = 'Update authority by matching 010'; @@ -76,6 +77,7 @@ export default { edit:() => { cy.do(rootSection.find(Button('Actions')).click()); cy.do(Button('Edit').click()); + QuickMarcEditorWindow.waitLoading(); }, contains: (expectedText) => cy.expect(rootSection.find(HTML(including(expectedText))).exists()), notContains: (expectedText) => cy.expect(rootSection.find(HTML(including(expectedText))).absent()), diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 4d4f97f53a..0f84505096 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -445,7 +445,10 @@ export default { }, waitLoading() { - cy.expect(Pane({ id: 'quick-marc-editor-pane' }).exists()); + cy.expect([ + Pane({ id: 'quick-marc-editor-pane' }).exists(), + QuickMarcEditorRow({ tagValue: '999' }).exists() + ]); }, getExistingLocation() { From 2b80e70d4f5b8c205700586247000f89051db4bd Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Thu, 17 Aug 2023 22:02:36 +0300 Subject: [PATCH 053/437] Master Fix (#1491) * Master Fix * Master Fix --- cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js | 2 +- .../item-statuses-are-set-to-status-other.cy.js | 1 - cypress/support/fragments/orders/orderLines.js | 3 +++ cypress/support/fragments/orders/orders.js | 4 ++++ cypress/support/fragments/organizations/organizations.js | 5 +++++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js b/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js index 0814207a3c..82bc5532f2 100644 --- a/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js +++ b/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js @@ -76,7 +76,7 @@ describe('ui-finance: Transactions', () => { orderNumber = firstOrderResponse.poNumber; Orders.checkCreatedOrder(defaultOrder); OrderLines.addPOLine(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '100', '1', '100', location.institutionId); OrderLines.backToEditingOrder(); Orders.openOrder(); diff --git a/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js index ed533c4160..d073a3ece3 100644 --- a/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js +++ b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js @@ -171,7 +171,6 @@ describe('orders: Receiving and Check-in', () => { ]) .then(userProperties => { - user = userProperties; cy.login(userProperties.username, userProperties.password, { path:TopMenu.receivingPath, waiter: Receiving.waitLoading }); }); }); diff --git a/cypress/support/fragments/orders/orderLines.js b/cypress/support/fragments/orders/orderLines.js index 8aca80d655..d21776aeed 100644 --- a/cypress/support/fragments/orders/orderLines.js +++ b/cypress/support/fragments/orders/orderLines.js @@ -207,6 +207,7 @@ export default { }, backToEditingOrder: () => { + cy.wait(4000); cy.do(Button({ id: 'clickable-backToPO' }).click()); cy.wait(4000); }, @@ -601,6 +602,7 @@ export default { }, fillInPOLineInfoForExportWithLocation(accountNumber, AUMethod, institutionId) { + cy.wait(4000); cy.do([ orderFormatSelect.choose(ORDER_FORMAT_NAMES.ELECTRONIC_RESOURCE), acquisitionMethodButton.click(), @@ -857,6 +859,7 @@ export default { }, selectRandomInstanceInTitleLookUP: (instanceName, rowNumber = 0) => { + cy.wait(4000); cy.do([ Button({ id: 'find-instance-trigger' }).click(), selectInstanceModal.find(TextField({ name: 'query' })).fillIn(instanceName), diff --git a/cypress/support/fragments/orders/orders.js b/cypress/support/fragments/orders/orders.js index c0b83bf9c7..dd2b593b2e 100644 --- a/cypress/support/fragments/orders/orders.js +++ b/cypress/support/fragments/orders/orders.js @@ -55,6 +55,7 @@ const resetButton = Button('Reset all'); export default { searchByParameter(parameter, value) { + cy.wait(4000); cy.do([ searchForm.selectIndex(parameter), searchForm.fillIn(value) @@ -398,10 +399,12 @@ export default { }, selectFromResultsList(number) { + cy.wait(4000); cy.do(MultiColumnList({ id: 'orders-list' }).find(Link(number)).click()); }, deleteOrderViaActions: () => { + cy.wait(4000); cy.do([ PaneHeader({ id: 'paneHeaderorder-details' }).find(actionsButton).click(), Button('Delete').click(), @@ -557,6 +560,7 @@ export default { cy.do(Button('Orders').click()); }, createPOLineViaActions: () => { + cy.wait(4000); cy.do([ Accordion({ id: 'POListing' }) .find(Button('Actions')) diff --git a/cypress/support/fragments/organizations/organizations.js b/cypress/support/fragments/organizations/organizations.js index 318a4275f0..7eeee78f54 100644 --- a/cypress/support/fragments/organizations/organizations.js +++ b/cypress/support/fragments/organizations/organizations.js @@ -181,6 +181,7 @@ export default { }, addIntegration: () => { + cy.wait(4000); cy.do([ openintegrationDetailsSectionButton.click(), Button({ id: 'clickable-neworganization-integration' }).click(), @@ -205,6 +206,7 @@ export default { acquisitionMethod, UTCTime ) => { + cy.wait(4000); cy.do([ Section({ id: 'integrationInfo' }) .find(TextField('Integration name*')) @@ -327,6 +329,7 @@ export default { }, searchByParameters: (parameter, value) => { + cy.wait(4000); cy.do([ searchInput.selectIndex(parameter), searchInput.fillIn(value), @@ -340,6 +343,7 @@ export default { }, checkSearchResults: (organization) => { + cy.wait(4000); cy.expect(organizationsList.find(Link(organization.name)).exists()); }, @@ -655,6 +659,7 @@ export default { }, selectOrganization: (organizationName) => { + cy.wait(4000); cy.do( Pane({ id: 'organizations-results-pane' }) .find(Link(organizationName)) From dec507b39d3eaa121527c73bbf3217e07a6b9265 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Fri, 18 Aug 2023 12:04:44 +0500 Subject: [PATCH 054/437] FAT-7479 (#1488) --- .../data-export/data-export-invalid-cql.cy.js | 52 +++++++++++++++++++ .../data-export/dataExportResults.js | 6 ++- .../fragments/data-export/exportFile.js | 4 +- 3 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 cypress/e2e/data-export/data-export-invalid-cql.cy.js diff --git a/cypress/e2e/data-export/data-export-invalid-cql.cy.js b/cypress/e2e/data-export/data-export-invalid-cql.cy.js new file mode 100644 index 0000000000..b523bedfde --- /dev/null +++ b/cypress/e2e/data-export/data-export-invalid-cql.cy.js @@ -0,0 +1,52 @@ +import TopMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import FileManager from '../../support/utils/fileManager'; +import ExportFileHelper from '../../support/fragments/data-export/exportFile'; +import DataExportResults from '../../support/fragments/data-export/dataExportResults'; +import getRandomPostfix from '../../support/utils/stringTools'; +import { getLongDelay } from '../../support/utils/cypressTools'; +import permissions from '../../support/dictionary/permissions'; +import devTeams from '../../support/dictionary/devTeams'; +import Users from '../../support/fragments/users/users'; +import DataExportLogs from '../../support/fragments/data-export/dataExportLogs'; + +let user; +const editedFileName = `invalid-query-${getRandomPostfix()}.cql`; + +describe('data-export', () => { + beforeEach('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.dataExportEnableModule.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.dataExportPath, + waiter: DataExportLogs.waitLoading, + }); + // Create file with invalid cql query + FileManager.createFile(`cypress/fixtures/${editedFileName}`, '(languages=="eng" and hello=="123") sortby title'); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${editedFileName}`); + }); + + it('C397323 Verify trigger Data export with invalid CQL (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + ExportFileHelper.uploadFile(editedFileName); + ExportFileHelper.exportWithDefaultJobProfile(editedFileName, 'instances', 'Instances', '.cql'); + + cy.intercept(/\/data-export\/job-executions\?query=status=\(COMPLETED/).as('getInfo'); + cy.wait('@getInfo', getLongDelay()).then((interception) => { + const job = interception.response.body.jobExecutions[0]; + const resultFileName = job.exportedFiles[0].fileName; + const recordsCount = job.progress.total; + const jobId = job.hrId; + + DataExportResults.verifyFailedExportResultCells(resultFileName, recordsCount, jobId, user.username, 'instances', true); + }); + }); +}); diff --git a/cypress/support/fragments/data-export/dataExportResults.js b/cypress/support/fragments/data-export/dataExportResults.js index 29b20a4691..555b5cb524 100644 --- a/cypress/support/fragments/data-export/dataExportResults.js +++ b/cypress/support/fragments/data-export/dataExportResults.js @@ -68,7 +68,7 @@ export default { }); }, - verifyFailedExportResultCells(resultFileName, recordsCount, jobId, userName = null, jobType = 'instances') { + verifyFailedExportResultCells(resultFileName, recordsCount, jobId, userName = null, jobType = 'instances', invalidQuery = false) { getRowByContent(resultFileName).then((row) => { const exportRow = MultiColumnListRow({ index: row }); @@ -90,11 +90,13 @@ export default { resultRow.status.is({ content: 'Fail' }), resultRow.total.is({ content: recordsCount.toString() }), resultRow.exported.is({ content: '' }), - resultRow.failed.is({ content: recordsCount.toString() }), resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), resultRow.runBy.is({ content: userNameToVerify }), resultRow.id.is({ content: jobId.toString() }) ]); + + if (invalidQuery) cy.do(resultRow.failed.is({ content: '' })); + else cy.do(resultRow.failed.is({ content: recordsCount.toString() })); }); }); diff --git a/cypress/support/fragments/data-export/exportFile.js b/cypress/support/fragments/data-export/exportFile.js index 20a17b5a36..af10333a82 100644 --- a/cypress/support/fragments/data-export/exportFile.js +++ b/cypress/support/fragments/data-export/exportFile.js @@ -86,13 +86,13 @@ export default { cy.get('input[type=file]', getLongDelay()).attachFile(fileName); }, - exportWithDefaultJobProfile: (fileName, jobType = 'instances', selectType = 'Instances') => { + exportWithDefaultJobProfile: (fileName, jobType = 'instances', selectType = 'Instances', fileType = '.csv') => { cy.do([ MultiColumnListCell({ content: `Default ${jobType} export job profile`, columnIndex: 0 }).click(), Modal({ id: 'choose-job-profile-confirmation-modal' }).find(Select()).choose(selectType), Button('Run').click(), ]); - cy.get('#job-logs-list').contains(fileName.replace('.csv', '')); + cy.get('#job-logs-list').contains(fileName.replace(fileType, '')); }, exportWithCreatedJobProfile: (fileName, profileName) => { From 2335e288f48657dce697efca513647b273c95f48 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Fri, 18 Aug 2023 10:57:55 +0300 Subject: [PATCH 055/437] Added automated tests for FAT-2596, FAT-2615 (#1492) --- ...cial-transactions-report-menu-option.cy.js | 16 +++++++++++ .../financialTransactionDetailReportModal.js | 28 +++++++++++++++++++ .../fragments/users/usersSearchResultsPane.js | 4 +++ 3 files changed, 48 insertions(+) diff --git a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js index 55782be295..af4300fec0 100644 --- a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js +++ b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js @@ -41,6 +41,22 @@ describe('Financial Transactions Detail Report', () => { UsersSearchResultsPane.verifyOptionsInActionsMenu(); }); + it('C343306 Check that the "Financial transactions detail report" modal is display when selected "Financial transactions detail report (CSV)"', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyStartDateFieldIsEmpty(); + FinancialTransactionDetailReportModal.verifyEndDateFieldIsEmpty(); + FinancialTransactionDetailReportModal.verifyFeeFineOwnerSelect(); + FinancialTransactionDetailReportModal.verifyAssociatedServicePointsMultiSelect(); + FinancialTransactionDetailReportModal.verifySaveButtonIsDisabled(); + FinancialTransactionDetailReportModal.verifyCancelButtonIsEnabled(); + }); + + it('C343308 Check that the user can not close "Financial transactions detail report" modal when click on the outside the modal', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + UsersSearchResultsPane.clickActionsButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + }); + it('C343316 Check that the "Save&close" button has become active after filling in all the required fields with valid data', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); diff --git a/cypress/support/fragments/users/financialTransactionDetailReportModal.js b/cypress/support/fragments/users/financialTransactionDetailReportModal.js index 37fcb59dcd..6a12469f31 100644 --- a/cypress/support/fragments/users/financialTransactionDetailReportModal.js +++ b/cypress/support/fragments/users/financialTransactionDetailReportModal.js @@ -30,6 +30,30 @@ export default { cy.do(financialReport.find(Button(including('Save'))).has({ disabled: false })); }, + verifySaveButtonIsDisabled() { + cy.do(financialReport.find(Button(including('Save'))).has({ disabled: true })); + }, + + verifyCancelButtonIsEnabled() { + cy.do(financialReport.find(Button(including('Cancel'))).has({ disabled: false })); + }, + + verifyStartDateFieldIsEmpty() { + cy.do(financialReport.find(startDateTextfield).has({ value: '' })); + }, + + verifyEndDateFieldIsEmpty() { + cy.do(financialReport.find(endDateTextfield).has({ value: '' })); + }, + + verifyFeeFineOwnerSelect() { + cy.expect(financialReport.find(feeFineOwnerSelect).exists()); + }, + + verifyAssociatedServicePointsMultiSelect() { + cy.expect(financialReport.find(MultiSelect({ label: 'Associated service points' })).exists()); + }, + save() { cy.do(financialReport.find(Button(including('Save'))).click()); }, @@ -41,4 +65,8 @@ export default { fillInServicePoints(servicePoints) { cy.do([financialReport.find(MultiSelect({ label: 'Associated service points' })).choose(servicePoints)]); }, + + verifyFinancialReportModalIsShown() { + cy.expect(financialReport.exists()); + } }; diff --git a/cypress/support/fragments/users/usersSearchResultsPane.js b/cypress/support/fragments/users/usersSearchResultsPane.js index e262276153..ad50803994 100644 --- a/cypress/support/fragments/users/usersSearchResultsPane.js +++ b/cypress/support/fragments/users/usersSearchResultsPane.js @@ -29,4 +29,8 @@ export default { openFinancialTransactionDetailReportModal:() => { cy.do([actionsButtonInSearchResultsPane.click(), actionsButtons['financialTransactionsReport'].click()]); }, + + clickActionsButton:() => { + cy.do([actionsButtonInSearchResultsPane.click()]); + } }; From ebe85fbb7bf48e81a18354685eac93a9ad7f9d63 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Fri, 18 Aug 2023 19:03:40 +0300 Subject: [PATCH 056/437] FAT-5133-C375994 (#1493) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7532: waits added * FAT-7532: more waits added, precondition updated * FAT-7532: removed steps to delete import logs from Spitfire tests * FAT-7532: updated methods * FAT-7532: alt upload method * FAT-7532: updated method added to export * FAT-7532: removed method * FAT-7532: updated import method added * FAT-7532: changed back URLs * FAT-7532: import method updated * FAT-5133: preconditions added * FAT-5133: test implemented * FAT-5133: replaced raw data with variables * FAT-5133: removed unnecessary import --- .../inventory/derive-linked-marc-bib.cy.js | 135 ++++++++++++++++++ cypress/fixtures/marcAuthFileC375994_1.mrc | 1 + cypress/fixtures/marcAuthFileC375994_2.mrc | 1 + cypress/fixtures/marcBibFileC375994.mrc | 1 + .../fragments/inventory/inventoryInstance.js | 7 + cypress/support/fragments/quickMarcEditor.js | 38 ++++- 6 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/inventory/derive-linked-marc-bib.cy.js create mode 100644 cypress/fixtures/marcAuthFileC375994_1.mrc create mode 100644 cypress/fixtures/marcAuthFileC375994_2.mrc create mode 100644 cypress/fixtures/marcBibFileC375994.mrc diff --git a/cypress/e2e/inventory/derive-linked-marc-bib.cy.js b/cypress/e2e/inventory/derive-linked-marc-bib.cy.js new file mode 100644 index 0000000000..b334859327 --- /dev/null +++ b/cypress/e2e/inventory/derive-linked-marc-bib.cy.js @@ -0,0 +1,135 @@ +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 InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import MarcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +import DataImport from '../../support/fragments/data_import/dataImport'; +import { JOB_STATUS_NAMES } from '../../support/constants'; +import getRandomPostfix from '../../support/utils/stringTools'; +import JobProfiles from '../../support/fragments/data_import/job_profiles/jobProfiles'; +import Logs from '../../support/fragments/data_import/logs/logs'; +import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; + +describe('MARC -> MARC Bibliographic -> Derive MARC bib', () => { + const testData = { + tag001: '001', + tag010: '010', + tag240: '240', + tag650: '650', + tag240FifthBoxValue: '$m test', + tag650FifthBoxValue: '$b 123', + tag650SeventhBoxValue: '$b 123' + }; + + const marcFiles = [ + { + marc: 'marcBibFileC375994.mrc', + fileName: `testMarcFileC375994.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + instanceTitle: 'C375994 Abraham Lincoln, by Lillian Hertz. Prize essay in Alexander Hamilton junior high school P.S. 186, June 24, 1927.' + }, + { + marc: 'marcAuthFileC375994_1.mrc', + fileName: `testMarcFileC375994.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C375994 Robinson, Peter, 1950-2022 Alt. title', + authority001FieldValue: '30520443759941', + }, + { + marc: 'marcAuthFileC375994_2.mrc', + fileName: `testMarcFileC375994.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C375994 Speaking Oratory debating', + authority010FieldValue: 'sh850952993759942', + } + ]; + + const createdRecordIDs = []; + + before('Import data, link records', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIconByIndex(10); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag001, marcFiles[1].authority001FieldValue); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag240); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIconByIndex(16); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[2].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[2].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthorityByIndex(16, testData.tag650); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIconByIndex(17); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[2].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[2].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthorityByIndex(17, testData.tag650); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + }); + + after('Deleting created user, data', () => { + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C375994 Add controllable subfields to multiple linked fields in "MARC bib" record when deriving record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.deriveNewMarcBib(); + QuickMarcEditor.fillLinkedFieldBox(10, 5, testData.tag240FifthBoxValue); + QuickMarcEditor.fillLinkedFieldBox(16, 5, testData.tag650FifthBoxValue); + QuickMarcEditor.fillLinkedFieldBox(17, 7, testData.tag650SeventhBoxValue); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.verifyCalloutControlledFields([testData.tag240, testData.tag650]); + }); +}); diff --git a/cypress/fixtures/marcAuthFileC375994_1.mrc b/cypress/fixtures/marcAuthFileC375994_1.mrc new file mode 100644 index 0000000000..37cb48c11a --- /dev/null +++ b/cypress/fixtures/marcAuthFileC375994_1.mrc @@ -0,0 +1 @@ +01896cz a2200325n 45000010015000000050017000150080041000320160015000730350023000880400053001110420008001640460033001720530017002050650032002221000054002543700054003083710029003623720024003913730085004153740018005003750017005183770008005356700056005436700068005996700261006676700268009286700083011966700276012799530015015553052044375994120221008174227.0900423n| azannaabn |n aaa  a0051J2038E a(OCoLC)oca02727665 aDLCbengerdacDLCdDLCdOCoLCdUPBdCaOONLdOkU anlc f1950-03-17g2022-10-042edtf 0aPR6068.O1964 aPS8585.O351762fcps5CaOONL1 aC375994 Robinson, Peter,d1950-2022 t Alt. title aCastleford (England)cCanadaeToronto (Ont.)2naf madmin@inspectorbanks.com aCrime writing2lcsh aUniversity of LeedsaUniversity of WindsoraYork University (Toronto, Ont.)2naf aAuthors2lcsh aMales2lcdgt aeng aHis Gallows view, c1990:bCIP t.p. (Peter Robinson) aTelephone call to publisher, 4-20-90b(Peter Robinson; b. 1950) aPeter Robinson, via WWW, Oct. 1, 2012b(born in Yorkshire; B.A. Honours, English Literature, University of Leeds; M.A., English and Creative Writing, University of Windsor in Canada; PhD, English, York University; Author of crime novels and short stories) aWikipedia, via WWW, Oct. 1, 2012b(born March 17, 1950 in Castleford, Yorkshire; English crime writer, based in Canada; lives in Toronto with his wife; teaches crime writing at University of Toronto; has served as Writer-in-Residence at the University of Windsor) aLAC internal file, April 26, 2019b(heading: Robinson, Peter, 1950-; Canadian) aHodder & Stoughton, Oct. 7, 2022:b(Hodder & Stoughton are sad to announce that the crime writer Peter Robinson died suddenly on 4th October after a brief illness.)uhttps://www.hodder.co.uk/hachette-news/2022/10/07/hodder-stoughton-announces-the-death-of-peter-robinson/ abd07bzz00 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileC375994_2.mrc b/cypress/fixtures/marcAuthFileC375994_2.mrc new file mode 100644 index 0000000000..6783c64640 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC375994_2.mrc @@ -0,0 +1 @@ +01081cz a2200337n 4500001000800000005001700008008004100025010002200066035002100088035001500109040001800124053001900142150005100161360006000212450001800272450002800290450001300318550003000331550001600361550003300377550002500410550001400435550001400449550002700463550002600490550002000516680014200536681003200678906001800710953001500728474525120120327095430.0860211i| anannbabn |a ana  ash850952993759942 a(DLC)sh 85095299 a(DLC)91936 aDLCcDLCdDLC 0aPN4001bPN4355 aC375994 Speaking 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/marcBibFileC375994.mrc b/cypress/fixtures/marcBibFileC375994.mrc new file mode 100644 index 0000000000..d17bc5490b --- /dev/null +++ b/cypress/fixtures/marcBibFileC375994.mrc @@ -0,0 +1 @@ +00779nam a2200241 4500001001000000003000400010005001700014008004100031035002100072035001900093040001300112041000800125100002800133240001900161245012600180260002700306300001900333600005900352600008000411650001300491650001800504903001500522in2340312ICU19951122000000.0950906s1927 xxu 000 0 eng d a(ICU)BID21137833 a(OCoLC)9192518 aICUcICU0 aeng1 aHertz, Lillian,d1913?-10aOriginal value10aC375994 Abraham 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 aOratory. 7aOriginal650_2 aOCLC/RECON \ No newline at end of file diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 2f967279f5..61d0569ff1 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -851,5 +851,12 @@ export default { fillItemBarcode(barcodeValue) { cy.do(itemBarcodeField.fillIn(barcodeValue)); + }, + + verifyAndClickLinkIconByIndex(rowIndex) { + // Waiter needed for the link to be loaded properly. + cy.wait(1000); + cy.expect(QuickMarcEditorRow({ index: rowIndex }).find(linkIconButton).exists()); + cy.do(QuickMarcEditorRow({ index: rowIndex }).find(linkIconButton).click()); } }; diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 0f84505096..fa82008175 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -130,6 +130,14 @@ const tag008DefaultValuesHoldings = [ { interactor:TextField('Rept date'), defaultValue:'\\\\\\\\\\\\' } ]; +const tagBox = TextField({ name: including('.tag') }); +const firstIndicatorBox = TextField({ name: including('.indicators[0]') }); +const secondIndicatorBox = TextField({ name: including('.indicators[0]') }); +const fourthBoxInLinkedField = TextArea({ name: including('.subfieldGroups.controlled') }); +const fifthBoxInLinkedField = TextArea({ name: including('.subfieldGroups.uncontrolledAlpha') }); +const sixthBoxInLinkedField = TextArea({ name: including('.subfieldGroups.zeroSubfield') }); +const seventhBoxInLinkedField = TextArea({ name: including('.subfieldGroups.uncontrolledNumber') }); + export default { getInitialRowsCount() { return validRecord.lastRowNumber; }, @@ -793,5 +801,33 @@ export default { this.pressSaveAndClose(); cy.expect(calloutAfterSaveAndClose.exists()); checkBib(); - } + }, + + fillLinkedFieldBox(rowIndex, boxNumber = 4, value) { + const boxes = [tagBox, firstIndicatorBox, secondIndicatorBox, fourthBoxInLinkedField, fifthBoxInLinkedField, sixthBoxInLinkedField, seventhBoxInLinkedField]; + cy.do(QuickMarcEditorRow({ index: rowIndex }).find(boxes[boxNumber - 1]).fillIn(value)); + // if other action performed immediately after input, it might not be registered + cy.wait(1000); + cy.expect(QuickMarcEditorRow({ index: rowIndex }).find(boxes[boxNumber - 1]).has({ value })); + }, + + verifyCalloutControlledFields(tags) { + let tagsText = `MARC ${tags[0]}`; + if (tags.length === 2) tagsText += ` and MARC ${tags[1]}`; + else if (tags.length > 2) { + for (let i = 1; i <= tags.length - 2; i++) { + tagsText += `, MARC ${tags[i]}`; + } + tagsText += `, and MARC ${tags[tags.length - 1]}`; + } + cy.expect(Callout(tagsText + ' has a subfield(s) that cannot be saved because the fields are controlled by authority records.').exists()); + }, + + verifyAfterLinkingAuthorityByIndex(rowIndex, tag) { + cy.expect([ + Callout(`Field ${tag} has been linked to a MARC authority record.`).exists(), + QuickMarcEditorRow({ index: rowIndex }).find(unlinkIconButton).exists(), + QuickMarcEditorRow({ index: rowIndex }).find(viewAuthorutyIconButton).exists(), + ]); + }, }; From 87017743be3fe674e8ed96be2fe61a506c57f46d Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:39:53 +0300 Subject: [PATCH 057/437] Implementing of FAT-5077 (#1496) --- .../edit-fund-with-reviewed-invoice.cy.js | 156 ++++++++++++++++++ .../support/fragments/finance/funds/funds.js | 14 ++ 2 files changed, 170 insertions(+) create mode 100644 cypress/e2e/orders/edit-fund-with-reviewed-invoice.cy.js diff --git a/cypress/e2e/orders/edit-fund-with-reviewed-invoice.cy.js b/cypress/e2e/orders/edit-fund-with-reviewed-invoice.cy.js new file mode 100644 index 0000000000..8454d5e59c --- /dev/null +++ b/cypress/e2e/orders/edit-fund-with-reviewed-invoice.cy.js @@ -0,0 +1,156 @@ +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'; +import Orders from '../../support/fragments/orders/orders'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import Organizations from '../../support/fragments/organizations/organizations'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import NewInvoice from '../../support/fragments/invoices/newInvoice'; +import Invoices from '../../support/fragments/invoices/invoices'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import NewOrder from '../../support/fragments/orders/newOrder'; + +describe('ui-orders: Orders', () => { + const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const firstFund = { ...Funds.defaultUiFund }; + const secondFund = { + name: `autotest_fund2_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: getRandomPostfix(), + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + const defaultOrder = { ...NewOrder.defaultOneTimeOrder, + approved: true, + reEncumber: true, + orderType: 'One-time' }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice, + status: 'Reviewed' }; + const allocatedQuantity = '1000'; + let user; + let orderNumber; + let servicePointId; + let location; + + before(() => { + cy.getAdminToken(); + + FiscalYears.createViaApi(defaultFiscalYear) + .then(response => { + defaultFiscalYear.id = response.id; + defaultLedger.fiscalYearOneId = defaultFiscalYear.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.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.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; + defaultOrder.vendor = organization.name; + }); + defaultOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(defaultOrder, true, false).then(orderResponse => { + defaultOrder.id = orderResponse.id; + orderNumber = orderResponse.poNumber; + Orders.checkCreatedOrder(defaultOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(firstFund, '50', '1', '50', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLineFromPol(orderNumber); + // Need to wait, while data will be loaded + cy.wait(4000); + }); + cy.createTempUser([ + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiInvoicesCanViewInvoicesAndInvoiceLines.gui, + permissions.uiOrdersEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C374190 Editing fund distribution in PO line when related Open invoice exists (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + OrderLines.selectPOLInOrder(0); + OrderLines.editPOLInOrder(); + OrderLines.editFundInPOL(secondFund, '70', '70'); + OrderLines.checkFundInPOL(secondFund); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.selectBudgetDetails(); + Funds.viewTransactions(); + Funds.checkOrderInTransactionList(`${secondFund.code}`, '($70.00)'); + Funds.selectTransactionInList('Encumbrance'); + Funds.checkStatusInTransactionDetails('Unreleased'); + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoice.invoiceNumber); + Invoices.selectInvoice(invoice.invoiceNumber); + Invoices.selectInvoiceLine(); + Invoices.checkFundInInvoiceLine(secondFund); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.selectBudgetDetails(); + Funds.viewTransactions(); + Funds.checkPaymentInTransactionDetails(1, defaultFiscalYear.code, invoice.invoiceNumber, `${secondFund.name} (${secondFund.code})`, '($70.00)'); + Funds.checkStatusInTransactionDetails('Unreleased'); + }); +}); diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 0fbe8d1e5f..7a51ed49e2 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -305,6 +305,12 @@ export default { ); }, + checkStatusInTransactionDetails: (status) => { + cy.expect( + transactionDetailSection.find(KeyValue('Status')).has({ value: status }) + ); + }, + checkOrderInTransactionList: (fundCode, amount) => { cy.expect([ transactionList @@ -326,6 +332,14 @@ export default { ]); }, + selectTransactionInList: (transactionType) => { + cy.get(`div[class*=mclCell-]:contains("${transactionType}")`) + .siblings('div[class*=mclCell-]') + .eq(0) + .find('a') + .click(); + }, + increaseAllocation: () => { cy.do([ actionsButton.click(), From 0bb18b6d4c37b4cd1b8a9109ceb433e290129249 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Mon, 21 Aug 2023 17:08:31 +0300 Subject: [PATCH 058/437] Implementing of FAT-5074 (#1494) --- ...edit-fund-when-invoice-are-cancelled.cy.js | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 cypress/e2e/orders/edit-fund-when-invoice-are-cancelled.cy.js diff --git a/cypress/e2e/orders/edit-fund-when-invoice-are-cancelled.cy.js b/cypress/e2e/orders/edit-fund-when-invoice-are-cancelled.cy.js new file mode 100644 index 0000000000..1d569f9d85 --- /dev/null +++ b/cypress/e2e/orders/edit-fund-when-invoice-are-cancelled.cy.js @@ -0,0 +1,155 @@ +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'; +import Orders from '../../support/fragments/orders/orders'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import Organizations from '../../support/fragments/organizations/organizations'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import NewInvoice from '../../support/fragments/invoices/newInvoice'; +import Invoices from '../../support/fragments/invoices/invoices'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import NewOrder from '../../support/fragments/orders/newOrder'; + +describe('ui-orders: Orders', () => { + const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const firstFund = { ...Funds.defaultUiFund }; + const secondFund = { + name: `autotest_fund2_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: getRandomPostfix(), + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + const defaultOrder = { ...NewOrder.defaultOneTimeOrder, + approved: true, + reEncumber: true, + orderType: 'One-time' }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const allocatedQuantity = '1000'; + let user; + let orderNumber; + let servicePointId; + let location; + + before(() => { + cy.getAdminToken(); + + FiscalYears.createViaApi(defaultFiscalYear) + .then(response => { + defaultFiscalYear.id = response.id; + defaultLedger.fiscalYearOneId = defaultFiscalYear.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.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.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; + defaultOrder.vendor = organization.name; + }); + defaultOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(defaultOrder, true, false).then(orderResponse => { + defaultOrder.id = orderResponse.id; + orderNumber = orderResponse.poNumber; + Orders.checkCreatedOrder(defaultOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(firstFund, '50', '1', '50', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLineFromPol(orderNumber); + // Need to wait, while data will be loaded + cy.wait(4000); + Invoices.approveInvoice(); + Invoices.cancelInvoice(); + }); + cy.createTempUser([ + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiInvoicesCanViewInvoicesAndInvoiceLines.gui, + permissions.uiOrdersEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C368478 Editing fund distribution in PO line when related Cancelled from approved invoice exists (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + OrderLines.selectPOLInOrder(0); + OrderLines.editPOLInOrder(); + OrderLines.editFundInPOL(secondFund, '70', '70'); + OrderLines.checkFundInPOL(secondFund); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.selectBudgetDetails(); + Funds.viewTransactions(); + Funds.checkOrderInTransactionList(`${secondFund.code}`, '($70.00)'); + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoice.invoiceNumber); + Invoices.selectInvoice(invoice.invoiceNumber); + Invoices.selectInvoiceLine(); + Invoices.checkFundInInvoiceLine(firstFund); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(firstFund.name); + Funds.selectFund(firstFund.name); + Funds.selectBudgetDetails(); + Funds.viewTransactions(); + Funds.checkPaymentInTransactionDetails(1, defaultFiscalYear.code, invoice.invoiceNumber, `${firstFund.name} (${firstFund.code})`, '($50.00)'); + Funds.clickInfoInTransactionDetails(); + }); +}); From 44aaefeb329d30f6f869683764b766e56a6c27c0 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Mon, 21 Aug 2023 19:12:48 +0300 Subject: [PATCH 059/437] FAT-1309-C9240 (#1497) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-1309: test implemented * FAT-1309: removed unused import --- .../eholdings/eholdings-titles-packages.cy.js | 59 ++++++++++++++----- .../eholdings/eHoldingResourceEdit.js | 8 ++- .../eholdings/eHoldingsResourceView.js | 9 ++- 3 files changed, 60 insertions(+), 16 deletions(-) diff --git a/cypress/e2e/eholdings/eholdings-titles-packages.cy.js b/cypress/e2e/eholdings/eholdings-titles-packages.cy.js index 23004ebd9b..2c09636a0a 100644 --- a/cypress/e2e/eholdings/eholdings-titles-packages.cy.js +++ b/cypress/e2e/eholdings/eholdings-titles-packages.cy.js @@ -2,38 +2,69 @@ import EHoldingSearch from '../../support/fragments/eholdings/eHoldingsSearch'; import EHoldingsTitlesSearch from '../../support/fragments/eholdings/eHoldingsTitlesSearch'; import TopMenu from '../../support/fragments/topMenu'; import Users from '../../support/fragments/users/users'; -import testTypes from '../../support/dictionary/testTypes'; -import features from '../../support/dictionary/features'; -import permissions from '../../support/dictionary/permissions'; -import devTeams from '../../support/dictionary/devTeams'; +import TestTypes from '../../support/dictionary/testTypes'; +import Features from '../../support/dictionary/features'; +import Permissions from '../../support/dictionary/permissions'; +import DevTeams from '../../support/dictionary/devTeams'; +import getRandomPostfix from '../../support/utils/stringTools'; +import EHoldingsTitle from '../../support/fragments/eholdings/eHoldingsTitle'; +import EHoldingsResourceView from '../../support/fragments/eholdings/eHoldingsResourceView'; +import EHoldingsResourceEdit from '../../support/fragments/eholdings/eHoldingResourceEdit'; describe('ui-eholdings: Search titles', () => { const testData = { title: 'Chemical Engineering', - publicationType: 'Journal' + publicationType: 'Journal', + titleC9240: 'Wiley Hall', + label1: 'simple', + label2: '123', + label1Value: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ${getRandomPostfix()}`, + label2Value: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut enim ad minim veniam, quis nostrud exercitation. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ${getRandomPostfix()}` }; - before('Creating user and getting info about title', () => { - cy.createTempUser([permissions.uieHoldingsRecordsEdit.gui, - permissions.uieHoldingsPackageTitleSelectUnselect.gui]).then(userProperties => { - testData.userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password, { path: TopMenu.eholdingsPath, waiter: EHoldingsTitlesSearch.waitLoading }); + before('Creating users and getting info about title', () => { + cy.createTempUser([ + Permissions.uieHoldingsRecordsEdit.gui, + Permissions.uieHoldingsPackageTitleSelectUnselect.gui + ]).then(userProperties => { + testData.C684UserProperties = userProperties; + }); + cy.createTempUser([ + Permissions.uieHoldingsRecordsEdit.gui, + ]).then(userProperties => { + testData.C9240UserProperties = userProperties; }); - EHoldingsTitlesSearch.getViaApi({ 'filter[name]': testData.title, 'filter[type]': testData.publicationType.toLowerCase() }).then((res) => { testData.titleProps = res[0]; }); }); - after('Deleting created user', () => { - Users.deleteViaApi(testData.userId); + after('Deleting created users', () => { + Users.deleteViaApi(testData.C684UserProperties.userId); + Users.deleteViaApi(testData.C9240UserProperties.userId); }); - it('C684 Title Search: Search titles for chemical engineering. Then filter results to journals. (spitfire)', { tags: [testTypes.smoke, devTeams.spitfire, features.eHoldings] }, () => { + it('C684 Title Search: Search titles for chemical engineering. Then filter results to journals. (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire, Features.eHoldings] }, () => { + cy.login(testData.C684UserProperties.username, testData.C684UserProperties.password, { path: TopMenu.eholdingsPath, waiter: EHoldingsTitlesSearch.waitLoading }); EHoldingSearch.switchToTitles(); EHoldingsTitlesSearch.byTitle(testData.title); EHoldingsTitlesSearch.byPublicationType(testData.publicationType); EHoldingsTitlesSearch.openTitle(testData.titleProps.attributes.name); EHoldingsTitlesSearch.checkTitleInfo(testData.publicationType, testData.title); }); + + it('C9240 Selected Title+Package: Add a value to a custom label (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + cy.login(testData.C9240UserProperties.username, testData.C9240UserProperties.password, { path: TopMenu.eholdingsPath, waiter: EHoldingsTitlesSearch.waitLoading }); + EHoldingSearch.switchToTitles(); + EHoldingsTitlesSearch.byTitle(testData.titleC9240); + EHoldingsTitlesSearch.bySelectionStatus('Selected'); + EHoldingsTitlesSearch.openTitle(testData.titleC9240); + EHoldingsTitle.openResource(); + EHoldingsResourceView.goToEdit(); + EHoldingsResourceEdit.fillCustomLabelValue(testData.label1, testData.label1Value); + EHoldingsResourceEdit.fillCustomLabelValue(testData.label2, testData.label2Value); + EHoldingsResourceEdit.saveAndClose(); + EHoldingsResourceView.verifyCustomLabelValue(testData.label1, testData.label1Value); + EHoldingsResourceView.verifyCustomLabelValue(testData.label2, testData.label2Value); + }); }); diff --git a/cypress/support/fragments/eholdings/eHoldingResourceEdit.js b/cypress/support/fragments/eholdings/eHoldingResourceEdit.js index 15403913bd..57b659140f 100644 --- a/cypress/support/fragments/eholdings/eHoldingResourceEdit.js +++ b/cypress/support/fragments/eholdings/eHoldingResourceEdit.js @@ -1,4 +1,4 @@ -import { TextField, Button, RadioButton } from '../../../../interactors'; +import { TextField, Button, RadioButton, Accordion } from '../../../../interactors'; const addNewRange = () => { cy.do(Button('Add date range').click()); @@ -9,6 +9,9 @@ const saveAndClose = () => { const customCoveredDatesRadioButton = RadioButton('Custom coverage dates (enter multiple date ranges in descending order)'); +const customLabelsAccordion = Accordion('Custom labels'); +const customLabelInput = (label) => customLabelsAccordion.find(TextField({ label })); + export default { // TODO: redesign to interactors after clarification of differences between edit and view pages waitLoading:() => { @@ -31,5 +34,8 @@ export default { removeExistingCustomeCoverageDates:() => { cy.do(RadioButton('Managed coverage dates').click()); saveAndClose(); + }, + fillCustomLabelValue(labelName, value) { + cy.do(customLabelInput(labelName).fillIn(value)); } }; diff --git a/cypress/support/fragments/eholdings/eHoldingsResourceView.js b/cypress/support/fragments/eholdings/eHoldingsResourceView.js index 5b904afab2..c64d5a3376 100644 --- a/cypress/support/fragments/eholdings/eHoldingsResourceView.js +++ b/cypress/support/fragments/eholdings/eHoldingsResourceView.js @@ -1,4 +1,4 @@ -import { Section, Pane, HTML, including, Button, Label, KeyValue, Modal } from '../../../../interactors'; +import { Section, Pane, HTML, including, Button, Label, KeyValue, Modal, Accordion } from '../../../../interactors'; import dateTools from '../../utils/dateTools'; import eHoldingResourceEdit from './eHoldingResourceEdit'; @@ -19,6 +19,9 @@ const openActionsMenu = () => { }); }; +const customLabelsAccordion = Accordion('Custom labels'); +const customLabelValue = (label) => customLabelsAccordion.find(KeyValue(label)); + export default { waitLoading: () => { cy.expect(holdingStatusSection.exists()); @@ -64,5 +67,9 @@ export default { cy.expect(addToHoldingButton.exists()); openActionsMenu(); cy.expect(Button('Add to holdings').exists()); + }, + verifyCustomLabelValue(labelName, value) { + this.waitLoading(); + cy.expect(customLabelValue(labelName).has({ value })); } }; From e629f6b72158650ed1467affb633e77f7960c71c Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:32:44 +0300 Subject: [PATCH 060/437] Fat 6542 c388505 (#1495) * added test * added checks * changed method * changed method for verifying holdings statuses * added checks quantity of created holdings --- ...-multiple-items-in-multiple-holdings.cy.js | 155 ++++++++++++++++++ cypress/fixtures/marcBibFileForC388505.mrc | 1 + .../fragments/data_import/logs/fileDetails.js | 31 ++++ .../fragments/inventory/instanceRecordView.js | 15 +- .../settings/orders/acquisitionMethods.js | 2 +- cypress/support/utils/arrays.js | 17 ++ 6 files changed, 218 insertions(+), 3 deletions(-) create mode 100644 cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-in-multiple-holdings.cy.js create mode 100644 cypress/fixtures/marcBibFileForC388505.mrc diff --git a/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-in-multiple-holdings.cy.js b/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-in-multiple-holdings.cy.js new file mode 100644 index 0000000000..f140a0cb4b --- /dev/null +++ b/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-in-multiple-holdings.cy.js @@ -0,0 +1,155 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import { + FOLIO_RECORD_TYPE, + LOCATION_NAMES, + LOAN_TYPE_NAMES, + ITEM_STATUS_NAMES, + ACCEPTED_DATA_TYPE_NAMES +} from '../../../support/constants'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +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 DataImport from '../../../support/fragments/data_import/dataImport'; +import TopMenu from '../../../support/fragments/topMenu'; +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 InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; + +describe('data-import', () => { + describe('Log details', () => { + let user; + let instanceHRID; + const arrayOfHoldingsStatuses = ['Created (KU/CC/DI/M)', 'Created (KU/CC/DI/A)', 'Created (E)']; + const holdingsData = [ + { permanentLocation: LOCATION_NAMES.MAIN_LIBRARY_UI, + itemsQuqntity: 3 }, + { permanentLocation: LOCATION_NAMES.ANNEX_UI, + itemsQuqntity: 2 }, + { permanentLocation: LOCATION_NAMES.ONLINE_UI, + itemsQuqntity: 1 } + ]; + const quantityOfCreatedItems = 6; + const quantityOfCreatedHoldings = 3; + const filePathForUpload = 'marcBibFileForC388505.mrc'; + const marcFileName = `C388505 autotestFileName.${getRandomPostfix()}`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C388505 Test multiple holdings.${getRandomPostfix()}`, + permanentLocation: '945$h' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C388505 Test multiple holdings.${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C388505 Test multiple items.${getRandomPostfix()}`, + materialType: '945$a', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C388505 Test multiple items.${getRandomPostfix()}` } + } + ]; + const jobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `C388505 Test multiple items.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; + + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + instance.items.forEach(item => cy.deleteItemViaApi(item.id)); + instance.holdings.forEach(holding => cy.deleteHoldingRecordViaApi(holding.id)); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C388505 Check the log result table for imported multiple items in multiple holdings (folijet)', + { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + // create mapping profiles + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[0].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[1].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[1].mappingProfile.status); + 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('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForUpload, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.verifyMultipleHoldingsStatus(arrayOfHoldingsStatuses, quantityOfCreatedHoldings); + FileDetails.verifyMultipleItemsStatus(quantityOfCreatedItems); + + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + }); + holdingsData.forEach(holdings => { + InventoryInstance.checkIsHoldingsCreated([`${holdings.permanentLocation} >`]); + InventoryInstance.openHoldingsAccordion(`${holdings.permanentLocation} >`); + InstanceRecordView.verifyQuantityOfItemsRelatedtoHoldings(holdings.permanentLocation, holdings.itemsQuqntity); + }); + }); + }); +}); diff --git a/cypress/fixtures/marcBibFileForC388505.mrc b/cypress/fixtures/marcBibFileForC388505.mrc new file mode 100644 index 0000000000..7a641c8c1d --- /dev/null +++ b/cypress/fixtures/marcBibFileForC388505.mrc @@ -0,0 +1 @@ +01555cam a2200349Ii 41y00010009000000050017000090080041000260030004000670400028000710200015000990200031001140350022001450500027001670820014001941000126002082450109003342640049004433000027004923360068005193370068005873380065006555200205007206500072009256550074009979440010010719450024010819450024011059450024011299450020011539450020011739450012011931194806420191023111031.6191004s2019 ilua 000 p eng dICU aCOObengerdacCOOdUOK a1642590258 a9781642590258q(paperback) a(OCoLC)1122747273 4aPR9265.9.C53bC76 2019 4a811.62231 aChin, Staceyann,d1972-eAuthoreNarrator0http://id.loc.gov/authorities/names/n20080524041http://viaf.org/viaf/2407405210aCrossfire :ba litany for survival : poems 1998-2019 /cStaceyann Chin ; foreword by Jacqueline Woodson. 1aChicago, Illinois :bHaymarket Books,c2019. axi, 208 pages ;c23 cm atext2rdacontent0http://id.loc.gov/vocabulary/contentTypes/txt aunmediated2rdamedia0http://id.loc.gov/vocabulary/mediaTypes/n avolume2rdacarrier0http://id.loc.gov/vocabulary/carriers/nc a"Crossfire collects world-renowned lesbian poet and spoken-word artist Staceyann Chin's empowering, feminist-LGBTQ-Caribbean, activism-driven poetry for the first time in a single book."-- Back cover. 0aFeminist poetry.0http://id.loc.gov/authorities/subjects/sh85047755 7aPoetry.2lcgft0http://id.loc.gov/authorities/genreForms/gf2014026481 smfilm hKU/CC/DI/MabookcE hKU/CC/DI/MabookcE hKU/CC/DI/MabookcE hKU/CC/DI/Aadvd hKU/CC/DI/Aadvd hEatext \ No newline at end of file diff --git a/cypress/support/fragments/data_import/logs/fileDetails.js b/cypress/support/fragments/data_import/logs/fileDetails.js index 67440cbc8e..e3ae7da38a 100644 --- a/cypress/support/fragments/data_import/logs/fileDetails.js +++ b/cypress/support/fragments/data_import/logs/fileDetails.js @@ -9,6 +9,7 @@ import { Button } from '../../../../../interactors'; import LogsViewAll from './logsViewAll'; +import arrays from '../../../utils/arrays'; const invoiceNumberFromEdifactFile = '94999'; @@ -234,6 +235,36 @@ export default { cy.do(nextButton.click()); }, + verifyMultipleHoldingsStatus:(expectedArray, expectedHoldingsQuantity, rowNumber = 0) => { + cy.do(resultsList + .find(MultiColumnListRow({ index: rowNumber })) + .perform(element => { + const currentArray = Array + .from(element.querySelectorAll('[class*="mclCell-"]:nth-child(5) [style]')) + .map(el => el.innerText.replace(/\n/g, '')); + const result = arrays.compareArrays(expectedArray, currentArray); + + expect(expectedHoldingsQuantity).to.equal(currentArray.length); + expect(result).to.equal(true); + })); + }, + + verifyMultipleItemsStatus:(expectedItemsQuantity, rowNumber = 0) => { + cy.do(resultsList + .find(MultiColumnListRow({ index: rowNumber })) + .find(MultiColumnListCell({ columnIndex: 5 })) + .perform(element => { + const extractedMatches = []; + // get text contains e.g. 'Created (it00000000123)' and put it to an array + Array.from(element.querySelectorAll('[class*="baselineCell-"]')) + .map(el => extractedMatches.push(el.innerText.match(/Created \((it\d+)\)/g))); + // get the first element from an array + const currentItemsQuantity = Array.from(extractedMatches[0]); + + expect(expectedItemsQuantity).to.equal(currentItemsQuantity.length); + })); + }, + checkStatusByTitle:(title, itemStatus) => { cy.do(resultsList.find(MultiColumnListCell({ content: title })).perform( element => { diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index 14b4984952..ae5c3e6c28 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -161,15 +161,26 @@ export default { cy.expect(Accordion({ label: including(`Holdings: ${holdingToBeOpened}`) }).find(Badge()).has({ value: itemsCount.toString() })); }, + // need to be updated regarding to verifyQuantityOfItemsRelatedtoHoldings function verifyQuantityOfItemsOnPage(quantityOfItems, itemLoanType) { for (let i = 0; i < 200; i++) { - cy.expect(MultiColumnList({ ariaRowCount: `${quantityOfItems} + 1` }) - .find(MultiColumnListRow({rowIndexInParent: `row-${i}`})) + cy.expect(MultiColumnList({ ariaRowCount: `${quantityOfItems}` }) + .find(MultiColumnListRow({ rowIndexInParent: `row-${i}` })) .find(MultiColumnListCell({ columnIndex: 3, content: itemLoanType })) .exists()); } }, + verifyQuantityOfItemsRelatedtoHoldings(holdingToBeOpened, quantityOfItems) { + cy.do( + Accordion({ label: including(`Holdings: ${holdingToBeOpened}`) }) + .perform(el => { + const items = el.querySelectorAll('div[class^="mclRow-"]').length; + expect(quantityOfItems).to.eq(items); + }) + ); + }, + clickNextPaginationButton() { cy.do(Pane({ id:'pane-instancedetails' }).find(Button('Next')).click()); }, diff --git a/cypress/support/fragments/settings/orders/acquisitionMethods.js b/cypress/support/fragments/settings/orders/acquisitionMethods.js index 48f10b51f8..4dffc2d311 100644 --- a/cypress/support/fragments/settings/orders/acquisitionMethods.js +++ b/cypress/support/fragments/settings/orders/acquisitionMethods.js @@ -37,7 +37,7 @@ export default { cy.do([ TextField({ name: 'items[0].value' }).fillIn(AMName), acquisitionMethodPane.find(saveButton).click() - ]); + ]); }, checkcreatedAM: (AMName) => { diff --git a/cypress/support/utils/arrays.js b/cypress/support/utils/arrays.js index d9a8d5bc48..df3cff1f15 100644 --- a/cypress/support/utils/arrays.js +++ b/cypress/support/utils/arrays.js @@ -13,6 +13,23 @@ export default { } return a; }, + + compareArrays(arr1, arr2) { + const set1 = new Set(arr1); + const set2 = new Set(arr2); + + if (set1.size !== set2.size) { + return false; + } + + for (const value of set1) { + if (!set2.has(value)) { + return false; + } + } + + return true; + } }; export const randomizeArray = (array) => { From 25fa42e883f9d547c07039ed70871acb26de1594 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Tue, 22 Aug 2023 12:51:25 +0500 Subject: [PATCH 061/437] FAT-7480 (#1498) --- ...k-edit-in-app-item-add-notes-actions.cy.js | 100 ++++++++++++++++++ cypress/support/dictionary/permissions.js | 1 + .../fragments/bulk-edit/bulk-edit-actions.js | 84 ++++++++++++++- 3 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js new file mode 100644 index 0000000000..c9c38eba1e --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js @@ -0,0 +1,100 @@ +import TopMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import devTeams from '../../../support/dictionary/devTeams'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import FileManager from '../../../support/utils/fileManager'; +import Users from '../../../support/fragments/users/users'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import ExportFile from '../../../support/fragments/data-export/exportFile'; +import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; + +let user; +const firstNote = { + bulkEdit: 'first\nnote', + inventory: 'first note' +}; +const secondNote = 'secondNote~!@#$%^&*()~{.[]<}>øƧ'; +const thirdNote = 'third note'; + +const item = { + barcode: getRandomPostfix(), + instanceName: `instance-${getRandomPostfix()}`, +}; +const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`; +const changedRecordsFileName = `*-Changed-Records-${itemBarcodesFileName}`; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + permissions.inventoryCRUDItemNoteTypes.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); + FileManager.createFile(`cypress/fixtures/${itemBarcodesFileName}`, item.barcode); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); + FileManager.deleteFileFromDownloadsByMask(changedRecordsFileName); + }); + + it('C400662 Verify Bulk Edit actions for Items notes - add notes (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item barcode'); + + BulkEditSearchPane.uploadFile(itemBarcodesFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(item.barcode); + + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Administrative notes', 'Notes', 'Circulation Notes'); + BulkEditActions.openInAppStartBulkEditFrom(); + + BulkEditActions.verifyItemOptions(); + BulkEditActions.verifyItemAdminstrativeNoteActions(); + BulkEditActions.addItemNote('Administrative note', firstNote.bulkEdit); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyItemCheckInNoteActions(1); + BulkEditActions.addItemNote('Check in note', secondNote, 1); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyItemNoteActions(2); + BulkEditActions.addItemNote('Note', thirdNote, 2); + + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); + ExportFile.verifyFileIncludes(changedRecordsFileName, [firstNote.bulkEdit, secondNote, thirdNote]); + + BulkEditSearchPane.verifyChangesUnderColumns('Administrative notes', firstNote.bulkEdit); + BulkEditSearchPane.verifyChangesUnderColumns('Circulation Notes', secondNote); + BulkEditSearchPane.verifyChangesUnderColumns('Notes', thirdNote); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.checkItemAdministrativeNote(firstNote.inventory); + ItemRecordView.checkCheckInNote(secondNote, 'No'); + ItemRecordView.checkItemNote(thirdNote, 'No'); + }); + }); +}); diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 4c25719e6e..ecf5852ec7 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -60,6 +60,7 @@ export default { uiInventoryMarcItemUnknow:{ internal:'ui-inventory.items.mark-unknown', gui:'Inventory: Mark items unknown' }, uiCreateEditDeleteURL: { internal:'ui-inventory.settings.electronic-access-relationships', gui:'Settings (Inventory): Create, edit, delete URL relationships' }, inventoryCRUDHoldings: { internal: 'ui-inventory.holdings.delete', gui: 'Inventory: View, create, edit, delete holdings' }, + inventoryCRUDItemNoteTypes: { internal: 'ui-inventory.settings.item-note-types', gui: 'Settings (Inventory): Create, edit, delete item note types' }, // Tags uiTagsPermissionAll: { internal: 'ui-tags.permission.all', gui:'Tags: All permissions' }, uiViewTagsSettings: { internal: 'ui-tags.settings.view', gui:'Settings (Tags): Can view tags settings' }, diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index d0f8243dab..e99428e5e8 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -9,7 +9,9 @@ import { MultiColumnListHeader, MultiColumnListCell, TextField, - RepeatableFieldItem, Select, + RepeatableFieldItem, + Select, + TextArea, } from '../../../../interactors'; import DateTools from '../../utils/dateTools'; import BulkEditSearchPane from './bulk-edit-search-pane'; @@ -244,6 +246,61 @@ export default { cy.expect(Checkbox('Apply to items records').has({ checked: value })); }, + verifyItemAdminstrativeNoteActions(rowIndex = 0) { + const options = [ + 'Add note', + 'Remove all', + 'Find', + 'Change note type' + ]; + cy.do([ + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Administrative note'), + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).click(), + ]); + this.verifyPossibleActions(options); + }, + + addItemNote(type, value, rowIndex = 0) { + cy.do([ + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose(type), + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).choose('Add note'), + RepeatableFieldItem({ index: rowIndex }).find(TextArea()).fillIn(value) + ]); + }, + + verifyItemCheckInNoteActions(rowIndex = 0) { + const options = [ + 'Mark as staff only', + 'Remove mark as staff only', + 'Add note', + 'Remove all', + 'Find', + 'Change note type', + 'Duplicate to' + ]; + cy.do([ + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Check in note'), + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).click(), + ]); + this.verifyPossibleActions(options); + }, + + verifyItemNoteActions(rowIndex = 0) { + const options = [ + 'Mark as staff only', + 'Remove mark as staff only', + 'Add note', + 'Remove all', + 'Find', + 'Change note type', + ]; + cy.do([ + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Note'), + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).click(), + ]); + this.verifyPossibleActions(options); + }, + checkApplyToItemsRecordsCheckbox() { cy.do(Checkbox('Apply to items records').click()); }, @@ -415,5 +472,28 @@ export default { actions.forEach(action => { cy.expect(HTML(action).exists()); }); - } + }, + + verifyItemOptions(rowIndex = 0) { + const options = [ + 'Administrative note', + 'Check in note', + 'Check out note', + 'Action note', + 'Binding', + 'Copy note', + 'Electronic bookplate', + 'Note', + 'Provenance', + 'Reproduction', + 'Item status', + 'Permanent loan type', + 'Temporary loan type', + 'Permanent item location', + 'Temporary item location', + 'Suppress from discovery']; + + cy.do(RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).click()); + this.verifyPossibleActions(options); + }, }; From f83e3add27f3d2c692f3c4675a183c0d005845b4 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Tue, 22 Aug 2023 17:11:30 +0300 Subject: [PATCH 062/437] Implemented tests 2596, 2597, 2599, 2600 (#1501) --- .../create-text-field-custom-field.cy.js | 28 ++++++------- cypress/e2e/ideyalabs/notes/note-type.cy.js | 6 +-- ...cial-transactions-report-menu-option.cy.js | 37 ++++++++++++++++++ .../financialTransactionDetailReportModal.js | 39 ++++++++++++++++++- 4 files changed, 92 insertions(+), 18 deletions(-) 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 index c7038ed712..efe83f48a1 100644 --- 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 @@ -3,34 +3,34 @@ 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'; +import { randomFourDigitNumber } from '../../../support/utils/stringTools'; const textFieldData = { - fieldLabel: `Test${getFourDigitRandomNumber()}`, - helpText: `Testdata${getFourDigitRandomNumber()}`, + fieldLabel: `Test${randomFourDigitNumber()}`, + helpText: `Testdata${randomFourDigitNumber()}`, }; const testAreaData = { - fieldLabel: `dataArea${getFourDigitRandomNumber()}`, - helpText: `fillData${getFourDigitRandomNumber()}`, + fieldLabel: `dataArea${randomFourDigitNumber()}`, + helpText: `fillData${randomFourDigitNumber()}`, }; const checkboxData = { - fieldLabel: `CheckBox${getFourDigitRandomNumber()}`, - helpText: `testdata${getFourDigitRandomNumber()}`, + fieldLabel: `CheckBox${randomFourDigitNumber()}`, + helpText: `testdata${randomFourDigitNumber()}`, }; const radioButtonData = { data: { - fieldLabel: `RadioButton${getFourDigitRandomNumber()}`, - helpText: `testData${getFourDigitRandomNumber()}`, - label1: `Radio1${getFourDigitRandomNumber()}`, - label2: `Radio2${getFourDigitRandomNumber()}`, + fieldLabel: `RadioButton${randomFourDigitNumber()}`, + helpText: `testData${randomFourDigitNumber()}`, + label1: `Radio1${randomFourDigitNumber()}`, + label2: `Radio2${randomFourDigitNumber()}`, }, }; -const label2 = `select${getFourDigitRandomNumber()}`; +const label2 = `select${randomFourDigitNumber()}`; const singleSelectData = { data: { - fieldLabel: `Single Select Dropdown${getFourDigitRandomNumber()}`, + fieldLabel: `Single Select Dropdown${randomFourDigitNumber()}`, helpText: 'select One Data', - label1: `Select${getFourDigitRandomNumber()}`, + label1: `Select${randomFourDigitNumber()}`, label2, }, }; diff --git a/cypress/e2e/ideyalabs/notes/note-type.cy.js b/cypress/e2e/ideyalabs/notes/note-type.cy.js index 0d741c24e1..eec15c7f38 100644 --- a/cypress/e2e/ideyalabs/notes/note-type.cy.js +++ b/cypress/e2e/ideyalabs/notes/note-type.cy.js @@ -5,10 +5,10 @@ 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'; +import { randomFourDigitNumber } from '../../../support/utils/stringTools'; -const noteData = `New Note${getFourDigitRandomNumber()}`; -const noteType = `Item${getFourDigitRandomNumber()}`; +const noteData = `New Note${randomFourDigitNumber()}`; +const noteType = `Item${randomFourDigitNumber()}`; describe.skip('Settings', () => { before('Login to Folio', () => { diff --git a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js index af4300fec0..2794f66aa5 100644 --- a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js +++ b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js @@ -51,12 +51,49 @@ describe('Financial Transactions Detail Report', () => { FinancialTransactionDetailReportModal.verifyCancelButtonIsEnabled(); }); + it('C343307 Check that the user returns to the "User search result" page when click in the "Cancel" button or "X" button on the "Financial transactions detail report" modal', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + FinancialTransactionDetailReportModal.closeFinancialReportModalByCancelButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + FinancialTransactionDetailReportModal.closeFinancialReportModalByXButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); + }); + it('C343308 Check that the user can not close "Financial transactions detail report" modal when click on the outside the modal', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); UsersSearchResultsPane.clickActionsButton(); FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); }); + it('C343309 Check that the user can close "Financial transactions detail report" modal when click on the "Esc" button', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + FinancialTransactionDetailReportModal.closeFinancialReportModalByEscButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); + }); + + it('C343311 Check that the error message ""Start date" is required" is appears under Start date field', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.clickEndDateField(); + FinancialTransactionDetailReportModal.verifyStartDateIsRequiredErrorMessage(); + }); + + it('C343312 Check that the error message ""Start date" is required if "End date" entered" is appears under Start date field and has red color when End date was selected', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInEndDate(); + FinancialTransactionDetailReportModal.verifyStartDateIsRequiredIfEndDateEnteredErrorMessage(); + }); + + it('C343313 Check that the "End date" must be greater than or equal to "Start date" error message is appears when End date is less than Start date', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInStartDate('01/20/2020'); + FinancialTransactionDetailReportModal.fillInEndDate('01/10/2020'); + FinancialTransactionDetailReportModal.verifyEndDateMustBeGreaterThanOrEqualToStartDateErrorMessage(); + }); + it('C343316 Check that the "Save&close" button has become active after filling in all the required fields with valid data', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); diff --git a/cypress/support/fragments/users/financialTransactionDetailReportModal.js b/cypress/support/fragments/users/financialTransactionDetailReportModal.js index 6a12469f31..70d20a072c 100644 --- a/cypress/support/fragments/users/financialTransactionDetailReportModal.js +++ b/cypress/support/fragments/users/financialTransactionDetailReportModal.js @@ -1,5 +1,5 @@ import DateTools from '../../utils/dateTools'; -import { Button, Modal, TextField, Select, including, MultiSelect } from '../../../../interactors'; +import { Button, Modal, TextField, Select, including, MultiSelect, HTML } from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; const financialReport = Modal({ id: 'financial-transactions-report-modal' }); @@ -21,6 +21,11 @@ export default { } }, + fillInStartDate(startDate) { + if (startDate) cy.do(financialReport.find(startDateTextfield).fillIn(startDate)); + else cy.do(financialReport.find(startDateTextfield).fillIn(currentDayOfMonth)); + }, + fillInEndDate(endDate) { if (endDate) cy.do(financialReport.find(endDateTextfield).fillIn(endDate)); else cy.do(financialReport.find(endDateTextfield).fillIn(currentDayOfMonth)); @@ -68,5 +73,37 @@ export default { verifyFinancialReportModalIsShown() { cy.expect(financialReport.exists()); + }, + + verifyFinancialReportModalIsNotShown() { + cy.expect(financialReport.absent()); + }, + + closeFinancialReportModalByEscButton() { + cy.get('#financial-transactions-report-modal').type('{esc}'); + }, + + closeFinancialReportModalByXButton() { + cy.do(financialReport.find(Button({ id: 'financial-transactions-report-modal-close-button' })).click()); + }, + + closeFinancialReportModalByCancelButton() { + cy.do(financialReport.find(Button(including('Cancel'))).click()); + }, + + clickEndDateField() { + cy.do(financialReport.find(endDateTextfield).click()); + }, + + verifyStartDateIsRequiredErrorMessage() { + cy.expect(financialReport.find(HTML(including('"Start date" is required'))).exists()); + }, + + verifyStartDateIsRequiredIfEndDateEnteredErrorMessage() { + cy.expect(financialReport.find(HTML(including('"Start date" is required if "End date" entered'))).exists()); + }, + + verifyEndDateMustBeGreaterThanOrEqualToStartDateErrorMessage() { + cy.expect(financialReport.find(HTML(including('"End date" must be greater than or equal to "Start date"'))).exists()); } }; From 5ee2e034de826463582ff319488e7ef2874e20cd Mon Sep 17 00:00:00 2001 From: nayimovag Date: Wed, 23 Aug 2023 14:34:46 +0500 Subject: [PATCH 063/437] FAT-7654 (#1502) --- .../e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js | 2 +- .../bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js | 5 +---- .../e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js | 1 + .../csv/bulk-edit-csv-user-barcodes-preview.cy.js | 1 + .../bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js | 2 ++ .../csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js | 4 +++- .../bulk-edit-csv-user-records-confirmation-page.cy.js | 1 + .../e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js | 1 + .../csv/bulk-edit-csv-users-ids-label-cleanup.cy.js | 5 +---- .../e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js | 9 ++++----- .../in-app/bulk-edit-in-app-correct-user.cy.js | 1 + .../bulk-edit/in-app/bulk-edit-in-app-elements.cy.js | 6 ++---- .../in-app/bulk-edit-in-app-intellectual-item.cy.js | 1 + .../bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js | 1 + .../in-app/bulk-edit-in-app-several-holdings.cy.js | 7 ++----- .../in-app/bulk-edit-in-app-user-barcodes-error.cy.js | 8 +++----- .../in-app/bulk-edit-in-app-user-barcodes.cy.js | 10 +++------- .../bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js | 1 + .../bulk-edit-logs-in-app-users-external-ids.cy.js | 1 + .../permissions/bulk-edit-csv-query-permissions.cy.js | 6 ++---- .../bulk-edit-in-app-query-permissions.cy.js | 7 ++----- .../bulk-edit-permission-for-all-approaches.cy.js | 2 +- cypress/e2e/inventory/locations/item-locations.cy.js | 4 ++-- cypress/support/dictionary/permissions.js | 2 +- .../fragments/bulk-edit/bulk-edit-search-pane.js | 9 +++++---- 25 files changed, 44 insertions(+), 53 deletions(-) diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js index 9c864d41f5..4875bc99ee 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-external-ids.cy.js @@ -40,8 +40,8 @@ describe('bulk-edit', () => { }); it('C353954 Verify uploading file with External IDs (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('External IDs'); - BulkEditSearchPane.uploadFile(userExternalIDsFileName); BulkEditSearchPane.waitFileUploading(); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js index e014c87235..1b2f4d0075 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-ids-uploading.cy.js @@ -36,11 +36,8 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - afterEach('reload bulk-edit page', () => { - cy.visit(TopMenu.bulkEditPath); - }); - it('C353956 Verify uploading file with User UUIDs (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); 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 6d1b1b7e95..c5e552c232 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 @@ -40,6 +40,7 @@ describe('bulk-edit', () => { }); it('C388498 Negative: Verify Local updating records with invalid date (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); BulkEditSearchPane.uploadFile(userBarcodesFileName); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes-preview.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes-preview.cy.js index ee4865f535..408b27f9e5 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes-preview.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes-preview.cy.js @@ -35,6 +35,7 @@ describe('bulk-edit', () => { beforeEach('reload bulk-edit page', () => { cy.visit(TopMenu.bulkEditPath); + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); }); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js index 6536e806ae..35fe28a875 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-barcodes.cy.js @@ -38,6 +38,7 @@ describe('bulk-edit', () => { }); it('C347871 Uploading file with identifiers (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); BulkEditSearchPane.uploadFile(userBarcodesFileName); @@ -46,6 +47,7 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyMatchedResults(user.barcode); TopMenuNavigation.navigateToApp('Bulk edit'); + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); BulkEditSearchPane.uploadFile('example.json'); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js index 59db9f66fd..2b14423c77 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js @@ -33,6 +33,7 @@ describe('bulk-edit', () => { FileManager.createFile(`cypress/fixtures/${userBarcodesFileName}`, user.barcode); }) .then(() => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); BulkEditSearchPane.waitFileUploading(); @@ -61,12 +62,13 @@ describe('bulk-edit', () => { BulkEditActions.verifyNoNewBulkEditButton(); TopMenuNavigation.navigateToApp('Bulk edit'); BulkEditSearchPane.verifyBulkEditPaneItems(); - BulkEditSearchPane.usersRadioIsDisabled(false); + BulkEditSearchPane.isUsersRadioChecked(false); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); BulkEditSearchPane.verifyDefaultFilterState(); }); it('C353650 Verify new bulk edit with changed identifiers (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); BulkEditSearchPane.waitFileUploading(); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js index 78a0fa07a2..63d750a1d3 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-records-confirmation-page.cy.js @@ -41,6 +41,7 @@ describe('bulk-edit', () => { }); it('C357982 Verify user records - in app permission - confirmation page (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('Usernames'); BulkEditSearchPane.uploadFile(userUUIDsFileName); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js index 192e68c93a..b06cc939b5 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-usernames.cy.js @@ -40,6 +40,7 @@ describe('bulk-edit', () => { it('C353964 Verify uploading file with Usernames (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('Usernames'); BulkEditSearchPane.uploadFile(userUUIDsFileName); 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 35f272ab56..942b445416 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 @@ -36,11 +36,8 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - afterEach('reload bulk-edit page', () => { - cy.visit(TopMenu.bulkEditPath); - }); - it('C356817 Verify Matched records label cleanup -- Local approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js index 245c5584c9..fde735d5f0 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids.cy.js @@ -36,13 +36,13 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - afterEach('reload bulk-edit page', () => { + beforeEach('go to bulk-edit page', () => { cy.visit(TopMenu.bulkEditPath); + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); }); it('C353233 Verify number of updated records (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); - // Upload file BulkEditSearchPane.uploadFile(userUUIDsFileName); BulkEditSearchPane.waitFileUploading(); @@ -64,11 +64,10 @@ describe('bulk-edit', () => { }); it('C357034 Verify elements of the bulk edit app -- Local app (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); - BulkEditSearchPane.clickToBulkEditMainButton(); BulkEditSearchPane.verifyDefaultFilterState(); + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js index 3561b1a96c..27a1ecae55 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js @@ -96,6 +96,7 @@ describe('bulk-edit', () => { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading }); + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); cy.intercept('/bulk-operations/*').as('fileUpload2'); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js index 0874d3ea66..e1631334ad 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js @@ -39,6 +39,8 @@ describe('bulk-edit', () => { }); beforeEach('select item tab', () => { + cy.visit(TopMenu.bulkEditPath); + BulkEditSearchPane.checkItemsRadio(); BulkEditSearchPane.selectRecordIdentifier('Item barcode'); }); @@ -49,10 +51,6 @@ describe('bulk-edit', () => { FileManager.deleteFile(`cypress/fixtures/${validItemBarcodeFileName}`); }); - afterEach('reload bulk-edit page', () => { - cy.visit(TopMenu.bulkEditPath); - }); - it('C353232 Verify error accordion during matching (In app approach) (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.uploadFile(invalidItemBarcodesFileName); BulkEditSearchPane.waitFileUploading(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-intellectual-item.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-intellectual-item.cy.js index 9efc27de72..0cbfec8f2a 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-intellectual-item.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-intellectual-item.cy.js @@ -47,6 +47,7 @@ describe('bulk-edit', () => { }); it('C367922 Verify that User can update item status with "Intellectual item" (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkItemsRadio(); BulkEditSearchPane.selectRecordIdentifier('Item barcode'); BulkEditSearchPane.uploadFile(itemBarcodesFileName); BulkEditSearchPane.waitFileUploading(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js index 92b964f185..2ad25a5eeb 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-navigation.cy.js @@ -39,6 +39,7 @@ describe('bulk-edit', () => { }); it('C374149 Verify Bulk edit state when navigating to another app and back -- In app approach (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); BulkEditSearchPane.uploadFile(userBarcodesFileName); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js index 86bac57bf2..30bf0041b4 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-several-holdings.cy.js @@ -71,11 +71,6 @@ describe('bulk-edit', { retries: 2 }, () => { }); }); - beforeEach('select holdings', () => { - BulkEditSearchPane.checkHoldingsRadio(); - BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); - }); - after('delete test data', () => { InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item2.itemBarcode); @@ -84,6 +79,8 @@ describe('bulk-edit', { retries: 2 }, () => { }); it('C365126 Verify confirmation page after bulk editing holdings locations (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); BulkEditSearchPane.uploadFile(validHoldingUUIDsFileName); BulkEditSearchPane.waitFileUploading(); BulkEditSearchPane.verifyMatchedResults(item.hrid, item2.hrid); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js index ee53fc0283..b938b954c0 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes-error.cy.js @@ -36,13 +36,13 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - afterEach('reload bulk-edit page', () => { + beforeEach('go to bulk-edit page', () => { cy.visit(TopMenu.bulkEditPath); + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); }); it('C359586 Negative --Verify populating "Errors" accordion (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.uploadFile(userBarcodesFileName); BulkEditSearchPane.waitFileUploading(); @@ -58,8 +58,6 @@ describe('bulk-edit', () => { }); it('C347883 Error messages in submitted identifiers (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.uploadFile(userBarcodesFileNameWithDuplicates); BulkEditSearchPane.waitFileUploading(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js index 7bfe48e3bf..0671b320ec 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-barcodes.cy.js @@ -32,13 +32,13 @@ describe('bulk-edit', () => { FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); }); - afterEach('open new bulk-edit form', () => { + beforeEach('go to bulk-edit page', () => { cy.visit(TopMenu.bulkEditPath); + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); }); it('C359248 Verify "Email" option in bulk edit (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.uploadFile(userBarcodesFileName); BulkEditSearchPane.waitFileUploading(); @@ -48,8 +48,6 @@ describe('bulk-edit', () => { }); it('C359592 Verify updating Email in Bulk edit (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.uploadFile(userBarcodesFileName); BulkEditSearchPane.waitFileUploading(); @@ -70,8 +68,6 @@ describe('bulk-edit', () => { }); it('C359606 Negative -- Verify bulk edit Users emails (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); - BulkEditSearchPane.uploadFile(userBarcodesFileName); BulkEditSearchPane.waitFileUploading(); diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js index 0e1139f221..3d9572ef95 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users.cy.js @@ -46,6 +46,7 @@ describe('Bulk Edit - Logs', () => { }); it('C375217 Verify generated Logs files for Users Local (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); BulkEditSearchPane.waitLoading(); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-external-ids.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-external-ids.cy.js index 7ac029eb18..ee2735aaea 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-external-ids.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-external-ids.cy.js @@ -46,6 +46,7 @@ describe('Bulk Edit - Logs', () => { cy.visit(TopMenu.bulkEditPath); BulkEditSearchPane.waitLoading(); + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('External IDs'); BulkEditSearchPane.uploadFile(userExternalIDsFileName); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js index dbfdf3f3b6..592accbf38 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-query-permissions.cy.js @@ -52,16 +52,13 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyRecordTypesEmpty(); BulkEditSearchPane.isBuildQueryButtonDisabled(true); - // Need to wait for verification to complete - cy.wait(2000); cy.login(userWithProfileView.username, userWithProfileView.password, { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading }); BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); - BulkEditSearchPane.usersRadioIsDisabled(false); - BulkEditSearchPane.isUsersRadioChecked(); + BulkEditSearchPane.isUsersRadioChecked(false); BulkEditSearchPane.isDragAndDropAreaDisabled(true); BulkEditSearchPane.openQuerySearch(); @@ -69,6 +66,7 @@ describe('bulk-edit', () => { BulkEditSearchPane.usersRadioIsDisabled(false); BulkEditSearchPane.isBuildQueryButtonDisabled(false); + BulkEditSearchPane.isUsersRadioChecked(false); BulkEditSearchPane.clickBuildQueryButton(); BulkEditSearchPane.verifyBuildQueryModal(); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js index 99afa7ead3..0fea399e75 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-in-app-query-permissions.cy.js @@ -50,8 +50,6 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyRecordTypesEmpty(); BulkEditSearchPane.isBuildQueryButtonDisabled(true); - // Need to wait for verification to complete - cy.wait(2000); cy.login(userWithInventoryView.username, userWithInventoryView.password, { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading @@ -59,17 +57,16 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query'); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); BulkEditSearchPane.itemsRadioIsDisabled(false); - BulkEditSearchPane.isItemsRadioChecked(); + BulkEditSearchPane.isItemsRadioChecked(false); BulkEditSearchPane.holdingsRadioIsDisabled(false); BulkEditSearchPane.isDragAndDropAreaDisabled(true); BulkEditSearchPane.openQuerySearch(); BulkEditSearchPane.verifySpecificTabHighlighted('Query'); BulkEditSearchPane.itemsRadioIsDisabled(false); - BulkEditSearchPane.isItemsRadioChecked(); + BulkEditSearchPane.isItemsRadioChecked(false); BulkEditSearchPane.holdingsRadioIsDisabled(false); BulkEditSearchPane.isBuildQueryButtonDisabled(false); - BulkEditSearchPane.clickBuildQueryButton(); BulkEditSearchPane.verifyBuildQueryModal(); }); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-permission-for-all-approaches.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-permission-for-all-approaches.cy.js index 752ab05c2c..2bc4fa7c64 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-permission-for-all-approaches.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-permission-for-all-approaches.cy.js @@ -57,7 +57,7 @@ describe('bulk-edit', () => { BulkEditActions.downloadErrorsExists(); TopMenuNavigation.navigateToApp('Bulk edit'); - + BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); BulkEditSearchPane.uploadFile(usersBarcodesFileName); diff --git a/cypress/e2e/inventory/locations/item-locations.cy.js b/cypress/e2e/inventory/locations/item-locations.cy.js index 30ba6e2173..9f96c3da84 100644 --- a/cypress/e2e/inventory/locations/item-locations.cy.js +++ b/cypress/e2e/inventory/locations/item-locations.cy.js @@ -108,7 +108,7 @@ describe('ui-inventory: location', () => { // verify results InventoryInstance.checkHoldingsTable( toBeEditedLocationName, - 1, + 0, '-', ITEM_BARCODE, ITEM_STATUS_NAMES.AVAILABLE, @@ -137,7 +137,7 @@ describe('ui-inventory: location', () => { // verify results InventoryInstance.checkHoldingsTable( editedLocationName, - 1, + 0, '-', ITEM_BARCODE, ITEM_STATUS_NAMES.AVAILABLE, diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index ecf5852ec7..cf377aff89 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -71,7 +71,7 @@ export default { uiUsersEdituserservicepoints: { internal: 'ui-users.edituserservicepoints', gui: 'Users: Can assign and unassign service points to users' }, // Locations uiTenantSettingsSettingsLocation:{ internal: 'ui-tenant-settings.settings.location', gui:'Settings (tenant): Can create, edit and remove locations' }, - uiTenantSettingsServicePointsCRUD:{ internal: 'ui-tenant-settings.settings.servicepoints', gui:'Settings (tenant): Can create, edit and remove service points' }, + uiTenantSettingsServicePointsCRUD:{ internal: 'ui-tenant-settings.settings.servicepoints', gui:'Settings (tenant): Can create, edit and remove service points' }, // DataImport dataImportUploadAll:{ internal: 'data-import.upload.all', gui:'Data Import File Upload - all permissions' }, moduleDataImportEnabled:{ internal: 'ui-data-import.settings.manage', gui:'Data import: Can upload files, import, and view logs' }, 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 5f09a98ae8..16520c0a41 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -450,8 +450,8 @@ export default { cy.expect(usersRadio.has({ disabled: isDisabled })); }, - isUsersRadioChecked() { - cy.expect(usersRadio.has({ checked: true })); + isUsersRadioChecked(checked = true) { + cy.expect(usersRadio.has({ checked })); }, checkItemsRadio() { @@ -462,8 +462,8 @@ export default { cy.expect(itemsRadio.has({ disabled: isDisabled })); }, - isItemsRadioChecked() { - cy.expect(itemsRadio.has({ checked: true })); + isItemsRadioChecked(checked = true) { + cy.expect(itemsRadio.has({ checked })); }, checkHoldingsRadio() { @@ -895,6 +895,7 @@ export default { isBuildQueryButtonDisabled(isDisabled) { cy.expect((buildQueryButton).has({ disabled: isDisabled })); + cy.wait(2000); }, clickBuildQueryButton() { From 044be5d3731b7b2223ce78896822e3a8f63bece0 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Wed, 23 Aug 2023 19:28:03 +0300 Subject: [PATCH 064/437] FAT-5111-C375163 (#1503) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-5133: added steps * FAT-5111: updated methods * FAT-5111: test implemented * FAT-5111: Updated test data for C375256 --- .../search/browse-subjects-linked.cy.js | 118 ++++++++++++++++++ .../search/search-in-inventory-linked.cy.js | 12 +- cypress/fixtures/marcAuthC375163.mrc | 1 + cypress/fixtures/marcAuthFileC375256_1.mrc | 2 +- cypress/fixtures/marcAuthFileC375256_2.mrc | 2 +- cypress/fixtures/marcBibC359596.mrc | 2 +- cypress/fixtures/marcBibC375163.mrc | 1 + cypress/fixtures/marcBibFileC375256.mrc | 2 +- .../inventory/inventorySearchAndFilter.js | 8 ++ .../inventory/search/browseContributors.js | 6 +- .../inventory/search/browseSubjects.js | 49 +++++++- 11 files changed, 186 insertions(+), 17 deletions(-) create mode 100644 cypress/e2e/inventory/search/browse-subjects-linked.cy.js create mode 100644 cypress/fixtures/marcAuthC375163.mrc create mode 100644 cypress/fixtures/marcBibC375163.mrc diff --git a/cypress/e2e/inventory/search/browse-subjects-linked.cy.js b/cypress/e2e/inventory/search/browse-subjects-linked.cy.js new file mode 100644 index 0000000000..91fca789fc --- /dev/null +++ b/cypress/e2e/inventory/search/browse-subjects-linked.cy.js @@ -0,0 +1,118 @@ +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 InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import BrowseSubjects from '../../../support/fragments/inventory/search/browseSubjects'; +import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; +import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; +import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; +import { JOB_STATUS_NAMES } from '../../../support/constants'; + +describe('Inventory: Subject Browse', () => { + const testData = { + tag010: '010', + tag610: '610', + subjectName: 'C375163 SuperCorp', + instanceTitle: 'C375163 Testfire : a litany for survival' + }; + + const marcFiles = [ + { + marc: 'marcBibC375163.mrc', + fileName: `testMarcFileC375163.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib' + }, + { + marc: 'marcAuthC375163.mrc', + fileName: `testMarcFileC375163.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + naturalId: 'gf201402375163' + } + ]; + + const createdRecordIDs = []; + + before('Creating data', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiCanLinkUnlinkAuthorityRecordsToBibRecords.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.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); + Logs.getCreatedItemsID().then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag610); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(testData.subjectName); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].naturalId}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag610); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + + after('Deleting created user and data', () => { + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C375163 Browse | Separate entries for "Subjects" from linked and unlinked "6XX" fields of "MARC bib" record (same subject names) (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventorySearchAndFilter.switchToBrowseTab(); + InventorySearchAndFilter.verifyKeywordsAsDefault(); + BrowseSubjects.select(); + BrowseSubjects.browse(testData.subjectName); + BrowseSubjects.checkNoAuthorityIconDisplayedForRow(5, testData.subjectName); + BrowseSubjects.checkAuthorityIconAndValueDisplayedForRow(6, testData.subjectName); + BrowseSubjects.checkRowValueIsBold(5, testData.subjectName); + BrowseSubjects.checkRowValueIsBold(6, testData.subjectName); + InventorySearchAndFilter.switchToSearchTab(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.clickUnlinkIconInTagField(20); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventorySearchAndFilter.switchToBrowseTab(); + BrowseSubjects.select(); + BrowseSubjects.browse(testData.subjectName); + BrowseSubjects.checkNoAuthorityIconDisplayedForRow(5, testData.subjectName); + BrowseSubjects.checkValueAbsentInRow(6, testData.subjectName); + BrowseSubjects.checkRowValueIsBold(5, testData.subjectName); + }); +}); diff --git a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js index b39a2a3141..80fe6d6542 100644 --- a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js +++ b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js @@ -22,10 +22,10 @@ describe('Search in Inventory', () => { 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"' + allRecords: 'alternativeTitles.alternativeTitle = "bibleC375256"', + secondLinkedRecord: 'alternativeTitles.alternativeTitle = "Hosanna BibleC375256"', + bothLinkedRecords: 'alternativeTitles.alternativeTitle = "Hosanna BibleC375256" OR alternativeTitles.alternativeTitle = "BibleC375256. Polish."', + linkedAndFirstNotLinkedRecords: 'alternativeTitles.alternativeTitle = "Hosanna BibleC375256" OR alternativeTitles.alternativeTitle = "BibleC375256. Polish." OR alternativeTitles.alternativeTitle = "BibleC375256 1"' }, searchResults: { firstLinkedRecord: 'Prayer Bible (Test record with 130 linked field).', @@ -46,7 +46,7 @@ describe('Search in Inventory', () => { marc: 'marcAuthFileC375256_1.mrc', fileName: `testMarcFileC375256.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', - authorityHeading: 'Bible. Polish. Biblia PÅ‚ocka C375256', + authorityHeading: 'BibleC375256. Polish. Biblia PÅ‚ocka C375256', authority010FieldValue: 'n92085235375256', numberOfRecords: 1 }, @@ -54,7 +54,7 @@ describe('Search in Inventory', () => { marc: 'marcAuthFileC375256_2.mrc', fileName: `testMarcFileC375256.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', - authorityHeading: 'Abraham, Angela, C375256 Hosanna Bible', + authorityHeading: 'Abraham, Angela, C375256 Hosanna', authority010FieldValue: 'n99036055375256', numberOfRecords: 1 }, diff --git a/cypress/fixtures/marcAuthC375163.mrc b/cypress/fixtures/marcAuthC375163.mrc new file mode 100644 index 0000000000..92ba40dcae --- /dev/null +++ b/cypress/fixtures/marcAuthC375163.mrc @@ -0,0 +1 @@ +02602cz a2200349n 4500001000800000005001700008008004100025010001900066035001700085040003500102110002200137455001200159455001100171455001700182555001900199670005800218670030600276670035900582670022300941670021501164670039601379670015101775670006701926670005901993670004102052910005102093910005302144985000802197985002302205906001202228906001202240985899020210911060015.0141201|| anznnbabn |a ana | agf201402375163 agf2014026297 aIlChALCSbengcDLCflcgftdDLC aC375163 SuperCorp aDramasx aPlaysx aStage playsx wgaLiteraturex 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 index 9620834267..e6f562427e 100644 --- a/cypress/fixtures/marcAuthFileC375256_1.mrc +++ b/cypress/fixtures/marcAuthFileC375256_1.mrc @@ -1 +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 aKnapinÌski, R. Iluminacje romanÌ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 +00605cz a2200169n 450000100070000000500170000700800410002401000200006503500210008504000180010613000520012443000190017643000190019567001800021467500320039495300090042676691219920825111123.7920825n| acannaab |a ana  an92085235375256 a(DLC)n 92085235 aDLCcDLCdDLC 0aBibleC375256.lPolish.sBiblia PÅ‚ockadC375256 0aBiblia PÅ‚ocka 0aPÅ‚ocka Biblia aKnapinÌski, R. Iluminacje romanÌ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 index 0549b63845..50a9544a61 100644 --- a/cypress/fixtures/marcAuthFileC375256_2.mrc +++ b/cypress/fixtures/marcAuthFileC375256_2.mrc @@ -1 +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 +00413nz a2200145n 450000100070000000500170000700800410002401000200006503500210008504000180010610000520012440000500017667000320022695300090025892724919990513143117.3990513n| acannaabn |a aaa  an99036055375256 a(DLC)n 99036055 aDLCbengcDLC10aAbraham, Angela,dC375256tHosanna BibleC37525610aAbraham, Angela,d1958-tJesus loves me Bible aJesus loves me Bible, 1999. ash21 \ No newline at end of file diff --git a/cypress/fixtures/marcBibC359596.mrc b/cypress/fixtures/marcBibC359596.mrc index fabe561b36..d6926b8749 100644 --- a/cypress/fixtures/marcBibC359596.mrc +++ b/cypress/fixtures/marcBibC359596.mrc @@ -1 +1 @@ -02490cam a2200361 i 45000010011000000030006000110050017000170080041000340100017000750400063000920200050001550200047002050350022002520420008002740500024002820820015003061000088003211000088004092400023004972450032005202640046005522640011005983000022006093360026006313370028006573380027006855040041007125050866007535200370016196500035019896550019020249800085020431005829214OCoLC20180605090557.6171003t20182018mnu b 000 p eng c a 2017040746 aPULbengerdacPULdYDXdBDXdVKCdYW6dDLCdMNWdEAUdIPU a9781566895095q(softcover ;qacid-free paper) a156689509Xq(softcover ;qacid-free paper) a(OCoLC)1005829214 apcc00aPS3614.G87bA6 201800a811/.62231 aMcOrmond, Steven Craig (Test)d1971-eauthor.9bb30e977-f934-4a2f-8fb8-858bac51b7ab1 aMcOrmond, Steven Craig (Test)d1971-eauthor.9bb30e977-f934-4a2f-8fb8-858bac51b7ac10aPoems.kSelections10aNot here (Test AuthorityID) 1aMinneapolis :bCoffee House Press,c2018. 4c©2018 a73 pages ;c23 cm atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aIncludes bibliographical references.00tWhite boy time machine: instruction manual --tLesson --tAgain, let me tell you what I know about trust --tStill, somehow --tNguyẽn --tElegy for the first --tWhite boy time machine: software --tType II --tAttending the party --tDear X --tThe study --tWhite boy time machine: joy ride --tAgain, what do I know about desire? --tCockfight --t#2 --tAgain, let me explain again --tWhite boy time machine: return policy --tBaptism --tApology, sort of --tProbe --tPunish --tMercy --tWhite boy time machine: safety tips --tB.F.F. --tPig --tHosting --tWhite boy time machine: override --tChangeling --tCommute --tOde to the pubic hair stuck in my throat --tNote --tPolitics of an elegy --tWhite boy time machine: error --tThe ranger --tAfterwards --tReunion --tHeavy --tMonica West is moving to Omaha, Nebraska --tNote on staying. a"Not Here is a flight plan for escape and a map for navigating home; a queer Vietnamese American body in confrontation with whiteness, trauma, family, and nostalgia; and a big beating heart of a book. Nguyen's poems ache with loneliness and desire and the giddy terrors of allowing yourself to hope for love, and revel in moments of connection achieved"--Amazon.com 0aAmerican poetryy21st century. 7aPoetry.2lcgft a40028235767bPOE2cGendJRLeYBPg509509h606313i180611lPaperm16.99q1j16.99 \ No newline at end of file +02630cam a2200421 i 45000010011000000030006000110050017000170080041000340100017000750400063000920200050001550200047002050350022002520420008002740500024002820820015003061000088003211000088004092400023004972450032005202640046005522640011005983000022006093360026006313370028006573380027006855040041007125050866007535200370016196500035019896550019020247100016020437100016020597100016020757100016020917100016021079800085021231005829214OCoLC20180605090557.6171003t20182018mnu b 000 p eng c a 2017040746 aPULbengerdacPULdYDXdBDXdVKCdYW6dDLCdMNWdEAUdIPU a9781566895095q(softcover ;qacid-free paper) a156689509Xq(softcover ;qacid-free paper) a(OCoLC)1005829214 apcc00aPS3614.G87bA6 201800a811/.62231 aMcOrmond, Steven Craig (Test)d1971-eauthor.9bb30e977-f934-4a2f-8fb8-858bac51b7ab1 aMcOrmond, Steven Craig (Test)d1971-eauthor.9bb30e977-f934-4a2f-8fb8-858bac51b7ac10aPoems.kSelections10aNot here (Test AuthorityID) 1aMinneapolis :bCoffee House Press,c2018. 4c©2018 a73 pages ;c23 cm atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aIncludes bibliographical references.00tWhite boy time machine: instruction manual --tLesson --tAgain, let me tell you what I know about trust --tStill, somehow --tNguyẽn --tElegy for the first --tWhite boy time machine: software --tType II --tAttending the party --tDear X --tThe study --tWhite boy time machine: joy ride --tAgain, what do I know about desire? --tCockfight --t#2 --tAgain, let me explain again --tWhite boy time machine: return policy --tBaptism --tApology, sort of --tProbe --tPunish --tMercy --tWhite boy time machine: safety tips --tB.F.F. --tPig --tHosting --tWhite boy time machine: override --tChangeling --tCommute --tOde to the pubic hair stuck in my throat --tNote --tPolitics of an elegy --tWhite boy time machine: error --tThe ranger --tAfterwards --tReunion --tHeavy --tMonica West is moving to Omaha, Nebraska --tNote on staying. a"Not Here is a flight plan for escape and a map for navigating home; a queer Vietnamese American body in confrontation with whiteness, trauma, family, and nostalgia; and a big beating heart of a book. Nguyen's poems ache with loneliness and desire and the giddy terrors of allowing yourself to hope for love, and revel in moments of connection achieved"--Amazon.com 0aAmerican poetryy21st century. 7aPoetry.2lcgft aATestValue1 aATestValue2 aATestValue3 aATestValue4 aATestValue5 a40028235767bPOE2cGendJRLeYBPg509509h606313i180611lPaperm16.99q1j16.99 \ No newline at end of file diff --git a/cypress/fixtures/marcBibC375163.mrc b/cypress/fixtures/marcBibC375163.mrc new file mode 100644 index 0000000000..0b0a4fbbe1 --- /dev/null +++ b/cypress/fixtures/marcBibC375163.mrc @@ -0,0 +1 @@ +01685cam a2200385Ii 41y00010009000000050017000090080041000260030004000670400028000710200015000990200031001140350022001450500027001670820014001941000086002082450108002942640049004023000027004513360068004783370068005463380065006145200205006796000022008846100017009066500016009236500016009396500016009556500016009716500016009877000078010037000020010819030009011019280086011109270103011961194806420191023111031.6191004s2019 ilua 000 p eng dICU aCOObengerdacCOOdUOK a1642590258 a9781642590258q(paperback) a(OCoLC)1122747273 4aPR9265.9.C53bC76 2019 4a811.62231 aC375163 Chin, Staceyann,d1972-eAuthoreNarrator 1http://viaf.org/viaf/2407405210aTestfire :ba litany for survival : poems 1998-2019 /cStaceyann Chin ; foreword by Jacqueline Woodson. 1aChicago, Illinois :bHaymarket Books,c2019. axi, 208 pages ;c23 cm atext2rdacontent0http://id.loc.gov/vocabulary/contentTypes/txt aunmediated2rdamedia0http://id.loc.gov/vocabulary/mediaTypes/n avolume2rdacarrier0http://id.loc.gov/vocabulary/carriers/nc a"Crossfire collects world-renowned lesbian poet and spoken-word artist Staceyann Chin's empowering, feminist-LGBTQ-Caribbean, activism-driven poetry for the first time in a single book."-- Back cover. aC375163 SuperCorp aC375163 Acme aBTestValue1 aBTestValue2 aBTestValue3 aBTestValue4 aBTestValue51 aWoodson, Jacqueline,ewriter of foreword. 1http://viaf.org/viaf/791171201 aChin, Staceyann aHeVa tLibrary of Congress classificationaPR9265.9.C53 C76 2019lJRLcJRL-Geni11444263 tLibrary of Congress classificationaPR9265.9.C53 C76 2019lJRLcJRL-GeneHESMb116492753i10165013 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC375256.mrc b/cypress/fixtures/marcBibFileC375256.mrc index 6a14ad141f..ebbcf07070 100644 --- a/cypress/fixtures/marcBibFileC375256.mrc +++ b/cypress/fixtures/marcBibFileC375256.mrc @@ -1 +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.06aBiblevPrieÌ€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.06aBiblevPrieÌ€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.06aBiblevPrieÌ€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.06aBiblevPrieÌ€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 +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.06aBiblevPrieÌ€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.06aBiblevPrieÌ€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 HOLDINGS03766cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375246001900393245005800412246002100470250002300491264004900514264001100563300003900574336002600613337002600639338003600665588002600701500004600727500006500773500002200838520036700860505060101227505038901828520020902217630002002426630003402446630002202480630003702502655002202539655005302561710003202614776012902646856010702775856010802882938004502990938002903035938004103064994001403105948004503119nin00009530419190504s2019 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 aBibleC375256 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.06aBiblevPrieÌ€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 HOLDINGS03766cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375247001900393245005800412246002100470250002300491264004900514264001100563300003900574336002600613337002600639338003600665588002600701500004600727500006500773500002200838520036700860505060101227505038901828520020902217630002002426630003402446630002202480630003702502655002202539655005302561710003202614776012902646856010702775856010802882938004502990938002903035938004103064994001403105948004503119nin00009530419190504s2019 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 aBibleC375256 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.06aBiblevPrieÌ€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/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 126a7d2ef9..75bc44889e 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -66,6 +66,8 @@ const nextButton = Button({ id: 'browse-results-list-callNumbers-next-paging-but const previousButton = Button({ id: 'browse-results-list-callNumbers-prev-paging-button' }); const instancesList = paneResultsSection.find(MultiColumnList({ id: 'list-inventory' })); +const searchToggleButton = Button({ id: 'mode-navigation-search' }); + const searchInstanceByHRID = (id) => { cy.do([ Select({ id: 'input-inventory-search-qindex' }).choose('Instance HRID'), @@ -638,10 +640,16 @@ export default { holdingsPermanentLocationAccordion.find(TextField()).click(); cy.do(holdingsPermanentLocationAccordion.find(Checkbox(location)).click()); }, + checkRowsCount: (expectedRowsCount) => { cy.expect([ instancesList.find(MultiColumnListRow({ index: expectedRowsCount - 1 })).exists(), instancesList.find(MultiColumnListRow({ index: expectedRowsCount })).absent() ]); + }, + + switchToSearchTab() { + cy.do(searchToggleButton.click()); + cy.expect(effectiveLocationInput.exists()); } }; diff --git a/cypress/support/fragments/inventory/search/browseContributors.js b/cypress/support/fragments/inventory/search/browseContributors.js index 56a3d387c4..7bb8a55ab2 100644 --- a/cypress/support/fragments/inventory/search/browseContributors.js +++ b/cypress/support/fragments/inventory/search/browseContributors.js @@ -142,9 +142,9 @@ export default { checkAuthorityIconAndValueDisplayedForMultipleRows(rowCount, value) { for (let i = 0; i < rowCount; i++) { cy.expect([ - MultiColumnListCell({ row: 5 + i, columnIndex: 0 }).has({ innerHTML: including(`${value}`) }), - MultiColumnListCell({ row: 5 + i, columnIndex: 0 }).has({ innerHTML: including('') }), + MultiColumnListCell({ row: i + 5, columnIndex: 0 }).has({ innerHTML: including(`${value}`) }), + MultiColumnListCell({ row: i + 5, columnIndex: 0 }).has({ innerHTML: including('') }), ]); } }, diff --git a/cypress/support/fragments/inventory/search/browseSubjects.js b/cypress/support/fragments/inventory/search/browseSubjects.js index bef91df68b..2085c38efc 100644 --- a/cypress/support/fragments/inventory/search/browseSubjects.js +++ b/cypress/support/fragments/inventory/search/browseSubjects.js @@ -1,8 +1,8 @@ -import { Button, MultiColumnListCell, Pane, TextField, Link, MultiColumnListHeader, MultiColumnListRow, Section } from '../../../../../interactors'; import { including } from 'bigtest'; +import { Button, MultiColumnListCell, Pane, TextField, Link, MultiColumnListHeader, MultiColumnListRow, Section, TextInput, Select } from '../../../../../interactors'; import InventorySearchAndFilter from '../inventorySearchAndFilter'; -const searchButton = Button('Search'); +const searchButton = Button('Search', { type: 'submit' }); const browseInventoryPane = Pane('Browse inventory'); const searchFilterPane = Pane('Search & filter'); const inventorySearchResultsPane = Section({ id: 'browse-inventory-results-pane' }); @@ -10,6 +10,8 @@ const nextButton = Button({ id: 'browse-results-list-browseSubjects-next-paging- const previousButton = Button({ id: 'browse-results-list-browseSubjects-prev-paging-button' }); const mclhSubjectTitle = MultiColumnListHeader({ id: 'list-column-subject' }); const mclhNumberOfTTitle = MultiColumnListHeader({ id: 'list-column-numberoftitles' }); +const recordSearch = TextInput({ id: 'input-record-search' }); +const browseOptionSelect = Select('Search field index'); export default { verifySearchButtonDisabled() { @@ -65,7 +67,7 @@ export default { clickNextPaginationButton() { cy.do(inventorySearchResultsPane.find(nextButton).click()); }, - + clickPreviousPaginationButton() { cy.do(inventorySearchResultsPane.find(previousButton).click()); }, @@ -87,4 +89,43 @@ export default { this.verifySearchButtonDisabled(); InventorySearchAndFilter.browseSearch(searchString); }, -} \ No newline at end of file + + checkAuthorityIconAndValueDisplayedForRow(rowIndex, value) { + cy.expect([ + MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ content: including(`${value}`) }), + MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ innerHTML: including('') }), + ]); + }, + + checkNoAuthorityIconDisplayedForRow(rowIndex, value) { + cy.expect([ + MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ content: including(`${value}`) }), + MultiColumnListCell({ row: rowIndex, columnIndex: 0, innerHTML: including('alt="MARC Authorities module">') }).absent(), + ]); + }, + + checkRowValueIsBold(rowNumber, value) { + cy.expect(MultiColumnListCell({ row: rowNumber, columnIndex: 0 }).has({ innerHTML: including(`${value}`) })); + }, + + browse(subjectName) { + cy.do(recordSearch.fillIn(subjectName)); + cy.expect([ + recordSearch.has({ value: subjectName }), + searchButton.has({ disabled: false }) + ]); + cy.do(searchButton.click()); + }, + + select() { + // cypress can't draw selected option without wait + cy.wait(1000); + cy.do(browseOptionSelect.choose('Subjects')); + cy.expect(browseOptionSelect.has({ value: 'browseSubjects' })); + }, + + checkValueAbsentInRow(rowIndex, value) { + cy.expect(MultiColumnListCell({ row: rowIndex, columnIndex: 0, content: including(value) }).absent()); + } +}; From ddf404aa45145f4f21364df46888ee22eaad8ec6 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:45:03 +0300 Subject: [PATCH 065/437] FAT-6543-C388506 (#1499) * added test * renamed files * added checks * changed test type --- ...it-file-and-reimport-to-update-items.cy.js | 2 +- ...critics-or-nonRoman-alphabet-records.cy.js | 2 +- ...ems-with-errors-in-multiple-holdings.cy.js | 150 ++++++++++++++++++ ...-after-editing-marc-bib-in-quickMarc.cy.js | 2 +- ...d100-to-authority100-with-subfield-0.cy.js | 54 +++---- ...-marc-authority-browse-by-name-title.cy.js | 58 +++---- cypress/fixtures/marcBibFileForC388506.mrc | 1 + ...ileForC11123.mrc => marcFileForC11123.mrc} | 0 ...eForC356829.mrc => marcFileForC356829.mrc} | 0 ...eForC380554.mrc => marcFileForC380554.mrc} | 0 ...cFileForC6709.mrc => marcFileForC6709.mrc} | 0 .../fragments/data_import/logs/fileDetails.js | 32 +++- 12 files changed, 234 insertions(+), 67 deletions(-) create mode 100644 cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-with-errors-in-multiple-holdings.cy.js create mode 100644 cypress/fixtures/marcBibFileForC388506.mrc rename cypress/fixtures/{mrcFileForC11123.mrc => marcFileForC11123.mrc} (100%) rename cypress/fixtures/{mrcFileForC356829.mrc => marcFileForC356829.mrc} (100%) rename cypress/fixtures/{mrcFileForC380554.mrc => marcFileForC380554.mrc} (100%) rename cypress/fixtures/{mrcFileForC6709.mrc => marcFileForC6709.mrc} (100%) 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 fde8ae5aa5..3ef2246ca6 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 @@ -33,7 +33,7 @@ describe('data-import', () => { let instanceHrid; const quantityOfItems = '1'; const uniqSubject = `35678123678${GenerateIdentifierCode.getRandomIdentifierCode()}`; - const filePathForUpload = 'mrcFileForC11123.mrc'; + const filePathForUpload = 'marcFileForC11123.mrc'; const instance = { instanceTitle: 'Love enough / Dionne Brand.', instanceSubject: uniqSubject, diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js index 0993ec3ba8..7704159f4c 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-lots-of-diacritics-or-nonRoman-alphabet-records.cy.js @@ -63,7 +63,7 @@ describe('data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // upload a marc file for creating of the new instance cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile('mrcFileForC6709.mrc', nameMarcFileForCreate); + DataImport.uploadFile('marcFileForC6709.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(nameMarcFileForCreate); diff --git a/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-with-errors-in-multiple-holdings.cy.js b/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-with-errors-in-multiple-holdings.cy.js new file mode 100644 index 0000000000..a9a46a2681 --- /dev/null +++ b/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-with-errors-in-multiple-holdings.cy.js @@ -0,0 +1,150 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import { + FOLIO_RECORD_TYPE, + LOCATION_NAMES, + LOAN_TYPE_NAMES, + ITEM_STATUS_NAMES, + ACCEPTED_DATA_TYPE_NAMES, + JOB_STATUS_NAMES +} from '../../../support/constants'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +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 DataImport from '../../../support/fragments/data_import/dataImport'; +import TopMenu from '../../../support/fragments/topMenu'; +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 InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; + +describe('data-import', () => { + describe('Log details', () => { + let user; + let instanceHRID; + const quantityOfCreatedHoldings = 5; + const quantityOfCreatedItems = 8; + const quantityOfErrors = 5; + const arrayOfHoldingsStatuses = ['Created (KU/CC/DI/M)', 'Created (KU/CC/DI/A)', 'Created (E)', 'No action', 'No action']; + const holdingsData = { permanentLocation: LOCATION_NAMES.MAIN_LIBRARY_UI, + itemsQuqntity: 3 }; + const filePathForUpload = 'marcBibFileForC388506.mrc'; + const marcFileName = `C388506 autotestFileName.${getRandomPostfix()}`; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C388506 Test multiple holdings.${getRandomPostfix()}`, + permanentLocation: '945$h' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C388506 Test multiple holdings.${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C388506 Test multiple items.${getRandomPostfix()}`, + materialType: '945$a', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.AVAILABLE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C388506 Test multiple items.${getRandomPostfix()}` } + } + ]; + const jobProfile = { ...NewJobProfile.defaultJobProfile, + profileName: `C388506 Test multiple items.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; + + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + instance.items.forEach(item => cy.deleteItemViaApi(item.id)); + instance.holdings.forEach(holding => cy.deleteHoldingRecordViaApi(holding.id)); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C388506 Check the log result table for imported multiple items with errors in multiple holdings (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create mapping profiles + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[0].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[1].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[1].mappingProfile.status); + 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('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload .mrc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForUpload, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED_WITH_ERRORS); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.verifyMultipleHoldingsStatus(arrayOfHoldingsStatuses, quantityOfCreatedHoldings); + FileDetails.verifyMultipleItemsStatus(quantityOfCreatedItems); + FileDetails.verifyMultipleErrorStatus(quantityOfErrors); + + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + }); + InventoryInstance.checkIsHoldingsCreated([`${holdingsData.permanentLocation} >`]); + InventoryInstance.openHoldingsAccordion(`${holdingsData.permanentLocation} >`); + InstanceRecordView.verifyQuantityOfItemsRelatedtoHoldings(holdingsData.permanentLocation, holdingsData.itemsQuqntity); + }); + }); +}); 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 129ec23a54..48bfa5b14b 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 @@ -188,7 +188,7 @@ describe('data-import', () => { InventoryViewSource.extructDataFrom999Field() .then(uuid => { // change file using uuid for 999 field - DataImport.editMarcFile('mrcFileForC356829.mrc', editedMarcFileName, ['srsUuid', 'instanceUuid', 'hrid'], [uuid[0], uuid[1], instanceHrid]); + DataImport.editMarcFile('marcFileForC356829.mrc', editedMarcFileName, ['srsUuid', 'instanceUuid', 'hrid'], [uuid[0], uuid[1], instanceHrid]); }); InventoryViewSource.close(); diff --git a/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js b/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js index bc430a2f52..c69e5dedf1 100644 --- a/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js +++ b/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js @@ -14,32 +14,32 @@ import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthor import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; describe('Manual Linking Bib field to Authority 1XX', () => { - const testData = { - tag100: '100', - tag010: '010', - tag240: '240', - authority100FieldValue: 'Coates, Ta-Nehisi', - authority010FieldValue: 'n 2008001084', - successMsg: 'This record has successfully saved and is in process. Changes may not appear immediately.', - accordion: 'Contributor', - }; - - const marcFiles = [ - { - marc: 'marcBibFileForC365134.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - numOfRecords: 1, - }, - { - marc: 'marcFileForC365134.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 1, - }, - ] + const testData = { + tag100: '100', + tag010: '010', + tag240: '240', + authority100FieldValue: 'Coates, Ta-Nehisi', + authority010FieldValue: 'n 2008001084', + successMsg: 'This record has successfully saved and is in process. Changes may not appear immediately.', + accordion: 'Contributor', + }; - let createdAuthorityIDs = []; + const marcFiles = [ + { + marc: 'marcBibFileForC365134.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }, + { + marc: 'marcFileForC365134.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1, + }, + ]; + + const createdAuthorityIDs = []; before('Creating user', () => { cy.createTempUser([ @@ -99,7 +99,7 @@ describe('Manual Linking Bib field to Authority 1XX', () => { QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag100); QuickMarcEditor.verifyTagFieldAfterLinking(33, '100', '1', '\\', '$a Coates, Ta-Nehisi', '$e author.', '$0 id.loc.gov/authorities/names/n2008001084', ''); QuickMarcEditor.pressSaveAndKeepEditing(testData.successMsg); - + InventoryInstance.clickViewAuthorityIconDisplayedInTagField(testData.tag100); MarcAuthorities.checkRecordDetailPageMarkedValue(testData.authority100FieldValue); @@ -114,4 +114,4 @@ describe('Manual Linking Bib field to Authority 1XX', () => { InventoryInstance.clickViewAuthorityIconDisplayedInMarcViewPane(); MarcAuthorities.checkRecordDetailPageMarkedValue(testData.authority100FieldValue); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js index d56d76b651..c6428af722 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-name-title.cy.js @@ -13,35 +13,35 @@ import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthorit import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; describe('plug-in MARC authority | Browse', () => { - const testData = { - searchOptionA: 'Name-title', - searchOptionB: 'Personal name', - typeOfHeadingA: 'Personal Name', - typeOfHeadingB: 'Corporate Name', - typeOfHeadingC: 'Conference Name', - value: 'DabbaÌ„gh, Ê»Abd al-RahÌ£maÌ„n ibn MuhÌ£ammad, 1208 or 1209-1299 or 1300. MashaÌ„riq anwaÌ„r al-quluÌ„b wa-mafaÌ„tihÌ£ asraÌ„r al-ghuyuÌ„b', - valueMarked: 'DabbaÌ„gh, Ê»Abd al-RahÌ£maÌ„n ibn MuhÌ£ammad,', - valueForNewSearch: 'United States. Truth in Lending Act', - authorized: 'Authorized', - reference: 'Reference', - }; - - const marcFiles = [ - { - marc: 'oneMarcBib.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - numOfRecords: 1, - }, - { - marc: 'mrcFileForC380554.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - numOfRecords: 3, - }, - ] + const testData = { + searchOptionA: 'Name-title', + searchOptionB: 'Personal name', + typeOfHeadingA: 'Personal Name', + typeOfHeadingB: 'Corporate Name', + typeOfHeadingC: 'Conference Name', + value: 'DabbaÌ„gh, Ê»Abd al-RahÌ£maÌ„n ibn MuhÌ£ammad, 1208 or 1209-1299 or 1300. MashaÌ„riq anwaÌ„r al-quluÌ„b wa-mafaÌ„tihÌ£ asraÌ„r al-ghuyuÌ„b', + valueMarked: 'DabbaÌ„gh, Ê»Abd al-RahÌ£maÌ„n ibn MuhÌ£ammad,', + valueForNewSearch: 'United States. Truth in Lending Act', + authorized: 'Authorized', + reference: 'Reference', + }; - let createdAuthorityIDs = []; + const marcFiles = [ + { + marc: 'oneMarcBib.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }, + { + marc: 'marcFileForC380554.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 3, + }, + ]; + + const createdAuthorityIDs = []; before('Creating user', () => { cy.createTempUser([ @@ -101,4 +101,4 @@ describe('plug-in MARC authority | Browse', () => { MarcAuthorities.searchBy(testData.searchOptionB, testData.valueForNewSearch); MarcAuthorities.checkSingleHeadingType(testData.authorized, testData.typeOfHeadingA); }); -}); \ No newline at end of file +}); diff --git a/cypress/fixtures/marcBibFileForC388506.mrc b/cypress/fixtures/marcBibFileForC388506.mrc new file mode 100644 index 0000000000..e61f1e6746 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC388506.mrc @@ -0,0 +1 @@ +01683cam a2200409Ii 41y00010009000000050017000090080041000260030004000670400028000710200015000990200031001140350022001450500027001670820014001941000126002082450109003342640049004433000027004923360068005193370068005873380065006555200205007206500072009256550074009979440010010719450024010819450024011059450024011299450012011539450012011659450012011779450018011899450018012079450021012259450021012469450006012671194806420191023111031.6191004s2019 ilua 000 p eng dICU aCOObengerdacCOOdUOK a1642590258 a9781642590258q(paperback) a(OCoLC)1122747273 4aPR9265.9.C53bC76 2019 4a811.62231 aChin, Staceyann,d1972-eAuthoreNarrator0http://id.loc.gov/authorities/names/n20080524041http://viaf.org/viaf/2407405210aCrossfire :ba litany for survival : poems 1998-2019 /cStaceyann Chin ; foreword by Jacqueline Woodson. 1aChicago, Illinois :bHaymarket Books,c2019. axi, 208 pages ;c23 cm atext2rdacontent0http://id.loc.gov/vocabulary/contentTypes/txt aunmediated2rdamedia0http://id.loc.gov/vocabulary/mediaTypes/n avolume2rdacarrier0http://id.loc.gov/vocabulary/carriers/nc a"Crossfire collects world-renowned lesbian poet and spoken-word artist Staceyann Chin's empowering, feminist-LGBTQ-Caribbean, activism-driven poetry for the first time in a single book."-- Back cover. 0aFeminist poetry.0http://id.loc.gov/authorities/subjects/sh85047755 7aPoetry.2lcgft0http://id.loc.gov/authorities/genreForms/gf2014026481 smfilm hKU/CC/DI/MabookcE hKU/CC/DI/MabookcE hKU/CC/DI/MabookcE abookcE abookcE abookcE hfakeabookcE hfakeabookcE hKU/CC/DI/Aaarch hKU/CC/DI/Aaarch hE \ No newline at end of file diff --git a/cypress/fixtures/mrcFileForC11123.mrc b/cypress/fixtures/marcFileForC11123.mrc similarity index 100% rename from cypress/fixtures/mrcFileForC11123.mrc rename to cypress/fixtures/marcFileForC11123.mrc diff --git a/cypress/fixtures/mrcFileForC356829.mrc b/cypress/fixtures/marcFileForC356829.mrc similarity index 100% rename from cypress/fixtures/mrcFileForC356829.mrc rename to cypress/fixtures/marcFileForC356829.mrc diff --git a/cypress/fixtures/mrcFileForC380554.mrc b/cypress/fixtures/marcFileForC380554.mrc similarity index 100% rename from cypress/fixtures/mrcFileForC380554.mrc rename to cypress/fixtures/marcFileForC380554.mrc diff --git a/cypress/fixtures/mrcFileForC6709.mrc b/cypress/fixtures/marcFileForC6709.mrc similarity index 100% rename from cypress/fixtures/mrcFileForC6709.mrc rename to cypress/fixtures/marcFileForC6709.mrc diff --git a/cypress/support/fragments/data_import/logs/fileDetails.js b/cypress/support/fragments/data_import/logs/fileDetails.js index e3ae7da38a..8d524da155 100644 --- a/cypress/support/fragments/data_import/logs/fileDetails.js +++ b/cypress/support/fragments/data_import/logs/fileDetails.js @@ -235,21 +235,20 @@ export default { cy.do(nextButton.click()); }, - verifyMultipleHoldingsStatus:(expectedArray, expectedHoldingsQuantity, rowNumber = 0) => { + verifyMultipleHoldingsStatus:(expectedArray, expectedQuantity, rowNumber = 0) => { cy.do(resultsList .find(MultiColumnListRow({ index: rowNumber })) .perform(element => { const currentArray = Array .from(element.querySelectorAll('[class*="mclCell-"]:nth-child(5) [style]')) .map(el => el.innerText.replace(/\n/g, '')); - const result = arrays.compareArrays(expectedArray, currentArray); - expect(expectedHoldingsQuantity).to.equal(currentArray.length); - expect(result).to.equal(true); + expect(expectedQuantity).to.equal(currentArray.length); + expect(arrays.compareArrays(expectedArray, currentArray)).to.equal(true); })); }, - verifyMultipleItemsStatus:(expectedItemsQuantity, rowNumber = 0) => { + verifyMultipleItemsStatus:(expectedQuantity, rowNumber = 0) => { cy.do(resultsList .find(MultiColumnListRow({ index: rowNumber })) .find(MultiColumnListCell({ columnIndex: 5 })) @@ -257,11 +256,28 @@ export default { const extractedMatches = []; // get text contains e.g. 'Created (it00000000123)' and put it to an array Array.from(element.querySelectorAll('[class*="baselineCell-"]')) - .map(el => extractedMatches.push(el.innerText.match(/Created \((it\d+)\)/g))); + .map(el => extractedMatches.push(el.innerText.match(/(Created \(it\d+\)|No action|-)/g))); // get the first element from an array - const currentItemsQuantity = Array.from(extractedMatches[0]); + const currentArray = Array.from(extractedMatches[0]); - expect(expectedItemsQuantity).to.equal(currentItemsQuantity.length); + expect(expectedQuantity).to.equal(currentArray.length); + })); + }, + + verifyMultipleErrorStatus:(expectedQuantity, rowNumber = 0) => { + cy.do(resultsList + .find(MultiColumnListRow({ index: rowNumber })) + .find(MultiColumnListCell({ columnIndex: 9 })) + .perform(element => { + console.log(element); + const extractedMatches = []; + // get text contains e.g. 'Error' and put it to an array + Array.from(element.querySelectorAll('[class*="baselineCell-"]')) + .map(el => extractedMatches.push(el.innerText.match(/(Error)/g))); + // get the first element from an array + const currentArray = Array.from(extractedMatches[0]); + + expect(expectedQuantity).to.equal(currentArray.length); })); }, From 6db3b43bdb44db1d30b55217f31e366b14e8a529 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Fri, 25 Aug 2023 09:34:34 +0300 Subject: [PATCH 066/437] Implementing of FAT-5092 (#1500) --- .../edit-fund-when-invoice-are-open.cy.js | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 cypress/e2e/orders/edit-fund-when-invoice-are-open.cy.js diff --git a/cypress/e2e/orders/edit-fund-when-invoice-are-open.cy.js b/cypress/e2e/orders/edit-fund-when-invoice-are-open.cy.js new file mode 100644 index 0000000000..c15137741d --- /dev/null +++ b/cypress/e2e/orders/edit-fund-when-invoice-are-open.cy.js @@ -0,0 +1,155 @@ +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'; +import Orders from '../../support/fragments/orders/orders'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import Organizations from '../../support/fragments/organizations/organizations'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import NewInvoice from '../../support/fragments/invoices/newInvoice'; +import Invoices from '../../support/fragments/invoices/invoices'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import NewOrder from '../../support/fragments/orders/newOrder'; + +describe('ui-orders: Orders', () => { + const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const firstFund = { ...Funds.defaultUiFund }; + const secondFund = { + name: `autotest_fund2_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: getRandomPostfix(), + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + const defaultOrder = { ...NewOrder.defaultOneTimeOrder, + approved: true, + reEncumber: true, + orderType: 'One-time' }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const allocatedQuantity = '1000'; + let user; + let orderNumber; + let servicePointId; + let location; + + before(() => { + cy.getAdminToken(); + + FiscalYears.createViaApi(defaultFiscalYear) + .then(response => { + defaultFiscalYear.id = response.id; + defaultLedger.fiscalYearOneId = defaultFiscalYear.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.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.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; + defaultOrder.vendor = organization.name; + }); + defaultOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(defaultOrder, true, false).then(orderResponse => { + defaultOrder.id = orderResponse.id; + orderNumber = orderResponse.poNumber; + Orders.checkCreatedOrder(defaultOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(firstFund, '50', '1', '50', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLineFromPol(orderNumber); + // Need to wait, while data will be loaded + cy.wait(4000); + }); + cy.createTempUser([ + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiInvoicesCanViewInvoicesAndInvoiceLines.gui, + permissions.uiOrdersEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C374190 Editing fund distribution in PO line when related Open invoice exists (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + OrderLines.selectPOLInOrder(0); + OrderLines.editPOLInOrder(); + OrderLines.editFundInPOL(secondFund, '70', '70'); + OrderLines.checkFundInPOL(secondFund); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.selectBudgetDetails(); + Funds.viewTransactions(); + Funds.checkOrderInTransactionList(`${secondFund.code}`, '($70.00)'); + Funds.selectTransactionInList('Encumbrance'); + Funds.checkStatusInTransactionDetails('Unreleased'); + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoice.invoiceNumber); + Invoices.selectInvoice(invoice.invoiceNumber); + Invoices.selectInvoiceLine(); + Invoices.checkFundInInvoiceLine(secondFund); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.selectBudgetDetails(); + Funds.viewTransactions(); + Funds.checkPaymentInTransactionDetails(1, defaultFiscalYear.code, invoice.invoiceNumber, `${secondFund.name} (${secondFund.code})`, '($70.00)'); + Funds.checkStatusInTransactionDetails('Unreleased'); + }); +}); From 2008fd7740796ef29a43f21d2106ae4f3e3d80fb Mon Sep 17 00:00:00 2001 From: nayimovag Date: Fri, 25 Aug 2023 17:45:32 +0500 Subject: [PATCH 067/437] FAT-7630 (#1506) --- ...k-edit-csv-user-new-bulk-edit-button.cy.js | 1 - ...-edit-in-app-item-staff-only-actions.cy.js | 107 ++++++++++++++++++ .../fragments/bulk-edit/bulk-edit-actions.js | 11 +- .../bulk-edit/bulk-edit-search-pane.js | 9 -- .../fragments/inventory/inventoryInstance.js | 2 + 5 files changed, 118 insertions(+), 12 deletions(-) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js index 2b14423c77..e04672a90b 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-user-new-bulk-edit-button.cy.js @@ -99,7 +99,6 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyDragNDropUsersUUIDsArea(); BulkEditSearchPane.usersRadioIsDisabled(false); BulkEditSearchPane.verifySpecificTabHighlighted('Identifier'); - BulkEditSearchPane.verifyActionsAfterChangingRecords(); }); }); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js new file mode 100644 index 0000000000..5ce092cae1 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js @@ -0,0 +1,107 @@ +import TopMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import devTeams from '../../../support/dictionary/devTeams'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import FileManager from '../../../support/utils/fileManager'; +import Users from '../../../support/fragments/users/users'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import ExportFile from '../../../support/fragments/data-export/exportFile'; +import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; + +let user; +const checkInNote = `checkIn-${getRandomPostfix()}`; +const checkOutNote = `checkOut-${getRandomPostfix()}`; +const actionNote = `actionNote-${getRandomPostfix()}`; + +const item = { + barcode: getRandomPostfix(), + instanceName: `instance-${getRandomPostfix()}`, +}; +const itemUUIDsFileName = `itemUUIdsFileName_${getRandomPostfix()}.csv`; +const changedRecordsFileName = `*-Changed-Records-${itemUUIDsFileName}`; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + permissions.inventoryCRUDItemNoteTypes.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); + cy.getItems({ limit: 1, expandAll: true, query: `"barcode"=="${item.barcode}"` }) + .then((res) => { + const itemData = res; + // Adding check in note, check out note and action note + itemData.notes = [{ itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e', note: actionNote, staffOnly: false }]; + itemData.circulationNotes = [ + { noteType: 'Check in', note: checkInNote, staffOnly: false }, + { noteType: 'Check out', note: checkOutNote, staffOnly: false }]; + cy.updateItemViaApi(itemData); + FileManager.createFile(`cypress/fixtures/${itemUUIDsFileName}`, res.id); + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${itemUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask(changedRecordsFileName); + }); + + it('C400670 Verify Bulk Edit actions for Items notes - mark Staff only (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkItemsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Item UUIDs'); + + BulkEditSearchPane.uploadFile(itemUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(item.barcode); + + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Notes', 'Circulation Notes'); + BulkEditActions.openInAppStartBulkEditFrom(); + + BulkEditActions.verifyItemOptions(); + BulkEditActions.verifyItemCheckInNoteActions(); + BulkEditActions.markAsStaffOnly('Check in note'); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyItemNoteActions('Action note', 1); + BulkEditActions.markAsStaffOnly('Action note', 1); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.markAsStaffOnly('Check out note', 2); + + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangedResults(item.barcode); + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); + ExportFile.verifyFileIncludes(changedRecordsFileName, [actionNote, checkInNote, checkOutNote]); + + BulkEditSearchPane.verifyChangesUnderColumns('Circulation Notes', checkInNote); + BulkEditSearchPane.verifyChangesUnderColumns('Circulation Notes', checkOutNote); + BulkEditSearchPane.verifyChangesUnderColumns('Notes', actionNote); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.checkCheckInNote(checkInNote); + ItemRecordView.checkCheckOutNote(checkOutNote); + ItemRecordView.checkItemNote(actionNote, 'Yes', 'Action note'); + }); + }); +}); diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index e99428e5e8..b7fba7e942 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -285,7 +285,7 @@ export default { this.verifyPossibleActions(options); }, - verifyItemNoteActions(rowIndex = 0) { + verifyItemNoteActions(type = 'Note', rowIndex = 0) { const options = [ 'Mark as staff only', 'Remove mark as staff only', @@ -295,12 +295,19 @@ export default { 'Change note type', ]; cy.do([ - RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Note'), + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose(type), RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).click(), ]); this.verifyPossibleActions(options); }, + markAsStaffOnly(type, rowIndex = 0) { + cy.do([ + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose(type), + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).choose('Mark as staff only'), + ]); + }, + checkApplyToItemsRecordsCheckbox() { cy.do(Checkbox('Apply to items records').click()); }, 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 16520c0a41..421ee6bb35 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -600,15 +600,6 @@ export default { } }, - verifyActionsAfterChangingRecords() { - cy.do(actions.click()); - cy.expect([ - Button('Download matched records (CSV)').absent(), - Button('Start bulk edit').absent(), - DropdownMenu().find(HTML('Show columns')).exists(), - ]); - }, - verifyUsersActionShowColumns() { cy.expect([ DropdownMenu().find(Checkbox('Username')).has({ checked: true }), diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 61d0569ff1..ad623c6301 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -643,6 +643,8 @@ export default { InventoryInstanceSelectInstanceModal.waitLoading(); InventoryInstanceSelectInstanceModal.searchByTitle(title); InventoryInstanceSelectInstanceModal.selectInstance(); + // cypress clicks too fast + cy.wait(2000); InventoryInstancesMovement.moveFromMultiple(holdingName, title); }, From 60e58dc4c3b7faa42a24dc3f2084273e6c96b577 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Mon, 28 Aug 2023 07:54:49 +0300 Subject: [PATCH 068/437] added parallelization tags (#1509) --- cypress/e2e/fee-fine/newFeeFines.cy.js | 3 ++- cypress/e2e/loans/renewal-failure.cy.js | 3 ++- .../settings/circulation/general/edit-circulation-rules.cy.js | 3 ++- cypress/support/dictionary/parallelization.js | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 cypress/support/dictionary/parallelization.js diff --git a/cypress/e2e/fee-fine/newFeeFines.cy.js b/cypress/e2e/fee-fine/newFeeFines.cy.js index 1fbb7b1af5..7a0f62f25b 100644 --- a/cypress/e2e/fee-fine/newFeeFines.cy.js +++ b/cypress/e2e/fee-fine/newFeeFines.cy.js @@ -1,6 +1,7 @@ import uuid from 'uuid'; import moment from 'moment'; import TestType from '../../support/dictionary/testTypes'; +import Parallelization from '../../support/dictionary/parallelization'; import Features from '../../support/dictionary/features'; import PatronGroups from '../../support/fragments/settings/users/patronGroups'; import DefaultUser from '../../support/fragments/users/userDefaultObjects/defaultUser'; @@ -95,7 +96,7 @@ describe('Fee/fine management', () => { }); }); - it('C455 Verify "New fee/fine" behavior when "Charge & pay now" button pressed (vega)', { tags: [TestType.smoke, Features.feeFine, devTeams.vega] }, () => { + it('C455 Verify "New fee/fine" behavior when "Charge & pay now" button pressed (vega)', { tags: [TestType.smoke, Features.feeFine, devTeams.vega, Parallelization.nonParallel] }, () => { const feeInfo = [testData.owner.name, testData.feeFineType.feeFineTypeName, 'Paid fully']; const itemInfo = [testData.instanceTitle + ' (book)', itemBarcode]; const initialCheckNewFeeFineFragment = () => { diff --git a/cypress/e2e/loans/renewal-failure.cy.js b/cypress/e2e/loans/renewal-failure.cy.js index 9246c854df..f37dd70eb0 100644 --- a/cypress/e2e/loans/renewal-failure.cy.js +++ b/cypress/e2e/loans/renewal-failure.cy.js @@ -3,6 +3,7 @@ import moment from 'moment'; import getRandomPostfix from '../../support/utils/stringTools'; import TestType from '../../support/dictionary/testTypes'; import DevTeams from '../../support/dictionary/devTeams'; +import Parallelization from '../../support/dictionary/parallelization'; import generateItemBarcode from '../../support/utils/generateItemBarcode'; import permissions from '../../support/dictionary/permissions'; import RenewalActions from '../../support/fragments/loans/renewals'; @@ -172,7 +173,7 @@ describe('Renewal', () => { }); }); - it('C568 Renewal: failure because loan is not renewable (vega)', { tags: [TestType.smoke, DevTeams.vega] }, () => { + it('C568 Renewal: failure because loan is not renewable (vega)', { tags: [TestType.smoke, DevTeams.vega, Parallelization.nonParallel] }, () => { RenewalActions.renewWithoutOverrideAccess(loanId, renewUserData.id, itemData); cy.login(renewOverrideUserData.lastName, renewOverrideUserData.password); RenewalActions.renewWithOverrideAccess( diff --git a/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js b/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js index bf5b738b14..813fb3102c 100644 --- a/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js +++ b/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js @@ -1,5 +1,6 @@ import devTeams from '../../../../support/dictionary/devTeams'; import TestType from '../../../../support/dictionary/testTypes'; +import Parallelization from '../../../../support/dictionary/parallelization'; import SettingsMenu from '../../../../support/fragments/settingsMenu'; import CirculationRules from '../../../../support/fragments/circulation/circulation-rules'; import OverdueFinePolicy, { @@ -65,7 +66,7 @@ describe('ui-circulation-settings: Edit circulation rules', () => { Users.deleteViaApi(newUserId); }); - it('C2268: Add notice policy to circulation rules (vega)', { tags: [TestType.smoke, devTeams.vega] }, () => { + it('C2268: Add notice policy to circulation rules (vega)', { tags: [TestType.smoke, devTeams.vega, Parallelization.nonParallel] }, () => { CirculationRules.clearCirculationRules(); CirculationRules.fillInPriority(); diff --git a/cypress/support/dictionary/parallelization.js b/cypress/support/dictionary/parallelization.js new file mode 100644 index 0000000000..88d4f0da87 --- /dev/null +++ b/cypress/support/dictionary/parallelization.js @@ -0,0 +1,2 @@ +export default { parallel:'parallel', + nonParallel: 'nonParallel' }; From a9f39218230e660b8abb3869b8fe37e5eeb5ee98 Mon Sep 17 00:00:00 2001 From: Daniil Novikau Date: Thu, 24 Aug 2023 13:17:43 +0300 Subject: [PATCH 069/437] Add prettier and precommit hook --- .eslintrc | 13 ++++++------- .husky/pre-commit | 4 ++++ package.json | 24 +++++++++++++++++++++--- prettier.config.js | 9 +++++++++ 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100755 .husky/pre-commit create mode 100644 prettier.config.js diff --git a/.eslintrc b/.eslintrc index c06eff264d..af7189d453 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,16 +6,15 @@ "mocha": true }, "parser": "@babel/eslint-parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, "plugins": [ - "cypress" + "cypress", + "import" ], "rules": { - "func-names": 0, - "import/no-extraneous-dependencies": 0, - "no-redeclare": 0, - "no-console": 0, - "prefer-arrow-callback": 0, - "cypress/no-assigning-return-values": "error", "cypress/no-unnecessary-waiting": "error", "cypress/assertion-before-screenshot": "warn", diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..d24fdfc601 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index 359bdd46a3..97021147a0 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,22 @@ "test:cypress:local": "stripes serve --port 3001 & wait-on http://localhost:3001 && cypress run && kill $!", "test:cypress:yakbak": "stripes serve --port 3001 --okapi http://localhost:3002 & pid1=$! && yakbak-proxy -v -i -n https://folio-snapshot-okapi.dev.folio.org & pid2=$! && wait-on http://localhost:3001 && cypress run && kill $pid1 $pid2", "regenerate": "stripes serve --port 3001 --okapi http://localhost:3002 & pid1=$! && rm -rf tapes && yakbak-proxy -v -i https://folio-snapshot-okapi.dev.folio.org & pid2=$! && wait-on http://localhost:3001 && cypress run && kill $pid1 $pid2", - "lint": "eslint .", - "build-mod-descriptor": "stripes mod descriptor --full --strict | jq '.[]' > module-descriptor.json " + "build-mod-descriptor": "stripes mod descriptor --full --strict | jq '.[]' > module-descriptor.json ", + "lint": "eslint . --ext=js", + "lint:fix": "eslint --fix --quiet", + "prettier": "prettier .", + "prettier:fix": "prettier --write" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.js": [ + "npm run prettier:fix", + "npm run lint:fix" + ] }, "dependencies": { "@interactors/html": "^1.0.0-rc1.4", @@ -31,7 +45,7 @@ "@babel/core": "^7.19.3", "@babel/eslint-parser": "^7.19.1", "@cypress/request": "2.88.7", - "@folio/eslint-config-stripes": "^6.1.0", + "@folio/eslint-config-stripes": "^6.4.0", "@interactors/with-cypress": "^1.0.0-rc1.2", "@shelex/cypress-allure-plugin": "^2.23.0", "bigtest": "^0.14.0", @@ -42,9 +56,13 @@ "cypress-xpath": "^1.6.2", "eslint": "^7.32.0", "eslint-plugin-cypress": "^2.11.2", + "eslint-plugin-import": "^2.28.1", "fs-extra": "7.0.1", "globby": "^11.1.0", + "husky": "^8.0.3", + "lint-staged": "^14.0.1", "localforage": "^1.9.0", + "prettier": "^3.0.2", "uuid": "^3.4.0" }, "resolutions": { diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000000..e4e9c9449a --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,9 @@ +module.exports = { + bracketSpacing: true, + printWidth: 100, + tabWidth: 2, + semi: true, + singleQuote: true, + trailingComma: 'all', + quoteProps: 'as-needed', +}; From 2d7d29bfe9c3ba5c9f96a0f7909b41aaed4e4f32 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 28 Aug 2023 11:36:51 +0300 Subject: [PATCH 070/437] added test (#1508) --- ...scription-is-incorrectly-constructed.cy.js | 2 +- ...-fields-mapping-into-1-invoice-field.cy.js | 182 ++++++++++++++++++ cypress/fixtures/ediFileForC345353.edi | 1 + .../mapping_profiles/fieldMappingProfiles.js | 1 + .../newFieldMappingProfile.js | 38 +++- .../support/fragments/invoices/invoiceView.js | 21 ++ 6 files changed, 238 insertions(+), 7 deletions(-) create mode 100644 cypress/e2e/data-import/settings/edifact-mapping-syntax-for-multiple-fields-mapping-into-1-invoice-field.cy.js create mode 100644 cypress/fixtures/ediFileForC345353.edi diff --git a/cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js b/cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js index 70ac3561fe..b2c367ee75 100644 --- a/cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js +++ b/cypress/e2e/data-import/importing-edifact-files/edifact-invoice-import-when-invoice-line-description-is-incorrectly-constructed.cy.js @@ -95,7 +95,7 @@ describe('data-import', () => { NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); - // upload a marc file for creating of the new instance, holding and item + // upload a marc file cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); diff --git a/cypress/e2e/data-import/settings/edifact-mapping-syntax-for-multiple-fields-mapping-into-1-invoice-field.cy.js b/cypress/e2e/data-import/settings/edifact-mapping-syntax-for-multiple-fields-mapping-into-1-invoice-field.cy.js new file mode 100644 index 0000000000..04bec4700a --- /dev/null +++ b/cypress/e2e/data-import/settings/edifact-mapping-syntax-for-multiple-fields-mapping-into-1-invoice-field.cy.js @@ -0,0 +1,182 @@ +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, + BATCH_GROUP, + VENDOR_NAMES, + PAYMENT_METHOD, + JOB_STATUS_NAMES } from '../../../support/constants'; +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 Users from '../../../support/fragments/users/users'; +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 InvoiceView from '../../../support/fragments/invoices/invoiceView'; +import Invoices from '../../../support/fragments/invoices/invoices'; + +describe('data-import', () => { + describe('Settings', () => { + let user; + const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.harrassowitz; + const filePathForUpload = 'ediFileForC345353.edi'; + const fileNameForFirstImport = `C345353 autotestFileName.${getRandomPostfix()}`; + const fileNameForSecondImport = `C345353 autotestFileName.${getRandomPostfix()}`; + const invoiceNumber = '246816'; + const invoiceData = [ + { + invoiceNote: 'HARRAS0001118 OTTO HARRASSOWITZ', + subscriptionInfo: '01.Jan.2021 iss.1 31.Dec.2021 iss.24', + comment: '01.Jan.2021 iss.1 31.Dec.2021 iss.24' + }, + { + invoiceNote: 'HARRAS0001118-OTTO HARRASSOWITZ', + subscriptionInfo: '01.Jan.2021 iss.1-31.Dec.2021 iss.24', + comment: '01.Jan.2021 iss.1-31.Dec.2021 iss.24' + } + ]; + const collectionOfProfiles = [ + { + mappingProfile: { incomingRecordType: NewFieldMappingProfile.incomingRecordType.edifact, + existingRecordType: FOLIO_RECORD_TYPE.INVOICE, + name: `C345353 Test Harrassowitz invoice with space.${getRandomPostfix()}`, + description: '', + batchGroup: BATCH_GROUP.FOLIO, + invoiceNote: 'RFF+API[2] " " NAD+SU+++[1]', + organizationName: VENDOR_NAMES.HARRASSOWITZ, + paymentMethod: PAYMENT_METHOD.CASH, + currency: 'USD', + invoiceLinePOlDescription: '{POL_title}; else IMD+L+050+[4-5]', + polNumber: 'RFF+LI[2]', + subscriptionInfo: 'IMD+L+085+[4-5] " " IMD+L+086+[4-5]', + subscriptionStartDate: 'DTM+194[2]', + subscriptionEndDate: 'DTM+206[2]', + comment: 'IMD+L+085+[4-5] " " IMD+L+086+[4-5]' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INVOICE, + name: `C345353 Change to Test Harrassowitz invoice with space.${getRandomPostfix()}` }, + jobProfile: { + ...NewJobProfile.defaultJobProfile, + profileName: `C345353 Change to Test Harrassowitz invoice with space.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT + } + }, + { + mappingProfile: { incomingRecordType: NewFieldMappingProfile.incomingRecordType.edifact, + existingRecordType: FOLIO_RECORD_TYPE.INVOICE, + name: `C345353 Test Harrassowitz invoice with hyphen.${getRandomPostfix()}`, + invoiceNote: 'RFF+API[2] "-" NAD+SU+++[1]', + subscriptionInfo: 'IMD+L+085+[4-5] "-" IMD+L+086+[4-5]', + comment: 'IMD+L+085+[4-5] "-" IMD+L+086+[4-5]' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INVOICE, + name: `C345353 Test Harrassowitz invoice with hyphen.${getRandomPostfix()}` }, + jobProfile: { ...NewJobProfile.defaultJobProfile, + profileName: `C345353 Test Harrassowitz invoice with hyphen.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT } + } + ]; + + before('create user', () => { + cy.createTempUser([ + permissions.dataImportUploadAll.gui, + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.viewEditDeleteInvoiceInvoiceLine.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); + collectionOfProfiles.forEach(profile => { + JobProfiles.deleteJobProfile(profile.jobProfile.profileName); + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + }); + + it('C345353 Check EDIFACT mapping syntax for multiple fields mapping into 1 invoice field (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create Field mapping profiles + FieldMappingProfiles.waitLoading(); + FieldMappingProfiles.createInvoiceMappingProfile(collectionOfProfiles[0].mappingProfile, profileForDuplicate); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[0].mappingProfile.name); + + FieldMappingProfiles.createInvoiceMappingProfile(collectionOfProfiles[1].mappingProfile, collectionOfProfiles[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfProfiles[1].mappingProfile.name); + + // create Action profiles + collectionOfProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create job profiles + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(collectionOfProfiles[0].jobProfile); + NewJobProfile.linkActionProfile(collectionOfProfiles[0].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(collectionOfProfiles[0].jobProfile.profileName); + + JobProfiles.createJobProfile(collectionOfProfiles[1].jobProfile); + NewJobProfile.linkActionProfile(collectionOfProfiles[1].actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(collectionOfProfiles[1].jobProfile.profileName); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForUpload, fileNameForFirstImport); + JobProfiles.searchJobProfileForImport(collectionOfProfiles[0].jobProfile.profileName); + JobProfiles.selectJobProfile(); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForFirstImport); + Logs.checkImportFile(collectionOfProfiles[0].jobProfile.profileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoiceNumber); + Invoices.selectInvoice(invoiceNumber); + InvoiceView.verifyInvoiceNote(invoiceData[0].invoiceNote); + InvoiceView.selectInvoiceLine(); + InvoiceView.verifyInvoiceLineSubscription(invoiceData[0].subscriptionInfo); + InvoiceView.verifyInvoiceLineComment(invoiceData[0].comment); + + cy.getInvoiceIdApi({ query: `vendorInvoiceNo="${invoiceNumber}"` }) + .then(id => cy.deleteInvoiceFromStorageViaApi(id)); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathForUpload, fileNameForSecondImport); + JobProfiles.searchJobProfileForImport(collectionOfProfiles[1].jobProfile.profileName); + JobProfiles.selectJobProfile(); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForSecondImport); + Logs.checkImportFile(collectionOfProfiles[1].jobProfile.profileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoiceNumber); + Invoices.selectInvoice(invoiceNumber); + InvoiceView.verifyInvoiceNote(invoiceData[1].invoiceNote); + InvoiceView.selectInvoiceLine(); + InvoiceView.verifyInvoiceLineSubscription(invoiceData[1].subscriptionInfo); + InvoiceView.verifyInvoiceLineComment(invoiceData[1].comment); + + cy.getInvoiceIdApi({ query: `vendorInvoiceNo="${invoiceNumber}"` }) + .then(id => cy.deleteInvoiceFromStorageViaApi(id)); + }); + }); +}); diff --git a/cypress/fixtures/ediFileForC345353.edi b/cypress/fixtures/ediFileForC345353.edi new file mode 100644 index 0000000000..57132bc571 --- /dev/null +++ b/cypress/fixtures/ediFileForC345353.edi @@ -0,0 +1 @@ +UNA:+.? 'UNB+UNOC:3+M+H+210816:1307+1++++++1'UNH+1+INVOIC:D:96A:UN:EAN008'BGM+380:::JINV+246816+55'DTM+137:20210208:102'NAD+SU+++OTTO HARRASSOWITZ:BOOKSELLERS & SUBSCRIPTION AGENTS:::ZS+KREUZBERGER RING 7C-D+WIESBADEN+GERMANY+65174+DE'RFF+API:HARRAS'NAD+BY+++Serials Acquisitions:MSU Libraries:Michigan State University+366 W Circle Drive+East Lansing, MI+MI+488241048+US'RFF+API:0001118'CUX+2:USD:4'LIN+1'PIA+5+ALL0006:SA'PIA+5+1430-2713:IS'IMD+L+050+:::Allgemeine Forst Zeitschrift AFZ. D:er Wald'IMD+L+085+:::01.Jan.2021 iss.1'IMD+L+086+:::31.Dec.2021 iss.24'QTY+47:1'DTM+194:20210101:102'DTM+206:20211231:102'MOA+203:315.57'PRI+AAB:300.97'RFF+LI:19515534'RFF+SNA:00007943'ALC+C++++G74::28'MOA+8:14.6'LIN+2'PIA+5+BUL0437:SA'PIA+5+0204-8906:IS'IMD+L+050+:::Bulgarian Historical Review = Revue:Bulgare d?'Histoire'IMD+L+085+:::01.Jan.2020 iss.1'IMD+L+086+:::31.Dec.2020 iss.4'QTY+47:1'DTM+194:20200101:102'DTM+206:20201231:102'MOA+203:95.43'PRI+AAB:91.02'RFF+LI:12098498'RFF+SNA:96242313'ALC+C++++G74::28'MOA+8:4.41'LIN+3'PIA+5+CES0023:SA'PIA+5+0862-6111:IS'IMD+L+050+:::Cesky Casopis Historicky 'IMD+L+085+:::01.Jan.2021'IMD+L+086+:::31.Dec.2021'QTY+47:1'DTM+194:20210101:102'DTM+206:20211231:102'MOA+203:96.46'PRI+AAB:92'RFF+LI:12004108'RFF+SNA:96235681'ALC+C++++G74::28'MOA+8:4.46'LIN+4'PIA+5+DEU007780:SA'PIA+5+0012-0936:IS'IMD+L+050+:::Deutsche Vierteljahrsschrift fuer L:iteraturwissenschaft und Geistesges'IMD+L+050+:::chichte'IMD+L+085+:::01.Jan.2021 v.95 iss.1'IMD+L+086+:::31.Dec.2021 v.95 iss.4'QTY+47:1'DTM+194:20210101:102'DTM+206:20211231:102'MOA+203:45.09'PRI+AAB:43'RFF+LI:12098565'RFF+SNA:00201421'ALC+C++++G74::28'MOA+8:2.09'LIN+5'PIA+5+GEN115525:SA'PIA+5+1747-633X:IS'IMD+L+050+:::Gender and Language'IMD+L+085+:::01.Jan.2021'IMD+L+086+:::31.Dec.2021'QTY+47:1'DTM+194:20210101:102'DTM+206:20211231:102'MOA+203:393.19'PRI+AAB:375'RFF+LI:45433306'RFF+SNA:96551544'ALC+C++++G74::28'MOA+8:18.19'LIN+6'PIA+5+WOR113525:SA'PIA+5+2471-4607:IS'IMD+L+050+:::Journal of Labor and Society 'IMD+L+085+:::01.Jan.2021 v.24 iss.1'IMD+L+086+:::31.Dec.2021 v.24 iss.4'QTY+47:1'DTM+194:20210101:102'DTM+206:20211231:102'MOA+203:651.12'PRI+AAB:621'RFF+LI:43797714'RFF+SNA:96551731'ALC+C++++G74::28'MOA+8:30.12'LIN+7'PIA+5+MUS0019:SA'PIA+5+0027-4801:IS'IMD+L+050+:::Die Musikforschung'IMD+L+085+:::01.Jan.2021 v.74 iss.1'IMD+L+086+:::31.Dec.2021 v.74 iss.4'QTY+47:1'DTM+194:20210101:102'DTM+206:20211231:102'MOA+203:154.6'PRI+AAB:147.45'RFF+LI:12009337'RFF+SNA:00186708'ALC+C++++G74::28'MOA+8:7.15'LIN+8'PIA+5+SPI0001:SA'PIA+5+0038-7452:IS'IMD+L+050+:::Der Spiegel'IMD+L+085+:::28.Dec.2020 v.74 iss.53'IMD+L+086+:::26.Dec.2021 v.75 iss.51'QTY+47:1'DTM+194:20201228:102'DTM+206:20211226:102'MOA+203:496.24'PRI+AAB:473.29'RFF+LI:12033352'RFF+SNA:00300748'ALC+C++++G74::28'MOA+8:22.95'UNS+S'CNT+1:8'CNT+2:8'MOA+79:2247.7'MOA+9:2247.7'ALC+C++++G74::28'MOA+8:103.97'UNT+138+1'UNZ+1+1' \ No newline at end of file diff --git a/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js b/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js index 678f3f9bea..3ca3dc8daf 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js +++ b/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js @@ -98,6 +98,7 @@ export default { createInvoiceMappingProfile:(mappingProfile, defaultProfile) => { search(defaultProfile); duplicateMappingProfile(); + cy.wait(1000); NewFieldMappingProfile.fillInvoiceMappingProfile(mappingProfile); closeViewModeForMappingProfile(mappingProfile.name); cy.expect(actionsButton.exists()); diff --git a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js index 483000e727..ed533a474d 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js +++ b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js @@ -345,19 +345,33 @@ export default { cy.do([ nameField.fillIn(profile.name), incomingRecordTypeField.choose(profile.incomingRecordType), - existingRecordType.choose(profile.existingRecordType), - Accordion('Summary').find(TextArea({ name:'profile.description' })).fillIn('') + existingRecordType.choose(profile.existingRecordType) ]); + if (profile.description) { + cy.do(Accordion('Summary').find(TextArea({ name:'profile.description' })).fillIn(profile.description)); + } // Invoice information section - cy.do(batchGroupField.fillIn(profile.batchGroup)); + if (profile.batchGroup) { + cy.do(batchGroupField.fillIn(profile.batchGroup)); + } if (profile.lockTotalAmount) { cy.do(TextField('Lock total amount').fillIn(profile.lockTotalAmount)); } + if (profile.invoiceNote) { + cy.do(TextArea('Note').fillIn(profile.invoiceNote)); + } // Vendor information section - cy.do(organizationLookUpButton.click()); - selectOrganizationByName(profile.organizationName); + if (profile.organizationName) { + cy.do(organizationLookUpButton.click()); + selectOrganizationByName(profile.organizationName); + } // Extended information section - cy.do(paymentMethodField.fillIn(profile.paymentMethod)); + if (profile.paymentMethod) { + cy.do(paymentMethodField.fillIn(profile.paymentMethod)); + } + if (profile.currency) { + cy.do(currencyField.fillIn(`"${profile.currency}"`)); + } // Invoice line information section if (profile.invoiceLinePOlDescription) { cy.do(Accordion('Invoice line information') @@ -369,6 +383,18 @@ export default { if (profile.polVendorReferenceNumber) { cy.do(TextField('Vendor reference number').fillIn(profile.polVendorReferenceNumber)); } + if (profile.subscriptionInfo) { + cy.do(TextField('Subscription info').fillIn(profile.subscriptionInfo)); + } + if (profile.subscriptionStartDate) { + cy.do(TextField('Subscription start date').fillIn(profile.subscriptionStartDate)); + } + if (profile.subscriptionEndDate) { + cy.do(TextField('Subscription end date').fillIn(profile.subscriptionEndDate)); + } + if (profile.comment) { + cy.do(TextField('Comment').fillIn(profile.comment)); + } cy.do(saveButton.click()); }, diff --git a/cypress/support/fragments/invoices/invoiceView.js b/cypress/support/fragments/invoices/invoiceView.js index b999a79eca..692505e8df 100644 --- a/cypress/support/fragments/invoices/invoiceView.js +++ b/cypress/support/fragments/invoices/invoiceView.js @@ -1,5 +1,6 @@ import { MultiColumnListCell, + MultiColumnListRow, Section, including, KeyValue, @@ -26,6 +27,14 @@ export default { .click() ); }, + selectInvoiceLine: () => { + cy.do( + Section({ id: 'invoiceLines' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .click() + ); + }, checkInvoiceDetails:(invoiceNumber) => { cy.do(Section().find(MultiColumnListCell(including(invoiceNumber))).perform(element => { @@ -56,5 +65,17 @@ export default { cy.expect(Pane({ id: 'pane-invoiceDetails' }).find(Button({ icon: 'tag' })).absent()); }, + verifyInvoiceNote:(note) => { + cy.expect(Pane({ id:'pane-invoiceDetails' }).find(KeyValue('Note')).has({ value: note })); + }, + + verifyInvoiceLineSubscription:(subscription) => { + cy.expect(Pane({ id:'pane-invoiceLineDetails' }).find(KeyValue('Subscription info')).has({ value: subscription })); + }, + + verifyInvoiceLineComment:(comment) => { + cy.expect(Pane({ id:'pane-invoiceLineDetails' }).find(KeyValue('Comment')).has({ value: comment })); + }, + vendorInvoiceNumber, }; From 2c21432060a1f5c23b83b91d01e7a68ed4761136 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:11:53 +0300 Subject: [PATCH 071/437] FAT-7760-C345356 (#1505) * added test * fixed method * added permission * changed method for deleting invoice --- ...mport-file-for-create-invoice-record.cy.js | 2 +- ...auses-invoices-to-import-with-errors.cy.js | 132 ++++++++++++++++++ cypress/fixtures/ediFileForC345356.edi | 1 + .../newFieldMappingProfile.js | 5 +- .../support/fragments/invoices/invoiceView.js | 4 + .../acquisitionUnits/acquisitionUnits.js | 1 - 6 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 cypress/e2e/data-import/settings/acquisitions-unit-causes-invoices-to-import-with-errors.cy.js create mode 100644 cypress/fixtures/ediFileForC345356.edi diff --git a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js index 260714ed39..517ca37a31 100644 --- a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js @@ -90,7 +90,7 @@ describe('data-import', () => { NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); - // upload a marc file for creating of the new instance, holding and item + // upload a marc file cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); diff --git a/cypress/e2e/data-import/settings/acquisitions-unit-causes-invoices-to-import-with-errors.cy.js b/cypress/e2e/data-import/settings/acquisitions-unit-causes-invoices-to-import-with-errors.cy.js new file mode 100644 index 0000000000..a4785ab36e --- /dev/null +++ b/cypress/e2e/data-import/settings/acquisitions-unit-causes-invoices-to-import-with-errors.cy.js @@ -0,0 +1,132 @@ +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, + BATCH_GROUP, + VENDOR_NAMES, + PAYMENT_METHOD, + ACCEPTED_DATA_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 NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import AcquisitionUnits from '../../../support/fragments/settings/acquisitionUnits/acquisitionUnits'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +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'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import TopMenu from '../../../support/fragments/topMenu'; +import InvoiceView from '../../../support/fragments/invoices/invoiceView'; +import Invoices from '../../../support/fragments/invoices/invoices'; +import Users from '../../../support/fragments/users/users'; + +describe('data-import', () => { + describe('Settings', () => { + let user; + const defaultAcquisitionUnit = { ...AcquisitionUnits.defaultAcquisitionUnit }; + const profileForDuplicate = FieldMappingProfiles.mappingProfileForDuplicate.gobi; + const filePathForUpload = 'ediFileForC345356.edi'; + const fileName = `C345356 autotestFile.${getRandomPostfix()}.edi`; + const invoiceNumber = '19353'; + const quantityOfItems = '1'; + const mappingProfile = { + name:`C345356 GOBI invoice - Acq Units.${getRandomPostfix()}`, + incomingRecordType:NewFieldMappingProfile.incomingRecordType.edifact, + existingRecordType:FOLIO_RECORD_TYPE.INVOICE, + description:'', + acquisitionsUnits: `"${defaultAcquisitionUnit.name}"`, + batchGroup: BATCH_GROUP.FOLIO, + lockTotalAmount: 'MOA+86[2]', + organizationName: VENDOR_NAMES.GOBI, + paymentMethod: PAYMENT_METHOD.CASH + }; + const actionProfile = { + name: `C345356 GOBI invoice - Acq Units.${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INVOICE + }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C345356 GOBI invoice - Acq Units.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.EDIFACT + }; + + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.assignAcqUnitsToNewInvoice.gui, + permissions.viewEditDeleteInvoiceInvoiceLine.gui, + permissions.uiSettingsAcquisitionUnitsViewEditCreateDelete.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(userProperties.username, userProperties.password, + { path:SettingsMenu.acquisitionUnitsPath, waiter: AcquisitionUnits.waitLoading }); + }); + }); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + Invoices.deleteInvoiceViaActions(); + Invoices.confirmInvoiceDeletion(); + cy.visit(SettingsMenu.acquisitionUnitsPath); + AcquisitionUnits.unAssignAdmin(defaultAcquisitionUnit.name); + AcquisitionUnits.delete(defaultAcquisitionUnit.name); + Users.deleteViaApi(user.userId); + }); + + it('C345336 Acquisitions unit causes Invoices to Import with errors (folijet)', + { tags: [TestTypes.extendedPath, DevTeams.folijet] }, () => { + AcquisitionUnits.newAcquisitionUnit(); + AcquisitionUnits.fillInAUInfo(defaultAcquisitionUnit.name); + // Need to wait until data will be loaded + cy.wait(2000); + AcquisitionUnits.assignUser(user.username); + + + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.waitLoading(); + FieldMappingProfiles.createInvoiceMappingProfile(mappingProfile, profileForDuplicate); + 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.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + 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(filePathForUpload, fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.selectJobProfile(); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkImportFile(jobProfile.profileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileName); + FileDetails.verifyEachInvoiceStatusInColunm('Created'); + FileDetails.checkInvoiceInSummaryTable(quantityOfItems); + + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoiceNumber); + Invoices.selectInvoice(invoiceNumber); + InvoiceView.verifyAcquisitionUnits(defaultAcquisitionUnit.name); + }); + }); +}); diff --git a/cypress/fixtures/ediFileForC345356.edi b/cypress/fixtures/ediFileForC345356.edi new file mode 100644 index 0000000000..cf1ef7f9ef --- /dev/null +++ b/cypress/fixtures/ediFileForC345356.edi @@ -0,0 +1 @@ +UNA:+.? 'UNB+UNOA:2+1694510A:ZZ+361347X:ZZ+210920:0602+513'UNH+552+INVOIC:D:96A:UN'BGM+380+19353'DTM+137:20210918:102'CUX+2:USD:4'LIN+1++9781975501402:EN'PIA+1+99988362617:SA'IMD+L+050+:::ACTIVIST ACADEMIC?: ENGAGED SCHOLARS'IMD+L+050+:::HIP FOR RESISTANCE, HOPE AND SOCIAL'IMD+L+050+:::CHANGE.'IMD+L+010+:::CANN, COLETTE N'IMD+L+110+:::GORHAM'QTY+47:1'MOA+203:209.92'PRI+AAB:209.92'PRI+AAA:209.92'LIN+2++9781118885017:EN'PIA+1+99988362611:SA'IMD+L+050+:::ADVANCES IN COMPARATIVE SURVEY METH'IMD+L+050+:::ODS?: MULTINATIONAL, MULTIREGIONAL,'IMD+L+050+:::AND MULTICULTURAL CONTEXTS (3MC)'IMD+L+010'IMD+L+110+:::HOBOKEN'QTY+47:1'MOA+203:245'PRI+AAB:245'PRI+AAA:245'LIN+3++9781119615903:EN'PIA+1+99988362625:SA'IMD+L+050+:::APPLIED REGRESSION MODELING.'IMD+L+010+:::PARDOE, IAIN, 1970-'IMD+L+110+:::HOBOKEN'QTY+47:1'MOA+203:225.66'PRI+AAB:225.66'PRI+AAA:225.66'LIN+4++9781118418512:EN'PIA+1+99988362628:SA'IMD+L+050+:::ARCHITECTURAL RESEARCH METHODS.'IMD+L+010+:::GROAT, LINDA N'IMD+L+110+:::HOBOKEN'QTY+47:1'MOA+203:14'PRI+AAB:14'PRI+AAA:14'LIN+5++9781119763727:EN'PIA+1+99988362624:SA'IMD+L+050+:::BUFFETT?'S TIPS?: A GUIDE TO FINANCIA'IMD+L+050+:::L LITERACY AND LIFE.'IMD+L+010+:::LONGO, JOHN M'IMD+L+110+:::HOBOKEN'QTY+47:1'MOA+203:47.16'PRI+AAB:47.16'PRI+AAA:47.16'LIN+6++9781119583332:EN'PIA+1+99988362613:SA'IMD+L+050+:::DO MORE FASTER?: TECHSTARS LESSONS T'IMD+L+050+:::O ACCELERATE YOUR STARTUP.'IMD+L+010+:::COHEN, DAVID G'IMD+L+110+:::HOBOKEN'QTY+47:1'MOA+203:52.41'PRI+AAB:52.41'PRI+AAA:52.41'LIN+7++9781609176433:EN'PIA+1+99988362618:SA'IMD+L+050+:::FAMINE POTS?: THE CHOCTAW-IRISH GIFT'IMD+L+050+:::EXCHANGE, 1847-PRESENT.'IMD+L+010+:::LEANNE HOWE'IMD+L+110+:::EAST LANSING'QTY+47:1'MOA+203:44.92'PRI+AAB:44.92'PRI+AAA:44.92'LIN+8++9781350069121:EN'PIA+1+99988362614:SA'IMD+L+050+:::HANNAH ARENDT ON EDUCATIONAL THINKI'IMD+L+050+:::NG AND PRACTICE IN DARK TIMES?: EDUC'IMD+L+050+:::ATION FOR A WORLD IN CRISIS'IMD+L+010'IMD+L+110+:::LONDON'QTY+47:1'MOA+203:240'PRI+AAB:240'PRI+AAA:240'LIN+9++9781849354196:EN'PIA+1+99988362619:SA'IMD+L+050+:::HOLDING CHANGE?: THE WAY OF EMERGENT'IMD+L+050+:::STRATEGY FACILITATION AND MEDIATIO'IMD+L+050+:::N.'IMD+L+010+:::BROWN, ADRIENNE MAREE'IMD+L+110+:::CHICO'QTY+47:1'MOA+203:17.99'PRI+AAB:17.99'PRI+AAA:17.99'LIN+10++9780226740515:EN'PIA+1+99988362622:SA'IMD+L+050+:::INVISIBLE CHINA?: HOW THE URBAN-RURA'IMD+L+050+:::L DIVIDE THREATENS CHINA?'S RISE.'IMD+L+010+:::ROZELLE, SCOTT'IMD+L+110+:::CHICAGO'QTY+47:1'MOA+203:33.75'PRI+AAB:33.75'PRI+AAA:33.75'LIN+11++9781509927050:EN'PIA+1+99988362627:SA'IMD+L+050+:::PERFORMING COPYRIGHT?: LAW, THEATRE'IMD+L+050+:::AND AUTHORSHIP.'IMD+L+010+:::MCDONAGH, LUKE'IMD+L+110+:::OXFORD'QTY+47:1'MOA+203:240'PRI+AAB:240'PRI+AAA:240'LIN+12++9781440863752:EN'PIA+1+99988362621:SA'IMD+L+050+:::PUBLIC AND PRIVATE EDUCATION IN AME'IMD+L+050+:::RICA?: EXAMINING THE FACTS.'IMD+L+010+:::COBB, CASEY D'IMD+L+110+:::SANTA BARBARA'QTY+47:1'MOA+203:130'PRI+AAB:130'PRI+AAA:130'LIN+13++9781641139441:EN'PIA+1+99988362615:SA'IMD+L+050+:::PUSHING OUR UNDERSTANDING OF DIVERS'IMD+L+050+:::ITY IN ORGANIZATIONS'IMD+L+010'IMD+L+110+:::CHARLOTTE'QTY+47:1'MOA+203:185'PRI+AAB:185'PRI+AAA:185'LIN+14++9781000245172:EN'PIA+1+99988362623:SA'IMD+L+050+:::SPACE DEBRIS PERIL?: PATHWAYS TO OPP'IMD+L+050+:::ORTUNITIES?: CAPACITY BUILDING IN TH'IMD+L+050+:::E NEW SPACE ERA'IMD+L+010'IMD+L+110+:::BOCA RATON'QTY+47:1'MOA+203:202.5'PRI+AAB:202.5'PRI+AAA:202.5'LIN+15++9781119541608:EN'PIA+1+99988362616:SA'IMD+L+050+:::STAINLESS STEEL SURFACES?: A GUIDE T'IMD+L+050+:::O ALLOYS, FINISHES, FABRICATION, AN'IMD+L+050+:::D MAINTENANCE IN ARCHITECTURE AND A'IMD+L+050+:::RT.'IMD+L+010+:::ZAHNER, L. WILLIAM'IMD+L+110+:::HOBOKEN'QTY+47:1'MOA+203:131.25'PRI+AAB:131.25'PRI+AAA:131.25'LIN+16++9781351266512:EN'PIA+1+99988362612:SA'IMD+L+050+:::SYSTEMS ENGINEERING MODELS?: THEORY,'IMD+L+050+:::METHODS, AND APPLICATIONS.'IMD+L+010+:::BADIRU, ADEDEJI BODUNDE, 1952-'IMD+L+110+:::BOCA RATON'QTY+47:1'MOA+203:217.5'PRI+AAB:217.5'PRI+AAA:217.5'LIN+17++9781469662855:EN'PIA+1+99988362620:SA'IMD+L+050+:::THING ABOUT RELIGION?: AN INTRODUCTI'IMD+L+050+:::ON TO THE MATERIAL STUDY OF RELIGIO'IMD+L+050+:::NS.'IMD+L+010+:::MORGAN, DAVID, 1957-'IMD+L+110+:::CHAPEL HILL'QTY+47:1'MOA+203:95'PRI+AAB:95'PRI+AAA:95'LIN+18++9780812297942:EN'PIA+1+99988362626:SA'IMD+L+050+:::VIOLENCE AND POWER IN THE THOUGHT O'IMD+L+050+:::F HANNAH ARENDT.'IMD+L+010+:::ASHCROFT, CAROLINE'IMD+L+110+:::PHILADELPHIA'QTY+47:1'MOA+203:157.5'PRI+AAB:157.5'PRI+AAA:157.5'UNS+S'CNT+1:18'CNT+2:18'MOA+86:2489.56'MOA+79:2489.56'UNT+196+552'UNZ+1+513' \ No newline at end of file diff --git a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js index ed533a474d..22b2fe8f49 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js +++ b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js @@ -360,6 +360,9 @@ export default { if (profile.invoiceNote) { cy.do(TextArea('Note').fillIn(profile.invoiceNote)); } + if (profile.acquisitionsUnits) { + cy.do(TextField('Acquisitions units').fillIn(profile.acquisitionsUnits)); + } // Vendor information section if (profile.organizationName) { cy.do(organizationLookUpButton.click()); @@ -406,7 +409,7 @@ export default { ]); if (specialMappingProfile.typeValue === holdingsType) { cy.do(TextField('Holdings type').fillIn('"Monograph"')); - // wait accepted values to be filled + // wait accepted values to be filed cy.wait(1500); cy.do(permanentLocationField.fillIn('980$a')); cy.do(TextField('Call number type').fillIn('"Library of Congress classification"')); diff --git a/cypress/support/fragments/invoices/invoiceView.js b/cypress/support/fragments/invoices/invoiceView.js index 692505e8df..fc2375f005 100644 --- a/cypress/support/fragments/invoices/invoiceView.js +++ b/cypress/support/fragments/invoices/invoiceView.js @@ -77,5 +77,9 @@ export default { cy.expect(Pane({ id:'pane-invoiceLineDetails' }).find(KeyValue('Comment')).has({ value: comment })); }, + verifyAcquisitionUnits:(acquisitionUnitName) => { + cy.expect(Pane({ id:'pane-invoiceDetails' }).find(KeyValue('Acquisition units')).has({ value: acquisitionUnitName })); + }, + vendorInvoiceNumber, }; diff --git a/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js b/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js index 57ad30dc55..5cabb709eb 100644 --- a/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js +++ b/cypress/support/fragments/settings/acquisitionUnits/acquisitionUnits.js @@ -39,7 +39,6 @@ export default { ]); this.assignAdmin(); cy.wait(4000); - }, fillInAUInfo: (name) => { From 951c1a799d61a7d092e5020e1bc961b1e487bdea Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:45:04 +0300 Subject: [PATCH 072/437] skip test C356791 (#1517) --- .../import-summary-table-with-create-update-actions.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7879b2f754..04cd4a8390 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 @@ -36,7 +36,7 @@ import ItemRecordView from '../../../support/fragments/inventory/item/itemRecord import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Users from '../../../support/fragments/users/users'; -describe('data-import', () => { +describe.skip('data-import', () => { describe('Log details', () => { let user; let instanceHrids; From 24c8db5b7acc1ad50a6da568d85666551c97d5c2 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Mon, 28 Aug 2023 18:06:00 +0300 Subject: [PATCH 073/437] added checks (#1504) --- ...ngs-for-physical-resource-open-order.cy.js | 201 ++++++++++++++++++ .../marc-authority/create-new-marc-bib.cy.js | 42 ++-- cypress/fixtures/marcFileForC388570.mrc | 1 + .../exportJobProfile/exportJobProfiles.js | 2 +- .../support/fragments/orders/orderLines.js | 21 ++ 5 files changed, 245 insertions(+), 22 deletions(-) create mode 100644 cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-and-holdings-for-physical-resource-open-order.cy.js create mode 100644 cypress/fixtures/marcFileForC388570.mrc diff --git a/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-and-holdings-for-physical-resource-open-order.cy.js b/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-and-holdings-for-physical-resource-open-order.cy.js new file mode 100644 index 0000000000..3143f3873b --- /dev/null +++ b/cypress/e2e/data-import/log-details/log-result-table-for-imported-multiple-items-and-holdings-for-physical-resource-open-order.cy.js @@ -0,0 +1,201 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import { + FOLIO_RECORD_TYPE, + LOCATION_NAMES, + LOAN_TYPE_NAMES, + ITEM_STATUS_NAMES, + ACCEPTED_DATA_TYPE_NAMES, + JOB_STATUS_NAMES, + ORDER_STATUSES, + VENDOR_NAMES, + ACQUISITION_METHOD_NAMES, + ORDER_FORMAT_NAMES_IN_PROFILE +} from '../../../support/constants'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +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 DataImport from '../../../support/fragments/data_import/dataImport'; +import TopMenu from '../../../support/fragments/topMenu'; +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 InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; + +describe('data-import', () => { + describe('Log details', () => { + let user; + let orderNumber; + let instanceHRID; + const filePathForCreate = 'marcFileForC388570.mrc'; + const marcFileName = `C388570 autotestFileName ${getRandomPostfix()}`; + const arrayOfHoldingsStatuses = ['Created (KU/CC/DI/M)', 'Created (E)', 'Created (KU/CC/DI/A)']; + const quantityOfCreatedHoldings = 3; + const quantityOfCreatedItems = '6'; + const holdingsData = [ + { permanentLocation: LOCATION_NAMES.MAIN_LIBRARY_UI, + itemsQuqntity: 3 }, + { permanentLocation: LOCATION_NAMES.ANNEX_UI, + itemsQuqntity: 2 }, + { permanentLocation: LOCATION_NAMES.ONLINE_UI, + itemsQuqntity: 1 } + ]; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C388570 Physical open order for multiple.${getRandomPostfix()}`, + orderStatus: ORDER_STATUSES.OPEN, + approved: true, + vendor: VENDOR_NAMES.GOBI, + title: '245$a', + acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, + orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, + receivingWorkflow: 'Synchronized', + physicalUnitPrice: '"20"', + quantityPhysical: '"1"', + currency: 'USD', + locationName: `"${LOCATION_NAMES.ANNEX}"`, + locationQuantityPhysical: '"1"' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ORDER, + name: `C388570 Physical open order for multiple.${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C388570 Test multiple holdings.${getRandomPostfix()}`, + permanentLocation: '945$h' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C388570 Test multiple holdings.${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C388570 Test multiple items.${getRandomPostfix()}`, + materialType: '945$a', + permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, + status: ITEM_STATUS_NAMES.ON_ORDER }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, + name: `C388570 Test multiple items.${getRandomPostfix()}` } + } + ]; + const jobProfile = { + profileName: `C388570 Physical open order for multiple.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('login', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(userProperties.username, userProperties.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) + .then((instance) => { + instance.items.forEach(item => cy.deleteItemViaApi(item.id)); + instance.holdings.forEach(holding => cy.deleteHoldingRecordViaApi(holding.id)); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(orderId => { + Orders.deleteOrderViaApi(orderId[0].id); + }); + }); + + it('C388570 Check the log result table for imported multiple items and holdings for Physical resource open order (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create mapping profiles + FieldMappingProfiles.createOrderMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); + NewFieldMappingProfile.fillMaterialType(collectionOfMappingAndActionProfiles[2].mappingProfile.materialType); + NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); + NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[2].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.linkActionProfile(collectionOfMappingAndActionProfiles[0].actionProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); + NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); + 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(filePathForCreate, marcFileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.order].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.verifyMultipleHoldingsStatus(arrayOfHoldingsStatuses, quantityOfCreatedHoldings); + FileDetails.verifyMultipleItemsStatus(Number(quantityOfCreatedItems)); + FileDetails.openOrder('Created'); + OrderLines.waitLoading(); + OrderLines.getAssignedPOLNumber().then(initialNumber => { + const polNumber = initialNumber; + orderNumber = polNumber.replace('-1', ''); + }); + OrderLines.checkQuantityPhysical(quantityOfCreatedItems); + OrderLines.checkPhysicalQuantityInLocation(quantityOfCreatedHoldings); + cy.go('back'); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + }); + holdingsData.forEach(holdings => { + InventoryInstance.checkIsHoldingsCreated([`${holdings.permanentLocation} >`]); + InventoryInstance.openHoldingsAccordion(`${holdings.permanentLocation} >`); + InstanceRecordView.verifyQuantityOfItemsRelatedtoHoldings(holdings.permanentLocation, holdings.itemsQuqntity); + }); + }); + }); +}); diff --git a/cypress/e2e/marc-authority/create-new-marc-bib.cy.js b/cypress/e2e/marc-authority/create-new-marc-bib.cy.js index 904e8c76c2..90fbc228ce 100644 --- a/cypress/e2e/marc-authority/create-new-marc-bib.cy.js +++ b/cypress/e2e/marc-authority/create-new-marc-bib.cy.js @@ -11,33 +11,33 @@ import MarcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { const testData = { tags: { - tag100: '100', - tag600: '600', - tag700: '700', - tag800: '800', - tag240: '240', - tag245: '245', - tagLDR: 'LDR', + tag100: '100', + tag600: '600', + tag700: '700', + tag800: '800', + tag240: '240', + tag245: '245', + tagLDR: 'LDR', }, fieldContents: { - tag100Content: 'Author, Person', - tag600Content: 'New subject', - tag700Content: 'Co-author, Person', - tag800Content: 'New series', - tag240Content: 'New alt. title', - tag245Content: 'New title', - tagLDRContent: '00000naa\\a2200000uu\\4500', + tag100Content: 'Author, Person', + tag600Content: 'New subject', + tag700Content: 'Co-author, Person', + tag800Content: 'New series', + tag240Content: 'New alt. title', + tag245Content: 'New title', + tagLDRContent: '00000naa\\a2200000uu\\4500', }, accordions: { - contributor: 'Contributor', - subject: 'Subject', - titleData: 'Title data', + contributor: 'Contributor', + subject: 'Subject', + titleData: 'Title data', } }; - let importedInstanceID = []; + const importedInstanceID = []; before(() => { cy.createTempUser([ @@ -70,18 +70,18 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); - InventoryInstance.getId().then(id => { importedInstanceID.push(id) }); + InventoryInstance.getId().then(id => { importedInstanceID.push(id); }); InventoryInstance.checkInstanceTitle(testData.fieldContents.tag245Content); InventoryInstance.checkDetailViewOfInstance(testData.accordions.contributor, testData.fieldContents.tag100Content); InventoryInstance.checkDetailViewOfInstance(testData.accordions.contributor, testData.fieldContents.tag700Content); InventoryInstance.checkDetailViewOfInstance(testData.accordions.subject, testData.fieldContents.tag600Content); InventoryInstance.checkDetailViewOfInstance(testData.accordions.titleData, testData.fieldContents.tag800Content); InventoryInstance.checkDetailViewOfInstance(testData.accordions.titleData, testData.fieldContents.tag240Content); - + InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.check008FieldContent(); QuickMarcEditor.checkFieldContentMatch('textarea[name="records[1].content"]', /in\d{11}/gm); QuickMarcEditor.checkFieldContentMatch('textarea[name="records[3].content"]', /\d{14}\.\d{1}/gm); QuickMarcEditor.verifyTagField(10, '999', 'f', 'f', '$s', '$i'); }); -}); \ No newline at end of file +}); diff --git a/cypress/fixtures/marcFileForC388570.mrc b/cypress/fixtures/marcFileForC388570.mrc new file mode 100644 index 0000000000..7a641c8c1d --- /dev/null +++ b/cypress/fixtures/marcFileForC388570.mrc @@ -0,0 +1 @@ +01555cam a2200349Ii 41y00010009000000050017000090080041000260030004000670400028000710200015000990200031001140350022001450500027001670820014001941000126002082450109003342640049004433000027004923360068005193370068005873380065006555200205007206500072009256550074009979440010010719450024010819450024011059450024011299450020011539450020011739450012011931194806420191023111031.6191004s2019 ilua 000 p eng dICU aCOObengerdacCOOdUOK a1642590258 a9781642590258q(paperback) a(OCoLC)1122747273 4aPR9265.9.C53bC76 2019 4a811.62231 aChin, Staceyann,d1972-eAuthoreNarrator0http://id.loc.gov/authorities/names/n20080524041http://viaf.org/viaf/2407405210aCrossfire :ba litany for survival : poems 1998-2019 /cStaceyann Chin ; foreword by Jacqueline Woodson. 1aChicago, Illinois :bHaymarket Books,c2019. axi, 208 pages ;c23 cm atext2rdacontent0http://id.loc.gov/vocabulary/contentTypes/txt aunmediated2rdamedia0http://id.loc.gov/vocabulary/mediaTypes/n avolume2rdacarrier0http://id.loc.gov/vocabulary/carriers/nc a"Crossfire collects world-renowned lesbian poet and spoken-word artist Staceyann Chin's empowering, feminist-LGBTQ-Caribbean, activism-driven poetry for the first time in a single book."-- Back cover. 0aFeminist poetry.0http://id.loc.gov/authorities/subjects/sh85047755 7aPoetry.2lcgft0http://id.loc.gov/authorities/genreForms/gf2014026481 smfilm hKU/CC/DI/MabookcE hKU/CC/DI/MabookcE hKU/CC/DI/MabookcE hKU/CC/DI/Aadvd hKU/CC/DI/Aadvd hEatext \ No newline at end of file diff --git a/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js b/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js index 876dc46ad8..36093daeac 100644 --- a/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js +++ b/cypress/support/fragments/data-export/exportJobProfile/exportJobProfiles.js @@ -43,7 +43,7 @@ export default { const itemAmount = element.attr('data-end-of-list'); for (let i = 0; i < itemAmount; i++) { cy.expect(jobProfilesPane.find(MultiColumnListCell({ column: 'Name', content: including(text) })).exists()); - }; + } } else cy.expect(HTML('The list contains no items').exists()); }); }, diff --git a/cypress/support/fragments/orders/orderLines.js b/cypress/support/fragments/orders/orderLines.js index d21776aeed..687a4ba73c 100644 --- a/cypress/support/fragments/orders/orderLines.js +++ b/cypress/support/fragments/orders/orderLines.js @@ -96,9 +96,13 @@ const submitOrderLine = () => { } }); }; +const checkQuantityPhysical = (quantity) => { + cy.expect(Accordion('Cost details').find(KeyValue('Quantity physical')).has({ value: quantity })); +}; export default { submitOrderLine, + checkQuantityPhysical, searchByParameter: (parameter, value) => { cy.do([ searchForm.selectIndex(parameter), @@ -1075,4 +1079,21 @@ export default { cy.wait(4000); InteractorsTools.checkCalloutErrorMessage(message); }, + + checkPhysicalQuantityInLocation:(quantity) => { + const arrayOfQuantityRows = []; + cy.get('#location') + .find('[class*="col-"]:nth-child(2)') + .each($row => { + cy.get('[class*="kvValue-"]', { withinSubject: $row }) + // extract its text content + .invoke('text') + .then(cellValue => { + arrayOfQuantityRows.push(cellValue); + }); + }) + .then(() => { + expect(quantity).to.equal(arrayOfQuantityRows.length); + }); + } }; From 1e9279512f2620956e0a205fea8860978002d820 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Mon, 28 Aug 2023 18:22:57 +0300 Subject: [PATCH 074/437] FAT-7781-C380704-C375163-Fixes (#1507) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7781: tests updated * FAT-7781: added instance check * FAT-7781: title value updated --- .../search/browse-subjects-linked.cy.js | 6 +++--- .../create-new-marc-bib-edit-ldr.cy.js | 6 ++++-- .../fragments/inventory/inventoryInstance.js | 2 +- .../inventory/search/browseSubjects.js | 17 ++++++++++++++--- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/inventory/search/browse-subjects-linked.cy.js b/cypress/e2e/inventory/search/browse-subjects-linked.cy.js index 91fca789fc..98537e1628 100644 --- a/cypress/e2e/inventory/search/browse-subjects-linked.cy.js +++ b/cypress/e2e/inventory/search/browse-subjects-linked.cy.js @@ -97,8 +97,8 @@ describe('Inventory: Subject Browse', () => { InventorySearchAndFilter.verifyKeywordsAsDefault(); BrowseSubjects.select(); BrowseSubjects.browse(testData.subjectName); - BrowseSubjects.checkNoAuthorityIconDisplayedForRow(5, testData.subjectName); - BrowseSubjects.checkAuthorityIconAndValueDisplayedForRow(6, testData.subjectName); + BrowseSubjects.checkRowWithValueAndAuthorityIconExists(testData.subjectName); + BrowseSubjects.checkRowWithValueAndNoAuthorityIconExists(testData.subjectName); BrowseSubjects.checkRowValueIsBold(5, testData.subjectName); BrowseSubjects.checkRowValueIsBold(6, testData.subjectName); InventorySearchAndFilter.switchToSearchTab(); @@ -112,7 +112,7 @@ describe('Inventory: Subject Browse', () => { BrowseSubjects.select(); BrowseSubjects.browse(testData.subjectName); BrowseSubjects.checkNoAuthorityIconDisplayedForRow(5, testData.subjectName); - BrowseSubjects.checkValueAbsentInRow(6, testData.subjectName); BrowseSubjects.checkRowValueIsBold(5, testData.subjectName); + BrowseSubjects.checkValueAbsentInRow(6, testData.subjectName); }); }); diff --git a/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js b/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js index b6d0b2f350..2995326b31 100644 --- a/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js +++ b/cypress/e2e/marc-authority/create-new-marc-bib-edit-ldr.cy.js @@ -17,7 +17,7 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { }, fieldContents: { - tag245Content: `Created_Bib_${getRandomPostfix()}` + tag245ContentPrefix: 'Created_Bib_' }, LDRValues: { @@ -88,9 +88,10 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { for (let i = 0; i < testData.LDRValues.validLDR07Values.length; i++) { const updatedLDRvalue = `${testData.LDRValues.validLDRvalue.substring(0, 6)}${testData.LDRValues.validLDR06Values[i]}${testData.LDRValues.validLDR07Values[i]}${testData.LDRValues.validLDRvalue.substring(8)}`; const updatedLDRmask = new RegExp(`\\d{5}${updatedLDRvalue.substring(5, 12).replace('\\', '\\\\')}\\d{5}${updatedLDRvalue.substring(17).replace('\\', '\\\\')}`); + const title = testData.fieldContents.tag245ContentPrefix + getRandomPostfix(); InventoryInstance.newMarcBibRecord(); - QuickMarcEditor.updateExistingField(testData.tags.tag245, `$a ${testData.fieldContents.tag245Content}`); + QuickMarcEditor.updateExistingField(testData.tags.tag245, `$a ${title}`); QuickMarcEditor.updateExistingField(testData.tags.tagLDR, replaceByIndex(testData.LDRValues.validLDRvalue, 6, testData.LDRValues.invalidLDR06Value)); QuickMarcEditor.checkSubfieldsAbsenceInTag008(); QuickMarcEditor.updateExistingField(testData.tags.tagLDR, testData.LDRValues.validLDRvalue); @@ -99,6 +100,7 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib', () => { QuickMarcEditor.checkSubfieldsPresenceInTag008(); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.checkInstanceTitle(title); InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.saveInstanceIdToArrayInQuickMarc(createdInstanceIDs); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index ad623c6301..7f593bbebb 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -276,7 +276,7 @@ export default { newMarcBibRecord() { cy.do([ - actionsBtn.click(), + paneResultsSection.find(actionsBtn).click(), newMarcBibButton.click(), ]); cy.expect([ diff --git a/cypress/support/fragments/inventory/search/browseSubjects.js b/cypress/support/fragments/inventory/search/browseSubjects.js index 2085c38efc..3c439b1f92 100644 --- a/cypress/support/fragments/inventory/search/browseSubjects.js +++ b/cypress/support/fragments/inventory/search/browseSubjects.js @@ -92,7 +92,7 @@ export default { checkAuthorityIconAndValueDisplayedForRow(rowIndex, value) { cy.expect([ - MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ content: including(`${value}`) }), + MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ content: including(value) }), MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ innerHTML: including('') }), ]); @@ -100,7 +100,7 @@ export default { checkNoAuthorityIconDisplayedForRow(rowIndex, value) { cy.expect([ - MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ content: including(`${value}`) }), + MultiColumnListCell({ row: rowIndex, columnIndex: 0 }).has({ content: including(value) }), MultiColumnListCell({ row: rowIndex, columnIndex: 0, innerHTML: including('alt="MARC Authorities module">') }).absent(), ]); }, @@ -127,5 +127,16 @@ export default { checkValueAbsentInRow(rowIndex, value) { cy.expect(MultiColumnListCell({ row: rowIndex, columnIndex: 0, content: including(value) }).absent()); - } + }, + + checkRowWithValueAndNoAuthorityIconExists(value) { + cy.expect(MultiColumnListCell({ columnIndex: 0, content: value }).exists()); + }, + + checkRowWithValueAndAuthorityIconExists(value) { + cy.expect(MultiColumnListCell({ + columnIndex: 0, + content: 'Linked to MARC authority' + value + }).exists()); + }, }; From 9711f004856da89bacc29e70c8cb000604118188 Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Mon, 28 Aug 2023 14:49:39 -0500 Subject: [PATCH 075/437] UITEST-109 use NodeJS v18 in CI (#1519) In CI, bumpt NodeJS from v16 to v18. Refs UITEST-109 --- .github/workflows/build-npm-release.yml | 2 +- .github/workflows/build-npm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-npm-release.yml b/.github/workflows/build-npm-release.yml index 2a9fb16fa8..8bb81e61aa 100644 --- a/.github/workflows/build-npm-release.yml +++ b/.github/workflows/build-npm-release.yml @@ -28,7 +28,7 @@ jobs: FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folio/' FOLIO_NPM_REGISTRY_AUTH: '//repository.folio.org/repository/npm-folio/' FOLIO_MD_REGISTRY: 'https://folio-registry.dev.folio.org' - NODEJS_VERSION: '16' + NODEJS_VERSION: '18' JEST_JUNIT_OUTPUT_DIR: 'artifacts/jest-junit' JEST_COVERAGE_REPORT_DIR: 'artifacts/coverage-jest/lcov-report/' BIGTEST_JUNIT_OUTPUT_DIR: 'artifacts/runTest' diff --git a/.github/workflows/build-npm.yml b/.github/workflows/build-npm.yml index 685eeb1e71..d4503f0179 100644 --- a/.github/workflows/build-npm.yml +++ b/.github/workflows/build-npm.yml @@ -25,7 +25,7 @@ jobs: FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folioci/' FOLIO_NPM_REGISTRY_AUTH: '//repository.folio.org/repository/npm-folioci/' FOLIO_MD_REGISTRY: 'https://folio-registry.dev.folio.org' - NODEJS_VERSION: '16' + NODEJS_VERSION: '18' JEST_JUNIT_OUTPUT_DIR: 'artifacts/jest-junit' JEST_COVERAGE_REPORT_DIR: 'artifacts/coverage-jest/lcov-report/' BIGTEST_JUNIT_OUTPUT_DIR: 'artifacts/runTest' From bc1d10ad6c26307b70e3b6d931393f7115d82b15 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 29 Aug 2023 07:54:26 +0300 Subject: [PATCH 076/437] FAT-7756-C2331 (#1510) * added test * moved to const fragments --- ...add-and-remove-tags-to-a-job-profile.cy.js | 52 +++++++++++++++++++ .../job_profiles/jobProfileView.js | 51 +++++++++++++++++- 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/data-import/settings/add-and-remove-tags-to-a-job-profile.cy.js diff --git a/cypress/e2e/data-import/settings/add-and-remove-tags-to-a-job-profile.cy.js b/cypress/e2e/data-import/settings/add-and-remove-tags-to-a-job-profile.cy.js new file mode 100644 index 0000000000..cabe6c4c3b --- /dev/null +++ b/cypress/e2e/data-import/settings/add-and-remove-tags-to-a-job-profile.cy.js @@ -0,0 +1,52 @@ +import uuid from 'uuid'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import JobProfileView from '../../../support/fragments/data_import/job_profiles/jobProfileView'; +import { ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; +import InteractorsTools from '../../../support/utils/interactorsTools'; + +describe('data-import', () => { + describe('Settings', () => { + const tag = 'important'; + const newTag = uuid(); + const calloutMessage = 'New tag created'; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C2331 autotest job profile.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('create test data', () => { + cy.loginAsAdmin(); + cy.getAdminToken(); + + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.saveAndClose(); + JobProfiles.closeJobProfile(jobProfile.profileName); + }); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + }); + + it('C2331 Add tags to a job profile, then remove tags from it (folijet)', + { tags: [TestTypes.extendedPath, DevTeams.folijet] }, () => { + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfileView.addExistingTag(tag); + JobProfileView.verifyAssignedTags(tag); + + JobProfileView.addNewTag(newTag); + InteractorsTools.checkCalloutMessage(calloutMessage); + JobProfileView.verifyAssignedTags(newTag, 2); + + JobProfileView.removeTag(tag); + JobProfileView.verifyAssignedTagsIsAbsent(tag); + }); + }); +}); diff --git a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js index e112607c5d..f2a2f2281a 100644 --- a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js +++ b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js @@ -1,9 +1,19 @@ import { HTML, including } from '@interactors/html'; -import { Button, Pane } from '../../../../../interactors'; +import { Accordion, + Button, + Pane, + MultiSelect, + ValueChipRoot, + MultiColumnList, + MultiColumnListCell, + MultiSelectOption } from '../../../../../interactors'; const viewPane = Pane({ id:'view-job-profile-pane' }); const resultsPane = Pane({ id:'pane-results' }); const actionsButton = Button('Actions'); +const tagSelect = MultiSelect({ id:'input-tag' }); +const addTagForSelectOption = MultiSelectOption(including('Add tag for:')); +const jobProfilesList = MultiColumnList({ id: 'job-profiles-list' }); export default { edit:() => { @@ -11,10 +21,49 @@ export default { cy.do(Button('Edit').click()); }, + addExistingTag:(tag) => { + cy.intercept({ + method: 'GET', + url: '/tags?limit=10000', + }).as('getTags'); + cy.do(Accordion({ id:'tag-accordion' }).clickHeader()); + cy.wait('@getTags'); + cy.expect(tagSelect.exists()); + cy.do(tagSelect.choose(tag)); + }, + + addNewTag:(newTag) => { + cy.expect(tagSelect.exists()); + cy.get('#input-tag-input').type(newTag); + cy.expect(addTagForSelectOption.exists()); + cy.do(addTagForSelectOption.click()); + }, + + removeTag:(tag) => { + cy.do(ValueChipRoot(tag).find(Button({ icon: 'times' })).click()); + cy.expect(ValueChipRoot(tag).absent()); + }, + verifyJobProfileOpened:() => { cy.expect(resultsPane.exists()); cy.expect(viewPane.exists()); }, + verifyAssignedTags:(tag, quantityOfTags = 1) => { + cy.expect(MultiSelect({ selectedCount: quantityOfTags }).exists()); + cy.expect(ValueChipRoot(tag).exists()); + cy.expect(resultsPane + .find(jobProfilesList) + .find(MultiColumnListCell({ row: 0, columnIndex: 2, content: including(tag) })) + .exists()); + }, + verifyAssignedTagsIsAbsent:(tag, quantityOfTags = 1) => { + cy.expect(MultiSelect({ selectedCount: quantityOfTags }).exists()); + cy.expect(ValueChipRoot(tag).absent()); + cy.expect(resultsPane + .find(jobProfilesList) + .find(MultiColumnListCell({ row: 0, columnIndex: 2, content: including(tag) })) + .absent()); + }, verifyJobProfileName:(profileName) => cy.expect(viewPane.find(HTML(including(profileName))).exists()), verifyActionMenuAbsent:() => cy.expect(viewPane.find(actionsButton).absent()) From b75098c5f4567c68f606721ce45cee507967fc16 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Tue, 29 Aug 2023 12:06:07 +0500 Subject: [PATCH 077/437] FAT-7811 (#1515) --- .../in-app/bulk-edit-in-app-item-add-notes-actions.cy.js | 2 +- .../in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js | 4 ++-- .../in-app/bulk-edit-in-app-suppressed-holdings-true.cy.js | 4 ++-- .../in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js | 5 ++++- ...dit-logs-in-app-suppressed-holdings-false-items-not.cy.js | 4 ++-- ...edit-logs-in-app-suppressed-holdings-true-items-not.cy.js | 4 ++-- .../logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js | 4 ++-- cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js | 4 ++-- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js index c9c38eba1e..7e7502e93e 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-add-notes-actions.cy.js @@ -74,7 +74,7 @@ describe('bulk-edit', () => { BulkEditActions.verifyItemCheckInNoteActions(1); BulkEditActions.addItemNote('Check in note', secondNote, 1); BulkEditActions.addNewBulkEditFilterString(); - BulkEditActions.verifyItemNoteActions(2); + BulkEditActions.verifyItemNoteActions('Note', 2); BulkEditActions.addItemNote('Note', thirdNote, 2); BulkEditActions.confirmChanges(); 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 index 66b4dcc0e1..8e02906a02 100644 --- 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 @@ -65,14 +65,14 @@ describe('bulk-edit', () => { const suppressFromDiscovery = false; BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditSearchPane.changeShowColumnCheckbox('Suppress from discovery'); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); BulkEditActions.confirmChanges(); BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + BulkEditSearchPane.verifyChangesUnderColumns('Suppress from discovery', suppressFromDiscovery); TopMenuNavigation.navigateToApp('Inventory'); InventorySearchAndFilter.switchToItem(); 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 index 1641985556..4a002e083c 100644 --- 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 @@ -55,14 +55,14 @@ describe('bulk-edit', () => { const suppressFromDiscovery = true; BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditSearchPane.changeShowColumnCheckbox('Suppress from discovery'); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); BulkEditActions.confirmChanges(); BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + BulkEditSearchPane.verifyChangesUnderColumns('Suppress from discovery', suppressFromDiscovery); cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.switchToItem(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js index fccbc55711..b80112f6a3 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js @@ -85,7 +85,10 @@ describe('bulk-edit', () => { cy.visit(SettingsMenu.customFieldsPath); CustomFields.editMultiSelectCustomField(customFieldData, updatedCustomFieldData); - cy.visit(TopMenu.bulkEditPath); + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js index 766c268a7e..66319ea1bf 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-false-items-not.cy.js @@ -81,7 +81,7 @@ describe('Bulk Edit - Logs', () => { const suppressFromDiscovery = false; BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditSearchPane.changeShowColumnCheckbox('Suppress from discovery'); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); BulkEditActions.checkApplyToItemsRecordsCheckbox(); @@ -89,7 +89,7 @@ describe('Bulk Edit - Logs', () => { BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + BulkEditSearchPane.verifyChangesUnderColumns('Suppress from discovery', suppressFromDiscovery); BulkEditSearchPane.openLogsSearch(); BulkEditSearchPane.checkHoldingsCheckbox(); 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 index a97e097acf..6e7ce3e86c 100644 --- 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 @@ -83,7 +83,7 @@ describe('Bulk Edit - Logs', () => { const suppressFromDiscovery = true; const newLocation = 'Main Library'; BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditSearchPane.changeShowColumnCheckbox('Suppress from discovery'); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); BulkEditActions.addNewBulkEditFilterString(); @@ -94,7 +94,7 @@ describe('Bulk Edit - Logs', () => { BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); - BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + BulkEditSearchPane.verifyChangesUnderColumns('Suppress from discovery', suppressFromDiscovery); BulkEditSearchPane.openLogsSearch(); BulkEditSearchPane.checkHoldingsCheckbox(); 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 b71466c45d..ffb622d774 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 @@ -73,8 +73,8 @@ describe('Bulk Edit - Logs', () => { BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); BulkEditActions.openActions(); - BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); - BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', false); + BulkEditSearchPane.changeShowColumnCheckbox('Suppress from discovery'); + BulkEditSearchPane.verifyChangesUnderColumns('Suppress from discovery', false); BulkEditActions.downloadChangedCSV(); BulkEditSearchPane.openLogsSearch(); 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 421ee6bb35..d459d1600d 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -661,7 +661,7 @@ export default { DropdownMenu().find(Checkbox('Copy number')).has({ checked: false }), DropdownMenu().find(Checkbox('Number of items')).has({ checked: false }), DropdownMenu().find(Checkbox('Receiving history')).has({ checked: false }), - DropdownMenu().find(Checkbox('Suppressed from discovery')).has({ checked: false }), + DropdownMenu().find(Checkbox('Suppress from discovery')).has({ checked: false }), DropdownMenu().find(Checkbox('Statistical codes')).has({ checked: false }), DropdownMenu().find(Checkbox('Tags')).has({ checked: false }), DropdownMenu().find(Checkbox('Source')).has({ checked: false }), @@ -685,7 +685,7 @@ export default { DropdownMenu().find(Checkbox({ name: 'Version', checked: false })).exists(), DropdownMenu().find(Checkbox({ name: 'Holdings record ID', checked: false })).exists(), DropdownMenu().find(Checkbox({ name: 'Former identifiers', checked: false })).exists(), - DropdownMenu().find(Checkbox({ name: 'Suppressed from discovery', checked: false })).exists(), + DropdownMenu().find(Checkbox({ name: 'Suppress from discovery', checked: false })).exists(), DropdownMenu().find(Checkbox({ name: 'Title', checked: false })).exists(), DropdownMenu().find(Checkbox({ name: 'Contributor names', checked: false })).exists(), DropdownMenu().find(Checkbox({ name: 'Call number', checked: false })).exists(), From b46e4f61fc3348d36fdaf760d7cadf7827e94ef4 Mon Sep 17 00:00:00 2001 From: Daniil Novikau Date: Mon, 28 Aug 2023 15:07:00 +0300 Subject: [PATCH 078/437] FAT-C440 --- cypress/e2e/settings/users/owners.cy.js | 253 ++++++++++++------ .../fragments/settings/settingsPane.js | 40 ++- .../fragments/settings/users/usersOwners.js | 244 ++++++++++------- interactors/button.js | 11 +- 4 files changed, 355 insertions(+), 193 deletions(-) diff --git a/cypress/e2e/settings/users/owners.cy.js b/cypress/e2e/settings/users/owners.cy.js index 112b4f8f45..886add7bd2 100644 --- a/cypress/e2e/settings/users/owners.cy.js +++ b/cypress/e2e/settings/users/owners.cy.js @@ -18,126 +18,207 @@ describe('ui-users-settings: Owners', () => { beforeEach(() => { cy.getAdminToken().then(() => { - cy.createServicePoint() - .then(newServicePoint => { - servicePoints.push(newServicePoint); - }); - cy.createServicePoint() - .then(newServicePoint => { - servicePoints.push(newServicePoint); - }); + cy.createServicePoint().then((newServicePoint) => { + servicePoints.push(newServicePoint); + }); + cy.createServicePoint().then((newServicePoint) => { + servicePoints.push(newServicePoint); + }); cy.loginAsAdmin({ path: SettingsMenu.usersOwnersPath, waiter: UsersOwners.waitLoading }); }); }); after(() => { - servicePoints.forEach(servicePointId => { + servicePoints.forEach((servicePointId) => { ServicePoint.deleteViaApi(servicePointId.id); }); - ownerNames.forEach(ownerName => { - UsersOwners.getOwnerViaApi({ query: `owner==${ownerName}` }) - .then(owner => UsersOwners.deleteViaApi(owner.id)); + ownerNames.forEach((ownerName) => { + UsersOwners.getOwnerViaApi({ query: `owner==${ownerName}` }).then((owner) => UsersOwners.deleteViaApi(owner.id)); }); }); - it('C350616 Fee/Fine Owners are not required to have a Service Point (volaris)', { tags: [TestType.smoke, DevTeams.volaris] }, () => { - const ownerName = `Automation owner $${getRandomPostfix()}`; - ownerNames.push(ownerName); - UsersOwners.startNewLineAdding(); - UsersOwners.fill(ownerName); - UsersOwners.save(ownerName); + it( + 'C350616 Fee/Fine Owners are not required to have a Service Point (volaris)', + { tags: [TestType.smoke, DevTeams.volaris] }, + () => { + const name = `Automation owner $${getRandomPostfix()}`; + ownerNames.push(name); + UsersOwners.startNewLineAdding(); + UsersOwners.fillOwner({ name }); + UsersOwners.saveOwner(name); + + UsersOwners.startNewLineAdding(); + UsersOwners.multiCheckFreeServicePointPresence(servicePoints); + }, + ); + + it( + 'C350615 The "Shared" Fee/Fine Owner is not allowed to have Service Points (volaris)', + { tags: [TestType.smoke, Features.sharedOwner, DevTeams.volaris] }, + () => { + const name = 'Shared'; + UsersOwners.startNewLineAdding(); + UsersOwners.fillOwner({ name }); + UsersOwners.saveOwner(); + ownerNames.push(name); + + UsersOwners.startNewLineAdding(); + UsersOwners.fillOwner({ name, servicePoint: servicePoints.at(-1).name }); + UsersOwners.trySave(); + + UsersOwners.checkValidatorError({ + error: 'Associated service points not allowed for Shared fee/fine owner', + }); + }, + ); + }); - UsersOwners.startNewLineAdding(); - UsersOwners.multiCheckFreeServicePointPresence(servicePoints); + describe('Management of fee/fine owners', () => { + before(() => { + cy.loginAsAdmin({ + path: SettingsMenu.usersOwnersPath, + waiter: UsersOwners.waitLoading, + }); }); - it('C350615 The "Shared" Fee/Fine Owner is not allowed to have Service Points (volaris)', { tags: [TestType.smoke, Features.sharedOwner, DevTeams.volaris] }, () => { - const ownerName = 'Shared'; - UsersOwners.startNewLineAdding(); - UsersOwners.fill(ownerName); - UsersOwners.save(); - ownerNames.push(ownerName); + it( + 'C440 Verify that you can create/edit/delete fee/fine owners (vega)', + { tags: [TestType.extendedPath, DevTeams.vega] }, + () => { + UsersOwners.startNewLineAdding(); + UsersOwners.trySave(); - UsersOwners.startNewLineAdding(); - UsersOwners.fill('Shared', servicePoints.at(-1).name); - UsersOwners.trySave(); + UsersOwners.checkValidatorError({ error: 'Please fill this in to continue' }); + UsersOwners.cancelAdding(); - UsersOwners.checkValidatorError('Shared', 'Associated service points not allowed for Shared fee/fine owner'); - }); - }); + const name = `Automation owner $${getRandomPostfix()}`; + const description = `Automation owner description $${getRandomPostfix()}`; - describe('Management of n fee/fine owners and service points', () => { - const testUsers = []; - const addedServicePoints = []; - const createRegularUser = () => cy.createTempUser([Permissions.uiUsersSettingsOwners.gui, - Permissions.uiUsersEdituserservicepoints.gui]); - - it('C441 Verify that you can create/edit/delete associations between fee/fine owners and service points (volaris)', { tags: [TestType.criticalPath, DevTeams.volaris] }, () => { - createRegularUser().then(firstUserProperties => { - testUsers.push(firstUserProperties); + UsersOwners.startNewLineAdding(); + UsersOwners.fillOwner({ name, description }); + UsersOwners.saveOwner(name); - cy.allure().startStep('Login and open Owners settings by user1'); - cy.login(firstUserProperties.username, firstUserProperties.password, { path: SettingsMenu.usersOwnersPath, waiter: UsersOwners.waitLoading }); - cy.allure().endStep(); + UsersOwners.startNewLineAdding(); + UsersOwners.fillOwner({ name, description }); + UsersOwners.trySave(); - // clarify should be service points be shared between existing users - cy.allure().startStep('Check presented owners and related service points'); - UsersOwners.getUsedServicePoints().then(usedServicePoints => { - addedServicePoints.push(UsersOwners.defaultServicePoints.filter(servicePoint => !usedServicePoints?.includes(servicePoint))[0]); - cy.allure().endStep(); + UsersOwners.checkValidatorError({ error: 'Fee/fine owner already exists' }); + UsersOwners.cancelAdding(); - cy.allure().startStep('Add new owner, related with current user and not used service point'); - UsersOwners.startNewLineAdding(); - UsersOwners.fill(testUsers[0].username, addedServicePoints.at(-1)); - UsersOwners.save(testUsers[0].username); - cy.allure().endStep(); + UsersOwners.editOwner(name, { + name: `${name} to be deleted`, + description: `${description} to be deleted`, + }); + UsersOwners.deleteOwner(`${name} to be deleted`); + }, + ); + }); - cy.allure().startStep('Verify values in Associated service points.'); - UsersOwners.startNewLineAdding(); - UsersOwners.checkUsedServicePoints(addedServicePoints); + describe('Management of n fee/fine owners and service points', () => { + const testUsers = []; + const addedServicePoints = []; + const createRegularUser = () => cy.createTempUser([ + Permissions.uiUsersSettingsOwners.gui, + Permissions.uiUsersEdituserservicepoints.gui, + ]); + + it( + 'C441 Verify that you can create/edit/delete associations between fee/fine owners and service points (volaris)', + { tags: [TestType.criticalPath, DevTeams.volaris] }, + () => { + createRegularUser().then((firstUserProperties) => { + testUsers.push(firstUserProperties); + + cy.allure().startStep('Login and open Owners settings by user1'); + cy.login(firstUserProperties.username, firstUserProperties.password, { + path: SettingsMenu.usersOwnersPath, + waiter: UsersOwners.waitLoading, + }); cy.allure().endStep(); - createRegularUser().then(secondUserProperties => { - testUsers.push(secondUserProperties); - - cy.allure().startStep('Login and open Owners settings by user2'); - cy.login(secondUserProperties.username, secondUserProperties.password, { path: SettingsMenu.usersOwnersPath, waiter: UsersOwners.waitLoading }); + // clarify should be service points be shared between existing users + cy.allure().startStep('Check presented owners and related service points'); + UsersOwners.getUsedServicePoints().then((usedServicePoints) => { + addedServicePoints.push( + UsersOwners.defaultServicePoints.filter( + (servicePoint) => !usedServicePoints?.includes(servicePoint), + )[0], + ); cy.allure().endStep(); - cy.allure().startStep('Verify values in Associated service points. It should not contain service point from previous step'); + cy.allure().startStep( + 'Add new owner, related with current user and not used service point', + ); UsersOwners.startNewLineAdding(); - UsersOwners.checkUsedServicePoints(addedServicePoints); - cy.allure().endStep(); - - cy.allure().startStep('Login and open Owners settings by user1'); - cy.login(firstUserProperties.username, firstUserProperties.password, { path: SettingsMenu.usersOwnersPath, waiter: UsersOwners.waitLoading }); + UsersOwners.fillOwner({ + name: testUsers[0].username, + servicePoint: addedServicePoints.at(-1), + }); + UsersOwners.saveOwner(testUsers[0].username); cy.allure().endStep(); - // TODO: can be not stable, review in the future - cy.allure().startStep('Edit last created owner, uncheck already selected service point and save changed owner '); - UsersOwners.unselectExistingServicePoint(addedServicePoints.at(-1)); - cy.allure().endStep(); - - cy.allure().startStep('Login and open Owners settings by user2'); - cy.login(secondUserProperties.username, secondUserProperties.password, { path: SettingsMenu.usersOwnersPath, waiter: UsersOwners.waitLoading }); - cy.allure().endStep(); - - cy.allure().startStep('Verify values in Associated service points. It should contain service point from previous step'); + cy.allure().startStep('Verify values in Associated service points.'); UsersOwners.startNewLineAdding(); - UsersOwners.checkFreeServicePointPresence(addedServicePoints.at(-1)); + UsersOwners.checkUsedServicePoints(addedServicePoints); cy.allure().endStep(); - UsersOwners.cancelAdding(); - // clearing of test data collector from outdated information - addedServicePoints.pop(); - UsersOwners.deleteOwner(); + + createRegularUser().then((secondUserProperties) => { + testUsers.push(secondUserProperties); + + cy.allure().startStep('Login and open Owners settings by user2'); + cy.login(secondUserProperties.username, secondUserProperties.password, { + path: SettingsMenu.usersOwnersPath, + waiter: UsersOwners.waitLoading, + }); + cy.allure().endStep(); + + cy.allure().startStep( + 'Verify values in Associated service points. It should not contain service point from previous step', + ); + UsersOwners.startNewLineAdding(); + UsersOwners.checkUsedServicePoints(addedServicePoints); + cy.allure().endStep(); + + cy.allure().startStep('Login and open Owners settings by user1'); + cy.login(firstUserProperties.username, firstUserProperties.password, { + path: SettingsMenu.usersOwnersPath, + waiter: UsersOwners.waitLoading, + }); + cy.allure().endStep(); + + // TODO: can be not stable, review in the future + cy.allure().startStep( + 'Edit last created owner, uncheck already selected service point and save changed owner ', + ); + UsersOwners.unselectExistingServicePoint(addedServicePoints.at(-1)); + cy.allure().endStep(); + + cy.allure().startStep('Login and open Owners settings by user2'); + cy.login(secondUserProperties.username, secondUserProperties.password, { + path: SettingsMenu.usersOwnersPath, + waiter: UsersOwners.waitLoading, + }); + cy.allure().endStep(); + + cy.allure().startStep( + 'Verify values in Associated service points. It should contain service point from previous step', + ); + UsersOwners.startNewLineAdding(); + UsersOwners.checkFreeServicePointPresence(addedServicePoints.at(-1)); + cy.allure().endStep(); + UsersOwners.cancelAdding(); + // clearing of test data collector from outdated information + addedServicePoints.pop(); + UsersOwners.deleteOwner(); + }); }); }); - }); - }); + }, + ); afterEach(() => { - testUsers.forEach(user => users.deleteViaApi(user.userId)); + testUsers.forEach((user) => users.deleteViaApi(user.userId)); }); }); }); diff --git a/cypress/support/fragments/settings/settingsPane.js b/cypress/support/fragments/settings/settingsPane.js index fb66ff3568..f7f5b2c7bc 100644 --- a/cypress/support/fragments/settings/settingsPane.js +++ b/cypress/support/fragments/settings/settingsPane.js @@ -1,7 +1,41 @@ -import { Pane } from '../../../../interactors'; +import { Button, Pane, Section, EditableList, EditableListRow } from '../../../../interactors'; + +export const SETTINGS = { + TENANT: 'Tenant', +}; + +export const startRowIndex = 2; +export const rootPaneSet = Section({ id: 'controlled-vocab-pane' }); +export const addButton = rootPaneSet.find(Button('+ New')); +export const table = rootPaneSet.find(EditableList()); + +const clickActionBtn = ({ rowIndex = startRowIndex, locator }) => { + // filter index implemented based on parent-child relations. + // aria-rowindex calculated started from 2. Need to count it. + const currentRow = table.find(EditableListRow({ index: rowIndex - startRowIndex })); + cy.do(currentRow.find(Button(locator)).click()); +}; export default { - waitLoading() { - cy.expect(Pane('Settings').exists()); + waitLoading(section = 'Settings') { + cy.expect(Pane(section).exists()); + }, + clickAddNewBtn() { + cy.do(addButton.click()); + }, + clickSaveBtn({ rowIndex = 2 } = {}) { + clickActionBtn({ rowIndex, locator: 'Save' }); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(1000); + }, + clickCancelBtn({ rowIndex } = {}) { + clickActionBtn({ rowIndex, locator: 'Cancel' }); + cy.expect(addButton.has({ disabled: false })); + }, + clickEditBtn({ rowIndex } = {}) { + clickActionBtn({ rowIndex, locator: { icon: 'edit' } }); + }, + clickDeleteBtn({ rowIndex } = {}) { + clickActionBtn({ rowIndex, locator: { icon: 'trash' } }); }, }; diff --git a/cypress/support/fragments/settings/users/usersOwners.js b/cypress/support/fragments/settings/users/usersOwners.js index 83db646b83..e06000932b 100644 --- a/cypress/support/fragments/settings/users/usersOwners.js +++ b/cypress/support/fragments/settings/users/usersOwners.js @@ -1,83 +1,96 @@ -import { PaneHeader, Button, MultiColumnListCell, TextField, MultiSelect, PaneSet, EditableList, EditableListRow, Modal, MultiSelectOption, ValueChipRoot, HTML, including } from '../../../../../interactors'; +import { + PaneHeader, + Button, + MultiColumnListCell, + TextField, + MultiSelect, + EditableListRow, + Modal, + MultiSelectOption, + ValueChipRoot, + HTML, + including, +} from '../../../../../interactors'; import { getLongDelay } from '../../../utils/cypressTools'; import { getTestEntityValue } from '../../../utils/stringTools'; +import SettingsPane, { + startRowIndex, + rootPaneSet, + addButton, + table as tableWithOwners, +} from '../settingsPane'; -const rootPaneset = PaneSet({ id:'settings-owners' }); -const addButton = rootPaneset.find(Button({ id:'clickable-add-settings-owners' })); -const tableWithOwners = rootPaneset.find(EditableList('editList-settings-owners')); +const defaultServicePoints = ['Circ Desk 1', 'Circ Desk 2', 'Online']; -const defaultServicePoints = ['Circ Desk 1', - 'Circ Desk 2', - 'Online']; +const fillOwner = ({ name, description, servicePoint }, rowIndex = 2) => { + const index = rowIndex - startRowIndex; -const startRowIndex = 2; + cy.do(tableWithOwners.find(TextField({ name: `items[${index}].owner` })).fillIn(name)); -const trySave = (rowNumber = 0) => { - cy.do(rootPaneset.find(Button({ id:`clickable-save-settings-owners-${rowNumber}` })).click()); - // fixed wait because there is no element for waiter - cy.wait(1000); -}; - -const save = (ownerName) => { - trySave(); - cy.expect(addButton.has({ disabled: false })); - cy.expect(cy.expect(tableWithOwners.find(MultiColumnListCell(ownerName)).exists())); -}; + if (description) { + cy.do(tableWithOwners.find(TextField({ name: `items[${index}].desc` })).fillIn(description)); + } -// filter index implemented based on parent-child relations. aria-rowindex calculated started from 2. Need to count it. -const deleteOwner = (rowNumber = 2) => { - cy.do(tableWithOwners.find(EditableListRow({ index:rowNumber - startRowIndex })).find(Button({ icon:'trash' })).click()); - cy.do(Modal('Delete Fee/fine owner').find(Button('Delete')).click()); - cy.expect(Modal('Delete Fee/fine owner').absent()); + if (servicePoint) { + cy.do( + tableWithOwners + .find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })) + .select(servicePoint), + ); + } }; function getAddServicePointsToOwnerPayload(owner, servicePoints) { - const points = servicePoints.map(servicePoint => { - return { 'value': servicePoint.id, 'label': `${servicePoint.name}` }; + const points = servicePoints.map((servicePoint) => { + return { value: servicePoint.id, label: `${servicePoint.name}` }; }); - return { 'owner': owner.name, - 'servicePointOwner': points, - 'id': owner.id }; + return { owner: owner.name, servicePointOwner: points, id: owner.id }; } export default { - trySave, - waitLoading:() => { - cy.intercept( - { - method: 'GET', - url: '/service-points??*', - } - ).as('getServicePoints'); + trySave() { + SettingsPane.clickSaveBtn(); + }, + waitLoading() { + cy.intercept({ + method: 'GET', + url: '/service-points??*', + }).as('getServicePoints'); cy.wait('@getServicePoints', getLongDelay()); cy.expect(PaneHeader('Fee/fine: Owners').exists()); cy.expect(addButton.exists()); - cy.expect(rootPaneset.find(HTML({ className: including('spinner') })).absent()); + cy.expect(rootPaneSet.find(HTML({ className: including('spinner') })).absent()); // TODO: clarify the reason of extra waiting + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(500); }, - getDefaultNewOwner: (id, name, desc) => ({ - owner: getTestEntityValue(name), - desc: getTestEntityValue(desc), - // required field - id, - }), - startNewLineAdding: () => cy.do(addButton.click()), + getDefaultNewOwner(id, name, desc) { + return { + owner: getTestEntityValue(name), + desc: getTestEntityValue(desc), + // required field + id, + }; + }, + startNewLineAdding() { + SettingsPane.clickAddNewBtn(); + }, defaultServicePoints, - getUsedServicePoints: () => { - cy.then(() => rootPaneset.find(EditableList()).isPresented()).then(isPresented => { + getUsedServicePoints() { + cy.then(() => tableWithOwners.isPresented()).then((isPresented) => { if (isPresented) { - cy.then(() => tableWithOwners.rowCount()).then(rowsCount => { + cy.then(() => tableWithOwners.rowCount()).then((rowsCount) => { const usedServicePoints = []; for (let i = 0; i < rowsCount; i++) { - cy.then(() => tableWithOwners.find(EditableListRow({ index:i })) + cy.then(() => tableWithOwners + .find(EditableListRow({ index: i })) // read value from thrid column(2 in case of 0 in initial position) - .find(MultiColumnListCell({ columnIndex:startRowIndex })).liValues()) - .then(servicePointNames => { - usedServicePoints.push(servicePointNames); - // flat related with cases when several service points assigned to one user - cy.wrap(usedServicePoints.flat(1)).as('usedServicePoints'); - }); + .find(MultiColumnListCell({ columnIndex: startRowIndex })) + .liValues()).then((servicePointNames) => { + usedServicePoints.push(servicePointNames); + // flat related with cases when several service points assigned to one user + cy.wrap(usedServicePoints.flat(1)).as('usedServicePoints'); + }); } }); } else { @@ -86,74 +99,105 @@ export default { }); return cy.get('@usedServicePoints'); }, - fill: (userName, servicePoint) => { - cy.do(tableWithOwners.find(TextField({ name:'items[0].owner' })).fillIn(userName)); - - if (servicePoint) { - cy.do(tableWithOwners.find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })).select(servicePoint)); - } + fillOwner, + saveOwner(name) { + SettingsPane.clickSaveBtn(); + cy.expect(cy.expect(tableWithOwners.find(MultiColumnListCell(name)).exists())); + }, + editOwner(owner, { name, description }) { + cy.then(() => tableWithOwners.find(MultiColumnListCell(owner)).row()).then((rowIndex) => { + SettingsPane.clickEditBtn({ rowIndex }); + fillOwner({ name, description }, rowIndex); + SettingsPane.clickSaveBtn({ rowIndex }); + }); }, - save, - deleteOwnerWithServicePoint: (selectedDervicePoint) => { - cy.then(() => tableWithOwners.find(MultiColumnListCell(selectedDervicePoint)).row()) - .then(rowNumber => { - deleteOwner(rowNumber); + deleteOwner(owner) { + if (owner) { + cy.then(() => tableWithOwners.find(MultiColumnListCell(owner)).row()).then((rowIndex) => { + SettingsPane.clickDeleteBtn({ rowIndex }); }); + } else { + SettingsPane.clickDeleteBtn(); + } + cy.do(Modal('Delete Fee/fine owner').find(Button('Delete')).click()); + cy.expect(Modal('Delete Fee/fine owner').absent()); + }, + checkUsedServicePoints(usedServicePoints) { + cy.do( + tableWithOwners + .find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })) + .open(), + ); + usedServicePoints.forEach((userServicePoint) => cy.expect(MultiSelectOption(userServicePoint).absent())); }, - deleteOwner, - checkUsedServicePoints:(usedServicePoints) => { - cy.do(tableWithOwners.find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })).open()); - usedServicePoints.forEach(userServicePoint => cy.expect(MultiSelectOption(userServicePoint).absent())); - }, - unselectExistingServicePoint:(usedServicePoint) => { - cy.then(() => tableWithOwners.find(MultiColumnListCell(usedServicePoint)).row()) - .then(rowNumber => { - const currentRow = tableWithOwners.find(EditableListRow({ index:rowNumber - startRowIndex })); - // filter index implemented based on parent-child relations. aria-rowindex calculated started from 2. Need to count it. - cy.do(currentRow.find(Button({ icon:'edit' })).click()); - cy.do(currentRow.find(ValueChipRoot(usedServicePoint)).find(Button({ icon: 'times' })).click()); + unselectExistingServicePoint(usedServicePoint) { + cy.then(() => tableWithOwners.find(MultiColumnListCell(usedServicePoint)).row()).then( + (rowNumber) => { + const currentRow = tableWithOwners.find( + EditableListRow({ index: rowNumber - startRowIndex }), + ); + // filter index implemented based on parent-child relations. + // aria-rowindex calculated started from 2. Need to count it. + cy.do(currentRow.find(Button({ icon: 'edit' })).click()); + cy.do( + currentRow + .find(ValueChipRoot(usedServicePoint)) + .find(Button({ icon: 'times' })) + .click(), + ); cy.do(currentRow.find(Button('Save')).click()); - }); + }, + ); }, - checkFreeServicePointPresence:(freeServicePoint) => { - cy.do(tableWithOwners.find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })).open()); + checkFreeServicePointPresence(freeServicePoint) { + cy.do( + tableWithOwners + .find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })) + .open(), + ); cy.expect(MultiSelectOption(freeServicePoint).exists()); }, - multiCheckFreeServicePointPresence:(servicePoints) => { - cy.do(tableWithOwners.find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })).open()); - servicePoints.forEach(servicePoint => { + multiCheckFreeServicePointPresence(servicePoints) { + cy.do( + tableWithOwners + .find(MultiSelect({ ariaLabelledby: 'associated-service-point-label' })) + .open(), + ); + servicePoints.forEach((servicePoint) => { cy.expect(MultiSelectOption(servicePoint.name).exists()); }); }, - cancelAdding:(rowNumber = 0) => { - cy.do(rootPaneset.find(Button({ id:`clickable-cancel-settings-owners-${rowNumber}` })).click()); - cy.expect(addButton.has({ disabled: false })); + cancelAdding(rowIndex = 2) { + SettingsPane.clickCancelBtn({ rowIndex }); + }, + createViaApi(owner) { + cy.okapiRequest({ + method: 'POST', + path: 'owners', + body: owner, + isDefaultSearchParamsRequired: false, + }).then((response) => ({ id: response.body.id, ownerName: response.body.owner })); }, - createViaApi: (owner) => cy.okapiRequest({ method: 'POST', - path: 'owners', - body: owner, - isDefaultSearchParamsRequired: false }).then(response => ({ id: response.body.id, ownerName: response.body.owner })), - getOwnerViaApi: (searchParams) => { + getOwnerViaApi(searchParams) { cy.okapiRequest({ path: 'owners', searchParams, - }) - .then(owner => { - cy.wrap(owner.body.owners[0]).as('owner'); - }); + }).then((owner) => { + cy.wrap(owner.body.owners[0]).as('owner'); + }); return cy.get('@owner'); }, - deleteViaApi: (ownerId) => { + deleteViaApi(ownerId) { cy.okapiRequest({ method: 'DELETE', path: `owners/${ownerId}`, isDefaultSearchParamsRequired: false, }); }, - checkValidatorError: (ownerName, errorMessage) => { - cy.expect(rootPaneset.find(TextField({ value: ownerName })).has({ error: errorMessage })); + checkValidatorError({ placeholder = 'owner', error }) { + cy.expect(rootPaneSet.find(TextField({ placeholder })).has({ error })); }, - addServicePointsViaApi: (owner, servicePoints) => { + addServicePointsViaApi(owner, servicePoints) { return cy.okapiRequest({ method: 'PUT', path: `owners/${owner.id}`, diff --git a/interactors/button.js b/interactors/button.js index a4ae615232..b8b3b57f7e 100644 --- a/interactors/button.js +++ b/interactors/button.js @@ -1,7 +1,9 @@ import HTML from './baseHTML'; export default HTML.extend('button') - .selector('a[href],button,input[type=button],input[type=submit],input[type=reset],input[type=image],a[role=button],div[role=button]') + .selector( + 'a[href],button,input[type=button],input[type=submit],input[type=reset],input[type=image],a[role=button],div[role=button]', + ) .filters({ // some buttons don't have attribute href href: (el) => el.getAttribute('href') ?? '', @@ -13,12 +15,13 @@ export default HTML.extend('button') default: (el) => el.classList.contains('default'), ariaLabel: (el) => el.ariaLabel, ariaExpanded: (el) => el.getAttribute('aria-expanded'), - dataId:(el) => el.getAttribute('data-id'), + dataId: (el) => el.getAttribute('data-id'), + dataType: (el) => el.getAttribute('data-type-button'), disabled: { apply: (el) => { if (el.disabled !== undefined) return el.disabled; return el.getAttribute('aria-disabled') === 'true'; }, - default: false - } + default: false, + }, }); From 4c04de1434055ed3f64fb73e30348a2322bed276 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Tue, 29 Aug 2023 16:47:34 +0300 Subject: [PATCH 079/437] Added a new test FAT-2602 (#1513) --- .../financial-transactions-report-menu-option.cy.js | 9 +++++++++ .../users/financialTransactionDetailReportModal.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js index 2794f66aa5..165024adff 100644 --- a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js +++ b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js @@ -94,6 +94,15 @@ describe('Financial Transactions Detail Report', () => { FinancialTransactionDetailReportModal.verifyEndDateMustBeGreaterThanOrEqualToStartDateErrorMessage(); }); + it('C343314 Check that the ""Fee/fine owner" is required" error message is appears when user is not selected "Fee/fine owner"', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInStartDate(); + FinancialTransactionDetailReportModal.fillInEndDate(); + FinancialTransactionDetailReportModal.verifyFeeFineOwnerSelect(); + FinancialTransactionDetailReportModal.activateFeeFineOwnerSelect(); + FinancialTransactionDetailReportModal.verifyFeeFineOwnerIsRequiredErrorMessage(); + }); + it('C343316 Check that the "Save&close" button has become active after filling in all the required fields with valid data', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); diff --git a/cypress/support/fragments/users/financialTransactionDetailReportModal.js b/cypress/support/fragments/users/financialTransactionDetailReportModal.js index 70d20a072c..ec9149c3bd 100644 --- a/cypress/support/fragments/users/financialTransactionDetailReportModal.js +++ b/cypress/support/fragments/users/financialTransactionDetailReportModal.js @@ -95,6 +95,11 @@ export default { cy.do(financialReport.find(endDateTextfield).click()); }, + activateFeeFineOwnerSelect() { + cy.do(financialReport.find(feeFineOwnerSelect).focus()); + cy.do(financialReport.click()); + }, + verifyStartDateIsRequiredErrorMessage() { cy.expect(financialReport.find(HTML(including('"Start date" is required'))).exists()); }, @@ -105,5 +110,9 @@ export default { verifyEndDateMustBeGreaterThanOrEqualToStartDateErrorMessage() { cy.expect(financialReport.find(HTML(including('"End date" must be greater than or equal to "Start date"'))).exists()); + }, + + verifyFeeFineOwnerIsRequiredErrorMessage() { + cy.expect(financialReport.find(HTML(including('"Fee/fine owner" is required'))).exists()); } }; From 864512d62ace82eb566a822829d4a3986aa949f5 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Tue, 29 Aug 2023 18:13:40 +0300 Subject: [PATCH 080/437] FAT-2730-C354002 (#1518) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-2730: test added --- .../eholdings/eholdings-packages-export.cy.js | 44 +++++++++++++++++++ .../eholdings/eHoldingsPackageView.js | 36 ++++++++++++++- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/eholdings/eholdings-packages-export.cy.js diff --git a/cypress/e2e/eholdings/eholdings-packages-export.cy.js b/cypress/e2e/eholdings/eholdings-packages-export.cy.js new file mode 100644 index 0000000000..2fa632c5ca --- /dev/null +++ b/cypress/e2e/eholdings/eholdings-packages-export.cy.js @@ -0,0 +1,44 @@ +import TestTypes from '../../support/dictionary/testTypes'; +import TopMenu from '../../support/fragments/topMenu'; +import EHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; +import EHoldingSearch from '../../support/fragments/eholdings/eHoldingsSearch'; +import EHoldingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import EHoldingsPackageView from '../../support/fragments/eholdings/eHoldingsPackageView'; +import EHoldingsTitlesSearch from '../../support/fragments/eholdings/eHoldingsTitlesSearch'; +import Permissions from '../../support/dictionary/permissions'; +import Users from '../../support/fragments/users/users'; +import DevTeams from '../../support/dictionary/devTeams'; + +describe('eHoldings -> Package', () => { + const testData = { + packageName: 'Wiley Obooks (CCINSHAE)', + }; + + before('Creating user, logging in', () => { + cy.createTempUser([ + Permissions.moduleeHoldingsEnabled.gui, + Permissions.exportManagerAll.gui + ]).then(userProperties => { + testData.userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { path: TopMenu.eholdingsPath, waiter: EHoldingsTitlesSearch.waitLoading }).then(() => { + EHoldingSearch.switchToPackages(); + }); + }); + }); + + after('Deleting user', () => { + Users.deleteViaApi(testData.userId); + }); + + it('C354002 Verify that "Export" button become disabled when user doesn\'t choose any fields to export (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + EHoldingsPackagesSearch.byName(testData.packageName); + EHoldingsPackages.checkPackageInResults(testData.packageName); + EHoldingsPackages.openPackage(); + EHoldingsPackageView.waitLoading(); + EHoldingsPackageView.openExportModal(); + EHoldingsPackageView.clickExportSelectedPackageFields(); + EHoldingsPackageView.clickExportSelectedTitleFields(); + EHoldingsPackageView.checkExportButtonInModalDisabled(); + EHoldingsPackageView.closeExportModalViaCancel(); + }); +}); diff --git a/cypress/support/fragments/eholdings/eHoldingsPackageView.js b/cypress/support/fragments/eholdings/eHoldingsPackageView.js index 1f955720d0..036ebf9b3e 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackageView.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackageView.js @@ -1,6 +1,14 @@ -import { Button, HTML, Pane, Section, KeyValue, including } from '../../../../interactors'; +import { Button, HTML, Pane, Section, KeyValue, including, Modal, RadioButton } from '../../../../interactors'; import eHoldingsPackages from './eHoldingsPackages'; +const actionsButton = Button('Actions'); +const exportButton = Button('Export package (CSV)'); +const exportModal = Modal('Export settings'); +const exportButtonInModal = exportModal.find(Button('Export')); +const cancelButtonInModal = exportModal.find(Button('Cancel')); +const selectedPackageFieldsRadioButton = RadioButton({ name: 'packageFields', ariaLabel: 'Export selected fields' }); +const selectedTitleFieldsRadioButton = RadioButton({ name: 'titleFields', ariaLabel: 'Export selected fields' }); + export default { close:() => { cy.do(Button({ icon: 'times' }).click()); @@ -23,5 +31,31 @@ export default { verifyPackageType(packageType) { cy.expect(KeyValue('Package type').has({ value: packageType })); + }, + + openExportModal() { + cy.do([ + actionsButton.click(), + exportButton.click() + ]); + cy.expect(exportModal.exists()); + }, + + clickExportSelectedPackageFields() { + cy.do(selectedPackageFieldsRadioButton.click()); + }, + + clickExportSelectedTitleFields() { + cy.do(selectedTitleFieldsRadioButton.click()); + }, + + checkExportButtonInModalDisabled() { + cy.expect(exportButtonInModal.has({ disabled: true })); + }, + + closeExportModalViaCancel() { + cy.do(cancelButtonInModal.click()); + cy.expect(exportModal.absent()); + this.waitLoading(); } }; From 328a2ee5f57d495f5c3a1f65c8d7cd86e3b5e090 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:15:28 +0500 Subject: [PATCH 081/437] added test C358995 (#1523) --- .../modify-marc-file-of-deleted-user.cy.js | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js index 36f38872b8..fb4ecfe3f1 100644 --- a/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js +++ b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js @@ -71,8 +71,15 @@ describe('MARC -> MARC Authority', () => { Permissions.uiUsersView.gui, ]).then(createdUserProperties => { user.userBProperties = createdUserProperties; + }); - cy.login(user.userBProperties.username, user.userBProperties.password, { path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading}); + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + ]).then(createdUserProperties => { + user.userCProperties = createdUserProperties; }); }); @@ -82,6 +89,7 @@ describe('MARC -> MARC Authority', () => { }); it('C358994 Verify that user has access to "quickMARC" when user who imported MARC record has been deleted (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + cy.login(user.userBProperties.username, user.userBProperties.password, { path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading}); UsersSearchPane.searchByUsername(user.userAProperties.username); UsersSearchPane.openUser(user.userAProperties.username); Users.deleteUser(); @@ -96,4 +104,30 @@ describe('MARC -> MARC Authority', () => { QuickMarcEditor.checkCallout(testData.calloutMessage); MarcAuthorities.checkRecordDetailPageMarkedValue(testData.valueAfterUpdate); }); + + it('C358995 Verify that user has access to "quickMARC" when user who edited MARC record has been deleted (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + cy.login(user.userCProperties.username, user.userCProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading}); + MarcAuthorities.searchBy(testData.searchOption, testData.valueAfterUpdate); + MarcAuthorities.selectTitle(testData.valueAfterUpdate); + MarcAuthority.edit(); + QuickMarcEditor.updateExistingFieldContent(7, `$a ${testData.marcValue}`); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkCallout(testData.calloutMessage); + MarcAuthorities.checkRecordDetailPageMarkedValue(testData.marcValue); + + cy.login(user.userBProperties.username, user.userBProperties.password, { path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading}); + UsersSearchPane.searchByUsername(user.userCProperties.username); + UsersSearchPane.openUser(user.userCProperties.username); + Users.deleteUser(); + Users.successMessageAfterDeletion(`User ${user.userCProperties.username}, testPermFirst testMiddleName deleted successfully.`) + + cy.visit(TopMenu.marcAuthorities); + MarcAuthorities.searchBy(testData.searchOption, testData.marcValue); + MarcAuthorities.selectTitle(testData.marcValue); + MarcAuthority.edit(); + QuickMarcEditor.updateExistingFieldContent(7, testData.valueForUpdate); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkCallout(testData.calloutMessage); + MarcAuthorities.checkRecordDetailPageMarkedValue(testData.valueAfterUpdate); + }); }); From 65651e89b72b9f776193ec68bbd53c01660cdff0 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Wed, 30 Aug 2023 12:19:00 +0300 Subject: [PATCH 082/437] fix for circulation rules (#1522) --- .../support/fragments/circulation/circulation-rules.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cypress/support/fragments/circulation/circulation-rules.js b/cypress/support/fragments/circulation/circulation-rules.js index 86b600a16f..65e625239a 100644 --- a/cypress/support/fragments/circulation/circulation-rules.js +++ b/cypress/support/fragments/circulation/circulation-rules.js @@ -49,10 +49,17 @@ export default { fillInNewLine() { this.fillInCirculationRules('\n'); + cy.wait(2000); + }, + + moveCursorFocusToTheEnd() { + cy.get('.react-codemirror2').type('{moveToEnd}'); }, fillInFallbackPolicy(policyData) { this.fillInCirculationRules('fallback-policy: '); + cy.wait(2000); + this.moveCursorFocusToTheEnd(); this.fillInPolicy(policyData); }, @@ -69,6 +76,7 @@ export default { this.fillInCirculationRules(priorityType); this.clickCirculationRulesHintItem(priorityTypeName); this.fillInCirculationRules(': '); + cy.wait(2000); } this.fillInCirculationRules('l '); this.clickCirculationRulesHintItem(loanPolicyName); From 6431085f78c3a750e8c0e16541db907b50cefb26 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Wed, 30 Aug 2023 15:24:05 +0300 Subject: [PATCH 083/437] Fat 7670 fat 7671 (#1524) * added tests for C654, C656 --- .../e2e/ideyalabs/eholdings/G_eholdings.cy.js | 32 ------------ .../general/edit-circulation-rules.cy.js | 50 ++++++++++++++++++- .../circulation/circulation-rules.js | 17 +++++-- 3 files changed, 61 insertions(+), 38 deletions(-) diff --git a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js index 5551752393..424431dc78 100644 --- a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js +++ b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js @@ -184,38 +184,6 @@ describe.skip('Create a custom package', () => { 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] }, diff --git a/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js b/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js index 813fb3102c..d0dd84c452 100644 --- a/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js +++ b/cypress/e2e/settings/circulation/general/edit-circulation-rules.cy.js @@ -30,7 +30,7 @@ describe('ui-circulation-settings: Edit circulation rules', () => { let addedCirculationRule; let newUserId; - beforeEach(() => { + before(() => { cy.createTempUser([ permissions.uiCirculationViewCreateEditDelete.gui, ]).then(({ @@ -51,11 +51,13 @@ describe('ui-circulation-settings: Edit circulation rules', () => { cy.login(username, password); }); + }); + beforeEach(() => { cy.visit(SettingsMenu.circulationRulesPath); }); - afterEach(() => { + after(() => { CirculationRules.deleteRuleViaApi(addedCirculationRule); MaterialTypes.deleteApi(defaultMaterialType.id); NoticePolicy.deleteViaApi(defaultNoticePolicy.id); @@ -94,4 +96,48 @@ describe('ui-circulation-settings: Edit circulation rules', () => { CirculationRules.checkUpdateCirculationRulesCalloutAppeared(); CirculationRules.checkNoticePolicyAddedToCirculationRules(defaultNoticePolicy.id); }); + + it('C654: Test behavior for incomplete vs complete circulation rules (i.e., all policy types must be present; else error)', { tags: [TestType.smoke, devTeams.vega, Parallelization.nonParallel] }, () => { + CirculationRules.clearCirculationRules(); + CirculationRules.fillInPriority(); + + CirculationRules.fillInFallbackPolicy({ + loanPolicyName: LOAN_POLICY_NAMES.EXAMPLE_LOAN, + overdueFinePolicyName: OVERDUE_FINE_POLICY_NAMES.OVERDUE_FINE_POLICY, + lostItemFeePolicyName: LOST_ITEM_FEES_POLICY_NAMES.LOST_ITEM_FEES_POLICY, + requestPolicyName: REQUEST_POLICY_NAMES.ALLOW_ALL, + noticePolicyName: NOTICE_POLICY_NAMES.SEND_NO_NOTICES, + }); + + CirculationRules.fillInPolicy({ + priorityType: 'm ', + priorityTypeName: defaultMaterialType.name, + lostItemFeePolicyName: defaultLostItemFeePolicy.name, + loanPolicyName: defaultLoanPolicy.name, + requestPolicyName: defaultRequestPolicy.name, + overdueFinePolicyName: defaultOverdueFinePolicy.name, + }); + + CirculationRules.saveCirculationRules(); + CirculationRules.verifyErrorMessageMissingNType(); + }); + + it('C656: Ensure interface alerts user of syntax errors in rules', { tags: [TestType.smoke, devTeams.vega, Parallelization.nonParallel] }, () => { + CirculationRules.clearCirculationRules(); + CirculationRules.fillInPriority(); + + CirculationRules.fillInFallbackPolicy({ + loanPolicyName: LOAN_POLICY_NAMES.EXAMPLE_LOAN, + overdueFinePolicyName: OVERDUE_FINE_POLICY_NAMES.OVERDUE_FINE_POLICY, + lostItemFeePolicyName: LOST_ITEM_FEES_POLICY_NAMES.LOST_ITEM_FEES_POLICY, + requestPolicyName: REQUEST_POLICY_NAMES.ALLOW_ALL, + noticePolicyName: NOTICE_POLICY_NAMES.SEND_NO_NOTICES, + }); + + CirculationRules.fillInCirculationRules('wrong rules'); + CirculationRules.moveCursorFocusToTheEnd(); + + CirculationRules.saveCirculationRules(); + CirculationRules.verifyErrorMessageWrongInput(); + }); }); diff --git a/cypress/support/fragments/circulation/circulation-rules.js b/cypress/support/fragments/circulation/circulation-rules.js index 65e625239a..3457fe7846 100644 --- a/cypress/support/fragments/circulation/circulation-rules.js +++ b/cypress/support/fragments/circulation/circulation-rules.js @@ -1,5 +1,6 @@ import { kebabCase } from 'lodash'; import { + HTML, Button, CodeMirror, CodeMirrorHint, @@ -9,6 +10,8 @@ import InteractorsTools from '../../utils/interactorsTools'; const calloutMessages = { CIRCULATION_RULES_UPDATE_SUCCESS: 'Rules were successfully updated.', + CIRCULATION_RULES_ERROR_MISSING_N_TYPE: 'Must contain one of each policy type, missing type n', + CIRCULATION_RULES_ERROR_WRONG_INPUT: 'mismatched input \'wrong\' expecting {, CRITERIUM_LETTER, NEWLINE}', }; export default { @@ -16,8 +19,12 @@ export default { 'rulesAsText': 'circulation policy' }, - verifyError() { - cy.expect(cy.get("[class^='rule-error']").contains('Must contain one of each policy type, missing type r')); + verifyErrorMessageMissingNType() { + cy.expect(CodeMirror().find(HTML(calloutMessages.CIRCULATION_RULES_ERROR_MISSING_N_TYPE)).exists()); + }, + + verifyErrorMessageWrongInput() { + cy.expect(CodeMirror().find(HTML(calloutMessages.CIRCULATION_RULES_ERROR_WRONG_INPUT)).exists()); }, policyError({ @@ -86,8 +93,10 @@ export default { this.clickCirculationRulesHintItem(lostItemFeePolicyName); this.fillInCirculationRules('r '); this.clickCirculationRulesHintItem(requestPolicyName); - this.fillInCirculationRules('n '); - this.clickCirculationRulesHintItem(noticePolicyName); + if (noticePolicyName) { + this.fillInCirculationRules('n '); + this.clickCirculationRulesHintItem(noticePolicyName); + } this.fillInNewLine(); }, From 2acfce405abc39e72b3e3d7aeb0a72937df9ca03 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:20:28 +0500 Subject: [PATCH 084/437] fixed bugs (#1526) --- cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js | 1 + cypress/support/fragments/inventory/inventorySearchAndFilter.js | 2 +- cypress/support/fragments/requests/newRequest.js | 2 +- cypress/support/fragments/settings/users/permissionSets.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js b/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js index e1e3510929..a55e9ac5a2 100644 --- a/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js +++ b/cypress/e2e/inventory/filter/filter-instances-by-tags.cy.js @@ -43,6 +43,7 @@ describe('inventory', () => { InventorySearchAndFilter.openTagsField(); InventorySearchAndFilter.verifyTagsView(); InventorySearchAndFilter.addTag(testTag); + cy.reload(); InventorySearchAndFilter.verifyTagCount(tagsCount); InventorySearchAndFilter.closeInstanceDetailPane(); InventorySearchAndFilter.resetAllAndVerifyNoResultsAppear(); diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 75bc44889e..ebc60e46c2 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -487,7 +487,7 @@ export default { verifyIsFilteredByTag(instanceTitle) { cy.expect(MultiColumnListCell({ row: 0, content: instanceTitle }).exists()); - cy.expect(MultiColumnList().has({ rowCount: 1 })); + cy.expect(MultiColumnList({ id: 'list-inventory' }).has({ rowCount: 1 })); }, filterByTag(tag) { diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index 5ea6d49c64..8be09638b3 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -53,13 +53,13 @@ export default { cy.intercept('/circulation/loans?*').as('getLoans'); cy.do(enterItemBarcodeButton.click()); } - cy.do(selectRequestType.choose(newRequest.requestType)); cy.wait('@getLoans'); cy.do(requesterBarcodeInput.fillIn(newRequest.requesterBarcode)); cy.intercept('/proxiesfor?*').as('getUsers'); cy.do(enterRequesterBarcodeButton.click()); cy.expect(selectServicePoint.exists); cy.wait('@getUsers'); + cy.do(selectRequestType.choose(newRequest.requestType)); }, choosepickupServicePoint(pickupServicePoint) { diff --git a/cypress/support/fragments/settings/users/permissionSets.js b/cypress/support/fragments/settings/users/permissionSets.js index d73123ab19..9de1097e89 100644 --- a/cypress/support/fragments/settings/users/permissionSets.js +++ b/cypress/support/fragments/settings/users/permissionSets.js @@ -57,7 +57,7 @@ export default { }, checkAfterSaving(values) { InteractorsTools.checkCalloutMessage(`The permission set ${values.name} was successfully created.`); - this.checkPermissionSet(); + this.checkPermissionSet(values); }, checkNewButtonNotAvailable() { cy.expect(Button({ id: 'clickable-create-entry' }).absent()); From f527cf425e9c3a00ccf925d62a5ee4cbd7f83c99 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Thu, 31 Aug 2023 12:56:51 +0500 Subject: [PATCH 085/437] FAT-5038 (#1528) --- ...-edit-in-app-item-staff-only-actions.cy.js | 2 + .../bulk-edit-in-app-user-date-picker.cy.js | 61 +++++++++++++++++++ .../fragments/bulk-edit/bulk-edit-actions.js | 19 +++++- 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-date-picker.cy.js diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js index 5ce092cae1..9c2dfaff7d 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-staff-only-actions.cy.js @@ -13,6 +13,8 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +// TODO: Update autotest after UIBULKED-329 gets done + let user; const checkInNote = `checkIn-${getRandomPostfix()}`; const checkOutNote = `checkOut-${getRandomPostfix()}`; diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-date-picker.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-date-picker.cy.js new file mode 100644 index 0000000000..46d6ad6df1 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-date-picker.cy.js @@ -0,0 +1,61 @@ +import TopMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import devTeams from '../../../support/dictionary/devTeams'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import Users from '../../../support/fragments/users/users'; +import DateTools from '../../../support/utils/dateTools'; + +let user; +const userUUIDsFileName = `userUUIDs_${getRandomPostfix()}.csv`; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.bulkEditUpdateRecords.gui, + permissions.uiUserEdit.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading }); + FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); + }); + }); + + after('delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${userUUIDsFileName}`); + Users.deleteViaApi(user.userId); + }); + + it('C359215 Verify date picker plugin for "Expiration date" option (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkUsersRadio(); + BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); + BulkEditSearchPane.uploadFile(userUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(user.username); + + const tomorrowDate = DateTools.getTomorrowDay(); + const nextWeekDate = DateTools.getFutureWeekDateObj(); + + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.fillExpirationDate(tomorrowDate); + BulkEditActions.verifyPickedDate(tomorrowDate); + + BulkEditActions.fillExpirationDate(nextWeekDate); + BulkEditActions.verifyPickedDate(nextWeekDate); + BulkEditActions.cancel(); + BulkEditSearchPane.verifyMatchedResults(user.username); + + BulkEditActions.openActions(); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.fillExpirationDate(tomorrowDate); + BulkEditActions.verifyPickedDate(tomorrowDate); + BulkEditActions.clearPickedDate(); + }); + }); +}); diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index b7fba7e942..747df64c42 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -27,6 +27,7 @@ const areYouSureForm = Modal('Are you sure?'); const downloadPreviewBtn = Button('Download preview'); const newBulkEditButton = Button('New bulk edit'); const startBulkEditLocalButton = Button('Start bulk edit (Local)'); +const calendarButton = Button({ icon: 'calendar' }); function getEmailField() { // 2 the same selects without class, id or someone different attr @@ -191,17 +192,31 @@ export default { const formattedDate = DateTools.getFormattedDate({ date }, 'MM/DD/YYYY'); cy.do([ RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Expiration date'), - Button({ icon: 'calendar' }).click(), + calendarButton.click(), TextField().fillIn(formattedDate), ]); // we don't have interactor for this element cy.get(`[aria-label="calendar"] [data-date="${formattedDate}"]`).click(); }, + verifyPickedDate(date, rowIndex = 0) { + const formattedDate = DateTools.getFormattedDate({ date }, 'MM/DD/YYYY'); + // there is no aria-expanded attr when collapsed + cy.expect([ + calendarButton.has({ ariaExpanded: null }), + RepeatableFieldItem({ index: rowIndex }).find(TextField({ value: formattedDate })).exists() + ]); + }, + + clearPickedDate(rowIndex = 0) { + cy.do(RepeatableFieldItem({ index: rowIndex }).find(Button({ ariaLabel: 'Clear field value' })).click()); + cy.expect(RepeatableFieldItem({ index: rowIndex }).find(TextField({ value: '' })).exists()); + }, + verifyCalendarItem(rowIndex = 0) { cy.do([ RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Expiration date'), - Button({ icon: 'calendar' }).click() + calendarButton.click() ]); // TODO: bulk edit calendar is not common datepicker like our interactor cy.get('[id^="datepicker-calendar-container"]').should('be.visible'); From 89f6c4d1582f272aa86fe4c8f85a7cf21ca82d2d Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:09:50 +0300 Subject: [PATCH 086/437] Implementing of FAT-5118 (#1520) * Implementing of FAT-5118 * Implementing of FAT-5118 * Implementing of FAT-5118 --- .../create-new-holdings.cy.js | 152 ++++++++++++++++++ .../support/fragments/orders/orderLines.js | 24 ++- 2 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/orders/inventory-interaction/create-new-holdings.cy.js diff --git a/cypress/e2e/orders/inventory-interaction/create-new-holdings.cy.js b/cypress/e2e/orders/inventory-interaction/create-new-holdings.cy.js new file mode 100644 index 0000000000..03e796921d --- /dev/null +++ b/cypress/e2e/orders/inventory-interaction/create-new-holdings.cy.js @@ -0,0 +1,152 @@ +import permissions from '../../../support/dictionary/permissions'; +import devTeams from '../../../support/dictionary/devTeams'; +import testType from '../../../support/dictionary/testTypes'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import Orders from '../../../support/fragments/orders/orders'; +import TopMenu from '../../../support/fragments/topMenu'; +import Helper from '../../../support/fragments/finance/financeHelper'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../../support/fragments/settings/tenant/locations/newLocation'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; +import { ITEM_STATUS_NAMES } from '../../../support/constants'; +import Users from '../../../support/fragments/users/users'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventoryNewHoldings from '../../../support/fragments/inventory/inventoryNewHoldings'; +import ItemRecordEdit from '../../../support/fragments/inventory/item/itemRecordEdit'; + +describe('Orders: Inventory interaction', () => { + const order = { + ...NewOrder.defaultOneTimeOrder, + approved: true, + }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + } + ] + }; + const barcodeForFirstItem = Helper.getRandomBarcode(); + const barcodeForSecondItem = Helper.getRandomBarcode(); + + let orderNumber; + let user; + let effectiveLocationServicePoint; + let firstLocation; + let instanceRecord = null; + let secondLocation; + + before(() => { + cy.getAdminToken(); + InventorySearchAndFilter.createInstanceViaApi().then(({ instanceData }) => { + instanceRecord = instanceData; + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) + .then((servicePoints) => { + effectiveLocationServicePoint = servicePoints[0]; + NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) + .then((firstLocationResponse) => { + firstLocation = firstLocationResponse; + Organizations.createOrganizationViaApi(organization) + .then(organizationsResponse => { + organization.id = organizationsResponse; + order.vendor = organizationsResponse; + }); + NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) + .then((secondLocationResponse) => { + secondLocation = secondLocationResponse; + cy.loginAsAdmin(); cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstance.searchByTitle(`${instanceRecord.instanceTitle}`); + InventoryInstances.selectInstance(); + InventoryInstance.pressAddHoldingsButton(); + InventoryNewHoldings.fillRequiredFields(`${firstLocation.name} (${firstLocation.code}) `); + InventoryNewHoldings.saveAndClose(); + InventoryInstance.waitLoading(); + }); + cy.loginAsAdmin({ path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + cy.createOrderApi(order) + .then((response) => { + orderNumber = response.body.poNumber; + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP(`${instanceRecord.instanceTitle}`, 0); + OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', firstLocation.institutionId, '2'); + OrderLines.backToEditingOrder(); + }); + }); + }); + }); + }); + cy.createTempUser([ + permissions.uiInventoryViewInstances.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiInventoryViewCreateEditInstances.gui, + permissions.uiInventoryViewCreateEditItems.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C375238 Create new holdings for already existing location when editing an order line (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.selectPOLInOrder(0); + OrderLines.editPOLInOrder(); + OrderLines.selectRandomInstanceInTitleLookUP(`${instanceRecord.instanceTitle}`, 0); + OrderLines.edeiPOLineInfoAndChangeLocation(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', secondLocation.institutionId, '2'); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + OrderLines.selectPOLInOrder(0); + OrderLines.openLinkedInstance(); + InventoryInstance.checkIsHoldingsCreated([`${firstLocation.name} >`]); + InventoryInstance.checkIsHoldingsCreated([`${secondLocation.name} >`]); + InventoryInstance.openHoldingsAccordion(secondLocation.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForFirstItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(secondLocation.name); + InventoryInstance.openItemByBarcodeAndIndex('No barcode'); + ItemActions.edit(); + ItemRecordEdit.addBarcode(barcodeForSecondItem); + ItemRecordEdit.save(); + // Need to wait,while instance will be saved + cy.wait(5000); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(secondLocation.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForFirstItem); + ItemRecordView.checkItemDetails(secondLocation.name, barcodeForFirstItem, ITEM_STATUS_NAMES.ON_ORDER); + ItemActions.closeItem(); + InventoryInstance.openHoldingsAccordion(secondLocation.name); + InventoryInstance.openItemByBarcodeAndIndex(barcodeForSecondItem); + ItemRecordView.checkItemDetails(secondLocation.name, barcodeForSecondItem, ITEM_STATUS_NAMES.ON_ORDER); + ItemActions.closeItem(); + }); +}); diff --git a/cypress/support/fragments/orders/orderLines.js b/cypress/support/fragments/orders/orderLines.js index 687a4ba73c..408c9d26e2 100644 --- a/cypress/support/fragments/orders/orderLines.js +++ b/cypress/support/fragments/orders/orderLines.js @@ -85,6 +85,7 @@ const orderHistorySection = Section({ id: 'versions-history-pane-order-line' }); const agreementLinesSection = Section({ id: 'relatedAgreementLines' }); const invoiceLinesSection = Section({ id: 'relatedInvoiceLines' }); const notesSection = Section({ id: 'notes' }); +const trashButton = Button({ icon: 'trash' }); const submitOrderLine = () => { const submitButton = Button('Submit'); cy.get('body').then($body => { @@ -666,6 +667,27 @@ export default { submitOrderLine(); }, + edeiPOLineInfoAndChangeLocation(accountNumber, AUMethod, institutionName, quantity) { + cy.do([ + locationSection.find(trashButton).click(), + addLocationButton.click(), + createNewLocationButton.click(), + ]); + cy.get('form[id=location-form] select[name=institutionId]').select(institutionName); + cy.do([ + selectPermanentLocationModal.find(saveButton).click(), + quantityPhysicalLocationField.fillIn(quantity), + ]); + cy.expect([ + physicalUnitPriceTextField.has({ value: physicalUnitPrice }), + quantityPhysicalLocationField.has({ value: quantity }), + ]); + cy.do(saveAndClose.click()); + // If purchase order line will be dublicate, Modal with button 'Submit' will be activated + cy.wait(2000); + submitOrderLine(); + }, + fillInPOLineInfoWithLocationForPEMIXResource(accountNumber, AUMethod, institutionName, quantity) { cy.do([ orderFormatSelect.choose(ORDER_FORMAT_NAMES.PE_MIX), @@ -777,7 +799,7 @@ export default { deleteFundInPOL() { cy.do([ - Section({ id: 'fundDistributionAccordion' }).find(Button({ icon: 'trash' })).click(), + Section({ id: 'fundDistributionAccordion' }).find(trashButton).click(), saveAndClose.click() ]); cy.wait(6000); From bb8f829093f569d189095ed53a3da655c8fb8874 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:20:03 +0500 Subject: [PATCH 087/437] added test C358996 (#1529) --- ...modify-marc-holdings-of-deleted-user.cy.js | 99 +++++++++++++++++++ .../modify-marc-file-of-deleted-user.cy.js | 2 +- 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/marc-authority/marc-holdings/modify-marc-holdings-of-deleted-user.cy.js diff --git a/cypress/e2e/marc-authority/marc-holdings/modify-marc-holdings-of-deleted-user.cy.js b/cypress/e2e/marc-authority/marc-holdings/modify-marc-holdings-of-deleted-user.cy.js new file mode 100644 index 0000000000..b6d1cd625d --- /dev/null +++ b/cypress/e2e/marc-authority/marc-holdings/modify-marc-holdings-of-deleted-user.cy.js @@ -0,0 +1,99 @@ +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 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 QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; +import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySteps from '../../../support/fragments/inventory/inventorySteps'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; + +describe('MARC -> MARC Authority', () => { + const testData = { + calloutMessage: 'This record has successfully saved and is in process. Changes may not appear immediately.', + } + + const fileName = `testMarcFile.${getRandomPostfix()}.mrc`; + const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; + + let instanceID; + + const user = {}; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcHoldingsEditorAll.gui, + Permissions.uiQuickMarcQuickMarcHoldingsEditorCreate.gui, + ]).then(createdUserProperties => { + user.userAProperties = createdUserProperties; + + cy.login(user.userAProperties.username, user.userAProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFile('oneMarcBib.mrc', fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(fileName); + Logs.getCreatedItemsID(0).then(link => { + instanceID = link.split('/')[5]; + }); + Logs.goToTitleLink('Created'); + InventorySteps.addMarcHoldingRecord(); + }); + }); + + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcHoldingsEditorAll.gui, + Permissions.uiUsersCheckTransactions.gui, + Permissions.uiUsersDelete.gui, + Permissions.uiUserEdit.gui, + Permissions.uiUsersView.gui, + ]).then(createdUserProperties => { + user.userBProperties = createdUserProperties; + + cy.login(user.userBProperties.username, user.userBProperties.password, { path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading}); + }); + }); + + after('Deleting created user', () => { + cy.loginAsAdmin({ path: TopMenu.inventoryPath, waiter: InventorySearchAndFilter.waitLoading }); + InventorySearchAndFilter.searchInstanceByTitle(instanceID); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.delete(); + if (instanceID) InventoryInstance.deleteInstanceViaApi(instanceID); + Users.deleteViaApi(user.userBProperties.userId); + }); + + it('C358996 Verify that user has access to "quickMARC" when user who imported "MARC holdings" record has been deleted (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + UsersSearchPane.searchByUsername(user.userAProperties.username); + UsersSearchPane.openUser(user.userAProperties.username); + Users.deleteUser(); + Users.successMessageAfterDeletion(`User ${user.userAProperties.username}, testPermFirst testMiddleName deleted successfully.`) + + cy.visit(TopMenu.inventoryPath); + 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(); + + QuickMarcEditor.addRow(HoldingsRecordView.newHolding.rowsCountInQuickMarcEditor); + QuickMarcEditor.checkInitialContent(HoldingsRecordView.newHolding.rowsCountInQuickMarcEditor + 1); + QuickMarcEditor.fillAllAvailableValues(undefined, undefined, HoldingsRecordView.newHolding.rowsCountInQuickMarcEditor); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkCallout(testData.calloutMessage); + }); +}); diff --git a/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js index fb4ecfe3f1..e6b48cea01 100644 --- a/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js +++ b/cypress/e2e/marc-authority/modify-marc-file-of-deleted-user.cy.js @@ -88,7 +88,7 @@ describe('MARC -> MARC Authority', () => { MarcAuthority.deleteViaAPI(createdAuthorityIDs[0]); }); - it('C358994 Verify that user has access to "quickMARC" when user who imported MARC record has been deleted (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C358994 Verify that user has access to "quickMARC" when user who imported "MARC authority" record has been deleted (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { cy.login(user.userBProperties.username, user.userBProperties.password, { path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading}); UsersSearchPane.searchByUsername(user.userAProperties.username); UsersSearchPane.openUser(user.userAProperties.username); From 2e52000593cd40ddb1c092f14a6b50aeb3d960d7 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Thu, 31 Aug 2023 16:09:50 +0300 Subject: [PATCH 088/437] Fat 2606 (#1525) * Added a new test C343318 --- cypress/e2e/ideyalabs/serviceshift.cy.js | 2 +- ...ancial-transactions-report-menu-option.cy.js | 9 +++++++++ .../financialTransactionDetailReportModal.js | 17 +++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/ideyalabs/serviceshift.cy.js b/cypress/e2e/ideyalabs/serviceshift.cy.js index 0737763e56..619c96cc22 100644 --- a/cypress/e2e/ideyalabs/serviceshift.cy.js +++ b/cypress/e2e/ideyalabs/serviceshift.cy.js @@ -148,7 +148,7 @@ describe.skip('Check In - Actions', () => { cy.deleteLoanType(testData.loanTypeId); }); it( - 'C7148 Check In: item with at least one open request (vega)', + 'C7148 Check In: item with at least one open request (vega) deprecated', { tags: [TestTypes.criticalPath, devTeams.vega] }, () => { cy.visit(TopMenu.checkInPath); diff --git a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js index 165024adff..2eb74e49f9 100644 --- a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js +++ b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js @@ -124,4 +124,13 @@ describe('Financial Transactions Detail Report', () => { FinancialTransactionDetailReportModal.save(); FinancialTransactionDetailReportModal.verifyCalloutMessage(); }); + + it('C343318 Check that the "Something went wrong" error toast appears when the user click on the "Save&close" button', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); + FinancialTransactionDetailReportModal.stubResponse500Error(); + FinancialTransactionDetailReportModal.save(); + FinancialTransactionDetailReportModal.verifyCalloutMessage(); + FinancialTransactionDetailReportModal.verifyCalloutErrorMessage(); + }); }); diff --git a/cypress/support/fragments/users/financialTransactionDetailReportModal.js b/cypress/support/fragments/users/financialTransactionDetailReportModal.js index ec9149c3bd..1f61ea6509 100644 --- a/cypress/support/fragments/users/financialTransactionDetailReportModal.js +++ b/cypress/support/fragments/users/financialTransactionDetailReportModal.js @@ -1,6 +1,5 @@ import DateTools from '../../utils/dateTools'; -import { Button, Modal, TextField, Select, including, MultiSelect, HTML } from '../../../../interactors'; -import InteractorsTools from '../../utils/interactorsTools'; +import { Button, Modal, TextField, Select, including, MultiSelect, HTML, Callout, calloutTypes } from '../../../../interactors'; const financialReport = Modal({ id: 'financial-transactions-report-modal' }); const startDateTextfield = TextField({ name: 'startDate' }); @@ -8,7 +7,8 @@ const endDateTextfield = TextField({ name: 'endDate' }); const firstDayOfMonth = DateTools.getFormattedDate({ date: new Date(new Date().getFullYear(), new Date().getMonth(), 1) }, 'MM/DD/YYYY'); const currentDayOfMonth = DateTools.getFormattedDate({ date: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()) }, 'MM/DD/YYYY'); const feeFineOwnerSelect = Select({ content: including('Select fee/fine owner') }); -const calloutMessage = 'Export in progress'; +const calloutSuccessMessage = 'Export in progress'; +const calloutErrorMessage = 'Something went wrong.'; export default { fillInRequiredFields({ startDate, ownerName }) { @@ -63,8 +63,17 @@ export default { cy.do(financialReport.find(Button(including('Save'))).click()); }, + stubResponse500Error() { + cy.intercept('POST', '/feefine-reports/financial-transactions-detail', { + statusCode: 500 + }); + }, + verifyCalloutMessage() { - InteractorsTools.checkCalloutMessage(calloutMessage); + cy.expect(Callout({ type: calloutTypes.success }).is({ textContent: calloutSuccessMessage })); + }, + verifyCalloutErrorMessage() { + cy.expect(Callout({ type: calloutTypes.error }).is({ textContent: calloutErrorMessage })); }, fillInServicePoints(servicePoints) { From d2702440d01cd9d62e2f3673795eff08b7c0e9da Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Thu, 31 Aug 2023 16:46:55 +0300 Subject: [PATCH 089/437] implemented TCs 343320 343321 (#1531) --- ...cial-transactions-report-menu-option.cy.js | 14 +++++++++++ .../financialTransactionDetailReportModal.js | 23 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js index 2eb74e49f9..4bb2fb9599 100644 --- a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js +++ b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js @@ -41,6 +41,20 @@ describe('Financial Transactions Detail Report', () => { UsersSearchResultsPane.verifyOptionsInActionsMenu(); }); + it('C343320 Check that the icon calendar is displayed in the Start date and End date on the "Financial transactions detail report" modal', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyStartDateFieldCalendarIcon(); + FinancialTransactionDetailReportModal.verifyEndDateFieldCalendarIcon(); + }); + + it('C343321 Check when user click on the icon calendar appears "datepicker" and user can select any date', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.openStartDateFieldCalendar(); + FinancialTransactionDetailReportModal.verifyCalendarIsShown(); + FinancialTransactionDetailReportModal.openEndDateFieldCalendar(); + FinancialTransactionDetailReportModal.verifyCalendarIsShown(); + }); + it('C343306 Check that the "Financial transactions detail report" modal is display when selected "Financial transactions detail report (CSV)"', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); FinancialTransactionDetailReportModal.verifyStartDateFieldIsEmpty(); diff --git a/cypress/support/fragments/users/financialTransactionDetailReportModal.js b/cypress/support/fragments/users/financialTransactionDetailReportModal.js index 1f61ea6509..1f8bc4494b 100644 --- a/cypress/support/fragments/users/financialTransactionDetailReportModal.js +++ b/cypress/support/fragments/users/financialTransactionDetailReportModal.js @@ -7,6 +7,9 @@ const endDateTextfield = TextField({ name: 'endDate' }); const firstDayOfMonth = DateTools.getFormattedDate({ date: new Date(new Date().getFullYear(), new Date().getMonth(), 1) }, 'MM/DD/YYYY'); const currentDayOfMonth = DateTools.getFormattedDate({ date: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()) }, 'MM/DD/YYYY'); const feeFineOwnerSelect = Select({ content: including('Select fee/fine owner') }); + +const startDateFieldCalendarIconLocator = './/div[./*[@name="startDate"]]//*[@icon="calendar"]'; +const endDateFieldCalendarIconLocator = './/div[./*[@name="endDate"]]//*[@icon="calendar"]'; const calloutSuccessMessage = 'Export in progress'; const calloutErrorMessage = 'Something went wrong.'; @@ -31,6 +34,26 @@ export default { else cy.do(financialReport.find(endDateTextfield).fillIn(currentDayOfMonth)); }, + verifyStartDateFieldCalendarIcon() { + cy.xpath(startDateFieldCalendarIconLocator).should('be.visible'); + }, + + verifyEndDateFieldCalendarIcon() { + cy.xpath(endDateFieldCalendarIconLocator).should('be.visible'); + }, + + verifyCalendarIsShown() { + cy.get('[id^="datepicker-calendar-container"]').should('be.visible'); + }, + + openStartDateFieldCalendar() { + cy.xpath(startDateFieldCalendarIconLocator).click(); + }, + + openEndDateFieldCalendar() { + cy.xpath(endDateFieldCalendarIconLocator).click(); + }, + verifySaveButtonIsEnabled() { cy.do(financialReport.find(Button(including('Save'))).has({ disabled: false })); }, From 82899f21a387b65c4b15a57b088d52b2c0752de7 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Thu, 31 Aug 2023 19:08:51 +0300 Subject: [PATCH 090/437] FAT-5069-C367974 (#1527) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-5069: test added * FAT-5069: moved C367974 in separate file * Fixes: Updated/separated linked auth edit tests * Fixes: updated preconditions in C387461, C375994 * Fixes: updated preconditions for C367974, C375256 * FAT-5069: commit to reload checks * FAT-5069: added nonParallel tag to certain tests --- .../inventory/derive-linked-marc-bib.cy.js | 4 +- .../holdings/edit-marc-holdings.cy.js | 6 +- .../search-in-inventory-linked-authID.cy.js | 121 ++++++++++++ .../search/search-in-inventory-linked.cy.js | 11 +- .../marc-authority-edit-linked-modals.cy.js | 146 +++++++++++++++ ...-authority-edit-linked-update-header.cy.js | 127 +++++++++++++ .../marc-authority-edit-linked.cy.js | 174 ++---------------- cypress/fixtures/marcAuthFileC367974.mrc | 1 + cypress/fixtures/marcBibFileC367974.mrc | 1 + .../fragments/inventory/inventoryInstances.js | 24 ++- 10 files changed, 450 insertions(+), 165 deletions(-) create mode 100644 cypress/e2e/inventory/search/search-in-inventory-linked-authID.cy.js create mode 100644 cypress/e2e/marc-authority/marc-authority-edit-linked-modals.cy.js create mode 100644 cypress/e2e/marc-authority/marc-authority-edit-linked-update-header.cy.js create mode 100644 cypress/fixtures/marcAuthFileC367974.mrc create mode 100644 cypress/fixtures/marcBibFileC367974.mrc diff --git a/cypress/e2e/inventory/derive-linked-marc-bib.cy.js b/cypress/e2e/inventory/derive-linked-marc-bib.cy.js index b334859327..5cc36663d4 100644 --- a/cypress/e2e/inventory/derive-linked-marc-bib.cy.js +++ b/cypress/e2e/inventory/derive-linked-marc-bib.cy.js @@ -13,6 +13,7 @@ import getRandomPostfix from '../../support/utils/stringTools'; import JobProfiles from '../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../support/fragments/data_import/logs/logs'; import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import Parallelization from '../../support/dictionary/parallelization'; describe('MARC -> MARC Bibliographic -> Derive MARC bib', () => { const testData = { @@ -60,6 +61,7 @@ describe('MARC -> MARC Bibliographic -> Derive MARC bib', () => { testData.userProperties = createdUserProperties; marcFiles.forEach(marcFile => { cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); JobProfiles.runImportFile(); @@ -122,7 +124,7 @@ describe('MARC -> MARC Bibliographic -> Derive MARC bib', () => { }); }); - it('C375994 Add controllable subfields to multiple linked fields in "MARC bib" record when deriving record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C375994 Add controllable subfields to multiple linked fields in "MARC bib" record when deriving record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventoryInstance.searchByTitle(createdRecordIDs[0]); InventoryInstances.selectInstance(); InventoryInstance.deriveNewMarcBib(); diff --git a/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js index f8c1535799..582178987c 100644 --- a/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js +++ b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js @@ -11,6 +11,7 @@ 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'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('MARC -> MARC Holdings', () => { const testData = { @@ -36,7 +37,8 @@ describe('MARC -> MARC Holdings', () => { testData.createdUserProperties = createdUserProperties; cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { - DataImport.uploadFile(marcFile.marc, marcFile.fileName); + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); JobProfiles.waitLoadingList(); JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); JobProfiles.runImportFile(); @@ -69,7 +71,7 @@ describe('MARC -> MARC Holdings', () => { InventoryInstance.deleteInstanceViaApi(recordIDs[0]); }); - it('C387461 Add multiple 001s when editing "MARC Holdings" record', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C387461 Add multiple 001s when editing "MARC Holdings" record', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventoryInstances.searchBySource('MARC'); InventoryInstance.searchByTitle(recordIDs[0]); InventoryInstances.selectInstance(); diff --git a/cypress/e2e/inventory/search/search-in-inventory-linked-authID.cy.js b/cypress/e2e/inventory/search/search-in-inventory-linked-authID.cy.js new file mode 100644 index 0000000000..1dbb2754dc --- /dev/null +++ b/cypress/e2e/inventory/search/search-in-inventory-linked-authID.cy.js @@ -0,0 +1,121 @@ +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'; +import Parallelization from '../../../support/dictionary/parallelization'; + +describe('Search in Inventory', () => { + const testData = { + tag010: '010', + tag700: '700', + authUUIDSearchOption: 'Authority UUID', + searchResultsC367974: [ + 'C367974 Aviator / Leonardo DiCaprio, Matt Damon, Jack Nicholson, Robert De Niro, Ray Liotta, Martin Scorsese, Barbara De Fina, Brad Grey, Alan Mak, Felix Chong, Nicholas Pileggi, William Monahan.', + 'C367974 Titanic / written and directed by James Cameron.' + ] + }; + + const marcFiles = [ + { + marc: 'marcBibFileC367974.mrc', + fileName: `testMarcFileC367974.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numberOfRecords: 2 + }, + { + marc: 'marcAuthFileC367974.mrc', + fileName: `testMarcFileC367974.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'DiCaprio, Leonardo C367974', + authority010FieldValue: 'n94000330367974', + 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.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + 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[1]); + InventoryInstances.selectInstance(); + // here and below - wait for detail view to be fully loaded + cy.wait(1500); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIconByIndex(22); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.switchToSearch(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthorityByIndex(22, testData.tag700); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + cy.wait(1500); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIconByIndex(65); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.switchToSearch(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthorityByIndex(65, testData.tag700); + 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 > 1) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C367974 Search for two "Instance" records by "Authority UUID" value of linked "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { + InventoryInstances.verifyInstanceSearchOptions(); + InventoryInstances.searchInstancesWithOption(testData.authUUIDSearchOption, createdRecordIDs[2]); + testData.searchResultsC367974.forEach(expectedTitle => { + InventorySearchAndFilter.verifyInstanceDisplayed(expectedTitle); + }); + InventorySearchAndFilter.checkRowsCount(2); + }); +}); diff --git a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js index 80fe6d6542..a27e6c22d1 100644 --- a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js +++ b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js @@ -14,6 +14,7 @@ import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthorit import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('Search in Inventory', () => { const testData = { @@ -57,7 +58,7 @@ describe('Search in Inventory', () => { authorityHeading: 'Abraham, Angela, C375256 Hosanna', authority010FieldValue: 'n99036055375256', numberOfRecords: 1 - }, + } ]; const createdRecordIDs = []; @@ -69,6 +70,7 @@ describe('Search in Inventory', () => { testData.userProperties = createdUserProperties; marcFiles.forEach(marcFile => { cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); JobProfiles.runImportFile(); @@ -112,21 +114,20 @@ describe('Search in Inventory', () => { QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag240); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); - - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); }); }); after('Deleting user, records', () => { Users.deleteViaApi(testData.userProperties.userId); createdRecordIDs.forEach((id, index) => { - if (index > marcFiles[0].numberOfRecords - 1) MarcAuthority.deleteViaAPI(id); + if (index > 3) MarcAuthority.deleteViaAPI(id); else InventoryInstance.deleteInstanceViaApi(id); }); }); - it('C375256 Query search | Search by "Alternative title" field of linked "MARC Bib" records (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C375256 Query search | Search by "Alternative title" field of linked "MARC Bib" records (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.allRecords); InventorySearchAndFilter.clickSearch(); InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstLinkedRecord); diff --git a/cypress/e2e/marc-authority/marc-authority-edit-linked-modals.cy.js b/cypress/e2e/marc-authority/marc-authority-edit-linked-modals.cy.js new file mode 100644 index 0000000000..6187836f15 --- /dev/null +++ b/cypress/e2e/marc-authority/marc-authority-edit-linked-modals.cy.js @@ -0,0 +1,146 @@ +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 MarcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +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 MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import { JOB_STATUS_NAMES } from '../../support/constants'; +import Parallelization from '../../support/dictionary/parallelization'; + +describe('MARC Authority -> Edit linked Authority record', () => { + const testData = { + tag001: '001', + tag035: '035', + tag046: '046', + tag100: '100', + tag600: '600', + tag952: '952', + updated010FieldValue: 'gf20140262973741590', + updated100FieldValue: '$a Clovio, Giulio, $d 1498-1578 TEST', + updated046FieldValue: '$f 1498 $g 1578 $2 edtf TEST', + updatedTagName: '03' + }; + + const marcFiles = [ + { + marc: 'marcBibFileC375173.mrc', + fileName: `testMarcFileC375173.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + instanceTitle: 'C375173 Farnese book of hours : MS M.69 of the Pierpont Morgan Library New York / commentary, William M. Voelkle, Ivan Golub.' + }, + { + marc: 'marcAuthFileC375173.mrc', + fileName: `testMarcFileC375173.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C375173 Clovio, Giulio, 1498-1578', + authority001FieldValue: 'n83073672375173', + authority035FieldValue: '(OCoLC)oca00955395', + authority952FieldValue: '$a RETRO' + } + ]; + + const createdRecordIDs = []; + + before('Creating user, importing and linking records', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + // wait for detail view to be fully loaded + cy.wait(1500); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag600); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag001, marcFiles[1].authority001FieldValue); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag600); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); + 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); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C375173 Save linked "MARC authority" record with deleted fields and edited "1XX" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); + MarcAuthorities.selectTitle(marcFiles[1].authorityHeading); + MarcAuthority.edit(); + QuickMarcEditor.updateExistingField(testData.tag100, testData.updated100FieldValue); + QuickMarcEditor.updateExistingTagValue(5, testData.updatedTagName); + QuickMarcEditor.checkContent(testData.updated100FieldValue, 8); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.deleteFieldAndCheck(5, testData.updatedTagName); + QuickMarcEditor.afterDeleteNotification(testData.updatedTagName); + // if clicked too fast, delete modal might not appear + cy.wait(1000); + QuickMarcEditor.clickSaveAndCloseThenCheck(1); + QuickMarcEditor.clickRestoreDeletedField(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent('$a ' + marcFiles[1].authority035FieldValue, 5); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); + QuickMarcEditor.updateExistingTagValue(5, testData.tag035); + QuickMarcEditor.updateExistingField(testData.tag046, testData.updated046FieldValue); + QuickMarcEditor.deleteFieldAndCheck(7, testData.tag046); + QuickMarcEditor.afterDeleteNotification(testData.tag046); + QuickMarcEditor.clickSaveAndCloseThenCheck(1); + QuickMarcEditor.clickRestoreDeletedField(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent(testData.updated046FieldValue, 7); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); + QuickMarcEditor.deleteFieldAndCheck(18, testData.tag952); + QuickMarcEditor.afterDeleteNotification(testData.tag952); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.checkDeleteModal(1); + QuickMarcEditor.clickRestoreDeletedField(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent(marcFiles[1].authority952FieldValue, 18); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); + }); +}); + diff --git a/cypress/e2e/marc-authority/marc-authority-edit-linked-update-header.cy.js b/cypress/e2e/marc-authority/marc-authority-edit-linked-update-header.cy.js new file mode 100644 index 0000000000..0403fbd9a5 --- /dev/null +++ b/cypress/e2e/marc-authority/marc-authority-edit-linked-update-header.cy.js @@ -0,0 +1,127 @@ +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 MarcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +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 MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import { JOB_STATUS_NAMES } from '../../support/constants'; +import Parallelization from '../../support/dictionary/parallelization'; + +describe('MARC Authority -> Edit linked Authority record', () => { + const testData = { + tag010: '010', + tag155: '155', + tag655: '655', + updated155FieldValue: 'Drama C374159 cinema', + updated010FieldValue: 'gf20140262973741590', + autoUpdateUserName: 'Automated linking update', + subjectAccordion: 'Subject', + authorityIconText: 'Linked to MARC authority' + }; + + const marcFiles = [ + { + marc: 'marcBibFileC374159.mrc', + fileName: `testMarcFileC374159.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + instanceTitle: 'Titanic / written and directed by James Cameron. C374159' + }, + { + marc: 'marcAuthFileC374159.mrc', + fileName: `testMarcFileC374159.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Drama C374159', + authority010FieldValue: 'gf2014026297374159', + authority555FieldValue: 'Literature C374159' + } + ]; + + const createdRecordIDs = []; + + before('Creating user, importing and linking records', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + // wait for detail view to be fully loaded + cy.wait(1500); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag655); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag655); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); + 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); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C374159 Edit values in "1XX" and "010" fields of linked "MARC Authority" record when "$0" = "010 $a" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[1].authority555FieldValue); + MarcAuthorities.selectTitle(marcFiles[1].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[0].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-edit-linked.cy.js b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js index 45f655f476..e435166388 100644 --- a/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js @@ -13,29 +13,14 @@ import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import { JOB_STATUS_NAMES } from '../../support/constants'; +import Parallelization from '../../support/dictionary/parallelization'; describe('MARC Authority -> Edit linked Authority record', () => { const testData = { - tag001: '001', tag010: '010', - tag035: '035', - tag046: '046', - tag100: '100', - tag155: '155', - tag600: '600', - tag655: '655', tag700: '700', - tag952: '952', subfieldZValue: 'n12345', - updatedSubfieldZValue: 'n12345678910', - updated155FieldValue: 'Drama C374159 cinema', - updated010FieldValue: 'gf20140262973741590', - updated100FieldValue: '$a Clovio, Giulio, $d 1498-1578 TEST', - updated046FieldValue: '$f 1498 $g 1578 $2 edtf TEST', - updatedTagName: '03', - autoUpdateUserName: 'Automated linking update', - subjectAccordion: 'Subject', - authorityIconText: 'Linked to MARC authority' + updatedSubfieldZValue: 'n12345678910' }; const marcFiles = [ @@ -45,42 +30,13 @@ 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: `testMarcFileC374159.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - instanceTitle: 'Titanic / written and directed by James Cameron. C374159' - }, - { - marc: 'marcBibFileC375173.mrc', - fileName: `testMarcFileC375173.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - instanceTitle: 'C375173 Farnese book of hours : MS M.69 of the Pierpont Morgan Library New York / commentary, William M. Voelkle, Ivan Golub.' - }, { marc: 'marcAuthFileC376596.mrc', fileName: `testMarcFileC376596.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'Elizabeth C376596', authority010FieldValue: 'n80126296376596', - }, - { - marc: 'marcAuthFileC374159.mrc', - fileName: `testMarcFileC374159.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - authorityHeading: 'Drama C374159', - authority010FieldValue: 'gf2014026297374159', - authority555FieldValue: 'Literature C374159' - }, - { - marc: 'marcAuthFileC375173.mrc', - fileName: `testMarcFileC375173.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create SRS MARC Authority', - authorityHeading: 'C375173 Clovio, Giulio, 1498-1578', - authority001FieldValue: 'n83073672375173', - authority035FieldValue: '(OCoLC)oca00955395', - authority952FieldValue: '$a RETRO' - }, + } ]; const createdRecordIDs = []; @@ -97,6 +53,7 @@ describe('MARC Authority -> Edit linked Authority record', () => { marcFiles.forEach(marcFile => { cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); JobProfiles.runImportFile(); @@ -113,151 +70,56 @@ describe('MARC Authority -> Edit linked Authority record', () => { InventoryInstances.waitContentLoading(); InventoryInstance.searchByTitle(createdRecordIDs[0]); InventoryInstances.selectInstance(); - // here and below - wait for detail view to be fully loaded + // wait for detail view to be fully loaded cy.wait(1500); InventoryInstance.editMarcBibliographicRecord(); InventoryInstance.verifyAndClickLinkIcon(testData.tag700); MarcAuthorities.switchToSearch(); InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.searchResults(marcFiles[3].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[3].authority010FieldValue}`); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); InventoryInstance.clickLinkButton(); QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag700); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); - - InventoryInstance.searchByTitle(createdRecordIDs[1]); - InventoryInstances.selectInstance(); - cy.wait(1500); - InventoryInstance.editMarcBibliographicRecord(); - InventoryInstance.verifyAndClickLinkIcon(testData.tag655); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.searchResults(marcFiles[4].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[4].authority010FieldValue}`); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag655); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); - - InventoryInstance.searchByTitle(createdRecordIDs[2]); - InventoryInstances.selectInstance(); - cy.wait(1500); - InventoryInstance.editMarcBibliographicRecord(); - InventoryInstance.verifyAndClickLinkIcon(testData.tag600); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(marcFiles[5].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag001, marcFiles[5].authority001FieldValue); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag600); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); }); }); - 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 > 2) MarcAuthority.deleteViaAPI(id); + if (index) MarcAuthority.deleteViaAPI(id); else InventoryInstance.deleteInstanceViaApi(id); }); }); - 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[3].authorityHeading); - MarcAuthorities.selectTitle(marcFiles[3].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, Parallelization.nonParallel] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); + MarcAuthorities.selectTitle(marcFiles[1].authorityHeading); MarcAuthority.edit(); - QuickMarcEditor.checkContent(`$a ${marcFiles[3].authority010FieldValue}`, 4); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[3].authority010FieldValue} $z ${testData.subfieldZValue}`); + QuickMarcEditor.checkContent(`$a ${marcFiles[1].authority010FieldValue}`, 4); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue} $z ${testData.subfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[3].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[3].authority010FieldValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - MarcAuthorities.searchBy('Keyword', marcFiles[3].authorityHeading); + MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); MarcAuthorities.verifyNumberOfTitles(4, '1'); MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.verifyTagFieldAfterLinking(60, testData.tag700, '0', '\\', - `$a ${marcFiles[3].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[3].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[4].authority555FieldValue); - MarcAuthorities.selectTitle(marcFiles[4].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'); - }); - - it('C375173 Save linked "MARC authority" record with deleted fields and edited "1XX" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { - MarcAuthorities.searchBy('Keyword', marcFiles[5].authorityHeading); - MarcAuthorities.selectTitle(marcFiles[5].authorityHeading); - MarcAuthority.edit(); - QuickMarcEditor.updateExistingField(testData.tag100, testData.updated100FieldValue); - QuickMarcEditor.updateExistingTagValue(5, testData.updatedTagName); - QuickMarcEditor.checkContent(testData.updated100FieldValue, 8); - QuickMarcEditor.checkButtonsEnabled(); - QuickMarcEditor.deleteFieldAndCheck(5, testData.updatedTagName); - QuickMarcEditor.afterDeleteNotification(testData.updatedTagName); - // if clicked too fast, delete modal might not appear - cy.wait(1000); - QuickMarcEditor.clickSaveAndCloseThenCheck(1); - QuickMarcEditor.clickRestoreDeletedField(); - QuickMarcEditor.checkDeleteModalClosed(); - QuickMarcEditor.checkContent('$a ' + marcFiles[5].authority035FieldValue, 5); - QuickMarcEditor.checkButtonsEnabled(); - QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); - QuickMarcEditor.updateExistingTagValue(5, testData.tag035); - QuickMarcEditor.updateExistingField(testData.tag046, testData.updated046FieldValue); - QuickMarcEditor.deleteFieldAndCheck(7, testData.tag046); - QuickMarcEditor.afterDeleteNotification(testData.tag046); - QuickMarcEditor.clickSaveAndCloseThenCheck(1); - QuickMarcEditor.clickRestoreDeletedField(); - QuickMarcEditor.checkDeleteModalClosed(); - QuickMarcEditor.checkContent(testData.updated046FieldValue, 7); - QuickMarcEditor.checkButtonsEnabled(); - QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); - QuickMarcEditor.deleteFieldAndCheck(18, testData.tag952); - QuickMarcEditor.afterDeleteNotification(testData.tag952); - QuickMarcEditor.clickSaveAndKeepEditingButton(); - QuickMarcEditor.checkDeleteModal(1); - QuickMarcEditor.clickRestoreDeletedField(); - QuickMarcEditor.checkDeleteModalClosed(); - QuickMarcEditor.checkContent(marcFiles[5].authority952FieldValue, 18); - QuickMarcEditor.checkButtonsEnabled(); - QuickMarcEditor.checkUpdateLinkedBibModalAbsent(); + `$a ${marcFiles[1].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[1].authority010FieldValue}`, ''); }); }); diff --git a/cypress/fixtures/marcAuthFileC367974.mrc b/cypress/fixtures/marcAuthFileC367974.mrc new file mode 100644 index 0000000000..e165744308 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC367974.mrc @@ -0,0 +1 @@ +01178cz 2200277n 4500001000800000005001700008008004100025010002000066035002300086040004600109046002100155100003100176370004100207372006000248374005700308375001700365377000800382400002700390400002400417670006500441670007500506670010700581670012200688670007500810953001500885358430820190116074415.0940103n| azannaabn |a aaa  an94000330367974 a(OCoLC)oca03522314 aDLCbengerdacDLCdIWhNdDLCdOCoLCdScU f1974-11-112edtf1 aDiCaprio, Leonardo C367974 aHollywood (Los Angeles, Calif.)2naf aActingaMotion pictures--Production and direction2lcsh aActorsaMotion picture producers and directors2lcsh aMales2lcdgt aeng1 wnneaDiCaprio, Leonard1 aDi Caprio, Leonardo aThis boy's life [MP] 1993:bcredits (cast, Leonard DiCaprio) aWhat's eating Gilbert Grape? 1994, c1993:bcredits (Leonardo DiCaprio) aHalliwell's filmgoer's & video viewer's comp., 11th ed.b(DiCaprio, Leonardo; b. 1974; American actor) aIMDb, June 6, 2003b(Leonardo DiCaprio; b. Nov. 11, 1974, Hollywood, Calif.; sometime credited as Leonardo Di Caprio) aIMDb, January 4 ,2019:b(Leonardo DiCaprio; actor, producer, director) aqu25bta30 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC367974.mrc b/cypress/fixtures/marcBibFileC367974.mrc new file mode 100644 index 0000000000..50d8234736 --- /dev/null +++ b/cypress/fixtures/marcBibFileC367974.mrc @@ -0,0 +1 @@ +03826cgm a2200865 i 4500001001400000008004100014007001000055005001700065035002400082040006000106024001700166028004600183035002200229037004600251041003300297043001200330050002200342082001800364245006200382250003700444264006100481300005700542336005000599337002300649338003000672344001900702344001900721344002100740344002200761344001100783344001200794347002200806347001200828347002000840380002700860538015100887546007001038500002701108511006201135500005301197500001701250521010001267520023601367610003201603650004501635650003601680650002701716650003101743610005001774650005501824650005001879650004201929650004601971651005202017655003702069655004502106655004502151655008402196655007302280655002602353655002602379655005402405655006502459655002902524655006002553655006002613700005802673700003202731700002702763700002502790700003302815710005302848994001402901948004502915in00000000001210223s2021 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/7222300aC367974 Titanic /cwritten and directed by James Cameron. 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)fst01423879 7aFeature films.2fast0(OCoLC)fst01710384 7aFiction films.2fast0(OCoLC)fst01710264 7aVideo recordings for people with visual disabilities.2fast0(OCoLC)fst01710451 7aVideo recordings for the hearing impaired.2fast0(OCoLC)fst01710450 7aFeature films.2lcgft 7aFiction films.2lcgft 7aVideo recordings for the hearing impaired.2lcgft 7aVideo recordings for people with visual disabilities.2lcgft 7aFilms de fiction.2rvmgf 7aVideÌos pour personnes handicapeÌes auditives.2rvmgf 7aVideÌos pour personnes handicapeÌes visuelles.2rvmgf1 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 HOLDINGS01670cgm a2200445Ma 4500001001400000008004100014005001700055035002400072040002900096020001800125020001500143024001700158028003500175035002100210245020100231260007100432300004500503336005000548337002300598338003000621511008800651500006500739521002000804538002200824700002400846700001700870700002100887700002100908700001700929700002200946700002200968700001600990700001501006700001801021700002301039700002201062856008201084994001401166948004401180in00000000003121208s2012 xxu--- vueng d20221124071656.3 a(OCoLC)ocn879282319 aLEPLLbengcLEPLLdOCLCQ a9786311627907 a63116279061 a88392925531342aWARBR313295bWarner Home Video a(OCoLC)87928231900aC367974 Aviator /cLeonardo DiCaprio, Matt Damon, Jack Nicholson, Robert De Niro, Ray Liotta, Martin Scorsese, Barbara De Fina, Brad Grey, Alan Mak, Felix Chong, Nicholas Pileggi, William Monahan. a[Place of publication not identified] :bWarner Home Video,c2012. a1 videodisc :bsound, color ;c4 3/4 in. atwo-dimensional moving imagebtdi2rdacontent avideobv2rdamedia avideodiscbvd2rdacarrier1 aStarring Leonardo DiCaprio, Matt Damon, Jack Nicholson, Robert De Niro, Ray Liotta. aIncludes the films The Departed, Goodfellas and The Aviator. aR (Restricted). aNTSC, Widescreen.1 aDiCaprio, Leonardo.1 aDamon, Matt.1 aNicholson, Jack.1 aNiro, Robert De.1 aLiotta, Ray.1 aScorsese, Martin.1 aFina, Barbara De.1 aGrey, Brad.1 aMak, Alan.1 aChong, Felix.1 aPileggi, Nicholas.1 aMonahan, William.413Amazon.comuhttp://www.amazon.com/exec/obidos/ASIN/B007TBJD1U/chopaconline-20 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 1 OTHER HOLDINGS \ No newline at end of file diff --git a/cypress/support/fragments/inventory/inventoryInstances.js b/cypress/support/fragments/inventory/inventoryInstances.js index 81ebd0b6e5..bb57fce7e4 100644 --- a/cypress/support/fragments/inventory/inventoryInstances.js +++ b/cypress/support/fragments/inventory/inventoryInstances.js @@ -10,7 +10,8 @@ import { TextField, Checkbox, Modal, - Select + Select, + TextInput } from '../../../../interactors'; import InventoryHoldings from './holdings/inventoryHoldings'; import inventoryNewInstance from './inventoryNewInstance'; @@ -23,6 +24,8 @@ const rootSection = Section({ id: 'pane-results' }); const inventoriesList = rootSection.find(MultiColumnList({ id: 'list-inventory' })); const actionsButton = rootSection.find(Button('Actions')); const singleRecordImportModal = Modal('Single record import'); +const inventorySearchInput = TextInput({ id: 'input-inventory-search' }); +const searchButton = Button('Search', { type: 'submit' }); const advSearchButton = Button('Advanced search'); const advSearchModal = Modal('Advanced search'); @@ -413,5 +416,24 @@ export default { verifySelectedSearchOption(option) { cy.expect(inventorySearchAndFilterInput.has({ value: searchInstancesOptionsValues[searchInstancesOptions.indexOf(option)] })); + }, + + searchInstancesWithOption(option = searchInstancesOptions[0], value) { + cy.do([ + inventorySearchAndFilterInput.choose(including(option)), + inventorySearchInput.fillIn(value) + ]); + this.verifySelectedSearchOption(option); + cy.expect([ + inventorySearchInput.has({ value }), + searchButton.has({ disabled: false }) + ]); + cy.do(searchButton.click()); + }, + + verifyInstanceSearchOptions() { + searchInstancesOptions.forEach((searchOption) => { + cy.expect(inventorySearchAndFilterInput.has({ content: including(searchOption) })); + }); } }; From 81abde70a5d5bf4d6436cd3abe11f24d52e53ee5 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Fri, 1 Sep 2023 01:04:42 +0500 Subject: [PATCH 091/437] test fixes (#1532) --- cypress/e2e/inventory/filter/filter-items-with-status.cy.js | 2 ++ cypress/e2e/inventory/search/browse-contributors.cy.js | 2 +- cypress/support/fragments/inventory/search/browseCallNumber.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/inventory/filter/filter-items-with-status.cy.js b/cypress/e2e/inventory/filter/filter-items-with-status.cy.js index 9216863223..1d3b5a0b30 100644 --- a/cypress/e2e/inventory/filter/filter-items-with-status.cy.js +++ b/cypress/e2e/inventory/filter/filter-items-with-status.cy.js @@ -99,6 +99,8 @@ describe('ui-inventory: Search in Inventory', () => { FilterItems.selectInstance(title); FilterItems.waitItemsLoading(); + // Waiter required for the pane to be loaded. + cy.wait(1000) FilterItems.toggleAccordionItemsButton(holdingId); cy.wait('@getItems'); FilterItems.verifyItemWithStatusExists(holdingId, status); diff --git a/cypress/e2e/inventory/search/browse-contributors.cy.js b/cypress/e2e/inventory/search/browse-contributors.cy.js index 86b2e9c6a4..703447d8c4 100644 --- a/cypress/e2e/inventory/search/browse-contributors.cy.js +++ b/cypress/e2e/inventory/search/browse-contributors.cy.js @@ -101,7 +101,7 @@ describe('Inventory -> Contributors Browse', () => { BrowseContributors.select(); BrowseContributors.browse(testData.contributor.name); BrowseContributors.checkSearchResultRecord(testData.contributor.name); - BrowseContributors.checkSearchResultRow(testData.contributor.name, testData.contributor.nameTypes.personal, `${testData.contributor.types.colorist}, ${testData.contributor.types.architect}, ${testData.contributor.types.dancer}`, '1'); + BrowseContributors.checkSearchResultRow(testData.contributor.name, testData.contributor.nameTypes.personal, `${testData.contributor.types.dancer}, ${testData.contributor.types.architect}, ${testData.contributor.types.colorist}`, '1'); }); it('C356837 Verify that deleted Contributor on instance record with source = Folio does not display on browse result list (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { diff --git a/cypress/support/fragments/inventory/search/browseCallNumber.js b/cypress/support/fragments/inventory/search/browseCallNumber.js index 3ed508304b..b7bc413383 100644 --- a/cypress/support/fragments/inventory/search/browseCallNumber.js +++ b/cypress/support/fragments/inventory/search/browseCallNumber.js @@ -10,7 +10,7 @@ export default { checkExactSearchResult(searchQuery) { cy.do([ - MultiColumnListCell(`${searchQuery}`).has({ innerHTML: including(`${searchQuery}`) }), + MultiColumnListCell(`${searchQuery}`).has({ innerHTML: including(searchQuery) }), ]); }, From ebb7a8e8348e7c872fef98b60da5962d7cf0a1bb Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Mon, 4 Sep 2023 09:22:58 +0300 Subject: [PATCH 092/437] Thunderjet Non Parallel tests (#1535) * Thunderjet Non Parallel tests * Thunderjet Non Parallel tests --- cypress/e2e/finance/funds/create-encumbrance-from-order.cy.js | 3 ++- cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js | 3 ++- cypress/e2e/invoices/cancelling-approved-invoices.cy.js | 4 +++- cypress/e2e/orders/orders.unreceivePiece.cy.js | 3 ++- cypress/e2e/orders/pol-search-am-filter.cy.js | 3 ++- .../item-statuses-are-set-to-status-other.cy.js | 3 ++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/finance/funds/create-encumbrance-from-order.cy.js b/cypress/e2e/finance/funds/create-encumbrance-from-order.cy.js index ab6a441f20..967a60903f 100644 --- a/cypress/e2e/finance/funds/create-encumbrance-from-order.cy.js +++ b/cypress/e2e/finance/funds/create-encumbrance-from-order.cy.js @@ -14,6 +14,7 @@ import NewOrganization from '../../../support/fragments/organizations/newOrganiz import Orders from '../../../support/fragments/orders/orders'; import NewOrder from '../../../support/fragments/orders/newOrder'; import OrderLines from '../../../support/fragments/orders/orderLines'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('ui-finance: Transactions', () => { const defaultFund = { ...Funds.defaultUiFund }; @@ -93,7 +94,7 @@ describe('ui-finance: Transactions', () => { Users.deleteViaApi(user.userId); }); - it('C6705 Create encumbrance from Order (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + it('C6705 Create encumbrance from Order (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet, Parallelization.nonParallel] }, () => { Orders.createPOLineViaActions(); OrderLines.fillInPOLineInfoWithFund(defaultFund); OrderLines.backToEditingOrder(); diff --git a/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js b/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js index 82bc5532f2..5f6e9f4f80 100644 --- a/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js +++ b/cypress/e2e/finance/transactions/unrelease-encumbrance.cy.js @@ -16,6 +16,7 @@ import NewInvoice from '../../../support/fragments/invoices/newInvoice'; import Invoices from '../../../support/fragments/invoices/invoices'; import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; import NewLocation from '../../../support/fragments/settings/tenant/locations/newLocation'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('ui-finance: Transactions', () => { const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; @@ -104,7 +105,7 @@ describe('ui-finance: Transactions', () => { Users.deleteViaApi(user.userId); }); - it('C375105 Unrelease encumbrance when cancelling approved invoice related to Ongoing order (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + it('C375105 Unrelease encumbrance when cancelling approved invoice related to Ongoing order (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet, Parallelization.nonParallel] }, () => { FinanceHelp.searchByName(defaultFund.name); Funds.selectFund(defaultFund.name); Funds.selectBudgetDetails(); diff --git a/cypress/e2e/invoices/cancelling-approved-invoices.cy.js b/cypress/e2e/invoices/cancelling-approved-invoices.cy.js index 3def4b08df..08b6e4c05c 100644 --- a/cypress/e2e/invoices/cancelling-approved-invoices.cy.js +++ b/cypress/e2e/invoices/cancelling-approved-invoices.cy.js @@ -1,6 +1,7 @@ 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 NewInvoiceLine from '../../support/fragments/invoices/newInvoiceLine'; @@ -18,6 +19,7 @@ import NewOrganization from '../../support/fragments/organizations/newOrganizati import BasicOrderLine from '../../support/fragments/orders/basicOrderLine'; import FiscalYears from '../../support/fragments/finance/fiscalYears/fiscalYears'; import Ledgers from '../../support/fragments/finance/ledgers/ledgers'; +import Parallelization from '../../support/dictionary/parallelization'; describe('ui-invoices: Cancelling approved invoices', () => { const invoice = { ...NewInvoice.defaultUiInvoice }; @@ -105,7 +107,7 @@ cy.wait(10000); Users.deleteViaApi(user.userId); }); - it('C350728 Cancelling approved invoices voids payments/credits and Unreleases encumbrances (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + it('C350728 Cancelling approved invoices voids payments/credits and Unreleases encumbrances (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet, Parallelization.nonParallel] }, () => { Invoices.searchByNumber(invoice.invoiceNumber); Invoices.selectInvoice(invoice.invoiceNumber); Invoices.selectInvoiceLine(); diff --git a/cypress/e2e/orders/orders.unreceivePiece.cy.js b/cypress/e2e/orders/orders.unreceivePiece.cy.js index bdb8bc5557..ce18e41c34 100644 --- a/cypress/e2e/orders/orders.unreceivePiece.cy.js +++ b/cypress/e2e/orders/orders.unreceivePiece.cy.js @@ -12,6 +12,7 @@ import Organizations from '../../support/fragments/organizations/organizations'; import DevTeams from '../../support/dictionary/devTeams'; import NewOrganization from '../../support/fragments/organizations/newOrganization'; import ItemRecordView from '../../support/fragments/inventory/item/itemRecordView'; +import Parallelization from '../../support/dictionary/parallelization'; describe('orders: Unreceive piece from Order', () => { const order = { ...NewOrder.defaultOneTimeOrder }; @@ -39,7 +40,7 @@ describe('orders: Unreceive piece from Order', () => { Organizations.deleteOrganizationViaApi(organization.id); }); - it('C10925 Unreceive piece (thunderjet)', { tags: [TestType.smoke, DevTeams.thunderjet] }, () => { + it('C10925 Unreceive piece (thunderjet)', { tags: [TestType.smoke, DevTeams.thunderjet, Parallelization.nonParallel] }, () => { const barcode = Helper.getRandomBarcode(); const caption = 'autotestCaption'; Orders.createOrderWithOrderLineViaApi(order, orderLine) diff --git a/cypress/e2e/orders/pol-search-am-filter.cy.js b/cypress/e2e/orders/pol-search-am-filter.cy.js index 8bc1aab8f0..b673ef9f1f 100644 --- a/cypress/e2e/orders/pol-search-am-filter.cy.js +++ b/cypress/e2e/orders/pol-search-am-filter.cy.js @@ -12,6 +12,7 @@ import InteractorsTools from '../../support/utils/interactorsTools'; import OrderLines from '../../support/fragments/orders/orderLines'; import SettingsMenu from '../../support/fragments/settingsMenu'; import SettingsOrders from '../../support/fragments/settings/orders/settingsOrders'; +import Parallelization from '../../support/dictionary/parallelization'; Cypress.on('uncaught:exception', () => false); @@ -84,7 +85,7 @@ describe('orders: export', () => { Users.deleteViaApi(user.userId); }); - it('C350603 Searching POL by specifying acquisition method (thunderjet)', { tags: [TestTypes.smoke, devTeams.thunderjet] }, () => { + it('C350603 Searching POL by specifying acquisition method (thunderjet)', { tags: [TestTypes.smoke, devTeams.thunderjet, Parallelization.nonParallel] }, () => { cy.logout(); cy.loginAsAdmin({ path:TopMenu.ordersPath, waiter: Orders.waitLoading }); order.orderType = 'Ongoing'; diff --git a/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js index d073a3ece3..fb9ab536ca 100644 --- a/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js +++ b/cypress/e2e/orders/receiving-and-check-in/item-statuses-are-set-to-status-other.cy.js @@ -19,6 +19,7 @@ import ItemRecordEdit from '../../../support/fragments/inventory/item/itemRecord import SwitchServicePoint from '../../../support/fragments/servicePoint/switchServicePoint'; import CheckInActions from '../../../support/fragments/check-in-actions/checkInActions'; import { ITEM_STATUS_NAMES } from '../../../support/constants'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('orders: Receiving and Check-in', () => { const order = { @@ -177,7 +178,7 @@ describe('orders: Receiving and Check-in', () => { // // TODO: Need to find solution to delete all data, becouse now i cant delete location and user - it('C367971 Item statuses are set to status other than "Order closed" or "On order" and are NOT changed to "In process" upon receiving (items for receiving includes "On order" statuses) (thunderjet)', { tags: [testType.smoke, devTeams.thunderjet] }, () => { + it('C367971 Item statuses are set to status other than "Order closed" or "On order" and are NOT changed to "In process" upon receiving (items for receiving includes "On order" statuses) (thunderjet)', { tags: [testType.smoke, devTeams.thunderjet, Parallelization.nonParallel] }, () => { Orders.searchByParameter('PO number', orderNumber); Receiving.selectLinkFromResultsList(); Receiving.receiveFromExpectedSection(); From 4820a5da74fee7b190ce749fcd76765d5b26ecb2 Mon Sep 17 00:00:00 2001 From: Daniil Novikau Date: Mon, 4 Sep 2023 11:08:37 +0300 Subject: [PATCH 093/437] Add 'husky install' script (#1537) --- README.md | 1 + package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c701567f93..d069ab92c8 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ git clone git@github.com:folio-org/platform-core.git cd platform-core git checkout snapshot yarn +yarn prepare yarn test-int ``` This will start stripes at http://localhost:3000, run the platform's tests, and diff --git a/package.json b/package.json index 97021147a0..f15d5dcf5a 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "lint": "eslint . --ext=js", "lint:fix": "eslint --fix --quiet", "prettier": "prettier .", - "prettier:fix": "prettier --write" + "prettier:fix": "prettier --write", + "prepare": "husky install" }, "husky": { "hooks": { From 3c80884bfb1c372e0cb7eb844b78220a214f8950 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Mon, 4 Sep 2023 13:49:53 +0500 Subject: [PATCH 094/437] added parallelization tags (#1538) --- .../bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js | 3 ++- .../in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js | 3 ++- .../bulk-edit-in-app-user-custom-fields-semicolon.cy.js | 3 ++- cypress/e2e/data-export/data-export-invalid-cql.cy.js | 3 ++- .../export-instance-records-invalid-profile.cy.js | 6 +++++- cypress/e2e/data-export/export-instance-records.cy.js | 3 ++- cypress/e2e/data-export/instance-hrid-004-field.cy.js | 6 +++++- 7 files changed, 20 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js index 27a1ecae55..6c1ded7bce 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-correct-user.cy.js @@ -1,6 +1,7 @@ import devTeams from '../../../support/dictionary/devTeams'; import permissions from '../../../support/dictionary/permissions'; import testTypes from '../../../support/dictionary/testTypes'; +import parallelization from '../../../support/dictionary/parallelization'; import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; import TopMenu from '../../../support/fragments/topMenu'; import Users from '../../../support/fragments/users/users'; @@ -62,7 +63,7 @@ describe('bulk-edit', () => { FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); }); - it('C380393 Verify that bulk edit jobs run by correct user (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C380393 Verify that bulk edit jobs run by correct user (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird, parallelization.nonParallel] }, () => { BulkEditSearchPane.checkItemsRadio(); BulkEditSearchPane.selectRecordIdentifier('Item UUIDs'); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js index b80112f6a3..21cf98ba19 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-recent.cy.js @@ -5,6 +5,7 @@ import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-s import FileManager from '../../../support/utils/fileManager'; import getRandomPostfix from '../../../support/utils/stringTools'; import devTeams from '../../../support/dictionary/devTeams'; +import parallelization from '../../../support/dictionary/parallelization'; import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; import Users from '../../../support/fragments/users/users'; import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; @@ -63,7 +64,7 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - it('C389570 In app | Verify bulk edit Users records with recently updated Custom fields (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C389570 In app | Verify bulk edit Users records with recently updated Custom fields (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird, parallelization.nonParallel] }, () => { cy.visit(TopMenu.bulkEditPath); BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js index ac79fb099f..5006486577 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-custom-fields-semicolon.cy.js @@ -5,6 +5,7 @@ import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-s import FileManager from '../../../support/utils/fileManager'; import getRandomPostfix from '../../../support/utils/stringTools'; import devTeams from '../../../support/dictionary/devTeams'; +import parallelization from '../../../support/dictionary/parallelization'; import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; import Users from '../../../support/fragments/users/users'; import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; @@ -55,7 +56,7 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - it('C389568 In app | Verify that User\'s Custom fields with semicolons are updated correctly (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C389568 In app | Verify that User\'s Custom fields with semicolons are updated correctly (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird, parallelization.nonParallel] }, () => { cy.visit(TopMenu.bulkEditPath); BulkEditSearchPane.checkUsersRadio(); diff --git a/cypress/e2e/data-export/data-export-invalid-cql.cy.js b/cypress/e2e/data-export/data-export-invalid-cql.cy.js index b523bedfde..e259a88fd3 100644 --- a/cypress/e2e/data-export/data-export-invalid-cql.cy.js +++ b/cypress/e2e/data-export/data-export-invalid-cql.cy.js @@ -7,6 +7,7 @@ import getRandomPostfix from '../../support/utils/stringTools'; import { getLongDelay } from '../../support/utils/cypressTools'; import permissions from '../../support/dictionary/permissions'; import devTeams from '../../support/dictionary/devTeams'; +import parallelization from '../../support/dictionary/parallelization'; import Users from '../../support/fragments/users/users'; import DataExportLogs from '../../support/fragments/data-export/dataExportLogs'; @@ -35,7 +36,7 @@ describe('data-export', () => { FileManager.deleteFile(`cypress/fixtures/${editedFileName}`); }); - it('C397323 Verify trigger Data export with invalid CQL (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C397323 Verify trigger Data export with invalid CQL (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird, parallelization.nonParallel] }, () => { ExportFileHelper.uploadFile(editedFileName); ExportFileHelper.exportWithDefaultJobProfile(editedFileName, 'instances', 'Instances', '.cql'); diff --git a/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js b/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js index b9fd850e79..018af7b061 100644 --- a/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js +++ b/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js @@ -7,10 +7,14 @@ import getRandomPostfix from '../../support/utils/stringTools'; import { getLongDelay } from '../../support/utils/cypressTools'; import permissions from '../../support/dictionary/permissions'; import devTeams from '../../support/dictionary/devTeams'; +import parallelization from '../../support/dictionary/parallelization'; import Users from '../../support/fragments/users/users'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import generateItemBarcode from '../../support/utils/generateItemBarcode'; +// 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 item = { instanceName: `testBulkEdit_${getRandomPostfix()}`, @@ -40,7 +44,7 @@ describe('data-export', () => { FileManager.deleteFile(`cypress/fixtures/${fileName}`); }); - it('C350407 Verify that a user cannot trigger the DATA EXPORT using invalid job profile (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C350407 Verify that a user cannot trigger the DATA EXPORT using invalid job profile (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird, parallelization.nonParallel] }, () => { ExportFileHelper.uploadFile(fileName); ExportFileHelper.exportWithDefaultJobProfile(fileName, 'holdings', 'Holdings'); diff --git a/cypress/e2e/data-export/export-instance-records.cy.js b/cypress/e2e/data-export/export-instance-records.cy.js index dcdeebafc4..fba0777c33 100644 --- a/cypress/e2e/data-export/export-instance-records.cy.js +++ b/cypress/e2e/data-export/export-instance-records.cy.js @@ -7,6 +7,7 @@ import getRandomPostfix from '../../support/utils/stringTools'; import { getLongDelay } from '../../support/utils/cypressTools'; import permissions from '../../support/dictionary/permissions'; import devTeams from '../../support/dictionary/devTeams'; +import parallelization from '../../support/dictionary/parallelization'; import Users from '../../support/fragments/users/users'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import generateItemBarcode from '../../support/utils/generateItemBarcode'; @@ -40,7 +41,7 @@ describe('data-export', () => { FileManager.deleteFile(`cypress/fixtures/${fileName}`); }); - it('C9288 Export small number of instance records - default instance mapping profile (firebird)', { tags: [TestTypes.smoke, devTeams.firebird] }, () => { + it('C9288 Export small number of instance records - default instance mapping profile (firebird)', { tags: [TestTypes.smoke, devTeams.firebird, parallelization.nonParallel] }, () => { ExportFileHelper.uploadFile(fileName); ExportFileHelper.exportWithDefaultJobProfile(fileName); diff --git a/cypress/e2e/data-export/instance-hrid-004-field.cy.js b/cypress/e2e/data-export/instance-hrid-004-field.cy.js index a50715a838..1239102cd3 100644 --- a/cypress/e2e/data-export/instance-hrid-004-field.cy.js +++ b/cypress/e2e/data-export/instance-hrid-004-field.cy.js @@ -1,5 +1,6 @@ import permissions from '../../support/dictionary/permissions'; import TopMenu from '../../support/fragments/topMenu'; +import parallelization from '../../support/dictionary/parallelization'; import DataExportLogs from '../../support/fragments/data-export/dataExportLogs'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import getRandomPostfix from '../../support/utils/stringTools'; @@ -11,6 +12,9 @@ import { getLongDelay } from '../../support/utils/cypressTools'; import DataExportResults from '../../support/fragments/data-export/dataExportResults'; import ExportFile from '../../support/fragments/data-export/exportFile'; +// 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 item = { barcode: getRandomPostfix(), @@ -55,7 +59,7 @@ describe('Data Export - Holdings records export', () => { FileManager.deleteFile(`cypress/fixtures/${fileName}`); }); - it('C376962 Verify that Default mapping profile for holdings maps instance HRID to "004" field (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C376962 Verify that Default mapping profile for holdings maps instance HRID to "004" field (firebird)', { tags: [testTypes.smoke, devTeams.firebird, parallelization.nonParallel] }, () => { ExportFile.uploadFile(fileName); ExportFile.exportWithDefaultJobProfile(fileName, 'holdings', 'Holdings'); From 30ef5dc7a51c76825a454d7c2b113c18f264717c Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:40:23 +0300 Subject: [PATCH 095/437] Idea Labs: Implementing of FAT-7706 (#1536) * Thunderjet Non Parallel tests * Thunderjet Non Parallel tests * Idea Labs: Implementing of FAT-7706 * Idea Labs: Implementing of FAT-7706 --- .../e2e/finance/check-available-balance.cy.js | 120 ++++++++++++++++++ .../finance/fiscalYears/fiscalYears.js | 38 +++++- .../fragments/finance/ledgers/ledgers.js | 19 +++ 3 files changed, 173 insertions(+), 4 deletions(-) create mode 100644 cypress/e2e/finance/check-available-balance.cy.js diff --git a/cypress/e2e/finance/check-available-balance.cy.js b/cypress/e2e/finance/check-available-balance.cy.js new file mode 100644 index 0000000000..911340b456 --- /dev/null +++ b/cypress/e2e/finance/check-available-balance.cy.js @@ -0,0 +1,120 @@ +import permissions from '../../support/dictionary/permissions'; +import testType from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +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'; +import NewOrder from '../../support/fragments/orders/newOrder'; +import Orders from '../../support/fragments/orders/orders'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import Organizations from '../../support/fragments/organizations/organizations'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import NewInvoice from '../../support/fragments/invoices/newInvoice'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import InteractorsTools from '../../support/utils/interactorsTools'; +import Groups from '../../support/fragments/finance/groups/groups'; + +describe('Finance', () => { + const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger, + restrictEncumbrance: false }; + const defaultFund = { ...Funds.defaultUiFund }; + const defaultOrder = { ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true, + reEncumber: true }; + const defaultGroup = { ...Groups.defaultUiGroup }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const allocatedQuantity = '1000'; + let user; + let servicePointId; + let location; + + before(() => { + cy.getAdminToken(); + FiscalYears.createViaApi(defaultFiscalYear) + .then(firstFiscalYearResponse => { + defaultFiscalYear.id = firstFiscalYearResponse.id; + defaultLedger.fiscalYearOneId = defaultFiscalYear.id; + Ledgers.createViaApi(defaultLedger) + .then(ledgerResponse => { + defaultLedger.id = ledgerResponse.id; + defaultFund.ledgerId = defaultLedger.id; + Groups.createViaApi(defaultGroup) + .then(firstGroupResponse => { + defaultGroup.id = firstGroupResponse.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); + Funds.addGroupToFund(defaultGroup.name); + InteractorsTools.checkCalloutMessage('Fund has been saved'); + }); + }); + }); + 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; + }); + defaultOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(defaultOrder).then(firstOrderResponse => { + defaultOrder.id = firstOrderResponse.id; + Orders.checkCreatedOrder(defaultOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '1100', '1', '1100', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + }); + cy.createTempUser([ + permissions.uiFinanceViewFiscalYear.gui, + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiFinanceViewLedger.gui, + permissions.uiFinanceViewLedger.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.fiscalYearPath, waiter: FiscalYears.waitForFiscalYearDetailsLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C377030 "Available balance" is displayed as a negative number when running a deficit (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + FinanceHelp.searchByName(defaultFiscalYear.name); + FiscalYears.selectFisacalYear(defaultFiscalYear.name); + FiscalYears.checkAvailableBalance('$1,000.00', '-$100.00'); + FiscalYears.clickOnLedgerTab(); + FinanceHelp.searchByName(defaultLedger.name); + Ledgers.selectLedger(defaultLedger.name); + FiscalYears.checkAvailableBalance('$1,000.00', '-$100.00'); + Ledgers.clickOnFundTab(); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.selectBudgetDetails(); + FiscalYears.checkAvailableBalance('$1,000.00', '-$100.00'); + }); +}); diff --git a/cypress/support/fragments/finance/fiscalYears/fiscalYears.js b/cypress/support/fragments/finance/fiscalYears/fiscalYears.js index b808c3b103..10612fa076 100644 --- a/cypress/support/fragments/finance/fiscalYears/fiscalYears.js +++ b/cypress/support/fragments/finance/fiscalYears/fiscalYears.js @@ -23,9 +23,10 @@ const buttonNew = Button('New'); const actions = Button('Actions'); const edit = Button('Edit'); const deleteButton = Button('Delete'); -const fiscalYear = Button('Fiscal year'); -const Ledgertab = Button('Ledger'); +const fiscalYearButton = Button('Fiscal year'); const resetButton = Button({ id: 'reset-fiscal-years-filters' }); +const fiscalYearFiltersSection = Section({ id: 'fiscal-year-filters-pane' }); + export default { defaultUiFiscalYear: { @@ -46,6 +47,10 @@ export default { series: 'FYTA' }, + selectFisacalYear:(fiscalYear) => { + cy.do(Pane({ id: 'fiscal-year-results-pane' }).find(Link(fiscalYear)).click()); + }, + waitForFiscalYearDetailsLoading: () => { cy.do(Pane({ id: 'pane-fiscal-year-details' }).exists); }, @@ -62,6 +67,13 @@ export default { this.waitForFiscalYearDetailsLoading(); }, + checkAvailableBalance(cashBalance, availableBalance) { + cy.get('div[class*=balanceWrapper-]').then(($element) => { + const text = $element.text(); + expect(text).to.eq(`Cash balance: ${cashBalance}Available balance: ${availableBalance}`); + }); + }, + closeThirdPane() { cy.do(PaneHeader({ id: 'paneHeaderpane-fiscal-year-details' }).find(Button({ icon: 'times' })).click()); }, @@ -69,16 +81,31 @@ export default { openAcquisitionAccordion() { cy.do(Button({ id: 'accordion-toggle-button-acqUnitIds' }).click()); }, + clickOnFiscalYear: () => { cy.do([ - fiscalYear.click() + fiscalYearButton.click() ]); }, + clickOnLedgerTab: () => { cy.do([ - Ledgertab.click() + fiscalYearFiltersSection.find(Button('Ledger')).click() ]); }, + + clickOnGroupTab: () => { + cy.do([ + fiscalYearFiltersSection.find(Button('Group')).click() + ]); + }, + + clickOnFundTab: () => { + cy.do([ + fiscalYearFiltersSection.find(Button('Fund')).click() + ]); + }, + editFiscalYearDetails: () => { cy.do([ actions.click(), @@ -98,6 +125,7 @@ export default { .should('be.visible') .and('have.text', fiscalYearName); }, + filltheStartAndEndDateoncalenderstartDateField1: () => { cy.do([ TextField({ name: 'periodStart' }).clear(), @@ -107,6 +135,7 @@ export default { saveAndClose.click() ]); }, + filltheStartAndEndDateoncalenderstartDateField2: () => { cy.do([ TextField({ name: 'periodStart' }).clear(), @@ -145,6 +174,7 @@ export default { .find(MultiColumnListCell(fiscalYear)) .exists()); }, + checkSearchResults1: (fiscalYear) => { cy.expect(MultiColumnList({ id: 'fiscal-years-list' }) .find(MultiColumnListCell(fiscalYear)).click()); diff --git a/cypress/support/fragments/finance/ledgers/ledgers.js b/cypress/support/fragments/finance/ledgers/ledgers.js index 9cfc6ddd87..4e7451447d 100644 --- a/cypress/support/fragments/finance/ledgers/ledgers.js +++ b/cypress/support/fragments/finance/ledgers/ledgers.js @@ -43,6 +43,7 @@ const addAvailableToSelect = Select({ name: 'budgetsRollover[0].addAvailableTo', }); const resetButton = Button({ id: 'reset-ledgers-filters' }); +const ledgersFiltersSection = Section({ id: 'ledger-filters-pane' }); export default { defaultUiLedger: { @@ -56,6 +57,24 @@ export default { cy.do(Section({ id: 'pane-ledger-details' }).visible); }, + clickOnFiscalYearTab: () => { + cy.do([ + ledgersFiltersSection.find(Button('Fiscal year')).click() + ]); + }, + + clickOnGroupTab: () => { + cy.do([ + ledgersFiltersSection.find(Button('Group')).click() + ]); + }, + + clickOnFundTab: () => { + cy.do([ + ledgersFiltersSection.find(Button('Fund')).click() + ]); + }, + rollover : () => { cy.wait(8000); From 853eba61516dc70d2b4ba80f71a216460e81b305 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 5 Sep 2023 12:20:17 +0300 Subject: [PATCH 096/437] added checks (#1511) --- .../duplicate-an-existing-job-profile.cy.js | 61 +++++++++++++++++++ .../job_profiles/jobProfileView.js | 5 ++ .../data_import/job_profiles/newJobProfile.js | 10 ++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/data-import/settings/duplicate-an-existing-job-profile.cy.js diff --git a/cypress/e2e/data-import/settings/duplicate-an-existing-job-profile.cy.js b/cypress/e2e/data-import/settings/duplicate-an-existing-job-profile.cy.js new file mode 100644 index 0000000000..77cd40fd00 --- /dev/null +++ b/cypress/e2e/data-import/settings/duplicate-an-existing-job-profile.cy.js @@ -0,0 +1,61 @@ +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 NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import InteractorsTools from '../../../support/utils/interactorsTools'; +import JobProfileView from '../../../support/fragments/data_import/job_profiles/jobProfileView'; +import { ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; +import Users from '../../../support/fragments/users/users'; + +describe('data-import', () => { + describe('Settings', () => { + let user; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C2333 autotest job profile ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const description = `Description for job profile.${getRandomPostfix()}`; + const jobProfileName = `C2333 newJobProfileName.${getRandomPostfix()}`; + const failCalloutMessage = `Job profile '${jobProfile.profileName}' already exists`; + const succsessCalloutMessage = `The job profile "${jobProfileName}" was successfully created`; + + before('create test data', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.saveAndClose(); + InteractorsTools.closeCalloutMessage(); + JobProfiles.closeJobProfile(jobProfile.profileName); + }); + }); + + after('delete test data', () => { + JobProfiles.deleteJobProfile(jobProfile.profileName); + JobProfiles.deleteJobProfile(jobProfileName); + Users.deleteViaApi(user.userId); + }); + + it('C2333 Duplicate an existing job profile (folijet)', + { tags: [TestTypes.extendedPath, DevTeams.folijet] }, () => { + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfileView.duplicate(); + NewJobProfile.fillDescription(description); + NewJobProfile.saveAndClose(); + NewJobProfile.checkCalloutMessage(failCalloutMessage); + NewJobProfile.fillProfileName(jobProfileName); + NewJobProfile.saveAndClose(); + NewJobProfile.checkCalloutMessage(succsessCalloutMessage); + JobProfileView.verifyJobProfileOpened(); + }); + }); +}); diff --git a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js index f2a2f2281a..228c6f5231 100644 --- a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js +++ b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js @@ -44,6 +44,11 @@ export default { cy.expect(ValueChipRoot(tag).absent()); }, + duplicate:() => { + cy.do(viewPane.find(actionsButton).click()); + cy.do(Button('Duplicate').click()); + }, + verifyJobProfileOpened:() => { cy.expect(resultsPane.exists()); cy.expect(viewPane.exists()); diff --git a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js index 8de5cffbc4..fa2ee2d7ea 100644 --- a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js +++ b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js @@ -1,5 +1,5 @@ import { HTML, including } from '@interactors/html'; -import { Accordion, Button, Select, TextField, Pane } from '../../../../../interactors'; +import { Accordion, Button, Select, TextField, Pane, TextArea, Callout } from '../../../../../interactors'; import ModalSelectProfile from './modalSelectProfile'; import { ACCEPTED_DATA_TYPE_NAMES, PROFILE_TYPE_NAMES } from '../../../constants'; @@ -75,6 +75,9 @@ export default { linkActionProfileForSubMatches, defaultJobProfile, + fillProfileName:(profileName) => cy.do(TextField({ name:'profile.name' }).fillIn(profileName)), + fillDescription:(description) => cy.do(TextArea({ name:'profile.description' }).fillIn(description)), + fillJobProfile: (specialJobProfile = defaultJobProfile) => { cy.do(TextField({ name:'profile.name' }).fillIn(specialJobProfile.profileName)); cy.expect(TextField({ name:'profile.name' }).has({ value: specialJobProfile.profileName })); @@ -250,5 +253,10 @@ export default { .then((responce) => { return responce.body.id; }); + }, + + checkCalloutMessage:(message) => { + cy.expect(Callout({ textContent: including(message) }).exists()); + cy.do(Callout().find(Button({ icon:'times' })).click()); } }; From 3e95036103b8ec532a8080ea0f9e07be925ee3fd Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 5 Sep 2023 12:38:13 +0300 Subject: [PATCH 097/437] Fat 7766 c385653 (#1542) * added test * added checks and after block * changed argument --- ...aking-incorrect-records-into-account.cy.js | 4 +- ...ary-table-with-create-update-actions.cy.js | 6 +- ...job-profile-with-repeatable-profiles.cy.js | 195 ++++++++++++++++++ .../fragments/circulation-log/searchPane.js | 10 +- .../job_profiles/jobProfileEdit.js | 8 +- .../job_profiles/jobProfileView.js | 50 ++++- .../data_import/job_profiles/newJobProfile.js | 35 +++- 7 files changed, 283 insertions(+), 25 deletions(-) create mode 100644 cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js index 56407e67b5..56d7c0345f 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js @@ -151,7 +151,7 @@ describe('data-import', () => { cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfile(jobProfile); NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkProfileForNonMatches('Default - Create instance'); + NewJobProfile.linkActionProfileForNonMatches('Default - Create instance'); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); @@ -188,7 +188,7 @@ describe('data-import', () => { cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfile(jobProfileForUpdate); NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); - NewJobProfile.linkProfileForNonMatches('Default - Create instance'); + NewJobProfile.linkActionProfileForNonMatches('Default - Create instance'); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); 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 04cd4a8390..52cb8b62e1 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 @@ -363,11 +363,11 @@ describe.skip('data-import', () => { cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfProfilesForUpdate[0].actionProfile.name); - NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[1].actionProfile.name); + NewJobProfile.linkActionProfileForNonMatches(collectionOfProfilesForCreate[1].actionProfile.name); NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfProfilesForUpdate[1].actionProfile.name, 2); - NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[2].actionProfile.name, 3); + NewJobProfile.linkActionProfileForNonMatches(collectionOfProfilesForCreate[2].actionProfile.name, 3); NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfProfilesForUpdate[2].actionProfile.name, 4); - NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[3].actionProfile.name, 5); + NewJobProfile.linkActionProfileForNonMatches(collectionOfProfilesForCreate[3].actionProfile.name, 5); NewJobProfile.saveAndClose(); // upload the edited marc file diff --git a/cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js b/cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js new file mode 100644 index 0000000000..e8171df709 --- /dev/null +++ b/cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js @@ -0,0 +1,195 @@ +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, + INSTANCE_STATUS_TERM_NAMES, + EXISTING_RECORDS_NAMES, + ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; +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 NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import JobProfileView from '../../../support/fragments/data_import/job_profiles/jobProfileView'; +import JobProfileEdit from '../../../support/fragments/data_import/job_profiles/jobProfileEdit'; +import Users from '../../../support/fragments/users/users'; + +describe('data-import', () => { + describe('Settings', () => { + let user; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `Update instance.${getRandomPostfix()}`, + catalogedDate: '###TODAY###', + statusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, + administrativeNote: 'Updated via OCLC match' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `Update instance via OCLC number match.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `Update holdings temp location.${getRandomPostfix()}`, + adminNote: 'Updated via OCLC number match' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `Update holdings via OCLC number match.${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `035$a to OCLC.${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + in1: '', + in2: '', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.identifierOCLC } + }, + { + matchProfile: { profileName: `035$z to OCLC.${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + in1: '', + in2: '', + subfield: 'z' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.identifierOCLC } + }, + { + matchProfile: { profileName: `Instance Status Batch Loaded.${getRandomPostfix()}`, + incomingStaticValue: 'Batch Loaded', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.instanceStatusTerm } + }, + { + matchProfile: { profileName: `Holdings type electronic.${getRandomPostfix()}`, + incomingStaticValue: 'Electronic', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + existingRecordOption: NewMatchProfile.optionsList.holdingsType } + } + ]; + const linkedProfileNames = [ + collectionOfMatchProfiles[1].matchProfile.profileName, + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMatchProfiles[3].matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMatchProfiles[0].matchProfile.profileName, + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMatchProfiles[3].matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMappingAndActionProfiles[1].actionProfile.name + ]; + + before('create test data', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password); + + // create Field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.fillCatalogedDate(collectionOfMappingAndActionProfiles[0].mappingProfile.catalogedDate); + NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfiles[0].mappingProfile.statusTerm); + NewFieldMappingProfile.addAdministrativeNote(collectionOfMappingAndActionProfiles[0].mappingProfile.administrativeNote, 9); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.addAdministrativeNote(collectionOfMappingAndActionProfiles[1].mappingProfile.adminNote, 5); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + + // create action profiles + cy.wrap(collectionOfMappingAndActionProfiles).each(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // craete match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(collectionOfMatchProfiles[0].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[0].matchProfile.profileName); + + MatchProfiles.createMatchProfile(collectionOfMatchProfiles[1].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[1].matchProfile.profileName); + + MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[2].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[2].matchProfile.profileName); + + MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[3].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[3].matchProfile.profileName); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); + }); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + }); + + it('C385653 Verify that no duplicates of match and actions profiles appear after editing job profile with repeatable profiles (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `Import job profile with the same match and action profiles.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const calloutMessage = `The job profile "${jobProfile.profileName}" was successfully updated`; + + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[2].matchProfile.profileName); + NewJobProfile.waitLoading(); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[3].matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.linkMatchProfileForNonMatches(collectionOfMatchProfiles[0].matchProfile.profileName, 5); + NewJobProfile.waitLoading(); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[2].matchProfile.profileName, 5); + NewJobProfile.waitLoading(); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[3].matchProfile.profileName, 5); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name, 5); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name, 5); + NewJobProfile.saveAndClose(); + + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfileView.edit(); + JobProfileEdit.verifyScreenName(jobProfile.profileName); + JobProfileEdit.unlinkProfile(1); + JobProfileEdit.saveAndClose(); + JobProfileView.verifyJobProfileOpened(); + JobProfileView.verifyCalloutMessage(calloutMessage); + JobProfileView.verifyLinkedProfiles(linkedProfileNames, linkedProfileNames.length); + + JobProfiles.deleteJobProfile(jobProfile.profileName); + }); + }); +}); diff --git a/cypress/support/fragments/circulation-log/searchPane.js b/cypress/support/fragments/circulation-log/searchPane.js index 25023ceab4..2dbeba072a 100644 --- a/cypress/support/fragments/circulation-log/searchPane.js +++ b/cypress/support/fragments/circulation-log/searchPane.js @@ -41,7 +41,7 @@ export default { cy.do([ Accordion({ id: 'loan' }).clickHeader(), Checkbox({ id: 'clickable-filter-loan-checked-out' }).click() - //,cy.do(TextField({ name: 'itemBarcode' }).fillIn(data)), + // ,cy.do(TextField({ name: 'itemBarcode' }).fillIn(data)), ]); }, @@ -81,12 +81,10 @@ export default { cy.expect(Pane({ title: 'Circulation log' }).exists()); cy.do([ Accordion({ id: 'loan' }).clickHeader(), - Checkbox({ - id: 'clickable-filter-loan-renewed-through-override', - }).click(), + Checkbox({ id: 'clickable-filter-loan-renewed-through-override' }).click(), Button('Reset all').click(), - TextField({ name: 'itemBarcode' }).fillIn('1040'), - ]), + TextField({ name: 'itemBarcode' }).fillIn('1040') + ]); cy.get('[class^="button-"][type="submit"]').first().click(); cy.expect(MultiColumnListRow().exists()); }, diff --git a/cypress/support/fragments/data_import/job_profiles/jobProfileEdit.js b/cypress/support/fragments/data_import/job_profiles/jobProfileEdit.js index ae88ce47b0..946e89cf62 100644 --- a/cypress/support/fragments/data_import/job_profiles/jobProfileEdit.js +++ b/cypress/support/fragments/data_import/job_profiles/jobProfileEdit.js @@ -1,5 +1,5 @@ import { including } from '@interactors/html'; -import { Button, Form, TextField } from '../../../../../interactors'; +import { Button, Form, Modal, TextField } from '../../../../../interactors'; const saveAndCloseButton = Button('Save as profile & Close'); @@ -9,5 +9,11 @@ export default { saveAndClose: () => { cy.do(saveAndCloseButton.click()); cy.expect(saveAndCloseButton.absent()); + }, + unlinkProfile:(number) => { + cy.get('[id*="branch-ROOT-MATCH-MATCH-MATCH-editable"]') + .eq(number) + .find('button[icon="unlink"]').click(); + cy.do(Modal({ id:'unlink-job-profile-modal' }).find(Button('Unlink')).click()); } }; diff --git a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js index 228c6f5231..b232c62d0a 100644 --- a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js +++ b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js @@ -6,7 +6,8 @@ import { Accordion, ValueChipRoot, MultiColumnList, MultiColumnListCell, - MultiSelectOption } from '../../../../../interactors'; + MultiSelectOption, + Callout } from '../../../../../interactors'; const viewPane = Pane({ id:'view-job-profile-pane' }); const resultsPane = Pane({ id:'pane-results' }); @@ -15,8 +16,15 @@ const tagSelect = MultiSelect({ id:'input-tag' }); const addTagForSelectOption = MultiSelectOption(including('Add tag for:')); const jobProfilesList = MultiColumnList({ id: 'job-profiles-list' }); +function waitLoading() { + // wait for the page to be fully loaded + cy.wait(1500); +} + export default { + waitLoading, edit:() => { + waitLoading(); cy.do(viewPane.find(actionsButton).click()); cy.do(Button('Edit').click()); }, @@ -69,7 +77,43 @@ export default { .find(MultiColumnListCell({ row: 0, columnIndex: 2, content: including(tag) })) .absent()); }, - + verifyCalloutMessage:(message) => { + cy.expect(Callout({ textContent: including(message) }).exists()); + cy.do(Callout().find(Button({ icon:'times' })).click()); + }, verifyJobProfileName:(profileName) => cy.expect(viewPane.find(HTML(including(profileName))).exists()), - verifyActionMenuAbsent:() => cy.expect(viewPane.find(actionsButton).absent()) + verifyActionMenuAbsent:() => cy.expect(viewPane.find(actionsButton).absent()), + getLinkedProfiles:() => { + waitLoading(); + const profileNames = []; + + return cy.get('[data-test-profile-link]').each($element => { + cy.wrap($element) + .invoke('text') + .then(name => { + profileNames.push(name); + }); + }).then(() => { + return profileNames; + }); + }, + + verifyLinkedProfiles(arrayOfProfileNames, numberOfProfiles) { + waitLoading(); + const profileNames = []; + + cy.get('[data-test-profile-link]').each($element => { + cy.wrap($element) + .invoke('text') + .then(name => { + profileNames.push(name); + }); + }).then(() => { + // Iterate through each element in profileNames + for (let i = 0; i < profileNames.length; i++) { + expect(profileNames[i]).to.include(arrayOfProfileNames[i]); + } + expect(numberOfProfiles).to.equal(profileNames.length); + }); + } }; diff --git a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js index fa2ee2d7ea..c1f919b138 100644 --- a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js +++ b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js @@ -66,6 +66,11 @@ function linkActionProfileForSubMatches(actionProfileName, forMatchesOrder = 0) cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); } +function waitLoading() { + // wait for the page to be fully loaded + cy.wait(3000); +} + export default { getDefaultJobProfile, linkActionProfileByName, @@ -73,6 +78,7 @@ export default { linkActionProfileForMatches, linkMatchProfileForSubMatches, linkActionProfileForSubMatches, + waitLoading, defaultJobProfile, fillProfileName:(profileName) => cy.do(TextField({ name:'profile.name' }).fillIn(profileName)), @@ -101,7 +107,7 @@ export default { cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); }, - linkProfileForNonMatches(profileName, forMatchesOrder = 1) { + linkActionProfileForNonMatches(profileName, forMatchesOrder = 1) { // TODO move to const cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); @@ -110,9 +116,18 @@ export default { cy.expect(Accordion('Overview').find(HTML(including(profileName))).exists()); }, + linkMatchProfileForNonMatches(profileName, forMatchesOrder = 1) { + // TODO move to const + cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); + cy.do(matchButton.click()); + ModalSelectProfile.searchProfileByName(profileName, 'match'); + ModalSelectProfile.selectProfile(profileName, 'match'); + cy.expect(Accordion('Overview').find(HTML(including(profileName))).exists()); + }, + linkMatchAndActionProfilesForSubMatches(matchProfileName, actionProfileName, forMatchesOrder = 0) { linkMatchProfileForMatches(matchProfileName); - cy.wait(3000); + waitLoading(); cy.get('[id*="type-selector-dropdown-ROOT-MATCH"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(actionProfileName); @@ -122,9 +137,9 @@ export default { linkMatchAndTwoActionProfilesForSubMatches(matchProfileName, firstActionProfileName, secondActionProfileName) { linkMatchProfileForSubMatches(matchProfileName); - cy.wait(3000); + waitLoading(); linkActionProfileForSubMatches(firstActionProfileName); - cy.wait(3000); + waitLoading(); linkActionProfileForSubMatches(secondActionProfileName); }, @@ -135,7 +150,7 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); - cy.wait(3000); + waitLoading(); // link action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); @@ -151,14 +166,14 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(matchProfileName))).exists()); - cy.wait(3000); + waitLoading(); // link first action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(firstActionProfileName); ModalSelectProfile.selectProfile(firstActionProfileName); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(firstActionProfileName))).exists()); - cy.wait(3000); + waitLoading(); // link second action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); @@ -174,21 +189,21 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(matchProfileName))).exists()); - cy.wait(3000); + waitLoading(); // link first action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(firstActionProfileName); ModalSelectProfile.selectProfile(firstActionProfileName); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(firstActionProfileName))).exists()); - cy.wait(3000); + waitLoading(); // link second action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(secondActionProfileName); ModalSelectProfile.selectProfile(secondActionProfileName); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(secondActionProfileName))).exists()); - cy.wait(3000); + waitLoading(); // link third action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); From e0371f0d9726223c61bfb264eac765b91f26ed3c Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:00:34 +0300 Subject: [PATCH 098/437] added test (#1512) --- .../delete-an-existing-job-profile.cy.js | 38 +++++++++++++++++++ .../job_profiles/jobProfileView.js | 18 ++++++--- .../data_import/job_profiles/jobProfiles.js | 3 +- 3 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 cypress/e2e/data-import/settings/delete-an-existing-job-profile.cy.js diff --git a/cypress/e2e/data-import/settings/delete-an-existing-job-profile.cy.js b/cypress/e2e/data-import/settings/delete-an-existing-job-profile.cy.js new file mode 100644 index 0000000000..0f9d884bb7 --- /dev/null +++ b/cypress/e2e/data-import/settings/delete-an-existing-job-profile.cy.js @@ -0,0 +1,38 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import InteractorsTools from '../../../support/utils/interactorsTools'; +import JobProfileView from '../../../support/fragments/data_import/job_profiles/jobProfileView'; +import { ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; + +describe('data-import', () => { + describe('Settings', () => { + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C2334 autotest job profile ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const calloutMessage = `The job profile "${jobProfile.profileName}" was successfully deleted`; + + before('create test data', () => { + cy.loginAsAdmin(); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.saveAndClose(); + InteractorsTools.closeCalloutMessage(calloutMessage); + JobProfiles.closeJobProfile(jobProfile.profileName); + }); + + it('C2334 Delete an existing job profile (folijet)', + { tags: [TestTypes.extendedPath, DevTeams.folijet] }, () => { + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfileView.delete(); + NewJobProfile.checkCalloutMessage(calloutMessage); + JobProfiles.verifyJobProfileAbsent(); + }); + }); +}); diff --git a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js index b232c62d0a..0f4f808c73 100644 --- a/cypress/support/fragments/data_import/job_profiles/jobProfileView.js +++ b/cypress/support/fragments/data_import/job_profiles/jobProfileView.js @@ -7,7 +7,8 @@ import { Accordion, MultiColumnList, MultiColumnListCell, MultiSelectOption, - Callout } from '../../../../../interactors'; + Callout, + Modal } from '../../../../../interactors'; const viewPane = Pane({ id:'view-job-profile-pane' }); const resultsPane = Pane({ id:'pane-results' }); @@ -28,6 +29,16 @@ export default { cy.do(viewPane.find(actionsButton).click()); cy.do(Button('Edit').click()); }, + duplicate:() => { + cy.do(viewPane.find(actionsButton).click()); + cy.do(Button('Duplicate').click()); + }, + delete:() => { + cy.do([viewPane.find(actionsButton).click(), + Button('Delete').click(), + Modal({ id:'delete-job-profile-modal' }).find(Button({ id:'clickable-delete-job-profile-modal-confirm' })).click() + ]); + }, addExistingTag:(tag) => { cy.intercept({ @@ -52,11 +63,6 @@ export default { cy.expect(ValueChipRoot(tag).absent()); }, - duplicate:() => { - cy.do(viewPane.find(actionsButton).click()); - cy.do(Button('Duplicate').click()); - }, - verifyJobProfileOpened:() => { cy.expect(resultsPane.exists()); cy.expect(viewPane.exists()); diff --git a/cypress/support/fragments/data_import/job_profiles/jobProfiles.js b/cypress/support/fragments/data_import/job_profiles/jobProfiles.js index 225ebe6144..93c3e93021 100644 --- a/cypress/support/fragments/data_import/job_profiles/jobProfiles.js +++ b/cypress/support/fragments/data_import/job_profiles/jobProfiles.js @@ -159,5 +159,6 @@ export default { .exists()); }, - verifyActionMenuAbsent:() => cy.expect(paneResults.find(actionsButton).absent()) + verifyActionMenuAbsent:() => cy.expect(paneResults.find(actionsButton).absent()), + verifyJobProfileAbsent:() => cy.expect(paneResults.find(HTML(including('The list contains no items'))).exists()) }; From 453f13dab21ac5eb44a62e4d9ff04b5af43f3cfa Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:12:05 +0300 Subject: [PATCH 099/437] added test (#1543) --- ...job-profile-with-repeatable-profiles.cy.js | 67 +++++++++++++++---- 1 file changed, 55 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js b/cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js index e8171df709..7b53cd2158 100644 --- a/cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js +++ b/cypress/e2e/data-import/settings/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles.cy.js @@ -81,17 +81,6 @@ describe('data-import', () => { existingRecordOption: NewMatchProfile.optionsList.holdingsType } } ]; - const linkedProfileNames = [ - collectionOfMatchProfiles[1].matchProfile.profileName, - collectionOfMatchProfiles[2].matchProfile.profileName, - collectionOfMatchProfiles[3].matchProfile.profileName, - collectionOfMappingAndActionProfiles[0].actionProfile.name, - collectionOfMatchProfiles[0].matchProfile.profileName, - collectionOfMatchProfiles[2].matchProfile.profileName, - collectionOfMatchProfiles[3].matchProfile.profileName, - collectionOfMappingAndActionProfiles[0].actionProfile.name, - collectionOfMappingAndActionProfiles[1].actionProfile.name - ]; before('create test data', () => { cy.createTempUser([ @@ -154,7 +143,18 @@ describe('data-import', () => { }); it('C385653 Verify that no duplicates of match and actions profiles appear after editing job profile with repeatable profiles (folijet)', - { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + { tags: [TestTypes.extendedPath, DevTeams.folijet] }, () => { + const linkedProfileNames = [ + collectionOfMatchProfiles[1].matchProfile.profileName, + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMatchProfiles[3].matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMatchProfiles[0].matchProfile.profileName, + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMatchProfiles[3].matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMappingAndActionProfiles[1].actionProfile.name + ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, profileName: `Import job profile with the same match and action profiles.${getRandomPostfix()}`, @@ -189,6 +189,49 @@ describe('data-import', () => { JobProfileView.verifyCalloutMessage(calloutMessage); JobProfileView.verifyLinkedProfiles(linkedProfileNames, linkedProfileNames.length); + JobProfiles.deleteJobProfile(jobProfile.profileName); + }); + + it('C385629 Verify that no duplicates of match and actions profiles appear after saving job profile with repeatable match/action profiles (folijet)', + { tags: [TestTypes.extendedPath, DevTeams.folijet] }, () => { + const linkedProfileNames = [ + collectionOfMatchProfiles[1].matchProfile.profileName, + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMatchProfiles[3].matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMappingAndActionProfiles[1].actionProfile.name, + collectionOfMatchProfiles[0].matchProfile.profileName, + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMatchProfiles[3].matchProfile.profileName, + collectionOfMappingAndActionProfiles[0].actionProfile.name, + collectionOfMappingAndActionProfiles[1].actionProfile.name + ]; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `Import job profile with the same match and action profiles.${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[2].matchProfile.profileName); + NewJobProfile.waitLoading(); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[3].matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.linkMatchProfileForNonMatches(collectionOfMatchProfiles[0].matchProfile.profileName, 5); + NewJobProfile.waitLoading(); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[2].matchProfile.profileName, 5); + NewJobProfile.waitLoading(); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[3].matchProfile.profileName, 5); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[0].actionProfile.name, 5); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name, 5); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + JobProfileView.verifyLinkedProfiles(linkedProfileNames, linkedProfileNames.length); + JobProfiles.deleteJobProfile(jobProfile.profileName); }); }); From a1e143e4112efd73bbb0d715e19ad595fa8429b5 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Tue, 5 Sep 2023 16:22:33 +0500 Subject: [PATCH 100/437] FAT-7723 (#1530) --- ...ed.cy.js => filter-claimed-returned.cy.js} | 23 +-- .../filter-declared-lost.cy.js | 63 +++---- ...g.cy.js => filter-marked-as-missing.cy.js} | 56 +++--- .../circulation-log/filter-notice-send.cy.js | 137 ++++++++++++++ ...ort-instance-records-invalid-profile.cy.js | 3 - .../data-export/instance-hrid-004-field.cy.js | 3 - cypress/e2e/ideyalabs/circulationLog.cy.js | 36 ---- ...notice-duplication-works-as-expected.cy.js | 2 +- .../e2e/staff-slips/add-notice-token.cy.js | 2 +- .../fragments/circulation-log/searchPane.js | 1 - .../circulation/notice-policy-template.js | 11 +- .../fragments/circulation/notice-policy.js | 22 +-- .../data-export/dataExportResults.js | 168 ++++++++---------- 13 files changed, 290 insertions(+), 237 deletions(-) rename cypress/e2e/circulation-log/{claimed-returned.cy.js => filter-claimed-returned.cy.js} (83%) rename cypress/e2e/circulation-log/{marked-as-missing.cy.js => filter-marked-as-missing.cy.js} (65%) create mode 100644 cypress/e2e/circulation-log/filter-notice-send.cy.js diff --git a/cypress/e2e/circulation-log/claimed-returned.cy.js b/cypress/e2e/circulation-log/filter-claimed-returned.cy.js similarity index 83% rename from cypress/e2e/circulation-log/claimed-returned.cy.js rename to cypress/e2e/circulation-log/filter-claimed-returned.cy.js index 78ce1bd35c..b905b89cf2 100644 --- a/cypress/e2e/circulation-log/claimed-returned.cy.js +++ b/cypress/e2e/circulation-log/filter-claimed-returned.cy.js @@ -2,7 +2,6 @@ import TopMenu from '../../support/fragments/topMenu'; import TestTypes from '../../support/dictionary/testTypes'; import SearchPane from '../../support/fragments/circulation-log/searchPane'; import getRandomPostfix from '../../support/utils/stringTools'; -import permissions from '../../support/dictionary/permissions'; import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; import UsersCard from '../../support/fragments/users/usersCard'; import devTeams from '../../support/dictionary/devTeams'; @@ -17,7 +16,6 @@ import ConfirmClaimReturnedModal from '../../support/fragments/users/loans/confi import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; let user; -let userId; let servicePointId; const item = { instanceName: `Barcode search test ${Number(new Date())}`, @@ -26,15 +24,9 @@ const item = { describe('circulation-log', () => { before('create checked out item', () => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.circulationLogAll.gui, - permissions.usersViewRequests.gui - ]) + cy.createTempUser() .then(userProperties => { user = userProperties; - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password, { path: TopMenu.circulationLogPath, waiter: SearchPane.waitLoading }); ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) .then((res) => { servicePointId = res[0].id; @@ -44,7 +36,7 @@ describe('circulation-log', () => { query: `"personal.lastName"="${userProperties.username}" and "active"="true"` }) .then(() => { - UserEdit.addServicePointViaApi(servicePointId, userId); + UserEdit.addServicePointViaApi(servicePointId, user.userId); cy.getUserServicePoints(Cypress.env('users')[0].id); InventoryInstances.createInstanceViaApi(item.instanceName, item.ITEM_BARCODE); }) @@ -55,22 +47,21 @@ describe('circulation-log', () => { servicePointId, }); }); - cy.loginAsAdmin(); - cy.visit(TopMenu.usersPath); + cy.loginAsAdmin({ path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading }); }); }); after('delete test data', () => { - ItemActions.markItemAsMissingByUserIdViaApi(userId).then(() => { + ItemActions.markItemAsMissingByUserIdViaApi(user.userId).then(() => { InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.ITEM_BARCODE); - Users.deleteViaApi(userId); + Users.deleteViaApi(user.userId); }); }); it('C16997 Filter circulation log by Claimed returned (firebird)', { tags: [TestTypes.criticalPath, devTeams.firebird] }, () => { UsersSearchPane.searchByStatus('Active'); - UsersSearchPane.searchByKeywords(userId); - UsersSearchPane.openUser(userId); + UsersSearchPane.searchByKeywords(user.userId); + UsersSearchPane.openUser(user.userId); UsersCard.openLoans(); UsersCard.showOpenedLoans(); LoansPage.checkAll(); diff --git a/cypress/e2e/circulation-log/filter-declared-lost.cy.js b/cypress/e2e/circulation-log/filter-declared-lost.cy.js index 8de08eab12..b5b94c44b6 100644 --- a/cypress/e2e/circulation-log/filter-declared-lost.cy.js +++ b/cypress/e2e/circulation-log/filter-declared-lost.cy.js @@ -5,7 +5,6 @@ import TestTypes from '../../support/dictionary/testTypes'; import Users from '../../support/fragments/users/users'; import SearchPane from '../../support/fragments/circulation-log/searchPane'; import getRandomPostfix from '../../support/utils/stringTools'; -import permissions from '../../support/dictionary/permissions'; import devTeams from '../../support/dictionary/devTeams'; import UserEdit from '../../support/fragments/users/userEdit'; import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; @@ -35,45 +34,41 @@ const ownerBody = { describe('circulation-log', () => { before('create test data', () => { - cy.createTempUser([ - permissions.circulationLogAll.gui, - ]) - .then(userProperties => { - user = userProperties; + cy.createTempUser([]).then(userProperties => { + user = userProperties; + ServicePoints.createViaApi(testData.userServicePoint); + testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); + Location.createViaApi(testData.defaultLocation); + UserEdit.addServicePointViaApi(testData.userServicePoint.id, user.userId); - ServicePoints.createViaApi(testData.userServicePoint); - testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); - Location.createViaApi(testData.defaultLocation); - UserEdit.addServicePointViaApi(testData.userServicePoint.id, user.userId); - - item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); - cy.getHoldings({ limit: 1, query: `"instanceId"="${item.instanceId}"` }) - .then((holdings) => { - cy.updateHoldingRecord(holdings[0].id, { - ...holdings[0], - permanentLocationId: testData.defaultLocation.id - }); + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); + cy.getHoldings({ limit: 1, query: `"instanceId"="${item.instanceId}"` }) + .then((holdings) => { + cy.updateHoldingRecord(holdings[0].id, { + ...holdings[0], + permanentLocationId: testData.defaultLocation.id }); - - Checkout.checkoutItemViaApi({ - itemBarcode: item.barcode, - userBarcode: user.barcode, - servicePointId: testData.userServicePoint.id, }); - UsersOwners.createViaApi(ownerBody).then((ownerResponse) => { - testData.ownerId = ownerResponse.id; - PaymentMethods.createViaApi(testData.ownerId).then((paymentMethod) => { - testData.paymentMethodId = paymentMethod.id; - }); - }); - UserLoans.getUserLoansIdViaApi(user.userId).then((userLoans) => { - UserLoans.declareLoanLostViaApi({ - servicePointId: testData.userServicePoint.id, - declaredLostDateTime: moment.utc().format(), - }, userLoans.loans[0].id); + Checkout.checkoutItemViaApi({ + itemBarcode: item.barcode, + userBarcode: user.barcode, + servicePointId: testData.userServicePoint.id, + }); + + UsersOwners.createViaApi(ownerBody).then((ownerResponse) => { + testData.ownerId = ownerResponse.id; + PaymentMethods.createViaApi(testData.ownerId).then((paymentMethod) => { + testData.paymentMethodId = paymentMethod.id; }); }); + UserLoans.getUserLoansIdViaApi(user.userId).then((userLoans) => { + UserLoans.declareLoanLostViaApi({ + servicePointId: testData.userServicePoint.id, + declaredLostDateTime: moment.utc().format(), + }, userLoans.loans[0].id); + }); + }); cy.loginAsAdmin({ path: TopMenu.circulationLogPath, waiter: SearchPane.waitLoading }); }); diff --git a/cypress/e2e/circulation-log/marked-as-missing.cy.js b/cypress/e2e/circulation-log/filter-marked-as-missing.cy.js similarity index 65% rename from cypress/e2e/circulation-log/marked-as-missing.cy.js rename to cypress/e2e/circulation-log/filter-marked-as-missing.cy.js index 501d49faac..fa28480b0b 100644 --- a/cypress/e2e/circulation-log/marked-as-missing.cy.js +++ b/cypress/e2e/circulation-log/filter-marked-as-missing.cy.js @@ -2,7 +2,6 @@ import moment from 'moment'; import TopMenu from '../../support/fragments/topMenu'; import SearchPane from '../../support/fragments/circulation-log/searchPane'; import getRandomPostfix from '../../support/utils/stringTools'; -import permissions from '../../support/dictionary/permissions'; import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; import UsersCard from '../../support/fragments/users/usersCard'; import devTeams from '../../support/dictionary/devTeams'; @@ -24,39 +23,32 @@ const item = { describe('circulation-log', () => { before('creating user and checking out item', () => { - cy.createTempUser([ - permissions.inventoryAll.gui, - permissions.circulationLogAll.gui, - permissions.checkoutAll.gui, - permissions.uiUsersViewLoans.gui, - permissions.uiUsersLoansClaimReturned.gui, - ]) - .then(userProperties => { - user = { ...userProperties }; - ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) - .then((res) => { - servicePointId = res[0].id; - }) - .then(() => { - UserEdit.addServicePointViaApi(servicePointId, user.userId); - InventoryInstances.createInstanceViaApi(item.name, item.barcode); - }) - .then(() => { - Checkout.checkoutItemViaApi({ - itemBarcode: item.barcode, - userBarcode: user.barcode, - servicePointId, - }); - }) - .then(() => { - UserLoans.getUserLoansIdViaApi(user.userId).then((userLoans) => { - userLoans.loans.forEach(({ id }) => { - UserLoans.claimItemReturnedViaApi({ itemClaimedReturnedDateTime: moment.utc().format() }, id); - }); + cy.createTempUser([]).then(userProperties => { + user = userProperties; + ServicePoints.getViaApi({ limit: 1, query: 'pickupLocation=="true"' }) + .then((res) => { + servicePointId = res[0].id; + }) + .then(() => { + UserEdit.addServicePointViaApi(servicePointId, user.userId); + InventoryInstances.createInstanceViaApi(item.name, item.barcode); + }) + .then(() => { + Checkout.checkoutItemViaApi({ + itemBarcode: item.barcode, + userBarcode: user.barcode, + servicePointId, + }); + }) + .then(() => { + UserLoans.getUserLoansIdViaApi(user.userId).then((userLoans) => { + userLoans.loans.forEach(({ id }) => { + UserLoans.claimItemReturnedViaApi({ itemClaimedReturnedDateTime: moment.utc().format() }, id); }); }); - cy.loginAsAdmin({ path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading }); - }); + }); + cy.loginAsAdmin({ path: TopMenu.usersPath, waiter: UsersSearchPane.waitLoading }); + }); }); after('cleaning up test data', () => { diff --git a/cypress/e2e/circulation-log/filter-notice-send.cy.js b/cypress/e2e/circulation-log/filter-notice-send.cy.js new file mode 100644 index 0000000000..64b8fec157 --- /dev/null +++ b/cypress/e2e/circulation-log/filter-notice-send.cy.js @@ -0,0 +1,137 @@ +import uuid from 'uuid'; +import moment from 'moment'; +import permissions from '../../support/dictionary/permissions'; +import TopMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +import UserEdit from '../../support/fragments/users/userEdit'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import Users from '../../support/fragments/users/users'; +import SearchPane from '../../support/fragments/circulation-log/searchPane'; +import CirculationRules from '../../support/fragments/circulation/circulation-rules'; +import NoticePolicyApi from '../../support/fragments/circulation/notice-policy'; +import NoticePolicyTemplateApi from '../../support/fragments/circulation/notice-policy-template'; +import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; +import CheckOutActions from '../../support/fragments/check-out-actions/check-out-actions'; +import Checkout from '../../support/fragments/checkout/checkout'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import getRandomPostfix from '../../support/utils/stringTools'; + +let user; +let addedCirculationRule; +const templateBody = { + active: true, + category: 'Loan', + description: 'Template created by autotest team', + id: uuid(), + localizedTemplates: { + en: { + body: '
Test_email_body{{item.title}}
', + header: 'Subject_Test' + } + }, + name: `Test_template_${getRandomPostfix()}`, + outputFormats: ['text/html'], + templateResolver: 'mustache', +}; +const noticePolicyName = `noticePolicy_${getRandomPostfix()}`; +const item = { + instanceTitle: `Instance ${getRandomPostfix()}`, + barcode: `item-${getRandomPostfix()}` +}; +const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotest receive notice check in', uuid()), +}; + +describe('circulation-log', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.checkoutAll.gui, + ]) + .then(userProperties => { + user = userProperties; + + ServicePoints.createViaApi(testData.userServicePoint); + cy.createLoanType({ + name: `type_${getRandomPostfix()}`, + }).then((loanType) => { + testData.loanTypeId = loanType.id; + }); + + UserEdit.addServicePointViaApi(testData.userServicePoint.id, + user.userId, testData.userServicePoint.id); + + cy.getCirculationRules().then((response) => { + testData.baseRules = response.rulesAsText; + testData.ruleProps = CirculationRules.getRuleProps(response.rulesAsText); + }); + + NoticePolicyTemplateApi.createViaApi(templateBody).then(() => { + NoticePolicyApi.createWithTemplateApi(noticePolicyName, templateBody.id, 'Check out'); + }); + + InventoryInstances.createInstanceViaApi(item.instanceTitle, item.barcode); + cy.getItems({ limit: 1, expandAll: true, query: `"barcode"=="${item.barcode}"` }) + .then((res) => { + res.permanentLoanType = { id: testData.loanTypeId }; + cy.updateItemViaApi(res); + }); + + cy.getNoticePolicy({ query: `name=="${noticePolicyName}"` }).then(response => { + testData.ruleProps.n = response[0].id; + addedCirculationRule = 't ' + testData.loanTypeId + ': i ' + testData.ruleProps.i + ' l ' + testData.ruleProps.l + ' r ' + testData.ruleProps.r + ' o ' + testData.ruleProps.o + ' n ' + testData.ruleProps.n; + CirculationRules.addRuleViaApi(testData.baseRules, testData.ruleProps, 't ', testData.loanTypeId); + }); + + cy.login(user.username, user.password, { path: TopMenu.checkOutPath, waiter: Checkout.waitLoading }); + CheckOutActions.checkOutUser(user.barcode); + Checkout.checkoutItemViaApi({ + id: uuid(), + itemBarcode: item.barcode, + loanDate: moment.utc().format(), + servicePointId: testData.userServicePoint.id, + userBarcode: user.barcode, + }); + CheckOutActions.endCheckOutSession(); + cy.loginAsAdmin({ path: TopMenu.circulationLogPath, waiter: SearchPane.waitLoading }); + }); + }); + + after('delete test data', () => { + CheckInActions.checkinItemViaApi({ + itemBarcode: item.barcode, + servicePointId: testData.userServicePoint.id, + checkInDate: moment.utc().format(), + }); + UserEdit.changeServicePointPreferenceViaApi(user.userId, [testData.userServicePoint.id]); + CirculationRules.deleteRuleViaApi(addedCirculationRule); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + NoticePolicyApi.deleteViaApi(testData.ruleProps.n); + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + cy.deleteLoanType(testData.loanTypeId); + NoticePolicyTemplateApi.getViaApi({ query: `name=${templateBody.name}` }).then((templateId) => { + NoticePolicyTemplateApi.deleteViaApi(templateId); + }); + }); + + it('C17092 Filter circulation log by (notice) send (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + const searchResultsData = { + userBarcode: user.barcode, + itemBarcode: item.barcode, + object: 'Notice', + circAction: 'Send', + servicePoint: testData.userServicePoint.name, + source: 'System', + desc: `Template: ${templateBody.name}. Triggering event: Check out.`, + }; + + SearchPane.setFilterOptionFromAccordion('notice', 'Send'); + SearchPane.verifyResultCells(); + SearchPane.checkResultSearch(searchResultsData); + + SearchPane.searchByUserBarcode(user.barcode); + SearchPane.verifyResultCells(); + SearchPane.checkResultSearch(searchResultsData); + }); +}); diff --git a/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js b/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js index 018af7b061..1cb43b9450 100644 --- a/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js +++ b/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js @@ -12,9 +12,6 @@ import Users from '../../support/fragments/users/users'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import generateItemBarcode from '../../support/utils/generateItemBarcode'; -// 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 item = { instanceName: `testBulkEdit_${getRandomPostfix()}`, diff --git a/cypress/e2e/data-export/instance-hrid-004-field.cy.js b/cypress/e2e/data-export/instance-hrid-004-field.cy.js index 1239102cd3..163047f94b 100644 --- a/cypress/e2e/data-export/instance-hrid-004-field.cy.js +++ b/cypress/e2e/data-export/instance-hrid-004-field.cy.js @@ -12,9 +12,6 @@ import { getLongDelay } from '../../support/utils/cypressTools'; import DataExportResults from '../../support/fragments/data-export/dataExportResults'; import ExportFile from '../../support/fragments/data-export/exportFile'; -// 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 item = { barcode: getRandomPostfix(), diff --git a/cypress/e2e/ideyalabs/circulationLog.cy.js b/cypress/e2e/ideyalabs/circulationLog.cy.js index 9da296c3f6..37215da454 100644 --- a/cypress/e2e/ideyalabs/circulationLog.cy.js +++ b/cypress/e2e/ideyalabs/circulationLog.cy.js @@ -1,25 +1,11 @@ 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.skip('CirculationLog App', () => { @@ -27,28 +13,6 @@ describe.skip('CirculationLog App', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C17092 Filter circulation log by (notice) send', { tags: [testTypes.criticalPath] }, () => { - 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'); diff --git a/cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js b/cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js index b71032e6dd..42a2c7eaac 100644 --- a/cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js +++ b/cypress/e2e/recieve-notice/patron-notice-duplication-works-as-expected.cy.js @@ -22,7 +22,7 @@ describe('Patron Notices', () => { ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }).then((servicePoints) => { servicePointId = servicePoints[0].id; }); - NoticePolicyTemplate.createViaApi('Loan').then((noticeTemplateResp) => { + NoticePolicyTemplate.createViaApi().then((noticeTemplateResp) => { testData.noticeTemplateBody = noticeTemplateResp.body; }); PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { diff --git a/cypress/e2e/staff-slips/add-notice-token.cy.js b/cypress/e2e/staff-slips/add-notice-token.cy.js index e8969f743f..eccef4cca3 100644 --- a/cypress/e2e/staff-slips/add-notice-token.cy.js +++ b/cypress/e2e/staff-slips/add-notice-token.cy.js @@ -23,7 +23,7 @@ describe('Patron Notices', () => { ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }).then((servicePoints) => { servicePointId = servicePoints[0].id; }); - NoticePolicyTemplate.createViaApi('Loan').then((noticeTemplateResp) => { + NoticePolicyTemplate.createViaApi().then((noticeTemplateResp) => { testData.noticeTemplateBody = noticeTemplateResp.body; }); PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { diff --git a/cypress/support/fragments/circulation-log/searchPane.js b/cypress/support/fragments/circulation-log/searchPane.js index 2dbeba072a..c3b1f7a002 100644 --- a/cypress/support/fragments/circulation-log/searchPane.js +++ b/cypress/support/fragments/circulation-log/searchPane.js @@ -41,7 +41,6 @@ export default { cy.do([ Accordion({ id: 'loan' }).clickHeader(), Checkbox({ id: 'clickable-filter-loan-checked-out' }).click() - // ,cy.do(TextField({ name: 'itemBarcode' }).fillIn(data)), ]); }, diff --git a/cypress/support/fragments/circulation/notice-policy-template.js b/cypress/support/fragments/circulation/notice-policy-template.js index e7d5bc36b4..fd71150c5b 100644 --- a/cypress/support/fragments/circulation/notice-policy-template.js +++ b/cypress/support/fragments/circulation/notice-policy-template.js @@ -5,6 +5,7 @@ import { Button, Modal, including } from '../../../../interactors'; const defaultNoticeTemplateBody = { active: true, + category: "Loan", description: 'Notice_policy_template_description', id: uuid(), localizedTemplates: { @@ -28,13 +29,11 @@ export default { ]); cy.do(Button('Close').click()); }, - createViaApi(noticeTemplateCategory) { - return cy.okapiRequest({ method: 'POST', + createViaApi(body = defaultNoticeTemplateBody) { + return cy.okapiRequest({ + method: 'POST', path: 'templates', - body: { - category: noticeTemplateCategory, - ...defaultNoticeTemplateBody - }, + body, searchParams: { query: '(cq l.allRecords=1) and category=""', limit: 1000, diff --git a/cypress/support/fragments/circulation/notice-policy.js b/cypress/support/fragments/circulation/notice-policy.js index bac10b5a08..e2fefae7c6 100644 --- a/cypress/support/fragments/circulation/notice-policy.js +++ b/cypress/support/fragments/circulation/notice-policy.js @@ -33,29 +33,21 @@ export const NOTICE_CATEGORIES = { } }; -const defaultNotice = { - 'format': 'Email', - 'realTime': false, -}; - -export const defaultNoticePolicy = { - name: getTestEntityValue(), - description: 'description', - active: true, - id: uuid(), -}; - export default { - createWithTemplateApi(createdTemplateId, sendWhenOption) { + createWithTemplateApi(policyName, createdTemplateId, sendWhenOption) { return cy .okapiRequest({ method: 'POST', path: 'patron-notice-policy-storage/patron-notice-policies', body: { - ...defaultNoticePolicy, + name: policyName, + description: 'description', + active: true, + id: uuid(), loanNotices: [{ - ...defaultNotice, + 'format': 'Email', + 'realTime': false, templateId: createdTemplateId, sendOptions: { sendWhen: sendWhenOption, diff --git a/cypress/support/fragments/data-export/dataExportResults.js b/cypress/support/fragments/data-export/dataExportResults.js index 555b5cb524..e50d3351af 100644 --- a/cypress/support/fragments/data-export/dataExportResults.js +++ b/cypress/support/fragments/data-export/dataExportResults.js @@ -1,9 +1,7 @@ import { MultiColumnListCell } from '../../../../interactors'; -import { MultiColumnListRow } from '../../../../interactors/multi-column-list'; import DateTools from '../../utils/dateTools'; const getSearchResult = (row = 0, col = 0) => MultiColumnListCell({ 'row': row, 'columnIndex': col }); -const getRowByContent = (content) => MultiColumnListCell(content).row(); const quickExportFileNameMask = /quick-export-\d{1,3}.mrc/gm; export default { @@ -19,104 +17,96 @@ export default { }, verifySuccessExportResultCells(resultFileName, recordsCount, jobId, userName = null, jobType = 'instances') { - getRowByContent(resultFileName).then((row) => { - const exportRow = MultiColumnListRow({ index: row }); - - const resultRow = { - fileName: exportRow.find(MultiColumnListCell({ columnIndex: 0 })), - status: exportRow.find(MultiColumnListCell({ columnIndex: 1 })), - total: exportRow.find(MultiColumnListCell({ columnIndex: 2 })), - exported: exportRow.find(MultiColumnListCell({ columnIndex: 3 })), - failed: exportRow.find(MultiColumnListCell({ columnIndex: 4 })), - jobProfile: exportRow.find(MultiColumnListCell({ columnIndex: 5 })), - endedRunning: exportRow.find(MultiColumnListCell({ columnIndex: 7 })), - runBy: exportRow.find(MultiColumnListCell({ columnIndex: 8 })), - id: exportRow.find(MultiColumnListCell({ columnIndex: 9 })), - }; - cy.getAdminToken().then(() => { - cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { - const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; - cy.do([ - resultRow.status.is({ content: 'Completed' }), - resultRow.total.is({ content: recordsCount.toString() }), - resultRow.exported.is({ content: recordsCount.toString() }), - resultRow.failed.is({ content: '' }), - resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), - resultRow.runBy.is({ content: userNameToVerify }), - resultRow.id.is({ content: jobId.toString() }) - ]); - }); + const resultRow = { + fileName: MultiColumnListCell({ 'row': 0, columnIndex: 0 }), + status: MultiColumnListCell({ 'row': 0, columnIndex: 1 }), + total: MultiColumnListCell({ 'row': 0, columnIndex: 2 }), + exported: MultiColumnListCell({ 'row': 0, columnIndex: 3 }), + failed: MultiColumnListCell({ 'row': 0, columnIndex: 4 }), + jobProfile: MultiColumnListCell({ 'row': 0, columnIndex: 5 }), + endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), + runBy: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), + id: MultiColumnListCell({ 'row': 0, columnIndex: 9 }), + }; + cy.getAdminToken().then(() => { + cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { + const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; + cy.do([ + resultRow.status.is({ content: 'Completed' }), + resultRow.total.is({ content: recordsCount.toString() }), + resultRow.exported.is({ content: recordsCount.toString() }), + resultRow.failed.is({ content: '' }), + resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), + resultRow.runBy.is({ content: userNameToVerify }), + resultRow.id.is({ content: jobId.toString() }) + ]); }); + }); - // verify file name - cy.do( - resultRow.fileName.perform(element => { - expect(element.innerText).to.equal(resultFileName); - expect(element.innerText).to.include(`-${jobId}.mrc`); - }) - ); + // verify file name + cy.do( + resultRow.fileName.perform(element => { + expect(element.innerText).to.equal(resultFileName); + expect(element.innerText).to.include(`-${jobId}.mrc`); + }) + ); - // verify date (ended running) - const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; - cy.do(resultRow.endedRunning.perform(element => { - const actualDate = element.innerText; - expect(actualDate).to.match(dateString); + // verify date (ended running) + const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; + cy.do(resultRow.endedRunning.perform(element => { + const actualDate = element.innerText; + expect(actualDate).to.match(dateString); - const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); - DateTools.verifyDate(dateWithUTC, 180000); - })); - }); + const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); + DateTools.verifyDate(dateWithUTC, 180000); + })); }, verifyFailedExportResultCells(resultFileName, recordsCount, jobId, userName = null, jobType = 'instances', invalidQuery = false) { - getRowByContent(resultFileName).then((row) => { - const exportRow = MultiColumnListRow({ index: row }); + const resultRow = { + fileName: MultiColumnListCell({ 'row': 0, columnIndex: 0 }), + status: MultiColumnListCell({ 'row': 0, columnIndex: 1 }), + total: MultiColumnListCell({ 'row': 0, columnIndex: 2 }), + exported: MultiColumnListCell({ 'row': 0, columnIndex: 3 }), + failed: MultiColumnListCell({ 'row': 0, columnIndex: 4 }), + jobProfile: MultiColumnListCell({ 'row': 0, columnIndex: 5 }), + endedRunning: MultiColumnListCell({ 'row': 0, columnIndex: 7 }), + runBy: MultiColumnListCell({ 'row': 0, columnIndex: 8 }), + id: MultiColumnListCell({ 'row': 0, columnIndex: 9 }), + }; + cy.getAdminToken().then(() => { + cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { + const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; + cy.do([ + resultRow.status.is({ content: 'Fail' }), + resultRow.total.is({ content: recordsCount.toString() }), + resultRow.exported.is({ content: '' }), + resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), + resultRow.runBy.is({ content: userNameToVerify }), + resultRow.id.is({ content: jobId.toString() }) + ]); - const resultRow = { - fileName: exportRow.find(MultiColumnListCell({ columnIndex: 0 })), - status: exportRow.find(MultiColumnListCell({ columnIndex: 1 })), - total: exportRow.find(MultiColumnListCell({ columnIndex: 2 })), - exported: exportRow.find(MultiColumnListCell({ columnIndex: 3 })), - failed: exportRow.find(MultiColumnListCell({ columnIndex: 4 })), - jobProfile: exportRow.find(MultiColumnListCell({ columnIndex: 5 })), - endedRunning: exportRow.find(MultiColumnListCell({ columnIndex: 7 })), - runBy: exportRow.find(MultiColumnListCell({ columnIndex: 8 })), - id: exportRow.find(MultiColumnListCell({ columnIndex: 9 })), - }; - cy.getAdminToken().then(() => { - cy.getUsers({ limit: 1, query: `username=${userName || Cypress.env('diku_login')}` }).then(() => { - const userNameToVerify = `${Cypress.env('users')[0].personal.firstName} ${Cypress.env('users')[0].personal.lastName}`; - cy.do([ - resultRow.status.is({ content: 'Fail' }), - resultRow.total.is({ content: recordsCount.toString() }), - resultRow.exported.is({ content: '' }), - resultRow.jobProfile.is({ content: `Default ${jobType} export job profile` }), - resultRow.runBy.is({ content: userNameToVerify }), - resultRow.id.is({ content: jobId.toString() }) - ]); - - if (invalidQuery) cy.do(resultRow.failed.is({ content: '' })); - else cy.do(resultRow.failed.is({ content: recordsCount.toString() })); - }); + if (invalidQuery) cy.do(resultRow.failed.is({ content: '' })); + else cy.do(resultRow.failed.is({ content: recordsCount.toString() })); }); + }); - // verify file name - cy.do( - resultRow.fileName.perform(element => { - expect(element.innerText).to.equal(resultFileName); - expect(element.innerText).to.include(`-${jobId}.mrc`); - }) - ); + // verify file name + cy.do( + resultRow.fileName.perform(element => { + expect(element.innerText).to.equal(resultFileName); + expect(element.innerText).to.include(`-${jobId}.mrc`); + }) + ); - // verify date (ended running) - const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; - cy.do(resultRow.endedRunning.perform(element => { - const actualDate = element.innerText; - expect(actualDate).to.match(dateString); + // verify date (ended running) + const dateString = /\d{1,2}\/\d{1,2}\/\d{4},\s\d{1,2}:\d{2}\s\w{2}/gm; + cy.do(resultRow.endedRunning.perform(element => { + const actualDate = element.innerText; + expect(actualDate).to.match(dateString); - const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); - DateTools.verifyDate(dateWithUTC, 180000); - })); - }); + const dateWithUTC = Date.parse(new Date(actualDate + ' UTC')); + DateTools.verifyDate(dateWithUTC, 180000); + })); }, }; From 66168a1dd87bfaecf9434ca83763fa8560b3706d Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Tue, 5 Sep 2023 18:49:58 +0300 Subject: [PATCH 101/437] FAT-5051-C360098 (#1534) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-5051: test added --- cypress/e2e/inventory/marc-bib-edit.cy.js | 102 +++++++++++++++++++ cypress/fixtures/marcBibFileC360098.mrc | 1 + cypress/support/fragments/quickMarcEditor.js | 34 ++++++- 3 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/inventory/marc-bib-edit.cy.js create mode 100644 cypress/fixtures/marcBibFileC360098.mrc diff --git a/cypress/e2e/inventory/marc-bib-edit.cy.js b/cypress/e2e/inventory/marc-bib-edit.cy.js new file mode 100644 index 0000000000..4941da4cba --- /dev/null +++ b/cypress/e2e/inventory/marc-bib-edit.cy.js @@ -0,0 +1,102 @@ +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 InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import getRandomPostfix from '../../support/utils/stringTools'; +import DataImport from '../../support/fragments/data_import/dataImport'; +import { JOB_STATUS_NAMES } from '../../support/constants'; +import JobProfiles from '../../support/fragments/data_import/job_profiles/jobProfiles'; +import Logs from '../../support/fragments/data_import/logs/logs'; + +describe('MARC -> MARC Bibliographic -> Edit MARC bib', () => { + const testData = { + tag001: '001', + tag245: '245', + tag504: '504', + tag555: '555', + tag504FirstUpdatedTag: '45', + tag504SecondUpdatedTag: '45e', + instanceNotesAccordion: 'Instance notes', + instanceTitle: 'C360098 Narysy z historyi belaruskaha mastatstva / Mikola Shchakatsikhin.', + instanceBibliographyNote: 'Includes bibliographical references and index' + }; + const marcFile = { + marc: 'marcBibFileC360098.mrc', + fileName: `testMarcFileC360098.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib' + }; + const createdInstanceIDs = []; + + before(() => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + createdInstanceIDs.push(link.split('/')[5]); + }); + }); + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdInstanceIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + }); + }); + }); + + after('Deleting created users, Instances', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdInstanceIDs[0]); + }); + + it('C360098 MARC Bib | MARC tag validation checks when clicks on the "Save & keep editing" button (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + QuickMarcEditor.updateExistingTagValue(20, ''); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.verifyAndDismissWrongTagLengthCallout(); + QuickMarcEditor.verifyTagValue(20, ''); + QuickMarcEditor.updateExistingTagValue(20, testData.tag504FirstUpdatedTag); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.verifyAndDismissWrongTagLengthCallout(); + QuickMarcEditor.verifyTagValue(20, testData.tag504FirstUpdatedTag); + QuickMarcEditor.updateExistingTagValue(20, testData.tag504SecondUpdatedTag); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.verifyInvalidTagCallout(); + QuickMarcEditor.verifyTagValue(20, testData.tag504SecondUpdatedTag); + QuickMarcEditor.updateExistingTagValue(20, testData.tag245); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.verifyMultiple245TagCallout(); + QuickMarcEditor.verifyTagValue(20, testData.tag245); + QuickMarcEditor.updateExistingTagValue(20, testData.tag504); + QuickMarcEditor.updateExistingTagValue(14, testData.tag555); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.verifyNo245TagCallout(); + QuickMarcEditor.verifyTagValue(14, testData.tag555); + QuickMarcEditor.updateExistingTagValue(14, testData.tag245); + QuickMarcEditor.updateExistingTagValue(16, ''); + QuickMarcEditor.updateTagNameToLockedTag(16, testData.tag001); + QuickMarcEditor.checkFourthBoxDisabled(16); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.verifyMultiple001TagCallout(); + QuickMarcEditor.verifyTagValue(16, testData.tag001); + QuickMarcEditor.checkFourthBoxDisabled(16); + QuickMarcEditor.closeWithoutSavingAfterChange(); + InventoryInstance.waitLoading(); + InventoryInstance.checkInstanceTitle(testData.instanceTitle); + InventoryInstance.checkDetailViewOfInstance(testData.instanceNotesAccordion, testData.instanceBibliographyNote); + }); +}); diff --git a/cypress/fixtures/marcBibFileC360098.mrc b/cypress/fixtures/marcBibFileC360098.mrc new file mode 100644 index 0000000000..6309a0ed63 --- /dev/null +++ b/cypress/fixtures/marcBibFileC360098.mrc @@ -0,0 +1 @@ +01104nam a22002891a 450000100100000000500170001000800410002703500210006890600450008995500290013401000170016304000130018004100110019304300120020405000170021610000400023324500790027326001110035230000290046350000390049250000700053150000710060150400510067265000210072365100210074474000490076570036009819940321084959.2940321s1970 bw a b 001 0 belo  9(DLC) 72209527 a7bibccorignewd1encipf19gy-gencatlg aNEW INPUT; sd13 03-21-94 a 72209527  aDLCcDLC0 abeleng ae-ur-bw00aN6995.W5bS31 aShchakatsikhin, Mikola,d1896-1940.10aC360098 Narysy z historyi belaruskaha mastatstva /cMikola Shchakatsikhin. aNʹi︠u︡ Ërk :bKryvitskae (Vi︠a︡likalitoŭskae) navukovae tavarystva Prantsisha Skaryny,c1970. a278 p. :bill. ;c21 cm. aPreface in Belarusian and English. aTitle on added t.p.: Outline of the history of Belarus fine arts. aOriginally published: Mensk : Instytut belaruskae kulʹtury, 1928. aIncludes bibliographical references and index. 0aArt, Belarusian. aBelarusgHistory0 aOutline of the history of Belarus fine arts. \ No newline at end of file diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index fa82008175..1e4ca1fdd1 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -35,6 +35,12 @@ const calloutUpdatedLinkedBibRecord = Callout('Record has been updated. 2 linked const calloutNonEditableLdrBib = Callout('Record cannot be saved. Please check the Leader. Only positions 5, 6, 7, 8, 17, 18 and/or 19 can be edited in the Leader.'); const calloutDelete008Error = Callout('Record cannot be saved without 008 field'); const calloutAfterSaveAndCloseNewRecord = Callout('Record created.'); +const calloutMarcTagWrongLength = Callout('Record cannot be saved. A MARC tag must contain three characters.'); +const calloutInvalidMarcTag = Callout('Invalid MARC tag. Please try again.'); +const calloutNo245MarcTag = Callout('Record cannot be saved without field 245.'); +const calloutMultiple245MarcTags = Callout('Record cannot be saved with more than one field 245.'); +const calloutMultiple001MarcTags = Callout('Record cannot be saved. Can only have one MARC 001.'); + const closeButton = Button({ icon: 'times' }); const validRecord = InventoryInstance.validOCLC; const validNewMarBibLDR = '00000naa\\a2200000uu\\4500'; @@ -736,7 +742,7 @@ export default { }, updateTagNameToLockedTag(rowIndex, newTagName) { - cy.get(`input[name="records[${rowIndex}].tag"`).type(newTagName); + cy.get(`input[name="records[${rowIndex}].tag"`).type(newTagName, { delay: 200 }); }, checkEmptyFieldAdded(rowIndex, defaultContent = '$a ') { @@ -830,4 +836,30 @@ export default { QuickMarcEditorRow({ index: rowIndex }).find(viewAuthorutyIconButton).exists(), ]); }, + + verifyAndDismissWrongTagLengthCallout() { + cy.expect(calloutMarcTagWrongLength.exists()); + cy.do(calloutMarcTagWrongLength.dismiss()); + cy.expect(calloutMarcTagWrongLength.absent()); + }, + + verifyTagValue(rowIndex, tagValue) { + cy.expect(QuickMarcEditorRow({ index: rowIndex }).find(TextField({ name: including('.tag') })).has({ value: tagValue })); + }, + + verifyInvalidTagCallout() { + cy.expect(calloutInvalidMarcTag.exists()); + }, + + verifyNo245TagCallout() { + cy.expect(calloutNo245MarcTag.exists()); + }, + + verifyMultiple245TagCallout() { + cy.expect(calloutMultiple245MarcTags.exists()); + }, + + verifyMultiple001TagCallout() { + cy.expect(calloutMultiple001MarcTags.exists()); + } }; From 3b5b4dd49a1cabc628e7d7de8eed10018bf74309 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Tue, 5 Sep 2023 19:03:07 +0300 Subject: [PATCH 102/437] FAT-5046-C359595 (#1540) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-5046: test added * FAT-5046: updated import file names --- ...rowse-contributors-linked-not-linked.cy.js | 103 ++++++++++++++++++ cypress/fixtures/marcAuthFileC359595.mrc | 1 + cypress/fixtures/marcBibFileC359595.mrc | 1 + 3 files changed, 105 insertions(+) create mode 100644 cypress/e2e/inventory/search/browse-contributors-linked-not-linked.cy.js create mode 100644 cypress/fixtures/marcAuthFileC359595.mrc create mode 100644 cypress/fixtures/marcBibFileC359595.mrc diff --git a/cypress/e2e/inventory/search/browse-contributors-linked-not-linked.cy.js b/cypress/e2e/inventory/search/browse-contributors-linked-not-linked.cy.js new file mode 100644 index 0000000000..6a951873c0 --- /dev/null +++ b/cypress/e2e/inventory/search/browse-contributors-linked-not-linked.cy.js @@ -0,0 +1,103 @@ +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 InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import BrowseContributors from '../../../support/fragments/inventory/search/browseContributors'; +import BrowseSubjects from '../../../support/fragments/inventory/search/browseSubjects'; +import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; +import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; +import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; + +describe('Inventory: Contributors Browse', () => { + const testData = { + tag010: '010', + tag700: '700', + contributorName: 'Lee, Stanley Test C359595', + }; + + const marcFiles = [ + { + marc: 'marcBibFileC359595.mrc', + fileName: `testMarcFileC359595.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib' + }, + { + marc: 'marcAuthFileC359595.mrc', + fileName: `testMarcFileC359595.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + naturalId: 'n8316359595' + } + ]; + + const createdRecordIDs = []; + + before('Creating data', () => { + 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('Completed'); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIconByIndex(26); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.switchToSearch(); + InventoryInstance.searchResults(testData.contributorName); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].naturalId}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthorityByIndex(26, testData.tag700); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + + after('Deleting created user and data', () => { + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C359595 Verify that contributors with the same "Name" and "Name type" and one has, and one has not "authorityID" will display in different rows in the response (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventorySearchAndFilter.switchToBrowseTab(); + InventorySearchAndFilter.verifyKeywordsAsDefault(); + BrowseContributors.select(); + BrowseContributors.browse(testData.contributorName); + BrowseSubjects.checkRowWithValueAndAuthorityIconExists(testData.contributorName); + BrowseSubjects.checkRowWithValueAndNoAuthorityIconExists(testData.contributorName); + BrowseSubjects.checkRowValueIsBold(5, testData.contributorName); + BrowseSubjects.checkRowValueIsBold(6, testData.contributorName); + BrowseSubjects.checkValueAbsentInRow(4, testData.contributorName); + BrowseSubjects.checkValueAbsentInRow(7, testData.contributorName); + }); +}); diff --git a/cypress/fixtures/marcAuthFileC359595.mrc b/cypress/fixtures/marcAuthFileC359595.mrc new file mode 100644 index 0000000000..5c9d100949 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC359595.mrc @@ -0,0 +1 @@ +01937cz a2200313n 4500001000800000005001700008008004100025010001600066035002300082040007300105046003300178053001700211100003000228370008200258372005200340373002900392374005400421374002200475377000800497400003900505400002000544670009400564670004400658670007600702670010600778670064400884670008001528953001501608242619020190610154002.0831201n| azannaabn a aaa  an8316359595 a(OCoLC)oca00990699 aDLCbengerdacDLCdDLCdOCoLCdDLCdDLCdIOrQBIdDLCdViUdDLCdMnU f1922-12-28g2018-11-122edtf 0aPS3562.E36471 aLee, Stanley Test C359595 aManhattan (New York, N.Y.)bLos Angeles (Calif.)eBronx (New York, N.Y.)2naf aComic books, strips, etc.aGraphic novels2lcsh aMarvel Comics Group2naf aAuthorsaEditorsaPublishers and publishing2lcsh aComic book writer aeng1 aLieber, Stanley Martin,d1922-20181 wnneaaLee, Stan aHis Stan Lee presents the Incredible Hulk pop-up-book, "Trapped", c1982:bt.p. (Stan Lee) aLC data base, 9-7-83b(hdg.: Lee, Stan) aExcelsior! 2002:bCIP t.p. (Stan Lee) data sheet (b. December 28, 1922) aStan Lee, c2006:bECIP t.p. (Stan Lee) chap. 2 (Stanley Martin Lieber, b. in New York, Dec. 28, 1922) aNew York times WWW site, viewed Nov. 13, 2018b(in obituary published Nov. 12: Stan Lee; b. Stanley Martin Lieber, Dec. 28, 1922, Manhattan; moved with his family to the Bronx; d. Monday [Nov. 12, 2018], Los Angeles, aged 95; superhero of Marvel Comics; helped create Spider-Man, the X-Men, the Fantastic Four, Iron Man, and others while overseeing his company's emergence as a media behemoth; writer, editor, publisher, Hollywood executive; used several pseudonyms to give the impression that Marvel had a large stable of writers; the name that stuck was simply his first name split in two; in the 1970s, he legally changed Lieber to Lee) aOCLC, February 18, 2019b(authorized access point prior to 2009: Lee, Stan) abe26brc15 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC359595.mrc b/cypress/fixtures/marcBibFileC359595.mrc new file mode 100644 index 0000000000..ca68736c9b --- /dev/null +++ b/cypress/fixtures/marcBibFileC359595.mrc @@ -0,0 +1 @@ +02516cam a2200421 i 45000010011000000030006000110050017000170080041000340100017000750400063000920200050001550200047002050350022002520420008002740500024002820820015003062400023003212450049003442640046003932640011004393000022004503360026004723370028004983380027005265040041005535050866005945200370014606500035018306550019018657000030018847000015019147100016019297100016019457100016019617100016019777100016019939800085020091005829214OCoLC20180605090557.6171003t20182018mnu b 000 p eng c a 2017040746 aPULbengerdacPULdYDXdBDXdVKCdYW6dDLCdMNWdEAUdIPU a9781566895095q(softcover ;qacid-free paper) a156689509Xq(softcover ;qacid-free paper) a(OCoLC)1005829214 apcc00aPS3614.G87bA6 201800a811/.622310aPoems.kSelections10aNot here (Test AuthorityID Scenario C359595) 1aMinneapolis :bCoffee House Press,c2018. 4c©2018 a73 pages ;c23 cm atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aIncludes bibliographical references.00tWhite boy time machine: instruction manual --tLesson --tAgain, let me tell you what I know about trust --tStill, somehow --tNguyẽn --tElegy for the first --tWhite boy time machine: software --tType II --tAttending the party --tDear X --tThe study --tWhite boy time machine: joy ride --tAgain, what do I know about desire? --tCockfight --t#2 --tAgain, let me explain again --tWhite boy time machine: return policy --tBaptism --tApology, sort of --tProbe --tPunish --tMercy --tWhite boy time machine: safety tips --tB.F.F. --tPig --tHosting --tWhite boy time machine: override --tChangeling --tCommute --tOde to the pubic hair stuck in my throat --tNote --tPolitics of an elegy --tWhite boy time machine: error --tThe ranger --tAfterwards --tReunion --tHeavy --tMonica West is moving to Omaha, Nebraska --tNote on staying. a"Not Here is a flight plan for escape and a map for navigating home; a queer Vietnamese American body in confrontation with whiteness, trauma, family, and nostalgia; and a big beating heart of a book. Nguyen's poems ache with loneliness and desire and the giddy terrors of allowing yourself to hope for love, and revel in moments of connection achieved"--Amazon.com 0aAmerican poetryy21st century. 7aPoetry.2lcgft aLee, Stanley Test C359595 aValue700-2 aBValue710-1 aBValue710-2 aBValue710-3 aBValue710-4 aBValue710-5 a40028235767bPOE2cGendJRLeYBPg509509h606313i180611lPaperm16.99q1j16.99 \ No newline at end of file From d09a9957ce35fa6d51afa9f75a9cd056d4815fd4 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Tue, 5 Sep 2023 20:12:54 +0300 Subject: [PATCH 103/437] FAT-5079-C369042 (#1541) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-5079: test added * FAT-5079: updated before block name * FAT-5079: added wait before checking results --- .../search/search-in-inventory-symbols.cy.js | 101 ++++++++++++++++++ cypress/fixtures/marcBibFileC369042.mrc | 1 + 2 files changed, 102 insertions(+) create mode 100644 cypress/e2e/inventory/search/search-in-inventory-symbols.cy.js create mode 100644 cypress/fixtures/marcBibFileC369042.mrc diff --git a/cypress/e2e/inventory/search/search-in-inventory-symbols.cy.js b/cypress/e2e/inventory/search/search-in-inventory-symbols.cy.js new file mode 100644 index 0000000000..dd1abc4a4f --- /dev/null +++ b/cypress/e2e/inventory/search/search-in-inventory-symbols.cy.js @@ -0,0 +1,101 @@ +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 InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; + +describe('Search in Inventory', () => { + const testData = { + searchQueries: [ + 'Pangkok', + 'Pangk ok', + 'Pangk\'ok', + 'Pangk\'ok : Kim Ki-ch\'ang changp\'yŏn sosŏl.', + 'Han’guk yÅnghwa 100-sÅn', + 'Hanguk yÅnghwa 100-sÅn', + 'Han guk yÅnghwa 100-sÅn', + 'Han\'guk yŏnghwa 100-yŏn, yŏnghwa kwanggo 100-sŏn / P\'yŏnjippu yŏkkŭm.', + 'Han\'guk yŏnghwa 100-sŏn : yŏnghwa hakcha, p\'yŏngnon\'ga ka ppobŭn Han\'guk yŏnghwa taep\'yojak : "Ch\'ŏngch\'un ŭi sipcharo" esŏ "P\'iet\'a" kkaji / Han\'guk Yŏngsang Charyowŏn p\'yŏn.' + ], + titles: [ + 'Pangk\'ok : Kim Ki-ch\'ang changp\'yŏn sosŏl.', + 'Han\'guk yŏnghwa 100-sŏn : yŏnghwa hakcha, p\'yŏngnon\'ga ka ppobŭn Han\'guk yŏnghwa taep\'yojak : "Ch\'ŏngch\'un ŭi sipcharo" esŏ "P\'iet\'a" kkaji / Han\'guk Yŏngsang Charyowŏn p\'yŏn.', + 'Han\'guk yŏnghwa 100-yŏn, yŏnghwa kwanggo 100-sŏn / P\'yŏnjippu yŏkkŭm.' + ] + }; + + const expectedTitles = [ + [testData.titles[0]], + [testData.titles[0]], + [testData.titles[0]], + [testData.titles[0]], + [testData.titles[1], testData.titles[2]], + [testData.titles[1], testData.titles[2]], + [testData.titles[1], testData.titles[2]], + [testData.titles[2]], + [testData.titles[1]] + ]; + + const marcFiles = [ + { + marc: 'marcBibFileC369042.mrc', + fileName: `testMarcFileC369042.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numberOfRecords: 3 + } + ]; + + const createdRecordIDs = []; + + before('Importing data, linking records', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + 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]); + }); + } + }); + }); + 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) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it('C369042 Search for "Instance" with "diacritic - Korean" symbol in the "Resource title" field using "Keyword" search option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + testData.searchQueries.forEach((query, index) => { + InventoryInstance.searchByTitle(query); + // wait for search results to be updated + cy.wait(1500); + expectedTitles[index].forEach(expectedTitle => { + InventorySearchAndFilter.verifyInstanceDisplayed(expectedTitle); + }); + InventorySearchAndFilter.checkRowsCount(expectedTitles[index].length); + }); + }); +}); diff --git a/cypress/fixtures/marcBibFileC369042.mrc b/cypress/fixtures/marcBibFileC369042.mrc new file mode 100644 index 0000000000..7964b2eb38 --- /dev/null +++ b/cypress/fixtures/marcBibFileC369042.mrc @@ -0,0 +1 @@ +01880cam a2200529 i 450000100090000000800410000900500170005001000170006703500220008403500130010604000620011902000300018102000150021104200080022604300120023405000290024608200160027510000440029124500600033525000200039526400430041530000240045833600260048233700280050833800270053649000410056354600150060465000570061965000590067665100440073565500330077965500390081265500380085165500540088965500350094365500190097883000420099788000410103988000480108088000180112888000430114602900220118990200330121194800580124499400120130294800360131415278035200515s2019 ko 000 1 kor 20220303142346.9 a 2020390921 a(OCoLC)1137281225 a15278035 aDLCbengerdacDLCdOCLCFdHMYdAU@dOCLCOdSTFdEYMdPAU a9788937473241q(hardback) a8937473240 apcc aa-ko---00aPL994.415.K523bP36 201904a895.7352231 6880-01aKim, Ki-ch'ang,d1978-eauthor.106880-02aPangk'ok :bKim Ki-ch'ang changp'yŏn sosŏl. 6880-03a1-p'an. 16880-04aSŏul-si :bMinŭmsa,c2019. a340 pages ;c20 cm. atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier1 aOnŭl ŭi chŏlmŭn chakka ;v24 aIn Korean. 0aForeign workers, VietnamesezKorea (South)vFiction. 7aForeign workers, Vietnamese.2fast0(OCoLC)fst01729217 7aKorea (South)2fast0(OCoLC)fst01206791 0aKorean fictiony21st century 7aFiction.2fast0(OCoLC)fst01423787 7aNovels.2fast0(OCoLC)fst01921742 7aSocial problem fiction.2fast0(OCoLC)fst01982507 7aSocial problem fiction.2lcgft 7aNovels.2lcgft 0aOnŭl ŭi chŏlmŭn chakka ;v24.1 6100-01aê¹€ 기창,d1978-,eauthor.106245-02a방콕 :bê¹€ 기창 장편 소설. 6250-03a1íŒ. 16264-04a서울시 :b민ìŒì‚¬,c2019.0 aAU@b000066472300 bCho, Il Hwan and Soon Ja Cho2 a20220302bmdPrefecticleanup-035-oclc_2022-03-02.mrc aZ0bCOO hHELD BY COO - 14 OTHER HOLDINGS01813cam a2200409Ia 4500001000800000005001700008008004100025020001800066020001500084035001200099035002100111040003000132043002100162066000700183245021400190250002200404260006100426300004100487650004500528650003700573650004600610651003600656651004400692655003800736710005800774880018200832880002301014880005701037880005501094902003301149948004201182948004401224948004301268948002801311948003701339950002701376840623320151220150220.0140305s2013 ko a 000 0 kor d a9788993056457 a8993056455 a8406233 a(OCoLC)883341353 aCSLcCSLdCSLdSTFdOCLCO aa-kr---aa-ko--- c$1006880-01aHan'guk yŏnghwa 100-sŏn :byŏnghwa hakcha, p'yŏngnon'ga ka ppobŭn Han'guk yŏnghwa taep'yojak : "Ch'ŏngch'un ŭi sipcharo" esŏ "P'iet'a" kkaji /cHan'guk Yŏngsang Charyowŏn p'yŏn. 6880-02aCh'op'an. 6880-03aSŏul :bHan'guk Yŏngsang Charyowŏn,c2013. a255 p. :bill. (some col.) ;c26 cm. 0aMotion pictureszKorea (South)vReviews. 0aMotion pictureszKoreavReviews. 7aMotion pictures2fast0(OCoLC)fst01027285 7aKorea2fast0(OCoLC)fst01206434 7aKorea (South)2fast0(OCoLC)fst01206791 7aReviews2fast0(OCoLC)fst014237602 6880-04aHan'guk Yŏngsang Charyowŏn (Seoul, Korea)006245-01/$1a한국 ì˜í™” 100ì„  :bì˜í™” í•™ìž, í‰ë¡ ê°€ ê°€ ë½‘ì€ í•œêµ­ ì˜í™” 대표작 : "청춘 ì˜ ì‹­ìžë¡œ" ì—ì„œ "피ì—타" 까지 /c한국 ì˜ìƒ ìžë£Œì› 편. 6250-02/$1aì´ˆíŒ. 6260-03/$1a서울 :b한국 ì˜ìƒ ìžë£Œì›,c2013.2 6710-04/$1a한국 ì˜ìƒ ìžë£Œì› (Seoul, Korea). bCho, Il Hwan and Soon Ja Cho0 a20140305bidbatcheltshmiscxEulyoo3 a20140611hbatchmatchiD140611.FILEC.mrc2 a20140613bmdbatcheltsxdeloclcprefix1 a20140718bfdyc935elts2 a20150103bmdbatcheltsxaddfast aPN1993.5.K6bH279 201301723cam a2200433 i 45000010009000000050017000090080041000260100017000670200018000840350022001020350013001240400052001370420008001890430012001970500027002092450097002362500022003332640044003553000040003993360021004393370025004603380023004856500051005086500064005596500058006236500060006816500047007416510037007886550039008257100062008648800076009268800020010028800043010228800061010659020033011269480060011599480043012199480027012621112260320201217150502.0191106s2019 ko a 000 0 kor  a 2019473087 a9791189231200 a(OCoLC)1125273135 a11122603 aDLCbengerdacDLCdUBCdHMYdOCLCOdOCLCFdSTF apcc aa-kr---00aPN1993.5.K6bH279 2019006880-01aHan'guk yŏnghwa 100-yŏn, yŏnghwa kwanggo 100-sŏn /cP'yŏnjippu yŏkkŭm. 6880-02aCh'op'an. 16880-03aSŏul-si :bKŭrimssi,c2019. a249 pages :billustrations ;c19 cm atext2rdacontent aunmediated2rdamedia avolume2rdacarrier 0aMotion pictureszKoreaxHistoryy20th century. 0aAdvertisingxMotion pictureszKoreaxHistoryy20th century. 0aAdvertising, NewspaperzKoreaxHistoryy20th century. 7aAdvertisingxMotion pictures.2fast0(OCoLC)fst00797711 7aMotion pictures.2fast0(OCoLC)fst01027285 7aKorea.2fast0(OCoLC)fst01206434 7aHistory.2fast0(OCoLC)fst014116282 6880-04aKŭrimssi (Publishing company : Korea),eeditor.006245-01a한국 ì˜í™” 100ë…„, ì˜í™” ê´‘ê³  100ì„  /c편집부 ì—®ìŒ. 6250-02aì´ˆíŒ. 16264-03a서울시 :b그림씨,c2019.2 6710-04a그림씨 (Publishing company : Korea),eeditor. bCho, Il Hwan and Soon Ja Cho0 a20200212bidbatcheltshapprxPanmun2019_September.mrc2 a20200214bmdbatcheltsxdeloclcprefix1 a20201217bfdsok1elts \ No newline at end of file From 86e2c40f314a5b7671e370672ffc5ec395be35fe Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:02:09 +0500 Subject: [PATCH 104/437] FAT-7729/C365602 (#1544) * added test C365602 * small change in hooks * deleted old test from idealabs --- cypress/e2e/ideyalabs/marc_authority.cy.js | 42 ------ ...marc-bib-from-marc-auth-using-derive.cy.js | 125 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC365602.mrc | 1 + cypress/fixtures/marcBibFileForC365602.mrc | 1 + cypress/support/fragments/quickMarcEditor.js | 27 ++++ 5 files changed, 154 insertions(+), 42 deletions(-) create mode 100644 cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC365602.mrc create mode 100644 cypress/fixtures/marcBibFileForC365602.mrc diff --git a/cypress/e2e/ideyalabs/marc_authority.cy.js b/cypress/e2e/ideyalabs/marc_authority.cy.js index 896b459677..2a34aa6754 100644 --- a/cypress/e2e/ideyalabs/marc_authority.cy.js +++ b/cypress/e2e/ideyalabs/marc_authority.cy.js @@ -74,48 +74,6 @@ describe.skip('Feature MARC Authority', () => { } ); - it( - 'C365602 Derive | Unlink ""MARC Bibliographic"" field from ""MARC Authority"" record and use the ""Save & close"" button in deriving window. (spitfire)', - { tags: [testTypes.ideaLabsTests] }, - () => { - cy.visit(topMenu.inventoryPath); - inventorySearchAndFilter.switchToHoldings(); - inventorySearchAndFilter.bySource(testData.source); - inventorySearchAndFilter.selectSearchResultByRowIndex( - testData.derive.rowIndex - ); - inventoryInstance.editMarcBibliographicRecord(); - - const unlinkButton = inventoryInstance.verifyUnlinkIcon( - testData.derive.tag700 - ); - if (unlinkButton) { - inventoryInstance.verifyAndClickLinkIcon(testData.derive.tag700); - inventoryInstance.verifySearchOptions(); - marcAuthorities.clickReset(); - marcAuthorities.searchBy( - testData.derive.searchOption, - testData.derive.authority700FieldValue - ); - marcAuthorities.clickLinkButton(); - marcAuthority.checkLinkingAuthority700(); - marc.saveAndClose(); - } else { - marc.closeEditMarc(); - } - inventoryInstance.deriveNewMarcBibRecord(); - marc.keepLinkingButton(); - inventoryInstance.verifyAndClickUnlinkIcon(testData.derive.tag700); - marc.popupUnlinkButton(); - marc.saveAndClose(); - inventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane( - testData.derive.accordion - ); - inventoryInstance.editMarcBibliographicRecord(); - inventoryInstance.verifyLinkIcon(testData.derive.tag700); - } - ); - it( 'C380755 Link of empty MARC Bib field with ""MARC Authority"" record (spitfire)', { tags: [testTypes.ideaLabsTests] }, diff --git a/cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js b/cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js new file mode 100644 index 0000000000..4b3498b0d6 --- /dev/null +++ b/cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js @@ -0,0 +1,125 @@ +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'; + +describe('Manual Linking Bib field to Authority 1XX', () => { + const testData = {}; + + const marcFiles = [ + { + marc: 'marcBibFileForC365602.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }, + { + marc: 'marcAuthFileForC365602.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 2, + }, + ] + + const linkingTagAndValues = [ + { + rowIndex: 76, + value: 'Sprouse, Chris', + tag: 700 + }, + { + rowIndex: 77, + value: 'Martin, Laura', + tag: 700 + }, + ]; + + let createdAuthorityIDs = []; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + Permissions.uiQuickMarcQuickMarcEditorDuplicate.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(() => { + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + linkingTagAndValues.forEach(linking => { + QuickMarcEditor.clickLinkIconInTagField(linking.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(linking.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.rowIndex); + }); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); + }); + }); + + after('Deleting created user', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + createdAuthorityIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + }); + }); + + it('C365602 Derive | Unlink "MARC Bibliographic" field from "MARC Authority" record and use the "Save & close" button in deriving window. (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.deriveNewMarcBibRecord(); + QuickMarcEditor.verifyRemoveLinkingModal('Do you want to remove authority linking for this new bibliographic record?'); + + QuickMarcEditor.clickKeepLinkingButton(); + QuickMarcEditor.verifyUnlinkAndViewAuthorityButtons(76); + QuickMarcEditor.verifyUnlinkAndViewAuthorityButtons(77); + QuickMarcEditor.checkButtonSaveAndCloseEnable(); + QuickMarcEditor.verifyTagFieldAfterLinking(76, '700', '1', '\\', '$a Sprouse, Chris', '$e artist.', '$0 1357871', ''); + + QuickMarcEditor.clickUnlinkIconInTagField(76); + QuickMarcEditor.verifyTagFieldAfterUnlinking(76, '700', '1', '\\', '$a Sprouse, Chris $e artist. $0 1357871'); + + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkCallout('Creating record may take several seconds.'); + QuickMarcEditor.checkCallout('Record created.'); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane('Contributor'); + }); +}); \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileForC365602.mrc b/cypress/fixtures/marcAuthFileForC365602.mrc new file mode 100644 index 0000000000..a6e915ab83 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC365602.mrc @@ -0,0 +1 @@ +01186cz a2200265n 4500001000800000005001700008008004100025010003100066035002300097040003300120100003900153370002200192372005200214374003200266375001100298378001600309400002200325670008000347670007900427670008800506670008200594670015500676670008000831953000900911964035620151019165040.0140826n| azannaabn |a aaa  an 2014052262zn 2003042557 a(OCoLC)oca09945978 aDLCbengerdacDLCdIENdDLC1 aMartin, Laurac(Comic book artist) eTampa (Fla.)2naf aComic books, strips, etc.aGraphic novels2lcsh aComic book artistaColorist afemale qLaura DePuy1 wnneaDePuy, Laura aWhen speaks the dragon!, 2014:btitle page (cover artists ... Laura Martin) aEllis, Warren. The absolute Authority, 2002:bt.p. (Laura Depuy, colorist) aPlanetary, ruling the world, 2000:bt.p. (DePuy) verso t.p. (Laura DePuy, colorist) aPlanetary, crossing worlds, c2004:bverso t.p. (Laura DePuy Martin, colorist) aPlanetary, leaving the 20th century, c2004:bt.p. (Laura Martin, colorist) p. 143 (Laura DePuy Martin; lives in Tampa with her husband Randy [Martin]) aBrubaker, Ed. Captain America, Vol. 2, 2013:bt.p. (Laura Martin, colorist) axk0500759cz a2200193n 4500001000800000005001700008008004100025035002300066040003000089046002100119100001900140370003100159372003600190374001800226670008600244670021300330953000900543985001300552135787120190917073159.0980218n| azannaabn |n aaa c a(OCoLC)oca04663934 aUkbengerdacUkdNNdNcD f1966-07-302edtf1 aSprouse, Chris aCharlottesville (Va.)2naf aComic books, strips, etc.2lcsh aArtists2lcsh aSplinter of the mind's eye, 1996:bt.p. (Chris Sprouse) p.104 (comic-book artist) aWikipedia, Sept. 16, 2019b(Chris Sprouse; b. July 30, 1966 in Charlottesville, Va.; American comic book artist; known for his work on comics such as Tom Strong, Legion of Super-Heroes, Star Wars, Midnighter) axx00 cBLeLSPC \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC365602.mrc b/cypress/fixtures/marcBibFileForC365602.mrc new file mode 100644 index 0000000000..6c8f699e85 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC365602.mrc @@ -0,0 +1 @@ +05350cam a2200997 i 4500001001400000008004100014005001700055035002400072040017600096019003600272020004300308020004000351020004300391020004000434020004300474020004000517020004300557020004000600020004300640020004000683020004300723020004000766020004300806020004000849020004300889020004000932020004300972020004001015020004301055020004001098035007601138043001201214050002901226050002601255082001801281100003201299245016401331264009901495300005701594336002601651336003301677337002801710338002701738500005401765521002201819588001401841520037501855505043902230600006902669650004802738650004302786650004202829650004502871650004402916651003802960650004402998650004003042650003603082650003103118651003303149600006803182650004403250650004503294650004203339650004803381650004303429651003803472655002703510655005303537655004603590655004803636655002703684655002903711655003403740655002703774655004703801655003103848700003203879700007703911700009403988700002804082700008404110700007604194938004104270938004104311in00000000144170814m20172019nyua 6 000 1 eng d20220704143031.8 a(OCoLC)on1000535936 aOJ4bengerdacOJ4dYDXdFLWMDdJTDdTOPdMYGdOCLCAdNJRdUABdP@NdNYPdOCLCQdOCLCFdOCLCAdCNNORdCCPLGdOCLCAdCCPLGdOCLdOCLCOdOCLCQdOCLCOdOCLCQdOCLdOCLCOdJPL a964194444a964760322a999445824 a9781302904159q(volume 1 ;qhardcover) a1302904159q(volume 1 ;qhardcover) a9781302900533q(volume 1 ;qpaperback) a1302900536q(volume 1 ;qpaperback) a9781302900540q(volume 2 ;qpaperback) a1302900544q(volume 2 ;qpaperback) a9781302901912q(volume 3 ;qpaperback) a1302901915q(volume 3 ;qpaperback) a9781302906498q(volume 4 ;qpaperback) a1302906496q(volume 4 ;qpaperback) a9781302909888q(volume 5 ;qpaperback) a1302909886q(volume 5 ;qpaperback) a9781302912932q(volume 6 ;qpaperback) a1302912933q(volume 6 ;qpaperback) a9781302912949q(volume 7 ;qpaperback) a1302912941q(volume 7 ;qpaperback) a9781302914462q(volume 8 ;qpaperback) a1302914464q(volume 8 ;qpaperback) a9781302921101q(volume 9 ;qpaperback) a130292110Xq(volume 9 ;qpaperback) a(OCoLC)1000535936z(OCoLC)964194444z(OCoLC)964760322z(OCoLC)999445824 af------14aPN6728.B519338bC63 2017 4aPN6728.B523bC63 201704a741.5/9732231 aCoates, Ta-Nehisi,eauthor.10aBlack Panther /cwriter, Ta-Nehisi Coates ; artist, Brian Stelfreeze ; pencils/layouts, Chris Sprouse ; color artist, Laura Martin ; letterer, VC's Joe Sabino. 1aNew York, NY :bMarvel Worldwide, Inc., a subsidiary of Marvel Entertainment, LLC,c2017-2019. a9 volumes :bchiefly color illustrations ;c26-29 cm atextbtxt2rdacontent astill imagebsti2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier a"Black Panther created by Stan Lee & Jack Kirby."8 aRated T for Teen.0 aVolume 1. aWhen a superhuman terrorist group named The People sparks a violent uprising in Wakanda, the kingdom famed for its incredible technology and proud traditions will be thrown into turmoil like never before! Black Panther knows that if Wakanda is to survive, it must adapt--but will he be able to make it through the transition alive? Heavy is the head that wears the cowl!00gv. 1.tA nation under our feetgv. 2.tA nation under our feet. Book twogv. 3.tA nation under our feet. Book threegv. 4.tAvengers of the new world. Part onegv. 5.tAvengers of the new world. Part two.gv. 6.tThe intergalactic empire of Wakanda. Part one --gv. 7.tThe intergalactic empire of Wakanda. Part two. --gv. 8.tThe intergalactic empire of Wakanda. Part three --gv. 9tThe intergalactic empire of Wakanda. Part four.00aBlack Pantherc(Fictitious character)vComic books, strips, etc. 0aKings and rulersvComic books, strips, etc. 0aSuperheroesvComic books, strips, etc. 0aInsurgencyvComic books, strips, etc. 0aGood and evilvComic books, strips, etc. 0aBlack peoplevComic books, strips, etc. 0aAfricavComic books, strips, etc. 6aRois et souverainsvBandes dessineÌes. 6aBandes dessineÌes de superheÌros. 6aReÌvoltesvBandes dessineÌes. 6aNoirsvBandes dessineÌes. 6aAfriquevBandes dessineÌes.07aBlack Pantherc(Fictitious character)2fast0(OCoLC)fst02000849 7aBlack people.2fast0(OCoLC)fst00833880 7aGood and evil.2fast0(OCoLC)fst00944894 7aInsurgency.2fast0(OCoLC)fst00975461 7aKings and rulers.2fast0(OCoLC)fst00987694 7aSuperheroes.2fast0(OCoLC)fst01765254 7aAfrica.2fast0(OCoLC)fst01239509 7asuperhero comics.2aat 7aComics (Graphic works)2fast0(OCoLC)fst01921613 7aGraphic novels.2fast0(OCoLC)fst01726630 7aSuperhero comics.2fast0(OCoLC)fst01922562 7aGraphic novels.2gsafd 7aSuperhero comics.2lcgft 7aComics (Graphic works)2lcgft 7aGraphic novels.2lcgft 7aBandes dessineÌes de superheÌros.2rvmgf 7aBandes dessineÌes.2rvmgf1 aStelfreeze, Brian,eartist.1 aSprouse, Chris,eartist.0http://id.loc.gov/authorities/names/no981056981 aMartin, Laurac(Comic book artist),ecolorist.0id.loc.gov/authorities/names/no20160638821 aSabino, Joe,eletterer.1 aLee, Stan,d1922-2018,ecreator.0http://id.loc.gov/authorities/names/n831692671 aKirby, Jack,ecreator.0http://id.loc.gov/authorities/names/n2019022493 aYBP Library ServicesbYANKn13260207 aYBP Library ServicesbYANKn13041443 \ No newline at end of file diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 1e4ca1fdd1..2f3029d3d4 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -28,6 +28,9 @@ const restoreDeletedFieldsBtn = Modal().find(Button({ id: 'clickable-quick-marc- const quickMarcEditorRowContent = HTML({ className: including('quickMarcEditorRowContent') }); const instanceDetailsPane = Pane({ id:'pane-instancedetails' }); const unlinkModal = Modal({ id: 'quick-marc-confirm-unlink-modal' }); +const removeLinkingModal = Modal({ id: 'quick-marc-remove-authority-linking-confirm-modal' }); +const keepLinkingButton = Button({ id: 'clickable-quick-marc-remove-authority-linking-confirm-modal-cancel' }); +const removeLinkingButton = Button({ id: 'clickable-quick-marc-remove-authority-linking-confirm-modal-confirm' }); const unlinkButtonInsideModal = Button({ id: 'clickable-quick-marc-confirm-unlink-modal-confirm' }); const calloutAfterSaveAndClose = Callout('This record has successfully saved and is in process. Changes may not appear immediately.'); const calloutUpdatedRecord = Callout('Record has been updated.'); @@ -377,6 +380,13 @@ export default { ]); }, + verifyUnlinkAndViewAuthorityButtons(rowIndex) { + cy.expect([ + QuickMarcEditorRow({ index: rowIndex }).find(unlinkIconButton).exists(), + QuickMarcEditorRow({ index: rowIndex }).find(viewAuthorutyIconButton).exists(), + ]); + }, + verifyTagFieldAfterLinking(rowIndex, tag, secondBox, thirdBox, content, eSubfield, zeroSubfield, seventhBox) { cy.expect([ QuickMarcEditorRow({ index: rowIndex }).find(TextField({ name: `records[${rowIndex}].tag` })).has({ disabled: true, value: tag }), @@ -642,6 +652,10 @@ export default { cy.expect(getRowInteractorByTagName(tag).find(linkToMarcRecordButton).exists()); }, + checkLinkButtonExistByRowIndex(rowIndex) { + cy.expect(QuickMarcEditorRow({ index: rowIndex }).find(linkToMarcRecordButton).exists()); + }, + checkButtonSaveAndCloseEnable() { cy.expect(saveAndCloseButton.exists()); }, @@ -837,6 +851,19 @@ export default { ]); }, + verifyRemoveLinkingModal(contentText) { + cy.expect([ + removeLinkingModal.exists(), + removeLinkingModal.find(removeLinkingButton).exists(), + removeLinkingModal.find(keepLinkingButton).exists(), + removeLinkingModal.has({ content: including(contentText) }), + ]); + }, + + clickKeepLinkingButton() { + cy.do(keepLinkingButton.click()); + }, + verifyAndDismissWrongTagLengthCallout() { cy.expect(calloutMarcTagWrongLength.exists()); cy.do(calloutMarcTagWrongLength.dismiss()); From aa4e8ffca8071e6e30013c0f626ad523ec2d78f2 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Wed, 6 Sep 2023 13:34:03 +0300 Subject: [PATCH 105/437] Spitfire-nonParallel-Yauhen (#1545) * added nonParallel tags --- .../e2e/inventory/search/advanced-search-in-inventory.cy.js | 5 +++-- cypress/e2e/inventory/search/browse-subjects-linked.cy.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js b/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js index 95d115cd7e..d7aeef19a9 100644 --- a/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js +++ b/cypress/e2e/inventory/search/advanced-search-in-inventory.cy.js @@ -13,6 +13,7 @@ import InventorySearchAndFilter from '../../../support/fragments/inventory/inven import { JOB_STATUS_NAMES } from '../../../support/constants'; import HoldingsRecordEdit from '../../../support/fragments/inventory/holdingsRecordEdit'; import InventoryNewHoldings from '../../../support/fragments/inventory/inventoryNewHoldings'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('Inventory -> Advanced search', () => { const testData = { @@ -93,7 +94,7 @@ describe('Inventory -> Advanced search', () => { }); }); - it('C400610 Search Instances using advanced search with "AND" operator (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C400610 Search Instances using advanced search with "AND" operator (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventoryInstances.clickAdvSearchButton(); InventoryInstances.checkAdvSearchInstancesModalFields(0); InventoryInstances.checkAdvSearchInstancesModalFields(1); @@ -112,7 +113,7 @@ describe('Inventory -> Advanced search', () => { InventorySearchAndFilter.checkRowsCount(1); }); - it('C400616 Search Instances using advanced search with a combination of operators (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C400616 Search Instances using advanced search with a combination of operators (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventoryInstances.clickAdvSearchButton(); InventoryInstances.fillAdvSearchRow(0, '(OCoLC)on1100023840001116', 'Exact phrase', 'OCLC number, normalized'); InventoryInstances.checkAdvSearchModalValues(0, '(OCoLC)on1100023840001116', 'Exact phrase', 'OCLC number, normalized'); diff --git a/cypress/e2e/inventory/search/browse-subjects-linked.cy.js b/cypress/e2e/inventory/search/browse-subjects-linked.cy.js index 98537e1628..edf524fa85 100644 --- a/cypress/e2e/inventory/search/browse-subjects-linked.cy.js +++ b/cypress/e2e/inventory/search/browse-subjects-linked.cy.js @@ -15,6 +15,7 @@ import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; import { JOB_STATUS_NAMES } from '../../../support/constants'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('Inventory: Subject Browse', () => { const testData = { @@ -92,7 +93,7 @@ describe('Inventory: Subject Browse', () => { }); }); - it('C375163 Browse | Separate entries for "Subjects" from linked and unlinked "6XX" fields of "MARC bib" record (same subject names) (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C375163 Browse | Separate entries for "Subjects" from linked and unlinked "6XX" fields of "MARC bib" record (same subject names) (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventorySearchAndFilter.switchToBrowseTab(); InventorySearchAndFilter.verifyKeywordsAsDefault(); BrowseSubjects.select(); From 627a49bac7b7d1886f052553a1e672c7fb00378a Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Wed, 6 Sep 2023 14:51:27 +0300 Subject: [PATCH 106/437] Added tests for FAT 2610, 2603 (#1547) --- .eslintrc | 1 - ...cial-transactions-report-menu-option.cy.js | 323 ++++++++++++------ .../financialTransactionDetailReportModal.js | 56 ++- 3 files changed, 265 insertions(+), 115 deletions(-) diff --git a/.eslintrc b/.eslintrc index af7189d453..b2398babd2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,7 +16,6 @@ ], "rules": { "cypress/no-assigning-return-values": "error", - "cypress/no-unnecessary-waiting": "error", "cypress/assertion-before-screenshot": "warn", "cypress/no-force": "warn", "cypress/no-async-tests": "error" diff --git a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js index 4bb2fb9599..40399bdd65 100644 --- a/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js +++ b/cypress/e2e/users/financial-transactions/financial-transactions-report-menu-option.cy.js @@ -9,21 +9,29 @@ import ServicePoints from '../../../support/fragments/settings/tenant/servicePoi describe('Financial Transactions Detail Report', () => { const ownerData = {}; - const servicePoint1 = ServicePoints.getDefaultServicePointWithPickUpLocation('autotest transaction', uuid()); - const servicePoint2 = ServicePoints.getDefaultServicePointWithPickUpLocation('autotest transaction', uuid()); + const servicePoint1 = ServicePoints.getDefaultServicePointWithPickUpLocation( + 'autotest transaction', + uuid(), + ); + const servicePoint2 = ServicePoints.getDefaultServicePointWithPickUpLocation( + 'autotest transaction', + uuid(), + ); before('UserOwner is created', () => { - //the login with admin, visiting the path and the waiter are separated to get the fetch request to get owners + // the login with admin, visiting the path and the waiter are separated to get the fetch request to get owners cy.getAdminToken().then(() => { ServicePoints.createViaApi(servicePoint1); ServicePoints.createViaApi(servicePoint2); - UsersOwners.createViaApi(UsersOwners.getDefaultNewOwner(uuid(), 'owner')).then(({ id, ownerName }) => { - ownerData.name = ownerName; - ownerData.id = id; - }).then(() => { - UsersOwners.addServicePointsViaApi(ownerData, [servicePoint1, servicePoint2]); - }); + UsersOwners.createViaApi(UsersOwners.getDefaultNewOwner(uuid(), 'owner')) + .then(({ id, ownerName }) => { + ownerData.name = ownerName; + ownerData.id = id; + }) + .then(() => { + UsersOwners.addServicePointsViaApi(ownerData, [servicePoint1, servicePoint2]); + }); }); }); @@ -37,114 +45,219 @@ describe('Financial Transactions Detail Report', () => { UsersOwners.deleteViaApi(ownerData.id); }); - it('C343305 Check that the "Financial transactions detail report (CSV)" is displayed in "Actions"', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.verifyOptionsInActionsMenu(); - }); + it( + 'C343305 Check that the "Financial transactions detail report (CSV)" is displayed in "Actions"', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.verifyOptionsInActionsMenu(); + }, + ); - it('C343320 Check that the icon calendar is displayed in the Start date and End date on the "Financial transactions detail report" modal', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.verifyStartDateFieldCalendarIcon(); - FinancialTransactionDetailReportModal.verifyEndDateFieldCalendarIcon(); - }); + it( + 'C343320 Check that the icon calendar is displayed in the Start date and End date on the "Financial transactions detail report" modal', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyStartDateFieldCalendarIcon(); + FinancialTransactionDetailReportModal.verifyEndDateFieldCalendarIcon(); + }, + ); - it('C343321 Check when user click on the icon calendar appears "datepicker" and user can select any date', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.openStartDateFieldCalendar(); - FinancialTransactionDetailReportModal.verifyCalendarIsShown(); - FinancialTransactionDetailReportModal.openEndDateFieldCalendar(); - FinancialTransactionDetailReportModal.verifyCalendarIsShown(); - }); + it( + 'C343321 Check when user click on the icon calendar appears "datepicker" and user can select any date', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.openStartDateFieldCalendar(); + FinancialTransactionDetailReportModal.verifyCalendarIsShown(); + FinancialTransactionDetailReportModal.openEndDateFieldCalendar(); + FinancialTransactionDetailReportModal.verifyCalendarIsShown(); + }, + ); - it('C343306 Check that the "Financial transactions detail report" modal is display when selected "Financial transactions detail report (CSV)"', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.verifyStartDateFieldIsEmpty(); - FinancialTransactionDetailReportModal.verifyEndDateFieldIsEmpty(); - FinancialTransactionDetailReportModal.verifyFeeFineOwnerSelect(); - FinancialTransactionDetailReportModal.verifyAssociatedServicePointsMultiSelect(); - FinancialTransactionDetailReportModal.verifySaveButtonIsDisabled(); - FinancialTransactionDetailReportModal.verifyCancelButtonIsEnabled(); - }); + it( + 'C343306 Check that the "Financial transactions detail report" modal is display when selected "Financial transactions detail report (CSV)"', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyStartDateFieldIsEmpty(); + FinancialTransactionDetailReportModal.verifyEndDateFieldIsEmpty(); + FinancialTransactionDetailReportModal.verifyFeeFineOwnerSelect(); + FinancialTransactionDetailReportModal.verifyAssociatedServicePointsMultiSelect(); + FinancialTransactionDetailReportModal.verifySaveButtonIsDisabled(); + FinancialTransactionDetailReportModal.verifyCancelButtonIsEnabled(); + }, + ); - it('C343307 Check that the user returns to the "User search result" page when click in the "Cancel" button or "X" button on the "Financial transactions detail report" modal', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); - FinancialTransactionDetailReportModal.closeFinancialReportModalByCancelButton(); - FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); - FinancialTransactionDetailReportModal.closeFinancialReportModalByXButton(); - FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); - }); + it( + 'C343307 Check that the user returns to the "User search result" page when click in the "Cancel" button or "X" button on the "Financial transactions detail report" modal', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + FinancialTransactionDetailReportModal.closeFinancialReportModalByCancelButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + FinancialTransactionDetailReportModal.closeFinancialReportModalByXButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); + }, + ); - it('C343308 Check that the user can not close "Financial transactions detail report" modal when click on the outside the modal', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - UsersSearchResultsPane.clickActionsButton(); - FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); - }); + it( + 'C343308 Check that the user can not close "Financial transactions detail report" modal when click on the outside the modal', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + UsersSearchResultsPane.clickActionsButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + }, + ); - it('C343309 Check that the user can close "Financial transactions detail report" modal when click on the "Esc" button', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); - FinancialTransactionDetailReportModal.closeFinancialReportModalByEscButton(); - FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); - }); + it( + 'C343309 Check that the user can close "Financial transactions detail report" modal when click on the "Esc" button', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsShown(); + FinancialTransactionDetailReportModal.closeFinancialReportModalByEscButton(); + FinancialTransactionDetailReportModal.verifyFinancialReportModalIsNotShown(); + }, + ); - it('C343311 Check that the error message ""Start date" is required" is appears under Start date field', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.clickEndDateField(); - FinancialTransactionDetailReportModal.verifyStartDateIsRequiredErrorMessage(); - }); + it( + 'C343311 Check that the error message ""Start date" is required" is appears under Start date field', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.clickEndDateField(); + FinancialTransactionDetailReportModal.verifyStartDateIsRequiredErrorMessage(); + }, + ); - it('C343312 Check that the error message ""Start date" is required if "End date" entered" is appears under Start date field and has red color when End date was selected', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.fillInEndDate(); - FinancialTransactionDetailReportModal.verifyStartDateIsRequiredIfEndDateEnteredErrorMessage(); - }); + it( + 'C343312 Check that the error message ""Start date" is required if "End date" entered" is appears under Start date field and has red color when End date was selected', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInEndDate(); + FinancialTransactionDetailReportModal.verifyStartDateIsRequiredIfEndDateEnteredErrorMessage(); + }, + ); - it('C343313 Check that the "End date" must be greater than or equal to "Start date" error message is appears when End date is less than Start date', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.fillInStartDate('01/20/2020'); - FinancialTransactionDetailReportModal.fillInEndDate('01/10/2020'); - FinancialTransactionDetailReportModal.verifyEndDateMustBeGreaterThanOrEqualToStartDateErrorMessage(); - }); + it( + 'C343313 Check that the "End date" must be greater than or equal to "Start date" error message is appears when End date is less than Start date', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInStartDate('01/20/2020'); + FinancialTransactionDetailReportModal.fillInEndDate('01/10/2020'); + FinancialTransactionDetailReportModal.verifyEndDateMustBeGreaterThanOrEqualToStartDateErrorMessage(); + }, + ); - it('C343314 Check that the ""Fee/fine owner" is required" error message is appears when user is not selected "Fee/fine owner"', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.fillInStartDate(); - FinancialTransactionDetailReportModal.fillInEndDate(); - FinancialTransactionDetailReportModal.verifyFeeFineOwnerSelect(); - FinancialTransactionDetailReportModal.activateFeeFineOwnerSelect(); - FinancialTransactionDetailReportModal.verifyFeeFineOwnerIsRequiredErrorMessage(); - }); + it( + 'C343314 Check that the ""Fee/fine owner" is required" error message is appears when user is not selected "Fee/fine owner"', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInStartDate(); + FinancialTransactionDetailReportModal.fillInEndDate(); + FinancialTransactionDetailReportModal.verifyFeeFineOwnerSelect(); + FinancialTransactionDetailReportModal.activateFeeFineOwnerSelect(); + FinancialTransactionDetailReportModal.verifyFeeFineOwnerIsRequiredErrorMessage(); + }, + ); - it('C343316 Check that the "Save&close" button has become active after filling in all the required fields with valid data', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); - FinancialTransactionDetailReportModal.verifySaveButtonIsEnabled(); - }); + it( + 'C343316 Check that the "Save&close" button has become active after filling in all the required fields with valid data', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInRequiredFields({ + startDate: false, + ownerName: ownerData.name, + }); + FinancialTransactionDetailReportModal.verifySaveButtonIsEnabled(); + }, + ); - it('C343319 Check that the user can select more than one service points in the "Associated service points" field', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); - FinancialTransactionDetailReportModal.fillInEndDate(); - FinancialTransactionDetailReportModal.fillInServicePoints([servicePoint1.name, servicePoint2.name]); - FinancialTransactionDetailReportModal.save(); - FinancialTransactionDetailReportModal.verifyCalloutMessage(); - }); + it( + 'C343319 Check that the user can select more than one service points in the "Associated service points" field', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInRequiredFields({ + startDate: false, + ownerName: ownerData.name, + }); + FinancialTransactionDetailReportModal.fillInEndDate(); + FinancialTransactionDetailReportModal.fillInServicePoints([ + servicePoint1.name, + servicePoint2.name, + ]); + FinancialTransactionDetailReportModal.save(); + FinancialTransactionDetailReportModal.verifyCalloutMessage(); + }, + ); - it('C343317 Check that the "Export in progress" success toast appear when the user click on the "Save&close" button', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); - FinancialTransactionDetailReportModal.save(); - FinancialTransactionDetailReportModal.verifyCalloutMessage(); - }); + it( + 'C343317 Check that the "Export in progress" success toast appear when the user click on the "Save&close" button', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInRequiredFields({ + startDate: false, + ownerName: ownerData.name, + }); + FinancialTransactionDetailReportModal.save(); + FinancialTransactionDetailReportModal.verifyCalloutMessage(); + }, + ); - it('C343318 Check that the "Something went wrong" error toast appears when the user click on the "Save&close" button', { tags: [TestTypes.criticalPath, DevTeams.vega] }, () => { - UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); - FinancialTransactionDetailReportModal.fillInRequiredFields({ startDate: false, ownerName: ownerData.name }); - FinancialTransactionDetailReportModal.stubResponse500Error(); - FinancialTransactionDetailReportModal.save(); - FinancialTransactionDetailReportModal.verifyCalloutMessage(); - FinancialTransactionDetailReportModal.verifyCalloutErrorMessage(); - }); + it( + 'C343318 Check that the "Something went wrong" error toast appears when the user click on the "Save&close" button', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInRequiredFields({ + startDate: false, + ownerName: ownerData.name, + }); + FinancialTransactionDetailReportModal.stubResponse500Error(); + FinancialTransactionDetailReportModal.save(); + FinancialTransactionDetailReportModal.verifyCalloutMessage(); + FinancialTransactionDetailReportModal.verifyCalloutErrorMessage(); + }, + ); + + it( + 'C343322 Check that "No items found" error toast appears when user click on the "Save&close" button', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInRequiredFields({ + startDate: false, + ownerName: ownerData.name, + }); + FinancialTransactionDetailReportModal.save(); + FinancialTransactionDetailReportModal.verifyCalloutMessage(); + FinancialTransactionDetailReportModal.verifyCalloutNoItemsFoundMessage(); + }, + ); + + it( + 'C343315 Check that the user can select service points in the "Associated service points" field', + { tags: [TestTypes.criticalPath, DevTeams.vega] }, + () => { + UsersSearchResultsPane.openFinancialTransactionDetailReportModal(); + FinancialTransactionDetailReportModal.fillInRequiredFields({ + startDate: false, + ownerName: ownerData.name, + }); + FinancialTransactionDetailReportModal.fillInServicePoints([servicePoint1.name]); + FinancialTransactionDetailReportModal.save(); + FinancialTransactionDetailReportModal.verifyCalloutMessage(); + }, + ); }); diff --git a/cypress/support/fragments/users/financialTransactionDetailReportModal.js b/cypress/support/fragments/users/financialTransactionDetailReportModal.js index 1f8bc4494b..e4ba3c2e16 100644 --- a/cypress/support/fragments/users/financialTransactionDetailReportModal.js +++ b/cypress/support/fragments/users/financialTransactionDetailReportModal.js @@ -1,17 +1,34 @@ import DateTools from '../../utils/dateTools'; -import { Button, Modal, TextField, Select, including, MultiSelect, HTML, Callout, calloutTypes } from '../../../../interactors'; +import { + Button, + Modal, + TextField, + Select, + including, + MultiSelect, + HTML, + Callout, + calloutTypes, +} from '../../../../interactors'; const financialReport = Modal({ id: 'financial-transactions-report-modal' }); const startDateTextfield = TextField({ name: 'startDate' }); const endDateTextfield = TextField({ name: 'endDate' }); -const firstDayOfMonth = DateTools.getFormattedDate({ date: new Date(new Date().getFullYear(), new Date().getMonth(), 1) }, 'MM/DD/YYYY'); -const currentDayOfMonth = DateTools.getFormattedDate({ date: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()) }, 'MM/DD/YYYY'); +const firstDayOfMonth = DateTools.getFormattedDate( + { date: new Date(new Date().getFullYear(), new Date().getMonth(), 1) }, + 'MM/DD/YYYY', +); +const currentDayOfMonth = DateTools.getFormattedDate( + { date: new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()) }, + 'MM/DD/YYYY', +); const feeFineOwnerSelect = Select({ content: including('Select fee/fine owner') }); const startDateFieldCalendarIconLocator = './/div[./*[@name="startDate"]]//*[@icon="calendar"]'; const endDateFieldCalendarIconLocator = './/div[./*[@name="endDate"]]//*[@icon="calendar"]'; const calloutSuccessMessage = 'Export in progress'; const calloutErrorMessage = 'Something went wrong.'; +const calloutNoItemsFoundMessage = 'No items found.'; export default { fillInRequiredFields({ startDate, ownerName }) { @@ -88,7 +105,7 @@ export default { stubResponse500Error() { cy.intercept('POST', '/feefine-reports/financial-transactions-detail', { - statusCode: 500 + statusCode: 500, }); }, @@ -98,9 +115,18 @@ export default { verifyCalloutErrorMessage() { cy.expect(Callout({ type: calloutTypes.error }).is({ textContent: calloutErrorMessage })); }, + verifyCalloutNoItemsFoundMessage() { + cy.expect( + Callout({ type: calloutTypes.error }).is({ textContent: calloutNoItemsFoundMessage }), + ); + }, fillInServicePoints(servicePoints) { - cy.do([financialReport.find(MultiSelect({ label: 'Associated service points' })).choose(servicePoints)]); + cy.do([ + financialReport + .find(MultiSelect({ label: 'Associated service points' })) + .choose(servicePoints), + ]); }, verifyFinancialReportModalIsShown() { @@ -116,7 +142,11 @@ export default { }, closeFinancialReportModalByXButton() { - cy.do(financialReport.find(Button({ id: 'financial-transactions-report-modal-close-button' })).click()); + cy.do( + financialReport + .find(Button({ id: 'financial-transactions-report-modal-close-button' })) + .click(), + ); }, closeFinancialReportModalByCancelButton() { @@ -137,14 +167,22 @@ export default { }, verifyStartDateIsRequiredIfEndDateEnteredErrorMessage() { - cy.expect(financialReport.find(HTML(including('"Start date" is required if "End date" entered'))).exists()); + cy.expect( + financialReport + .find(HTML(including('"Start date" is required if "End date" entered'))) + .exists(), + ); }, verifyEndDateMustBeGreaterThanOrEqualToStartDateErrorMessage() { - cy.expect(financialReport.find(HTML(including('"End date" must be greater than or equal to "Start date"'))).exists()); + cy.expect( + financialReport + .find(HTML(including('"End date" must be greater than or equal to "Start date"'))) + .exists(), + ); }, verifyFeeFineOwnerIsRequiredErrorMessage() { cy.expect(financialReport.find(HTML(including('"Fee/fine owner" is required'))).exists()); - } + }, }; From ca1ec2085fd19c1874ac599e4a5ec90fcdb95629 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Thu, 7 Sep 2023 11:36:10 +0500 Subject: [PATCH 107/437] FAT-7533/fixed unstable tests (#1550) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixed unstable tests * test fix * ädded non parallelization to some tests * fixed C357549 --- .../add-subfields-to-linked-fields.cy.js | 6 ++++-- .../update-controllable-subfield0.cy.js | 4 ++-- .../e2e/inventory/marc-bibliographic.cy.js | 14 +++++++++++-- .../search/browse-in-inventory.cy.js | 3 ++- .../search/search-in-inventory.cy.js | 15 +++++++------- .../e2e/inventory/search/subject-browse.cy.js | 3 ++- .../marc-authority-update.cy.js | 3 ++- ...e_two_marc_bib_linked_marc_authority.cy.js | 20 ++++++++++--------- ...d100-to-authority100-with-subfield-0.cy.js | 2 ++ ...d240-to-authority100-with-subfield-t.cy.js | 4 +++- .../marc-authority-advanced-search.cy.js | 3 ++- .../marc-authority-delete.cy.js | 2 +- .../marc-authority/marc-authority-edit.cy.js | 4 +++- .../marc-authority-import.cy.js | 3 ++- .../marc-authority-reporting.cy.js | 3 ++- .../marc-authority/marc-authority-sort.cy.js | 3 ++- .../marc-authority/marc-authority-view.cy.js | 2 ++ .../e2e/marc-authority/marc-authority.cy.js | 3 ++- ...n-marc-authority-browse-by-corporate.cy.js | 4 ++-- ...ug-in-marc-authority-browse-by-genre.cy.js | 4 ++-- ...-authority-browse-by-geographic-name.cy.js | 10 +++++----- ...rc-authority-browse-by-personal-name.cy.js | 4 ++-- ...rc-authority-browse-by-uniform-title.cy.js | 4 ++-- ...ug-in-marc-authority-search-by-genre.cy.js | 3 ++- ...-in-marc-authority-search-by-subject.cy.js | 3 ++- .../plug-in-marc-authority-search.cy.js | 3 ++- cypress/fixtures/marcAuthFileC385665_3.mrc | 2 +- cypress/fixtures/marcAuthFileForC369084.mrc | 2 +- cypress/fixtures/marcFileForC357549.mrc | 2 +- cypress/fixtures/marcFileForC380551.mrc | 1 + cypress/fixtures/marcFileForC380552.mrc | 1 + cypress/fixtures/marcFileForC380553.mrc | 1 + cypress/fixtures/marcFileForC380555.mrc | 1 + cypress/fixtures/marcFileForC380557.mrc | 1 + cypress/fixtures/marcFileForC385673.mrc | 2 +- 35 files changed, 92 insertions(+), 53 deletions(-) create mode 100644 cypress/fixtures/marcFileForC380551.mrc create mode 100644 cypress/fixtures/marcFileForC380552.mrc create mode 100644 cypress/fixtures/marcFileForC380553.mrc create mode 100644 cypress/fixtures/marcFileForC380555.mrc create mode 100644 cypress/fixtures/marcFileForC380557.mrc diff --git a/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js index 1e9ff61563..674934cc04 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js @@ -84,7 +84,7 @@ describe('data-import', () => { }, { rowIndex: 75, - value: 'Chin, Staceyann,', + value: 'Chin, Staceyann, C385673', tag: 700 }, { @@ -219,10 +219,12 @@ describe('data-import', () => { Logs.clickOnHotLink(0, 3, 'Updated'); InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.verifyTagFieldAfterLinking(33, '100', '1', '\\', '$a Coates, Ta-Nehisi', '$e Writer $e author.', '$0 id.loc.gov/authorities/names/n2008001084', ''); - QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann, C385673', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); QuickMarcEditor.verifyTagFieldAfterLinking(76, '700', '1', '\\', '$a Lee, Stan, $d 1922-2018', '$e AUTHOR $e creator', '$0 id.loc.gov/authorities/names/n83169267', ''); QuickMarcEditor.closeEditorPane(); + //Wait for the content to be loaded. + cy.wait(4000); InventoryInstance.viewSource(); InventoryInstance.checkExistanceOfAuthorityIconInMarcViewPane(); MarcAuthorities.checkFieldAndContentExistence('100', '‡9'); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js index 32ec70e845..47022ffa17 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js @@ -91,7 +91,7 @@ describe('data-import', () => { const linkingTagAndValues = [ { rowIndex: 75, - value: 'Chin, Staceyann' + value: 'Chin, Staceyann C385665' }, { rowIndex: 76, @@ -233,7 +233,7 @@ describe('data-import', () => { InventoryInstance.searchByTitle(createdAuthorityIDs[0]); InventoryInstances.selectInstance(); InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann, $d 1972-', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); + QuickMarcEditor.verifyTagFieldAfterLinking(75, '700', '1', '\\', '$a Chin, Staceyann C385665', '$e letterer.', '$0 id.loc.gov/authorities/names/n2008052404', ''); QuickMarcEditor.verifyTagFieldAfterLinking(76, '700', '1', '\\', '$a Lee, Stan, $d 1922-2018', '$e creator', '$0 id.loc.gov/authorities/names/n83169267', ''); QuickMarcEditor.verifyTagFieldAfterUnlinking(77, '700', '1', '\\', '$a Kirby, Steve, $e creator. $0 id.loc.gov/authorities/names/n77020008test'); }); diff --git a/cypress/e2e/inventory/marc-bibliographic.cy.js b/cypress/e2e/inventory/marc-bibliographic.cy.js index 4fee815f01..459abd07e1 100644 --- a/cypress/e2e/inventory/marc-bibliographic.cy.js +++ b/cypress/e2e/inventory/marc-bibliographic.cy.js @@ -10,6 +10,7 @@ import Users from '../../support/fragments/users/users'; import DevTeams from '../../support/dictionary/devTeams'; import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; import Z3950TargetProfiles from '../../support/fragments/settings/inventory/integrations/z39.50TargetProfiles'; +import Parallelization from '../../support/dictionary/parallelization'; describe('MARC -> MARC Bibliographic', () => { const testData = {}; @@ -45,7 +46,7 @@ describe('MARC -> MARC Bibliographic', () => { InventoryInstance.deleteInstanceViaApi(testData.instanceID); }); - it('C10950 Edit and save a MARC record in quickMARC (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { + it('C10950 Edit and save a MARC record in quickMARC (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventorySearchAndFilter.searchInstanceByTitle(testData.instanceID); InventoryInstance.goToEditMARCBiblRecord(); @@ -57,6 +58,8 @@ describe('MARC -> MARC Bibliographic', () => { QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.deleteConfirmationPresented(); QuickMarcEditor.confirmDelete(); + //Wait for the content to be loaded. + cy.wait(4000); InventoryInstance.viewSource(); InventoryViewSource.contains(expectedInSourceRow); InventoryViewSource.contains(expectedInSourceRowWithSubfield); @@ -75,6 +78,8 @@ describe('MARC -> MARC Bibliographic', () => { QuickMarcEditor.pressSaveAndClose(); InventoryInstance.waitLoading(); + //Wait for the content to be loaded. + cy.wait(4000); InventoryInstance.viewSource(); InventoryViewSource.contains(expectedInSourceRow); InventoryViewSource.close(); @@ -96,6 +101,8 @@ describe('MARC -> MARC Bibliographic', () => { QuickMarcEditor.deleteConfirmationPresented(); QuickMarcEditor.confirmDelete(); InventoryInstance.waitLoading(); + //Wait for the content to be loaded. + cy.wait(4000); InventoryInstance.viewSource(); InventoryViewSource.notContains(deletedTag); }); @@ -131,7 +138,8 @@ describe('MARC -> MARC Bibliographic', () => { const testRecord = { content: 'testContent', tag: '505', tagMeaning: 'Formatted Contents Note' }; const expectedInSourceRow = QuickMarcEditor.fillAllAvailableValues(testRecord.content, testRecord.tag); QuickMarcEditor.pressSaveAndClose(); - + //Wait for the content to be loaded. + cy.wait(4000); InventoryInstance.viewSource(); InventoryViewSource.contains(expectedInSourceRow); InventoryViewSource.close(); @@ -158,6 +166,8 @@ describe('MARC -> MARC Bibliographic', () => { InventoryInstance.checkExpectedMARCSource(); InventoryInstance.checkPresentedText(expectedUpdatedValue); + //Wait for the content to be loaded. + cy.wait(4000); InventoryInstance.viewSource(); InventoryViewSource.contains(expectedCreatedValue); InventoryViewSource.contains(expectedUpdatedValue); diff --git a/cypress/e2e/inventory/search/browse-in-inventory.cy.js b/cypress/e2e/inventory/search/browse-in-inventory.cy.js index 7d54a0cd27..a40b5511fd 100644 --- a/cypress/e2e/inventory/search/browse-in-inventory.cy.js +++ b/cypress/e2e/inventory/search/browse-in-inventory.cy.js @@ -14,6 +14,7 @@ import BrowseContributors from '../../../support/fragments/inventory/search/brow import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('Browse in Inventory', () => { const testData = { @@ -102,7 +103,7 @@ describe('Browse in Inventory', () => { }); }); - it('C388531 Verify that contributors with the same "Name" , "Name type" and "authorityID" will display as one row (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C388531 Verify that contributors with the same "Name" , "Name type" and "authorityID" will display as one row (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventorySearchAndFilter.switchToBrowseTab(); InventorySearchAndFilter.verifyKeywordsAsDefault(); BrowseContributors.select(); diff --git a/cypress/e2e/inventory/search/search-in-inventory.cy.js b/cypress/e2e/inventory/search/search-in-inventory.cy.js index 6a522be504..cba000eef4 100644 --- a/cypress/e2e/inventory/search/search-in-inventory.cy.js +++ b/cypress/e2e/inventory/search/search-in-inventory.cy.js @@ -14,7 +14,8 @@ import { JOB_STATUS_NAMES } from '../../../support/constants'; describe('Search in Inventory', () => { const testData = {}; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const fileName = `testInventoryFile.${getRandomPostfix()}.mrc`; + const fileNameForC360548 = `testInventoryFile.${getRandomPostfix()}.mrc`; + const fileNameForC360555 = `testInventoryFile.${getRandomPostfix()}.mrc`; const createdInstanceIDs = []; before('Creating data', () => { @@ -40,13 +41,13 @@ describe('Search in Inventory', () => { it('C360548 Verify that operator "=" is used when user search for "Instance" by "Contributor" search option. (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { const searchQueries = ['Henri Sauguet', 'Sauguet, Henri, 1901-1989', 'Henri Sauguet 1901-1989']; - DataImport.uploadFile('Sauguet_Henri_5_Bib_records.mrc', fileName); + DataImport.uploadFile('Sauguet_Henri_5_Bib_records.mrc', fileNameForC360548); JobProfiles.waitLoadingList(); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); + JobProfiles.waitFileIsImported(fileNameForC360548); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileName); + Logs.openFileDetails(fileNameForC360548); for (let i = 0; i < 5; i++) { Logs.getCreatedItemsID(i).then(link => { createdInstanceIDs.push(link.split('/')[5]); @@ -75,13 +76,13 @@ describe('Search in Inventory', () => { it('C360555 Verify that search for "Instance" records by "Keyword" option with "" query will only return the records with matched identifier value. (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { const searchQueries = ['978-92-8000-565-9', '978-92-8011-565-9']; - DataImport.uploadFile('two_bib_records_with_isbn_search_by_keyword.mrc', fileName); + DataImport.uploadFile('two_bib_records_with_isbn_search_by_keyword.mrc', fileNameForC360555); JobProfiles.waitLoadingList(); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileName); + JobProfiles.waitFileIsImported(fileNameForC360555); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileName); + Logs.openFileDetails(fileNameForC360555); for (let i = 0; i < 2; i++) { Logs.getCreatedItemsID(i).then(link => { createdInstanceIDs.push(link.split('/')[5]); diff --git a/cypress/e2e/inventory/search/subject-browse.cy.js b/cypress/e2e/inventory/search/subject-browse.cy.js index 8762c7cc6d..b30db59d6d 100644 --- a/cypress/e2e/inventory/search/subject-browse.cy.js +++ b/cypress/e2e/inventory/search/subject-browse.cy.js @@ -10,6 +10,7 @@ import BrowseSubjects from '../../../support/fragments/inventory/search/browseSu 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 Parallelization from '../../../support/dictionary/parallelization'; describe('Inventory > Subject Browse', () => { const testData = { @@ -53,7 +54,7 @@ describe('Inventory > Subject Browse', () => { Users.deleteViaApi(testData.user.userId); }); - it('C350387 Verify the "Browse subjects" result list (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C350387 Verify the "Browse subjects" result list (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventorySearchAndFilter.switchToBrowseTab(); BrowseSubjects.searchBrowseSubjects(testData.testValue); BrowseSubjects.checkSearchResultsTable(); diff --git a/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js b/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js index d8e0ad30a1..2096f8fd88 100644 --- a/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js +++ b/cypress/e2e/marc-authority/Importing-marc-authority-files/marc-authority-update.cy.js @@ -19,6 +19,7 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import ExportFile from '../../../support/fragments/data-export/exportFile'; import FileManager from '../../../support/utils/fileManager'; import SettingsMenu from '../../../support/fragments/settingsMenu'; +import Parallelization from '../../../support/dictionary/parallelization'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; describe('Data Import - Update MARC Authority files', () => { @@ -159,7 +160,7 @@ describe('Data Import - Update MARC Authority files', () => { FileManager.deleteFile(`cypress/fixtures/${testData.csvFile}`); }); - it('C374186 Update "1XX" field value (edit controlling field) of linked "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C374186 Update "1XX" field value (edit controlling field) of linked "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); InventoryInstance.searchByTitle(createdAuthorityIDs[0]); InventoryInstances.selectInstance(); diff --git a/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js b/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js index 69208896f4..994f3072cf 100644 --- a/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js +++ b/cypress/e2e/marc-authority/delete_two_marc_bib_linked_marc_authority.cy.js @@ -16,7 +16,7 @@ import MarcAuthoritiesDelete from '../../support/fragments/marcAuthority/marcAut describe('MARC -> MARC Authority', () => { const testData = { - marcValue: 'Chin, Staceyann, 1972-', + marcValue: 'Chin, Staceyann, 1972- C369084', markedValue: 'Chin, Staceyann,', searchOption: 'Personal name', }; @@ -41,12 +41,12 @@ describe('MARC -> MARC Authority', () => { const linkingTagForFirstMarcBib = [ { rowIndex: 17, - value: 'Chin, Staceyann, 1972-', + value: 'Chin, Staceyann, 1972- C369084', tag: 100 }, { rowIndex: 28, - value: 'Chin, Staceyann, 1972-', + value: 'Chin, Staceyann, 1972- C369084', tag: 600 }, ]; @@ -54,12 +54,12 @@ describe('MARC -> MARC Authority', () => { const linkingTagForSecondMarcBib = [ { rowIndex: 11, - value: 'Chin, Staceyann, 1972-', + value: 'Chin, Staceyann, 1972- C369084', tag: 100 }, { rowIndex: 19, - value: 'Feminist poetry', + value: 'Feminist poetry C369084', tag: 650 }, ]; @@ -158,8 +158,8 @@ describe('MARC -> MARC Authority', () => { InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane('Contributor'); InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane('Subject'); InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(11, '100', '1', '\\', '$a Chin, Staceyann, $d 1972- $e Author $e Narrator $0 id.loc.gov/authorities/names/n2008052404 $1 http://viaf.org/viaf/24074052'); - QuickMarcEditor.verifyTagFieldAfterLinking(19, '650', '\\', '0', '$a Feminist poetry', '', '$0 id.loc.gov/authorities/subjects/sh85047755', ''); + QuickMarcEditor.verifyTagFieldAfterUnlinking(11, '100', '1', '\\', '$a Chin, Staceyann, $d 1972- C369084 $e Author $e Narrator $0 id.loc.gov/authorities/names/n2008052404 $1 http://viaf.org/viaf/24074052'); + QuickMarcEditor.verifyTagFieldAfterLinking(19, '650', '\\', '0', '$a Feminist poetry C369084', '', '$0 id.loc.gov/authorities/subjects/sh85047755', ''); QuickMarcEditor.checkLinkButtonExist('100'); QuickMarcEditor.closeEditorPane(); @@ -168,10 +168,12 @@ describe('MARC -> MARC Authority', () => { InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane('Contributor'); InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane('Subject'); InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(17, '100', '1', '\\', '$a Chin, Staceyann, $d 1972- $e author. $0 id.loc.gov/authorities/names/n2008052404'); - QuickMarcEditor.verifyTagFieldAfterUnlinking(28, '600', '1', '0', '$a Chin, Staceyann, $d 1972- $x Childhood and youth. $0 id.loc.gov/authorities/names/n2008052404'); + QuickMarcEditor.verifyTagFieldAfterUnlinking(17, '100', '1', '\\', '$a Chin, Staceyann, $d 1972- C369084 $e author. $0 id.loc.gov/authorities/names/n2008052404'); + QuickMarcEditor.verifyTagFieldAfterUnlinking(28, '600', '1', '0', '$a Chin, Staceyann, $d 1972- C369084 $x Childhood and youth. $0 id.loc.gov/authorities/names/n2008052404'); QuickMarcEditor.pressCancel(); + //Wait for the content to be loaded. + cy.wait(4000); InventoryInstance.viewSource(); InventoryInstance.checkAbsenceOfAuthorityIconInMarcViewPane(); }); diff --git a/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js b/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js index c69e5dedf1..4d5a335de0 100644 --- a/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js +++ b/cypress/e2e/marc-authority/manual-linking/linking-bibField100-to-authority100-with-subfield-0.cy.js @@ -110,6 +110,8 @@ describe('Manual Linking Bib field to Authority 1XX', () => { MarcAuthorities.checkRecordDetailPageMarkedValue(testData.authority100FieldValue); InventoryInstance.goToPreviousPage(); + //Wait for the content to be loaded. + cy.wait(6000); InventoryInstance.viewSource(); InventoryInstance.clickViewAuthorityIconDisplayedInMarcViewPane(); MarcAuthorities.checkRecordDetailPageMarkedValue(testData.authority100FieldValue); diff --git a/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js b/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js index 542b01f0b7..bfbb4f375b 100644 --- a/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js +++ b/cypress/e2e/marc-authority/manual-linking/linking-bibField240-to-authority100-with-subfield-t.cy.js @@ -104,7 +104,9 @@ describe('Manual Linking Bib field to Authority 1XX', () => { InventoryInstance.clickViewAuthorityIconDisplayedInInstanceDetailsPane(testData.accordion); MarcAuthorities.checkRecordDetailPageMarkedValue(testData.authorityMarkedValue); InventoryInstance.goToPreviousPage(); - + + //Wait for the content to be loaded. + cy.wait(6000); InventoryInstance.viewSource(); InventoryInstance.clickViewAuthorityIconDisplayedInMarcViewPane(); MarcAuthorities.checkRecordDetailPageMarkedValue(testData.authorityMarkedValue); diff --git a/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js b/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js index 6b7015d6a0..e72264fb54 100644 --- a/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-advanced-search.cy.js @@ -9,6 +9,7 @@ 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 MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import Parallelization from '../../support/dictionary/parallelization'; describe('MARC Authority - Advanced Search', () => { const testData = { @@ -68,7 +69,7 @@ describe('MARC Authority - Advanced Search', () => { Users.deleteViaApi(testData.userProperties.userId); }); - it('C350684 Updating Advanced Search query from modal window (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C350684 Updating Advanced Search query from modal window (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { MarcAuthorities.clickActionsButton(); MarcAuthorities.actionsSortBy('Type of heading'); diff --git a/cypress/e2e/marc-authority/marc-authority-delete.cy.js b/cypress/e2e/marc-authority/marc-authority-delete.cy.js index 9ee9de9a78..163f4a861e 100644 --- a/cypress/e2e/marc-authority/marc-authority-delete.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-delete.cy.js @@ -18,7 +18,7 @@ describe('MARC Authority Delete', () => { const testData = { uniqueFileName: `C350643autotestFile.${getRandomPostfix()}.mrc`, fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - record: 'Angelou, Maya. And still I rise', + record: 'Angelou, Maya. And still I rise C357549', searchOption: 'Name-title', }; diff --git a/cypress/e2e/marc-authority/marc-authority-edit.cy.js b/cypress/e2e/marc-authority/marc-authority-edit.cy.js index dea38321b7..17d974a6bf 100644 --- a/cypress/e2e/marc-authority/marc-authority-edit.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-edit.cy.js @@ -12,6 +12,7 @@ import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthoriti import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; import MarcFieldProtection from '../../support/fragments/settings/dataImport/marcFieldProtection'; import { replaceByIndex } from '../../support/utils/stringTools'; +import Parallelization from '../../support/dictionary/parallelization'; describe('MARC Authority -> Edit Authority record', () => { const testData = { @@ -98,7 +99,7 @@ describe('MARC Authority -> Edit Authority record', () => { }); }); - it('C350901 Add multiple / delete 1XX tag of "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C350901 Add multiple / delete 1XX tag of "MARC Authority" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { MarcAuthorities.searchBy(testData.authority.searchOption, testData.authority.title); MarcAuthorities.selectTitle(testData.authority.title); MarcAuthority.edit(); @@ -106,6 +107,7 @@ describe('MARC Authority -> Edit Authority record', () => { QuickMarcEditor.updateExistingTagValue(14, '150'); MarcAuthority.checkAddNew1XXTag(14, '100', '$a'); QuickMarcEditor.closeWithoutSavingAfterChange(); + MarcAuthorities.selectTitle(testData.authority.title); MarcAuthority.contains(testData.authority.title); }); diff --git a/cypress/e2e/marc-authority/marc-authority-import.cy.js b/cypress/e2e/marc-authority/marc-authority-import.cy.js index 36a25e48f9..42bb34cdbe 100644 --- a/cypress/e2e/marc-authority/marc-authority-import.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-import.cy.js @@ -11,6 +11,7 @@ import JobProfiles from '../../support/fragments/data_import/job_profiles/jobPro import Logs from '../../support/fragments/data_import/logs/logs'; import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; import MarcAuthorityBrowse from '../../support/fragments/marcAuthority/MarcAuthorityBrowse'; +import Parallelization from '../../support/dictionary/parallelization'; describe('Data Import - Importing MARC Authority files', () => { const testData = { @@ -50,7 +51,7 @@ describe('Data Import - Importing MARC Authority files', () => { }); }); - it('C360520 Import of "MARC Authority" record with valid prefix in "001" field only (spitfire)', { tags: [TestTypes.smoke, Features.authority, DevTeams.spitfire] }, () => { + it('C360520 Import of "MARC Authority" record with valid prefix in "001" field only (spitfire)', { tags: [TestTypes.smoke, Features.authority, DevTeams.spitfire, Parallelization.nonParallel] }, () => { DataImport.uploadFile('marcFileForC360520.mrc', fileName); JobProfiles.waitLoadingList(); JobProfiles.searchJobProfileForImport(jobProfileToRun); diff --git a/cypress/e2e/marc-authority/marc-authority-reporting.cy.js b/cypress/e2e/marc-authority/marc-authority-reporting.cy.js index 5594f460d1..6eea16113c 100644 --- a/cypress/e2e/marc-authority/marc-authority-reporting.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-reporting.cy.js @@ -15,6 +15,7 @@ import InventoryInstances from '../../support/fragments/inventory/inventoryInsta import DateTools from '../../support/utils/dateTools'; import ExportManagerSearchPane from '../../support/fragments/exportManager/exportManagerSearchPane'; import FileManager from '../../support/utils/fileManager'; +import Parallelization from '../../support/dictionary/parallelization'; describe('MARC Authority -> Reporting | MARC authority', () => { const testData = { @@ -83,7 +84,7 @@ describe('MARC Authority -> Reporting | MARC authority', () => { Users.deleteViaApi(testData.userProperties.userId); }); - it('C375231 "MARC authority headings updates (CSV)" report includes correct number of linked "MARC bib" records (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { + it('C375231 "MARC authority headings updates (CSV)" report includes correct number of linked "MARC bib" records (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire, Parallelization.nonParallel] }, () => { const dataForC375231 = [ { recordTitle: createdAuthorityID[0], diff --git a/cypress/e2e/marc-authority/marc-authority-sort.cy.js b/cypress/e2e/marc-authority/marc-authority-sort.cy.js index 4830a5e728..c1b86bcea5 100644 --- a/cypress/e2e/marc-authority/marc-authority-sort.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-sort.cy.js @@ -10,6 +10,7 @@ import JobProfiles from '../../support/fragments/data_import/job_profiles/jobPro import Logs from '../../support/fragments/data_import/logs/logs'; import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import Parallelization from '../../support/dictionary/parallelization'; // 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); @@ -98,7 +99,7 @@ describe('MARC Authority Sort', () => { Users.deleteViaApi(testData.userProperties.userId); }); - it('C365113 Apply "Authority source" facet to the search result list (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C365113 Apply "Authority source" facet to the search result list (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { MarcAuthorities.searchBy(testData.authority.searchOption, testData.authority.all); MarcAuthorities.checkResultsListRecordsCountGreaterThan(0); MarcAuthorities.checkAuthoritySourceOptions(); diff --git a/cypress/e2e/marc-authority/marc-authority-view.cy.js b/cypress/e2e/marc-authority/marc-authority-view.cy.js index fb2ec56aea..5c8bb2b681 100644 --- a/cypress/e2e/marc-authority/marc-authority-view.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-view.cy.js @@ -39,6 +39,8 @@ describe('MARC Authority management', () => { InventoryInstances.selectInstance(); InventoryInstance.getId().then(id => { instanceID = id; }); InventoryInstance.checkExpectedMARCSource(); + //Wait for the content to be loaded. + cy.wait(2000); InventoryInstance.checkMARCSourceAtNewPane(); }); }); diff --git a/cypress/e2e/marc-authority/marc-authority.cy.js b/cypress/e2e/marc-authority/marc-authority.cy.js index 45506025a8..d2ea7c3736 100644 --- a/cypress/e2e/marc-authority/marc-authority.cy.js +++ b/cypress/e2e/marc-authority/marc-authority.cy.js @@ -12,6 +12,7 @@ import SettingsMenu from '../../support/fragments/settingsMenu'; import NewJobProfile from '../../support/fragments/data_import/job_profiles/newJobProfile'; import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; import MarcAuthorityBrowse from '../../support/fragments/marcAuthority/MarcAuthorityBrowse'; +import Parallelization from '../../support/dictionary/parallelization'; describe('Importing MARC Authority files', () => { const testData = { @@ -84,7 +85,7 @@ describe('Importing MARC Authority files', () => { Users.deleteViaApi(testData.userProperties.userId); }); - it('C350667 Update a MARC authority record via data import. Record match with 010 $a (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { + it('C350667 Update a MARC authority record via data import. Record match with 010 $a (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire, Parallelization.nonParallel] }, () => { cy.visit(TopMenu.dataImportPath); DataImport.uploadFile('test-auth-file.mrc', fileName); JobProfiles.waitLoadingList(); diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js index 9dcb50ea77..b1e20a407e 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-corporate.cy.js @@ -19,7 +19,7 @@ describe('plug-in MARC authority | Browse', () => { typeB: 'Reference', typeOfHeadingA: 'Corporate Name', typeOfHeadingB: 'Conference Name', - title: 'Apple Academic Press', + title: 'Apple Academic Press C380552', }; const marcFiles = [ @@ -30,7 +30,7 @@ describe('plug-in MARC authority | Browse', () => { numOfRecords: 1, }, { - marc: 'marcFileForC359228.mrc', + marc: 'marcFileForC380552.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', numOfRecords: 5, diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js index 2398bf3539..24561e19dc 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-genre.cy.js @@ -16,7 +16,7 @@ import InventorySearchAndFilter from '../../../support/fragments/inventory/inven describe('plug-in MARC authority | Browse', () => { const testData = { searchOption: 'Genre', - value: 'Peplum films', + value: 'Peplum films C380557', }; const marcFiles = [ @@ -27,7 +27,7 @@ describe('plug-in MARC authority | Browse', () => { numOfRecords: 1, }, { - marc: 'marcFileForC380572.mrc', + marc: 'marcFileForC380557.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', numOfRecords: 1, diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js index 9b82465555..31fcdac2b8 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-geographic-name.cy.js @@ -15,7 +15,7 @@ import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthor describe('plug-in MARC authority | Browse', () => { const testData = { searchOption: 'Geographic name', - value: 'Gulf Stream', + value: 'Gulf Stream C380553', }; const marcFiles = [ @@ -26,7 +26,7 @@ describe('plug-in MARC authority | Browse', () => { numOfRecords: 1, }, { - marc: 'marcFileForC359229.mrc', + marc: 'marcFileForC380553.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', numOfRecords: 2, @@ -90,8 +90,8 @@ describe('plug-in MARC authority | Browse', () => { MarcAuthorities.selectTitle(testData.value); MarcAuthorities.checkFieldAndContentExistence('151', testData.value); InventoryInstance.checkRecordDetailPage(testData.value); - MarcAuthorities.searchBy('Personal name', 'North End (Boston, Mass.)'); - MarcAuthorities.selectTitle('North End (Boston, Mass.)'); - InventoryInstance.checkRecordDetailPage('North End (Boston, Mass.)'); + MarcAuthorities.searchBy('Personal name', 'North End (Boston, Mass.) C380553'); + MarcAuthorities.selectTitle('North End (Boston, Mass.) C380553'); + InventoryInstance.checkRecordDetailPage('North End (Boston, Mass.) C380553'); }); }); \ No newline at end of file diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js index 2af68f80bc..94c4a90084 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-personal-name.cy.js @@ -16,7 +16,7 @@ import InventorySearchAndFilter from '../../../support/fragments/inventory/inven describe('plug-in MARC authority | Browse', () => { const testData = { searchOption: 'Personal name', - value: 'Erbil, H. Yıldırım', + value: 'Erbil, H. Yıldırım C380551', }; const marcFiles = [ @@ -27,7 +27,7 @@ describe('plug-in MARC authority | Browse', () => { numOfRecords: 1, }, { - marc: 'marcFileForC359206.mrc', + marc: 'marcFileForC380551.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', numOfRecords: 2, diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js index 29383d2ebd..dce1c5ed45 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-browse-by-uniform-title.cy.js @@ -15,7 +15,7 @@ import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthor describe('plug-in MARC authority | Browse', () => { const testData = { searchOption: 'Uniform title', - value: 'Marvel comics', + value: 'Marvel comics C380555', }; const marcFiles = [ @@ -26,7 +26,7 @@ describe('plug-in MARC authority | Browse', () => { numOfRecords: 1, }, { - marc: 'marcFileForC359231.mrc', + marc: 'marcFileForC380555.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', numOfRecords: 1, diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js index fcfceb68a1..e809962c65 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-genre.cy.js @@ -11,6 +11,7 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import getRandomPostfix from '../../../support/utils/stringTools'; import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('plug-in MARC authority | Search', () => { const testData = { @@ -76,7 +77,7 @@ describe('plug-in MARC authority | Search', () => { }); }); - it('C380572 MARC Authority plug-in | Search using "Genre" option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C380572 MARC Authority plug-in | Search using "Genre" option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventoryInstance.searchByTitle(createdAuthorityIDs[0]); InventoryInstances.selectInstance(); InventoryInstance.editMarcBibliographicRecord(); diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js index 6d10f3f50e..2f7c405751 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search-by-subject.cy.js @@ -11,6 +11,7 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import getRandomPostfix from '../../../support/utils/stringTools'; import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('plug-in MARC authority | Search', () => { const testData = { @@ -82,7 +83,7 @@ describe('plug-in MARC authority | Search', () => { } }); - it('C380571 MARC Authority plug-in | Search using "Subject" option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C380571 MARC Authority plug-in | Search using "Subject" option (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventoryInstance.searchByTitle(createdAuthorityIDs[0]); InventoryInstances.selectInstance(); InventoryInstance.editMarcBibliographicRecord(); diff --git a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js index da5022136c..963e4cae89 100644 --- a/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js +++ b/cypress/e2e/marc-authority/plug-in-marc-authority/plug-in-marc-authority-search.cy.js @@ -11,6 +11,7 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import getRandomPostfix from '../../../support/utils/stringTools'; import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; +import Parallelization from '../../../support/dictionary/parallelization'; describe('plug-in MARC authority | Search', () => { const testData = { @@ -146,7 +147,7 @@ describe('plug-in MARC authority | Search', () => { }); }); - it('C380565 MARC Authority plug-in | Search for MARC authority records when the user clicks on the "Link" icon (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { + it('C380565 MARC Authority plug-in | Search for MARC authority records when the user clicks on the "Link" icon (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire, Parallelization.nonParallel] }, () => { InventoryInstance.searchByTitle(createdAuthorityIDs[0]); InventoryInstances.selectInstance(); InventoryInstance.editMarcBibliographicRecord(); diff --git a/cypress/fixtures/marcAuthFileC385665_3.mrc b/cypress/fixtures/marcAuthFileC385665_3.mrc index ca64ef8748..076ddaf328 100644 --- a/cypress/fixtures/marcAuthFileC385665_3.mrc +++ b/cypress/fixtures/marcAuthFileC385665_3.mrc @@ -1 +1 @@ -01031cz a2200241n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139053001700160100002800177370004400205372004100249374002700290375001100317377000800328670013700336670009300473670021400566953000900780761350820170217073826.0080801n| azannaabn |n aaa  an 2008052404 a(OCoLC)oca07838205 aDLCbengerdacDLCdDLCdInU f1972-12-252edtf 0aPR9265.9.C531 aChin, Staceyann,d1972- aJamaicaeBrooklyn (New York, N.Y.)2naf aSpoken word poetryaGay rights2lcsh aPoetsaActivists2lcsh afemale aeng aThe other side of paradise, 2009:bt.p. (Staceyann Chin) dataview (b. Dec. 25, 1972; spoken word poet and gay activist from Jamaica) awww.staceyannchin.com, Aug. 1, 2008b(resident of New York City and a Jamaican national) aWikipedia, 16 Feb. 2017b(Staceyann Chin; b. 25 Dec. 1972 in Jamaica; spoken-word poet, performing artist, and LGBT rights activist; is of Chinese-Jamaican and Afro-Jamaican descent; now lives in Brooklyn, NY) alh45 \ No newline at end of file +01031cz a2200241n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139053001700160100002800177370004400205372004100249374002700290375001100317377000800328670013700336670009300473670021400566953000900780761350820170217073826.0080801n| azannaabn |n aaa  an 2008052404 a(OCoLC)oca07838205 aDLCbengerdacDLCdDLCdInU f1972-12-252edtf 0aPR9265.9.C531 aChin, Staceyann C385665 aJamaicaeBrooklyn (New York, N.Y.)2naf aSpoken word poetryaGay rights2lcsh aPoetsaActivists2lcsh afemale aeng aThe other side of paradise, 2009:bt.p. (Staceyann Chin) dataview (b. Dec. 25, 1972; spoken word poet and gay activist from Jamaica) awww.staceyannchin.com, Aug. 1, 2008b(resident of New York City and a Jamaican national) aWikipedia, 16 Feb. 2017b(Staceyann Chin; b. 25 Dec. 1972 in Jamaica; spoken-word poet, performing artist, and LGBT rights activist; is of Chinese-Jamaican and Afro-Jamaican descent; now lives in Brooklyn, NY) alh45 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileForC369084.mrc b/cypress/fixtures/marcAuthFileForC369084.mrc index a6d7cd1fef..f2af74f966 100644 --- a/cypress/fixtures/marcAuthFileForC369084.mrc +++ b/cypress/fixtures/marcAuthFileForC369084.mrc @@ -1 +1 @@ -00407cz a2200169n 4500001000800000005001700008008004100025010001700066035002100083035001500104040001800119150002000137550001400157906001800171952003300189953001500222469947220120323073631.0860211 | anannbabn |a ana  ash 85047755  a(DLC)sh 85047755 a(DLC)46157 aDLCcDLCdDLC aFeminist poetry wgaPoetry t9007ufk04v0 a0 bib. records to be changed axx00btd1401031cz a2200241n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139053001700160100002800177370004400205372004100249374002700290375001100317377000800328670013700336670009300473670021400566953000900780761350820170217073826.0080801n| azannaabn |n aaa  an 2008052404 a(OCoLC)oca07838205 aDLCbengerdacDLCdDLCdInU f1972-12-252edtf 0aPR9265.9.C531 aChin, Staceyann,d1972- aJamaicaeBrooklyn (New York, N.Y.)2naf aSpoken word poetryaGay rights2lcsh aPoetsaActivists2lcsh afemale aeng aThe other side of paradise, 2009:bt.p. (Staceyann Chin) dataview (b. Dec. 25, 1972; spoken word poet and gay activist from Jamaica) awww.staceyannchin.com, Aug. 1, 2008b(resident of New York City and a Jamaican national) aWikipedia, 16 Feb. 2017b(Staceyann Chin; b. 25 Dec. 1972 in Jamaica; spoken-word poet, performing artist, and LGBT rights activist; is of Chinese-Jamaican and Afro-Jamaican descent; now lives in Brooklyn, NY) alh45 \ No newline at end of file +00415cz a2200169n 4500001000800000005001700008008004100025010001700066035002100083035001500104040001800119150002800137550001400165906001800179952003300197953001500230469947220120323073631.0860211 | anannbabn |a ana  ash 85047755  a(DLC)sh 85047755 a(DLC)46157 aDLCcDLCdDLC aFeminist poetry C369084 wgaPoetry t9007ufk04v0 a0 bib. records to be changed axx00btd1401039cz a2200241n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139053001700160100003600177370004400213372004100257374002700298375001100325377000800336670013700344670009300481670021400574953000900788761350820170217073826.0080801n| azannaabn |n aaa  an 2008052404 a(OCoLC)oca07838205 aDLCbengerdacDLCdDLCdInU f1972-12-252edtf 0aPR9265.9.C531 aChin, Staceyann,d1972- C369084 aJamaicaeBrooklyn (New York, N.Y.)2naf aSpoken word poetryaGay rights2lcsh aPoetsaActivists2lcsh afemale aeng aThe other side of paradise, 2009:bt.p. (Staceyann Chin) dataview (b. Dec. 25, 1972; spoken word poet and gay activist from Jamaica) awww.staceyannchin.com, Aug. 1, 2008b(resident of New York City and a Jamaican national) aWikipedia, 16 Feb. 2017b(Staceyann Chin; b. 25 Dec. 1972 in Jamaica; spoken-word poet, performing artist, and LGBT rights activist; is of Chinese-Jamaican and Afro-Jamaican descent; now lives in Brooklyn, NY) alh45 \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC357549.mrc b/cypress/fixtures/marcFileForC357549.mrc index 7d4a9d8fe5..d0ad44376f 100644 --- a/cypress/fixtures/marcFileForC357549.mrc +++ b/cypress/fixtures/marcFileForC357549.mrc @@ -1 +1 @@ -00446cz a2200145n 4500001000800000005001700008008004100025010001700066040002800083100003700111400003300148670004900181670006100230953000900291518302220140528102603.0000831n| azannaabn |a aaa  an 00041513  aDLCbengerdacDLCdDLC1 aAngelou, Maya.tAnd still I rise1 aAngelou, Maya.tStill I rise aAngelou, Maya. Still I rise, 2001:bCIP t.p. aLC database, 08-31-00b(Angelou, Maya. And still I rise) alh07 \ No newline at end of file +00462cz a2200145n 4500001000800000005001700008008004100025010001700066040002800083100004500111400004100156670004900197670006100246953000900307518302220140528102603.0000831n| azannaabn |a aaa  an 00041513  aDLCbengerdacDLCdDLC1 aAngelou, Maya.tAnd still I rise C3575491 aAngelou, Maya.tStill I rise C357549 aAngelou, Maya. Still I rise, 2001:bCIP t.p. aLC database, 08-31-00b(Angelou, Maya. And still I rise) alh07 \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC380551.mrc b/cypress/fixtures/marcFileForC380551.mrc new file mode 100644 index 0000000000..50df83e7ce --- /dev/null +++ b/cypress/fixtures/marcFileForC380551.mrc @@ -0,0 +1 @@ +00729cz a2200145n 4500001001300000008004100013005001700054010003100071040002300102100003400125400003700159400003000196670014800226670020900374n 00000911 000225n| acannaabn |a aaa 20220728213423.7 an 00000911 zn 2005070769 aDLCbengcDLCdDLC1 aErbil, H. Yıldırım C3805511 aErbil, Y.q(Yıldırım) C3805511 aErbil,cProfessor C380551 aErbil, H. Yıldırım. Vinyl acetate emulsion polymerization and copolymerization with acrylic monomers, 2000:bCIP t.p. (H. Yıldırım Erbil) aSurface chemistry of solid and liquid interfaces, 2006:bCIP t.p. (Professor Erbil; Gebze Institute of Technology, Faculty of Engineering, Department of Chemical Engineering, Turkey) data view (Erbil, Y.)03770cz a2200493n 4500001000700000008004100007005001700048010003100065024006200096024006300158024005600221024004400277024011700321024005500438035002300493040004300516046001500559100006900574370011000643380006900753380007300822380009500895380008400990380007901074380006801153380007701221386008201298386007601380400009201456400006501548400005501613400008601668500016501754500015701919530018802076530018702264667009702451670013402548670007902682670004202761670039802803670006003201953001503261500804791115n| azannaabn |a aaa 20220830093525.4 an 79132705 zn 79125030 7 aQ2154102wikidata1http://www.wikidata.org/entity/Q2154108 1http://dbpedia.org/resource/Adventures_of_Huckleberry_Finn7 a1788061362viaf1http://www.viaf.org/viaf/1788061368 1http://worldcat.org/entity/work/id/61327 acdd30e78-a598-45b0-b2ec-6f72c5b41a3c2musicb1http://musicbrainz.org/work/cdd30e78-a598-45b0-b2ec-6f72c5b41a3c#_7 a13561102fast0http://id.worldcat.org/fast/1356110 a(OCoLC)oca00364098 aDLCbengerdacDLCdDLCdOrUdDLCdWaU k18842edtf1 aTwain, Mark,d1835-1910.tAdventures of Huckleberry Finn C380551 gUnited States2naf0http://id.loc.gov/authorities/names/n780953301http://id.loc.gov/rwo/agents/n78095330 aFiction2lcsh0http://id.loc.gov/authorities/subjects/sh85048050 aNovels2lcgft0http://id.loc.gov/authorities/genreForms/gf2015026020 aAction and adventure fiction2lcgft0http://id.loc.gov/authorities/genreForms/gf2014026217 aSatirical fiction2lcgft0http://id.loc.gov/authorities/genreForms/gf2018026115 aAdventure stories2lcsh0http://id.loc.gov/authorities/subjects/sh85001072 aSatire2lcsh0http://id.loc.gov/authorities/subjects/sh85117645 aSocial satire2lcsh0http://id.loc.gov/authorities/subjects/sh2008009879 aAmericans2lcdgt0http://id.loc.gov/authorities/demographicTerms/dg2015060001 aMen2lcdgt0http://id.loc.gov/authorities/demographicTerms/dg20150603591 aTwain, Mark,d1835-1910.tAdventures of Huckleberry Finn (Tom Sawyer's comrade) C3805511 aTwain, Mark,d1835-1910.tAnnotated Huckleberry Finn C3805511 aTwain, Mark,d1835-1910.tHuckleberry Finn C3805511 aTwain, Mark,d1835-1910.tMark Twain's The adventures of Huckleberry Finn C3805511 wriAuthor:aTwain, Mark,d1835-19100http://id.loc.gov/authorities/names/n790211641http://id.loc.gov/rwo/agents/n790211641http://www.wikidata.org/entity/Q72451 wriSequel to:aTwain, Mark,d1835-1910.tAdventures of Tom Sawyer0http://id.loc.gov/authorities/names/n791327041http://www.wikidata.org/entity/Q326914 0wriAdapted as motion picture (work):aAdventures of Huckleberry Finn (Motion picture : 1939)0http://id.loc.gov/authorities/names/no20141119841http://www.wikidata.org/entity/Q2472318 0wriAdapted as motion picture (work):aAdventures of Huckleberry Finn (Motion picture : 1960)0http://id.loc.gov/authorities/names/no20141115351http://www.wikidata.org/entity/Q319115 aURIs added to this record for the PCC URI MARC Pilot. Please do not remove or edit the URIs. aHis Tom Sawyer and Huckleberry Finn, 1979, c1980:bt.p. (containing the complete texts of ... The adventures of Huckleberry Finn) aTwain, M. The adventures of Huckleberry Finn (Tom Sawyer's comrade), 1884. aThe annotated Huckleberry Finn, 1981. aWikipedia, August 22, 2014b(Adventures of Huckleberry Finn (or, in more recent editions, The Adventures of Huckleberry Finn) is a novel by Mark Twain, first published in the United Kingdom in December 1884 and in the United States in February 1885; a direct sequel to The Adventures of Tom Sawyer; genre: Satirical novel; an often scathing satire on entrenched attitudes, particularly racism) aMark Twain's The adventures of Huckleberry Finn, c1975. abe20blk19 \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC380552.mrc b/cypress/fixtures/marcFileForC380552.mrc new file mode 100644 index 0000000000..2624b880c2 --- /dev/null +++ b/cypress/fixtures/marcFileForC380552.mrc @@ -0,0 +1 @@ +01071cz a2200169n 4500001000800000005001700008008004100025010001700066035002300083040003300106111006700139411006900206511007100275667009500346670012200441675033800563897908920120828074806.0120502n| acannaabn |a ana c ano2012061368 a(OCoLC)oca09186965 aOkSbengcOkSdOkSdDLCdOkS2 aWestern Region Agricultural Education Research Meeting C3805522 aWestern Regional Agricultural Education Research Meeting C3805522 wbaWestern Region Agricultural Education Research Seminar (1983- ) aTHIS 1XX FIELD CANNOT BE USED UNDER RDA UNTIL THIS RECORD HAS BEEN REVIEWED AND/OR UPDATED aFirst annual Western Region Agricultural Education Research Meeting, 1982:bt.p. (held April 26, 1982, Austin, Texas) aSecond annual Western Region Agricultural Education Research Seminar, 1983: t.p. (held April 19, 1983, Rio Rico, Arizona) p. [3] (2nd Western Regional Research Meeting)aResearch in agricultural education, 1993: cover (Twelfth annual Western Regional Agricultural Education Research Meeting; held in Bozeman, Montana, April 14, 1993)01031cz a2200169n 4500001000800000005001700008008004100025010001700066035002300083040002300106111007300129511007100202511006200273667009500335670012900430675030200559900934520120820081718.0120605n| acannaabn |a ana c ano2012077746 a(OCoLC)oca09217880 aOkSbengcOkSdDLC2 aWestern Region Research Conference in Agricultural Education C3805522 waaWestern Region Agricultural Education Research Seminar (1983- )2 wbaWestern Region Agricultural Education Research Meeting aTHIS 1XX FIELD CANNOT BE USED UNDER RDA UNTIL THIS RECORD HAS BEEN REVIEWED AND/OR UPDATED aWestern Region Research Conference in Agricultural Education, 1984:bcover (held Oklahoma City, Oklahoma, April 23-24, 1984) aSecond annual Western Region Agricultural Education Research Seminar, 1983: t.p (held April 19, 1983, Rio Rico, Arizona)aEducational excellence for the no. 1 industry "agriculture," 1985: cover (Western Region 4th Annual Agricultural Education Research Meeting; held April 17, 1985, Boise, Idaho)00528nz a2200169n 4500001000800000005001700008008004100025010001700066035002100083040001300104110003800117410004000155410003700195670010300232953000900335985001400344321927819980528051132.6980415n| acannaab |a ana c anr 98013926  a(DLC)nr 98013926 aCStcCSt20aApple & Honey Productions C38055220aApple and Honey Productions C38055220aApple & Honey Film Corp. C380552 aThe Quarrel, c1996:bcredits (Apple & Honey Productions) cassette label (Apple & Honey Film Corp.) axx00 cRLGeLSPC00563nz a2200145n 4500001000800000005001700008008004100025010001700066035002300083040002200106110009900128410002300227410001800250670014900268606365020031001052609.0030930n| acannaabn |a ana  ano2003097702 a(OCoLC)oca06164925 aDLC-SbengcDLC-S2 aAssociation pour la promotion et la protection de la liberteÌ d'expression au Burundi C3805522 aA.P.P.L.E. C3805522 aAPPLE C380552 aGuide de la presse burundaise, 1996:bt.p. (Association pour la promotion et la protection de la liberteÌ d'expression au Burundi (A.P.P.L.E.))00351cz a2200109n 4500001000800000005001700008008004100025010001700066040002800083110003300111670009700144975152920160621105355.0150112n| azannaabn |n ana  an 2015002050 aDLCbengerdacDLCdDLC2 aApple Academic Press C380552 aChemical technology, 2015:bECIP t.p. (Apple Academic Press; loc., Toronto [and] New Jersey) \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC380553.mrc b/cypress/fixtures/marcFileForC380553.mrc new file mode 100644 index 0000000000..59501f37f5 --- /dev/null +++ b/cypress/fixtures/marcFileForC380553.mrc @@ -0,0 +1 @@ +01038cz a2200217n 4500001000800000005001700008008004100025010003100066034005800097035002300155040004300178043001200221151003800233368002400271370003900295410003900334667008200373670005700455670029900512953000900811179271120160403123639.0970228n| azannaabn |a ana  an 97021259 zsh 85092514  d-71.055107e-71.055107f42.363949g42.3639492wikiped a(OCoLC)oca04282880 aDLCbengerdacDLCdDLCdWaUdDLCdWaU an-us-ma aNorth End (Boston, Mass.) C380553 bNeighborhoods2lcsh cUnited StateseBoston (Mass.)2naf1 aBoston (Mass.).bNorth End C380553 aSUBJECT USAGE: This heading is not valid for use as a geographic subdivision. aBoston's first neighborhood : the North End, ©1976. aWikipedia, April 1, 2016:bNorth End, Boston (The North End is a neighborhood of Boston, Massachusetts, United States. It has the distinction of being the city's oldest residential community, where people have continuously inhabited since it was settled in the 1630s; 42.363949°N 71.055107°W) ata0000424cz a2200181n 4500001000800000005001700008008004100025010001700066035002100083035001500104040001800119053001000137151002400147550002200171781001600193906001800209953001500227470925320120326095037.0860211|| anannbabn |a ana  ash 85057894  a(DLC)sh 85057894 a(DLC)55938 aDLCcDLCdDLC 0aGC296 aGulf Stream C380553 wgaOcean currents 0zGulf Stream t64--u----v0 axx00btd14 \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC380555.mrc b/cypress/fixtures/marcFileForC380555.mrc new file mode 100644 index 0000000000..93e9ccad81 --- /dev/null +++ b/cypress/fixtures/marcFileForC380555.mrc @@ -0,0 +1 @@ +00399cz a2200133n 4500001001300000003000400013008004100017005001700058010001700075040001800092130002600110670007900136670005000215n 80026980 DLC800331n| acannaab| |n ana ||| 20220816153125.5 an 80026980  aDLCcDLCdDLC 0aMarvel comics C380555 aData from Tales of suspense ... [FS] 1979 (a.e.)b(Marvel classics comics) aSci. fic. encyclopedia, 1979b(Marvel comics)00395cz a2200133n 4500001001300000003000400013008004100017005001700058010001700075040001800092130002200110670007900132670005000211n 80026980 DLC800331n| acannaab| |n ana ||| 20220816153125.5 an 80026980  aDLCcDLCdDLC 0aDC comics C380555 aData from Tales of suspense ... [FS] 1979 (a.e.)b(Marvel classics comics) aSci. fic. encyclopedia, 1979b(Marvel comics) \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC380557.mrc b/cypress/fixtures/marcFileForC380557.mrc new file mode 100644 index 0000000000..0640b06860 --- /dev/null +++ b/cypress/fixtures/marcFileForC380557.mrc @@ -0,0 +1 @@ +03051cz a2200301n 4500001001300000003000400013008004100017005001700058010003100075040003500106155002500141455002800166455002800194455003600222455005300258455004900311455005300360455005300413555003100466670021200497670041900709670009601128670101901224670013002243670009702373670019902470680008002669gf2011026439DLC110507|| anznnbabn |a ana 20220830075325.6 agf2011026439zsh2007025255 aDLCbengcDLCflcgftdDLCdWaU aPeplum films C380557 aGladiator films C380557 aMuscleman films C380557 aPepla (Motion pictures) C380557 aSandal-and-spear epics (Motion pictures) C380557 aSex-and-sand epics (Motion pictures) C380557 aSpear-and-sandal epics (Motion pictures) C380557 aSword-and-sandal epics (Motion pictures) C380557 wgaMotion pictures C380557 aWork cat.: Gladiator (Motion picture : 2000). Gladiator, 2003b(summary: When a Roman general is betrayed and his family murdered by an emperor's corrupt son, he comes to Rome as a gladiator to seek revenge) aLoÌpez, D. Films by genre, ©1993b(Peplum (Sex-and-Sand Epic, S & S Movie); Peplums are minor epics featuring mythological, biblical, and Italian-created strongmen elevated to the category of popular heroes: Hercules, Maciste, Ursus, Samson, Goliath, Taur; has also been referred to as sword-and-sandal epic, sandal-and-spear/s epic, spear-and-sandal epic, cloak-and sandal, gladiator, and muscle/muscleman epic) aMoving image genre-form guide via WWW, July 19, 2007:b(peplum: see Ancient world; Fantasy) aThe Mondo-Esoterica guide to the peplum, via WWW, May 2, 2018b(term Peplum most commonly applied to the mass of muscle-man movies that sprung up in the 1960s after the success of Hercules (1958). However, like most euro-cult expressions it has become confused and re-used heavily down the years, most often interchangably with the generic term "Sword and Sandal" leading to many American made films being rather incorrectly classified as Pepla; incorporating the traditional muscleman films as well as historical epics and adventure pictures with a classical/ancient setting (from Ancient Egypt through to around 700 AD) but not including more modern-set historical epics and muscleman films or the Biblical epics of which the Italians shot many during the 1960s; The Peplum should also not be confused with the later "Sword and Scorcery" genre that arose from the success of Conan the Barbarian (1982) and although there is a lot of overlap, the latter distinctly employed more high fantasy and magical elements) aOf muscles and men : essays on the sword and sandal film, ©2011:bp. 5 (the peplum; pepla; peplum or sword and sandal films) aGünsberg, M. Italian cinema : gender and genre, 2005:bp. 17 (peplum films) p. 103 (pepla) aGoogle, July 14, 2018:b(peplum films: 18,100 hits; cloak-and-sandal films: 2 hits; muscleman films: 419 hits; pepla: 28,500 hits; sex-and-sand epics: 213 hits; Spear-and-sandal epics: 197 hits) iFilms that feature mythological, biblical, or invented strongmen as heroes. \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC385673.mrc b/cypress/fixtures/marcFileForC385673.mrc index 72bba285d6..ac1f1f3c6f 100644 --- a/cypress/fixtures/marcFileForC385673.mrc +++ b/cypress/fixtures/marcFileForC385673.mrc @@ -1 +1 @@ -01934cz a2200313n 4500001000800000005001700008008004100025010001700066035002300083040007300106046003300179053001700212100002600229370008200255372005200337373002900389374005400418374002200472377000800494400003900502400002000541670009400561670004400655670007600699670010600775670064400881670008001525953001501605242619020190610154002.0831201n| azannaabn a aaa  an 83169267  a(OCoLC)oca00990699 aDLCbengerdacDLCdDLCdOCoLCdDLCdDLCdIOrQBIdDLCdViUdDLCdMnU f1922-12-28g2018-11-122edtf 0aPS3562.E36471 aLee, Stan,d1922-2018 aManhattan (New York, N.Y.)bLos Angeles (Calif.)eBronx (New York, N.Y.)2naf aComic books, strips, etc.aGraphic novels2lcsh aMarvel Comics Group2naf aAuthorsaEditorsaPublishers and publishing2lcsh aComic book writer aeng1 aLieber, Stanley Martin,d1922-20181 wnneaaLee, Stan aHis Stan Lee presents the Incredible Hulk pop-up-book, "Trapped", c1982:bt.p. (Stan Lee) aLC data base, 9-7-83b(hdg.: Lee, Stan) aExcelsior! 2002:bCIP t.p. (Stan Lee) data sheet (b. December 28, 1922) aStan Lee, c2006:bECIP t.p. (Stan Lee) chap. 2 (Stanley Martin Lieber, b. in New York, Dec. 28, 1922) aNew York times WWW site, viewed Nov. 13, 2018b(in obituary published Nov. 12: Stan Lee; b. Stanley Martin Lieber, Dec. 28, 1922, Manhattan; moved with his family to the Bronx; d. Monday [Nov. 12, 2018], Los Angeles, aged 95; superhero of Marvel Comics; helped create Spider-Man, the X-Men, the Fantastic Four, Iron Man, and others while overseeing his company's emergence as a media behemoth; writer, editor, publisher, Hollywood executive; used several pseudonyms to give the impression that Marvel had a large stable of writers; the name that stuck was simply his first name split in two; in the 1970s, he legally changed Lieber to Lee) aOCLC, February 18, 2019b(authorized access point prior to 2009: Lee, Stan) abe26brc1501031cz a2200241n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139053001700160100002800177370004400205372004100249374002700290375001100317377000800328670013700336670009300473670021400566953000900780761350820170217073826.0080801n| azannaabn |n aaa  an 2008052404 a(OCoLC)oca07838205 aDLCbengerdacDLCdDLCdInU f1972-12-252edtf 0aPR9265.9.C531 aChin, Staceyann,d1972- aJamaicaeBrooklyn (New York, N.Y.)2naf aSpoken word poetryaGay rights2lcsh aPoetsaActivists2lcsh afemale aeng aThe other side of paradise, 2009:bt.p. (Staceyann Chin) dataview (b. Dec. 25, 1972; spoken word poet and gay activist from Jamaica) awww.staceyannchin.com, Aug. 1, 2008b(resident of New York City and a Jamaican national) aWikipedia, 16 Feb. 2017b(Staceyann Chin; b. 25 Dec. 1972 in Jamaica; spoken-word poet, performing artist, and LGBT rights activist; is of Chinese-Jamaican and Afro-Jamaican descent; now lives in Brooklyn, NY) alh4501874cz a2200265n 4500001000800000005001700008008004100025010001700066035002300083040005100106046002100157053001500178100002200193370004000215373002700255373010400282374003100386375001700417377000800434378001900442670008300461670090700544670014801451953000901599739428420190330083358.0080107n| azannaabn |n aaa  an 2008001084 a(OCoLC)oca07622362 aDLCbengerdacDLCdDHU-MSdInUdScUdVtUdDLC f1975-09-302edtf 0aPS3603.O171 aCoates, Ta-Nehisi aBaltimore (Md.)cUnited States2naf aHoward University2naf aWashington Post (Newspaper)aWashington Times (Newspaper)aVillage Voice (Newspaper)aTime Magazine aJournalistsaAuthors2lcsh aMales2lcdgt aeng qTa-Nehisi Paul aCoates, Ta-Nehisi. The beautiful struggle, 2008:beCIP t.p. (Ta-Nehisi Coates) aAfrican American National Biography, accessed December 12 2014, via Oxford African American Studies Center database:b(Coates, Ta-Nehisi; print journalist, autobiographer / memoirist; born 1975 in Baltimore, Maryland, United States; his name is the word ancient Egyptians used for the land of Nubia; grew up in a West Baltimore during the 1980s epidemic of crack cocaine and its accompanying violent turf battles; attended Howard University, from 1993 until 1997; became a journalist around 1996, when he started writing for the Washington Times and then the Washington Post; his writing and reporting talent later took him to Washington Monthly, Entertainment Weekly, and the Village Voice; worked at the Voice until 2004, when he went to work for Time Magazine between 2005 and 2007; his memoir, The Beautiful Struggle: A Father, Two Sons, and an Unlikely Road to Manhood, was also published in 2008) aWikipedia, 16 Feb. 2017b(Ta-Nehisi Coates; Ta-Nehisi Paul Coates; b. 30 Sep. 1975 in Baltimore, MD; American writer, journalist, and educator) alk32 \ No newline at end of file +01934cz a2200313n 4500001000800000005001700008008004100025010001700066035002300083040007300106046003300179053001700212100002600229370008200255372005200337373002900389374005400418374002200472377000800494400003900502400002000541670009400561670004400655670007600699670010600775670064400881670008001525953001501605242619020190610154002.0831201n| azannaabn a aaa  an 83169267  a(OCoLC)oca00990699 aDLCbengerdacDLCdDLCdOCoLCdDLCdDLCdIOrQBIdDLCdViUdDLCdMnU f1922-12-28g2018-11-122edtf 0aPS3562.E36471 aLee, Stan,d1922-2018 aManhattan (New York, N.Y.)bLos Angeles (Calif.)eBronx (New York, N.Y.)2naf aComic books, strips, etc.aGraphic novels2lcsh aMarvel Comics Group2naf aAuthorsaEditorsaPublishers and publishing2lcsh aComic book writer aeng1 aLieber, Stanley Martin,d1922-20181 wnneaaLee, Stan aHis Stan Lee presents the Incredible Hulk pop-up-book, "Trapped", c1982:bt.p. (Stan Lee) aLC data base, 9-7-83b(hdg.: Lee, Stan) aExcelsior! 2002:bCIP t.p. (Stan Lee) data sheet (b. December 28, 1922) aStan Lee, c2006:bECIP t.p. (Stan Lee) chap. 2 (Stanley Martin Lieber, b. in New York, Dec. 28, 1922) aNew York times WWW site, viewed Nov. 13, 2018b(in obituary published Nov. 12: Stan Lee; b. Stanley Martin Lieber, Dec. 28, 1922, Manhattan; moved with his family to the Bronx; d. Monday [Nov. 12, 2018], Los Angeles, aged 95; superhero of Marvel Comics; helped create Spider-Man, the X-Men, the Fantastic Four, Iron Man, and others while overseeing his company's emergence as a media behemoth; writer, editor, publisher, Hollywood executive; used several pseudonyms to give the impression that Marvel had a large stable of writers; the name that stuck was simply his first name split in two; in the 1970s, he legally changed Lieber to Lee) aOCLC, February 18, 2019b(authorized access point prior to 2009: Lee, Stan) abe26brc1501032cz a2200241n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139053001700160100002900177370004400206372004100250374002700291375001100318377000800329670013700337670009300474670021400567953000900781761350820170217073826.0080801n| azannaabn |n aaa  an 2008052404 a(OCoLC)oca07838205 aDLCbengerdacDLCdDLCdInU f1972-12-252edtf 0aPR9265.9.C531 aChin, Staceyann, C385673 aJamaicaeBrooklyn (New York, N.Y.)2naf aSpoken word poetryaGay rights2lcsh aPoetsaActivists2lcsh afemale aeng aThe other side of paradise, 2009:bt.p. (Staceyann Chin) dataview (b. Dec. 25, 1972; spoken word poet and gay activist from Jamaica) awww.staceyannchin.com, Aug. 1, 2008b(resident of New York City and a Jamaican national) aWikipedia, 16 Feb. 2017b(Staceyann Chin; b. 25 Dec. 1972 in Jamaica; spoken-word poet, performing artist, and LGBT rights activist; is of Chinese-Jamaican and Afro-Jamaican descent; now lives in Brooklyn, NY) alh4501874cz a2200265n 4500001000800000005001700008008004100025010001700066035002300083040005100106046002100157053001500178100002200193370004000215373002700255373010400282374003100386375001700417377000800434378001900442670008300461670090700544670014801451953000901599739428420190330083358.0080107n| azannaabn |n aaa  an 2008001084 a(OCoLC)oca07622362 aDLCbengerdacDLCdDHU-MSdInUdScUdVtUdDLC f1975-09-302edtf 0aPS3603.O171 aCoates, Ta-Nehisi aBaltimore (Md.)cUnited States2naf aHoward University2naf aWashington Post (Newspaper)aWashington Times (Newspaper)aVillage Voice (Newspaper)aTime Magazine aJournalistsaAuthors2lcsh aMales2lcdgt aeng qTa-Nehisi Paul aCoates, Ta-Nehisi. The beautiful struggle, 2008:beCIP t.p. (Ta-Nehisi Coates) aAfrican American National Biography, accessed December 12 2014, via Oxford African American Studies Center database:b(Coates, Ta-Nehisi; print journalist, autobiographer / memoirist; born 1975 in Baltimore, Maryland, United States; his name is the word ancient Egyptians used for the land of Nubia; grew up in a West Baltimore during the 1980s epidemic of crack cocaine and its accompanying violent turf battles; attended Howard University, from 1993 until 1997; became a journalist around 1996, when he started writing for the Washington Times and then the Washington Post; his writing and reporting talent later took him to Washington Monthly, Entertainment Weekly, and the Village Voice; worked at the Voice until 2004, when he went to work for Time Magazine between 2005 and 2007; his memoir, The Beautiful Struggle: A Father, Two Sons, and an Unlikely Road to Manhood, was also published in 2008) aWikipedia, 16 Feb. 2017b(Ta-Nehisi Coates; Ta-Nehisi Paul Coates; b. 30 Sep. 1975 in Baltimore, MD; American writer, journalist, and educator) alk32 \ No newline at end of file From 3ed448f1390f0a9cab805f1f7dd4ba41e675f5c5 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Thu, 7 Sep 2023 11:52:07 +0500 Subject: [PATCH 108/437] FAT-7722 (#1546) --- .../filter-renewed-through-override.cy.js | 95 +++++++++++++++++++ cypress/e2e/ideyalabs/checkin.cy.js | 6 -- .../fragments/circulation-log/searchPane.js | 11 --- .../fragments/users/loans/userLoans.js | 6 ++ 4 files changed, 101 insertions(+), 17 deletions(-) create mode 100644 cypress/e2e/circulation-log/filter-renewed-through-override.cy.js diff --git a/cypress/e2e/circulation-log/filter-renewed-through-override.cy.js b/cypress/e2e/circulation-log/filter-renewed-through-override.cy.js new file mode 100644 index 0000000000..d00b30a162 --- /dev/null +++ b/cypress/e2e/circulation-log/filter-renewed-through-override.cy.js @@ -0,0 +1,95 @@ +import uuid from 'uuid'; +import moment from 'moment'; +import TopMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +import UserEdit from '../../support/fragments/users/userEdit'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import Users from '../../support/fragments/users/users'; +import SearchPane from '../../support/fragments/circulation-log/searchPane'; +import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; +import Checkout from '../../support/fragments/checkout/checkout'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import getRandomPostfix from '../../support/utils/stringTools'; +import UserLoans from '../../support/fragments/users/loans/userLoans'; + +let user; +const item = { + instanceTitle: `Instance ${getRandomPostfix()}`, + barcode: `item-${getRandomPostfix()}` +}; +const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotest receive notice check in', uuid()), +}; + +describe('circulation-log', () => { + before('create test data', () => { + cy.createTempUser([]).then(userProperties => { + user = userProperties; + + ServicePoints.createViaApi(testData.userServicePoint); + UserEdit.addServicePointViaApi(testData.userServicePoint.id, user.userId, testData.userServicePoint.id); + + InventoryInstances.createInstanceViaApi(item.instanceTitle, item.barcode); + Checkout.checkoutItemViaApi({ + id: uuid(), + itemBarcode: item.barcode, + loanDate: moment.utc().format(), + servicePointId: testData.userServicePoint.id, + userBarcode: user.barcode, + }); + + const renewBody = { + id: uuid(), + itemBarcode: item.barcode, + overrideBlocks: { + comment: `override-message-${getRandomPostfix()}`, + renewalBlock: {} + }, + servicePointId: testData.userServicePoint.id, + userBarcode: user.barcode, + }; + + UserLoans.getUserLoansIdViaApi(user.userId).then((userLoans) => { + UserLoans.declareLoanLostViaApi({ + servicePointId: testData.userServicePoint.id, + declaredLostDateTime: moment.utc().format(), + }, userLoans.loans[0].id) + .then(() => { + UserLoans.renewItemViaApi(renewBody); + }); + }); + }); + cy.loginAsAdmin({ path: TopMenu.circulationLogPath, waiter: SearchPane.waitLoading }); + }); + + after('delete test data', () => { + CheckInActions.checkinItemViaApi({ + itemBarcode: item.barcode, + servicePointId: testData.userServicePoint.id, + checkInDate: moment.utc().format(), + }); + UserEdit.changeServicePointPreferenceViaApi(user.userId, [testData.userServicePoint.id]); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + Users.deleteViaApi(user.userId); + }); + + it('C17137 Filter circulation log by renewed through override (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + const searchResultsData = { + userBarcode: user.barcode, + itemBarcode: item.barcode, + object: 'Loan', + circAction: 'Renewed through override', + servicePoint: testData.userServicePoint.name, + source: 'ADMINISTRATOR, DIKU', + }; + SearchPane.setFilterOptionFromAccordion('loan', 'Renewed through override'); + SearchPane.verifyResultCells(); + SearchPane.checkResultSearch(searchResultsData); + + SearchPane.searchByItemBarcode(item.barcode); + SearchPane.verifyResultCells(); + SearchPane.checkResultSearch(searchResultsData); + }); +}); diff --git a/cypress/e2e/ideyalabs/checkin.cy.js b/cypress/e2e/ideyalabs/checkin.cy.js index 8cb289a0d0..b87af160c5 100644 --- a/cypress/e2e/ideyalabs/checkin.cy.js +++ b/cypress/e2e/ideyalabs/checkin.cy.js @@ -2,7 +2,6 @@ import checkInItems from '../../support/ideyaLabs/checkinitems'; import serviceShift from '../../support/ideyaLabs/serviceshift'; import testTypes from '../../support/dictionary/testTypes'; import checkInActions from '../../support/fragments/check-in-actions/checkInActions'; -import searchPane from '../../support/fragments/circulation-log/searchPane'; import topMenu from '../../support/fragments/topMenu'; const testData = { @@ -41,11 +40,6 @@ describe.skip('servicepoints shift', () => { checkInItems.lostAndPaid(); }); - it('C17137 - Filter circulation log by renewed through override (firebird)', { tags: [testTypes.ideaLabsTests] }, () => { - cy.visit(topMenu.circulationLogPath); - searchPane.checkBarcode(); - }); - it('C590 Check in: multipiece items (vega)', { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.checkInPath); checkInItems.checkIn(testData.itemA); diff --git a/cypress/support/fragments/circulation-log/searchPane.js b/cypress/support/fragments/circulation-log/searchPane.js index c3b1f7a002..6eae2b017f 100644 --- a/cypress/support/fragments/circulation-log/searchPane.js +++ b/cypress/support/fragments/circulation-log/searchPane.js @@ -76,17 +76,6 @@ export default { servicePointField.choose(servicePoint), ]); }, - checkBarcode() { - cy.expect(Pane({ title: 'Circulation log' }).exists()); - cy.do([ - Accordion({ id: 'loan' }).clickHeader(), - Checkbox({ id: 'clickable-filter-loan-renewed-through-override' }).click(), - Button('Reset all').click(), - TextField({ name: 'itemBarcode' }).fillIn('1040') - ]); - cy.get('[class^="button-"][type="submit"]').first().click(); - cy.expect(MultiColumnListRow().exists()); - }, checkElementText: () => { cy.do([ diff --git a/cypress/support/fragments/users/loans/userLoans.js b/cypress/support/fragments/users/loans/userLoans.js index a8526c932a..ff5b0db351 100644 --- a/cypress/support/fragments/users/loans/userLoans.js +++ b/cypress/support/fragments/users/loans/userLoans.js @@ -72,6 +72,12 @@ export default { body: apiBody, isDefaultSearchParamsRequired: false }), + renewItemViaApi:(apiBody) => cy.okapiRequest({ + method: 'POST', + path: `circulation/renew-by-barcode`, + body: apiBody, + isDefaultSearchParamsRequired: false + }), changeDueDateViaApi: (apiBody, loanId) => cy.okapiRequest({ method: 'PUT', path: `circulation/loans/${loanId}`, From d68f3e8a96fd9167a3077dfa158c4a928ff8d2a1 Mon Sep 17 00:00:00 2001 From: Daniil Novikau Date: Tue, 5 Sep 2023 13:27:28 +0300 Subject: [PATCH 109/437] C374166 --- .../moving-allocation-between-funds.cy.js | 98 +++++ .../transactions/moving-allocation.cy.js | 139 ++++--- .../fragments/finance/budgets/budgets.js | 34 ++ .../finance/fiscalYears/fiscalYears.js | 84 +++-- .../support/fragments/finance/funds/funds.js | 357 +++++++----------- cypress/support/fragments/finance/index.js | 5 + .../fragments/finance/ledgers/ledgers.js | 141 +++---- 7 files changed, 452 insertions(+), 406 deletions(-) create mode 100644 cypress/e2e/finance/funds/moving-allocation-between-funds.cy.js create mode 100644 cypress/support/fragments/finance/budgets/budgets.js create mode 100644 cypress/support/fragments/finance/index.js diff --git a/cypress/e2e/finance/funds/moving-allocation-between-funds.cy.js b/cypress/e2e/finance/funds/moving-allocation-between-funds.cy.js new file mode 100644 index 0000000000..ca18f5a703 --- /dev/null +++ b/cypress/e2e/finance/funds/moving-allocation-between-funds.cy.js @@ -0,0 +1,98 @@ +import permissions from '../../../support/dictionary/permissions'; +import testType from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; +import { + FiscalYears, + Funds, + Budgets, + Ledgers, + FinanceHelp, +} from '../../../support/fragments/finance'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import InteractorsTools from '../../../support/utils/interactorsTools'; + +describe('Finance: Funds', () => { + const toFund = Funds.getDefaultFund(); + const fromFund = { + ...Funds.getDefaultFund(), + allocatedToIds: [toFund.id], + }; + const toBudget = Budgets.getDefaultBudget(); + const fromBudget = Budgets.getDefaultBudget(); + + const testData = { + fiscalYear: FiscalYears.getDefaultFiscalYear(), + ledger: Ledgers.getDefaultLedger(), + funds: [toFund, fromFund], + budgets: [toBudget, fromBudget], + user: {}, + }; + + before('Create test data', () => { + cy.getAdminToken().then(() => { + FiscalYears.createViaApi(testData.fiscalYear).then(() => { + const ledgerProperties = { + ...testData.ledger, + fiscalYearOneId: testData.fiscalYear.id, + }; + Ledgers.createViaApi(ledgerProperties).then(() => { + testData.funds.forEach((fund, ind) => { + const fundProperties = { + ...fund, + ledgerId: testData.ledger.id, + }; + Funds.createViaApi(fundProperties).then(() => { + Budgets.createViaApi({ + ...testData.budgets[ind], + fiscalYearId: testData.fiscalYear.id, + fundId: testData.funds[ind].id, + }); + }); + }); + }); + }); + }); + + cy.createTempUser([ + permissions.uiFinanceCreateAllocations.gui, + permissions.uiFinanceViewFundAndBudget.gui, + ]).then((userProperties) => { + testData.user = userProperties; + + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.fundPath, + waiter: Funds.waitLoading, + }); + }); + }); + + after('Delete test data', () => { + testData.budgets.forEach(({ id }) => Budgets.deleteViaApi(id)); + testData.funds.forEach(({ id }) => Funds.deleteFundViaApi(id)); + Ledgers.deleteledgerViaApi(testData.ledger.id); + FiscalYears.deleteFiscalYearViaApi(testData.fiscalYear.id); + Users.deleteViaApi(testData.user.userId); + }); + + it( + 'C374166 Moving allocation between funds is NOT successful if it results in negative available amount (thunderjet)', + { tags: [testType.criticalPath, devTeams.thunderjet] }, + () => { + FinanceHelp.searchByName(fromFund.name); + Funds.selectFund(fromFund.name); + + Funds.checkBudgetDetails([{ ...fromBudget, available: fromBudget.allocated }]); + Funds.selectBudgetDetails(); + + const amount = '100'; + Funds.moveAllocation({ fromFund, toFund, amount }); + InteractorsTools.checkCalloutErrorMessage( + `$${amount}.00 was not successfully allocated to the budget ${toBudget.name} because it exceeds the total allocation amount of ${fromBudget.name}`, + ); + Funds.closeTransferModal(); + Funds.closeBudgetDetails(); + Funds.checkBudgetDetails([{ ...fromBudget, available: fromBudget.allocated }]); + }, + ); +}); diff --git a/cypress/e2e/finance/transactions/moving-allocation.cy.js b/cypress/e2e/finance/transactions/moving-allocation.cy.js index aa160ed905..1d2fa5bf63 100644 --- a/cypress/e2e/finance/transactions/moving-allocation.cy.js +++ b/cypress/e2e/finance/transactions/moving-allocation.cy.js @@ -1,97 +1,96 @@ 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 { + FiscalYears, + Funds, + Budgets, + Ledgers, + FinanceHelp, +} from '../../../support/fragments/finance'; 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'; - -Cypress.on('uncaught:exception', () => false); - -describe('ui-finance: Transactions', () => { - const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; - const defaultLedger = { ...Ledgers.defaultUiLedger }; - const firstFund = { ...Funds.defaultUiFund }; - const secondFund = { - name: `autotest_fund2_${getRandomPostfix()}`, - code: getRandomPostfix(), - externalAccountNo: getRandomPostfix(), - fundStatus: 'Active', - description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, +import InteractorsTools from '../../../support/utils/interactorsTools'; +describe('Finance: Transactions', () => { + const firstFiscalYear = FiscalYears.getDefaultFiscalYear(); + const defaultLedger = Ledgers.getDefaultLedger(); + const toFund = Funds.getDefaultFund(); + const fromFund = { + ...Funds.getDefaultFund(), + allocatedToIds: [toFund.id], + }; + const toBudget = { + ...Budgets.getDefaultBudget(), + allocated: 0, }; - const allocatedQuantity = '500'; let user; 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; - 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.visit(TopMenu.fundPath); - FinanceHelp.searchByName(secondFund.name); - Funds.selectFund(secondFund.name); - Funds.addTrunsferTo(firstFund.name); - }); + cy.getAdminToken().then(() => { + FiscalYears.createViaApi(firstFiscalYear).then(() => { + const ledgerProperties = { + ...defaultLedger, + fiscalYearOneId: firstFiscalYear.id, + }; + Ledgers.createViaApi(ledgerProperties).then(() => { + const toFundProperties = { + ...toFund, + ledgerId: defaultLedger.id, + }; + Funds.createViaApi(toFundProperties).then(() => { + Budgets.createViaApi({ + ...toBudget, + fiscalYearId: firstFiscalYear.id, + fundId: toFund.id, + }); }); + + const fromFundProperties = { + ...fromFund, + ledgerId: defaultLedger.id, + }; + Funds.createViaApi(fromFundProperties); + }); }); + }); cy.createTempUser([ permissions.uiFinanceCreateAllocations.gui, permissions.uiFinanceViewFundAndBudget.gui, - ]) - .then(userProperties => { - user = userProperties; - cy.login(userProperties.username, userProperties.password, { path:TopMenu.fundPath, waiter: Funds.waitLoading }); + ]).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); - + Budgets.deleteViaApi(toBudget.id); + Funds.deleteFundViaApi(toFund.id); + Funds.deleteFundViaApi(fromFund.id); Ledgers.deleteledgerViaApi(defaultLedger.id); - FiscalYears.deleteFiscalYearViaApi(firstFiscalYear.id); - Users.deleteViaApi(user.userId); }); - it('C375175 Moving allocation is NOT successful if money was moved from fund having NO current budget (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { - FinanceHelp.searchByName(firstFund.name); - Funds.selectFund(firstFund.name); - Funds.selectBudgetDetails(); - Funds.moveAllocationWithError(secondFund, '100'); - }); + it( + 'C375175 Moving allocation is NOT successful if money was moved from fund having NO current budget (thunderjet)', + { tags: [testType.criticalPath, devTeams.thunderjet] }, + () => { + FinanceHelp.searchByName(toFund.name); + Funds.selectFund(toFund.name); + Funds.selectBudgetDetails(); + + const amount = '10'; + Funds.moveAllocation({ toFund, fromFund, amount }); + InteractorsTools.checkCalloutErrorMessage( + `$${amount}.00 was not successfully allocated because ${fromFund.code} has no budget`, + ); + Funds.closeTransferModal(); + }, + ); }); diff --git a/cypress/support/fragments/finance/budgets/budgets.js b/cypress/support/fragments/finance/budgets/budgets.js new file mode 100644 index 0000000000..dc81c3747c --- /dev/null +++ b/cypress/support/fragments/finance/budgets/budgets.js @@ -0,0 +1,34 @@ +import uuid from 'uuid'; +import getRandomPostfix from '../../../utils/stringTools'; + +export default { + getDefaultBudget() { + return { + id: uuid(), + name: `autotest_budget_${getRandomPostfix()}`, + allocated: 50, + allowableEncumbrance: 100, + allowableExpenditure: 100, + budgetStatus: 'Active', + }; + }, + createViaApi(budgetProperties) { + return cy + .okapiRequest({ + path: 'finance/budgets', + body: budgetProperties, + method: 'POST', + isDefaultSearchParamsRequired: false, + }) + .then((response) => { + return response.body; + }); + }, + deleteViaApi(budgetId) { + return cy.okapiRequest({ + method: 'DELETE', + path: `finance/budgets/${budgetId}`, + isDefaultSearchParamsRequired: false, + }); + }, +}; diff --git a/cypress/support/fragments/finance/fiscalYears/fiscalYears.js b/cypress/support/fragments/finance/fiscalYears/fiscalYears.js index 10612fa076..ecf87f6a05 100644 --- a/cypress/support/fragments/finance/fiscalYears/fiscalYears.js +++ b/cypress/support/fragments/finance/fiscalYears/fiscalYears.js @@ -1,3 +1,4 @@ +import uuid from 'uuid'; import { Button, TextField, @@ -8,12 +9,13 @@ import { MultiColumnListCell, SelectionOption, Link, - Section + Section, } from '../../../../../interactors'; import getRandomPostfix from '../../../utils/stringTools'; import DateTools from '../../../utils/dateTools'; -const createdFiscalYearNameXpath = '//*[@id="paneHeaderpane-fiscal-year-details-pane-title"]/h2/span'; +const createdFiscalYearNameXpath = + '//*[@id="paneHeaderpane-fiscal-year-details-pane-title"]/h2/span'; const numberOfSearchResultsHeader = '//*[@id="paneHeaderfiscal-year-results-pane-subtitle"]/span'; const zeroResultsFoundText = '0 records found'; // TODO: move all same buttons to one place related to Finance module @@ -28,14 +30,13 @@ const resetButton = Button({ id: 'reset-fiscal-years-filters' }); const fiscalYearFiltersSection = Section({ id: 'fiscal-year-filters-pane' }); export default { - defaultUiFiscalYear: { name: `autotest_year_${getRandomPostfix()}`, code: DateTools.getRandomFiscalYearCode(2000, 9999), periodStart: `${DateTools.getPreviousDayDateForFiscalYear()}T00:00:00.000+00:00`, periodEnd: `${DateTools.getCurrentDateForFiscalYear()}T00:00:00.000+00:00`, description: `This is fiscal year created by E2E test automation script_${getRandomPostfix()}`, - series: 'FY' + series: 'FY', }, defaultRolloverFiscalYear: { @@ -44,10 +45,20 @@ export default { periodStart: `${DateTools.getPreviousDayDateForFiscalYear()}T00:00:00.000+00:00`, periodEnd: `${DateTools.getCurrentDateForFiscalYear()}T00:00:00.000+00:00`, description: `This is fiscal year created by E2E test automation script_${getRandomPostfix()}`, - series: 'FYTA' - }, - - selectFisacalYear:(fiscalYear) => { + series: 'FYTA', + }, + getDefaultFiscalYear() { + return { + id: uuid(), + name: `autotest_year_${getRandomPostfix()}`, + code: DateTools.getRandomFiscalYearCode(2000, 9999), + periodStart: `${DateTools.getPreviousDayDateForFiscalYear()}T00:00:00.000+00:00`, + periodEnd: `${DateTools.getCurrentDateForFiscalYear()}T00:00:00.000+00:00`, + description: `This is fiscal year created by E2E test automation script_${getRandomPostfix()}`, + series: 'FY', + }; + }, + selectFisacalYear: (fiscalYear) => { cy.do(Pane({ id: 'fiscal-year-results-pane' }).find(Link(fiscalYear)).click()); }, @@ -62,7 +73,7 @@ export default { TextField('Code*').fillIn(fiscalYear.code), TextField({ name: 'periodStart' }).fillIn(fiscalYear.periodBeginDate), TextField({ name: 'periodEnd' }).fillIn(fiscalYear.periodEndDate), - saveAndClose.click() + saveAndClose.click(), ]); this.waitForFiscalYearDetailsLoading(); }, @@ -75,7 +86,11 @@ export default { }, closeThirdPane() { - cy.do(PaneHeader({ id: 'paneHeaderpane-fiscal-year-details' }).find(Button({ icon: 'times' })).click()); + cy.do( + PaneHeader({ id: 'paneHeaderpane-fiscal-year-details' }) + .find(Button({ icon: 'times' })) + .click(), + ); }, openAcquisitionAccordion() { @@ -83,47 +98,34 @@ export default { }, clickOnFiscalYear: () => { - cy.do([ - fiscalYearButton.click() - ]); + cy.do([fiscalYearButton.click()]); }, clickOnLedgerTab: () => { - cy.do([ - fiscalYearFiltersSection.find(Button('Ledger')).click() - ]); + cy.do([fiscalYearFiltersSection.find(Button('Ledger')).click()]); }, clickOnGroupTab: () => { - cy.do([ - fiscalYearFiltersSection.find(Button('Group')).click() - ]); + cy.do([fiscalYearFiltersSection.find(Button('Group')).click()]); }, clickOnFundTab: () => { - cy.do([ - fiscalYearFiltersSection.find(Button('Fund')).click() - ]); + cy.do([fiscalYearFiltersSection.find(Button('Fund')).click()]); }, editFiscalYearDetails: () => { - cy.do([ - actions.click(), - edit.click() - ]); + cy.do([actions.click(), edit.click()]); }, selectNoAcquisitionUnit() { - cy.do([Button({ id: 'acqUnitIds-selection' }).click(), + cy.do([ + Button({ id: 'acqUnitIds-selection' }).click(), SelectionOption('No acquisition unit').click(), ]); }, - checkCreatedFiscalYear: (fiscalYearName) => { - cy.xpath(createdFiscalYearNameXpath) - .should('be.visible') - .and('have.text', fiscalYearName); + cy.xpath(createdFiscalYearNameXpath).should('be.visible').and('have.text', fiscalYearName); }, filltheStartAndEndDateoncalenderstartDateField1: () => { @@ -132,7 +134,7 @@ export default { TextField({ name: 'periodStart' }).fillIn('01/01/2022'), TextField({ name: 'periodEnd' }).clear(), TextField({ name: 'periodEnd' }).fillIn('12/30/2022'), - saveAndClose.click() + saveAndClose.click(), ]); }, @@ -142,7 +144,7 @@ export default { TextField({ name: 'periodStart' }).fillIn('01/01/2024'), TextField({ name: 'periodEnd' }).clear(), TextField({ name: 'periodEnd' }).fillIn('12/30/2024'), - saveAndClose.click() + saveAndClose.click(), ]); }, @@ -159,7 +161,7 @@ export default { agreements.click(), Button('Keep editing').click(), Button('Cancel').click(), - Button('Close without saving').click() + Button('Close without saving').click(), ]); }, @@ -170,14 +172,15 @@ export default { }, checkSearchResults: (fiscalYear) => { - cy.expect(MultiColumnList({ id: 'fiscal-years-list' }) - .find(MultiColumnListCell(fiscalYear)) - .exists()); + cy.expect( + MultiColumnList({ id: 'fiscal-years-list' }).find(MultiColumnListCell(fiscalYear)).exists(), + ); }, checkSearchResults1: (fiscalYear) => { - cy.expect(MultiColumnList({ id: 'fiscal-years-list' }) - .find(MultiColumnListCell(fiscalYear)).click()); + cy.expect( + MultiColumnList({ id: 'fiscal-years-list' }).find(MultiColumnListCell(fiscalYear)).click(), + ); }, fiscalYearsDisplay: () => { @@ -192,7 +195,7 @@ export default { cy.do([ actions.click(), deleteButton.click(), - Button('Delete', { id: 'clickable-fiscal-year-remove-confirmation-confirm' }).click() + Button('Delete', { id: 'clickable-fiscal-year-remove-confirmation-confirm' }).click(), ]); }, @@ -227,5 +230,4 @@ export default { expextFY: (FYName) => { cy.expect(Section({ id: 'fiscal-year-results-pane' }).find(Link(FYName)).exists()); }, - }; diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 7a51ed49e2..db27ab2da2 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -25,23 +25,22 @@ import FinanceHelp from '../financeHelper'; import TopMenu from '../../topMenu'; import getRandomPostfix from '../../../utils/stringTools'; import Describer from '../../../utils/describer'; -import InteractorsTools from '../../../utils/interactorsTools'; -const createdFundNameXpath = - '//*[@id="paneHeaderpane-fund-details-pane-title"]/h2/span'; -const numberOfSearchResultsHeader = - '//*[@id="paneHeaderfund-results-pane-subtitle"]/span'; +const createdFundNameXpath = '//*[@id="paneHeaderpane-fund-details-pane-title"]/h2/span'; +const numberOfSearchResultsHeader = '//*[@id="paneHeaderfund-results-pane-subtitle"]/span'; const zeroResultsFoundText = '0 records found'; const budgetTitleXpath = '//*[@id="paneHeaderpane-budget-pane-title"]/h2/span'; const noItemsMessage = 'The list contains no items'; const viewTransactionsLinkXpath = '//a[text()="View transactions"]'; -const budgetPaneId = 'pane-budget'; const transactionResultPaneId = 'transaction-results-pane'; +const fundDetailsPane = Section({ id: 'pane-fund-details' }); const saveAndCloseButton = Button({ id: 'clickable-save-title' }); const currentBudgetSection = Section({ id: 'currentBudget' }); +const budgetPane = Section({ id: 'pane-budget' }); const actionsButton = Button('Actions'); const deleteButton = Button('Delete'); const transferButton = Button('Transfer'); +const moveAllocationButton = Button('Move allocation'); const FundsTab = Button('Fund'); const searchField = SearchField({ id: 'input-record-search' }); const amountTextField = TextField({ name: 'amount' }); @@ -70,12 +69,15 @@ export default { fundStatus: 'Active', description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, }, - - defaultUiBudget: { - allocated: 50, - allowableEncumbrance: 100, - allowableExpenditure: 100, - budgetStatus: 'Active', + getDefaultFund() { + return { + id: uuid(), + name: `autotest_fund_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: getRandomPostfix(), + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; }, waitLoading: () => { cy.expect(Pane({ id: 'fund-results-pane' }).exists()); @@ -90,7 +92,7 @@ export default { }, waitForFundDetailsLoading: () => { - cy.do(Section({ id: 'pane-fund-details' }).visible()); + cy.do(fundDetailsPane.visible()); }, createFund(fund) { @@ -123,10 +125,7 @@ export default { cy.get('[data-test-col-transfer-to="true"] ul[role="listbox"]') .contains(secondFund.name) .click(); - cy.do([ - cancelButton.click(), - closeWithoutSavingButton.click() - ]); + cy.do([cancelButton.click(), closeWithoutSavingButton.click()]); this.waitLoading(); }, @@ -149,21 +148,21 @@ export default { ]); }, - addTrunsferTo: (fund) => { + addTransferTo: (fund) => { cy.do([ actionsButton.click(), Button('Edit').click(), MultiSelect({ label: 'Transfer to' }).select([fund]), - saveAndCloseButton.click() + saveAndCloseButton.click(), ]); }, checkAddGroupToFund: (group) => { - cy.expect(Pane({ id: 'pane-fund-details' }).exists()); + cy.expect(fundDetailsPane.exists()); cy.expect( Accordion({ id: 'information' }) .find(KeyValue({ value: group })) - .exists() + .exists(), ); }, @@ -172,9 +171,7 @@ export default { }, checkCreatedFund: (fundName) => { - cy.xpath(createdFundNameXpath) - .should('be.visible') - .and('have.text', fundName); + cy.xpath(createdFundNameXpath).should('be.visible').and('have.text', fundName); }, tryToCreateFundWithoutMandatoryFields: (fundName) => { @@ -193,19 +190,20 @@ export default { Button('Close without saving').click(), ]); }, - checkBudgetQuantity1: (quantityValue1, quantityValue2) => { + checkBudgetQuantity: (quantityValue) => { // TODO: refactor using interactors (Mutli column list) cy.expect( - Section({ id: budgetPaneId }) - .find(HTML(including('Cash balance: $' + quantityValue1))) - .exists() + budgetPane.find(HTML(including('Cash balance: $' + quantityValue.toFixed(2)))).exists(), ); cy.expect( - Section({ id: budgetPaneId }) - .find(HTML(including('Available balance: $' + quantityValue2))) - .exists() + budgetPane.find(HTML(including('Available balance: $' + quantityValue.toFixed(2)))).exists(), ); }, + checkBudgetQuantity1: (quantityValue1, quantityValue2) => { + // TODO: refactor using interactors (Mutli column list) + cy.expect(budgetPane.find(HTML(including('Cash balance: $' + quantityValue1))).exists()); + cy.expect(budgetPane.find(HTML(including('Available balance: $' + quantityValue2))).exists()); + }, checkZeroSearchResultsHeader: () => { cy.xpath(numberOfSearchResultsHeader) @@ -222,6 +220,7 @@ export default { id: 'clickable-fund-remove-confirmation-confirm', }).click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); }, @@ -229,12 +228,13 @@ export default { cy.do(Accordion('Current budget').find(newButton).click()); cy.expect(Modal('Current budget').exists()); cy.do([ - Modal('Current budget').find(TextField({ name: 'allocated' })).fillIn(allocatedQuantity.toString()), + Modal('Current budget') + .find(TextField({ name: 'allocated' })) + .fillIn(allocatedQuantity.toString()), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); - cy.do([ - Button('Save').click() - ]); + cy.do([Button('Save').click()]); }, viewTransactions: () => { @@ -254,61 +254,41 @@ export default { ]); }, - checkTransactionDetails: ( - indexNumber, - fiscalYear, - amount, - source, - type, - fund, - status - ) => { + checkTransactionDetails: (indexNumber, fiscalYear, amount, source, type, fund, status) => { cy.do( transactionList .find(MultiColumnListRow({ index: indexNumber })) .find(Link()) - .click() + .click(), ); cy.expect( - transactionDetailSection - .find(KeyValue('Fiscal year')) - .has({ value: fiscalYear }), + transactionDetailSection.find(KeyValue('Fiscal year')).has({ value: fiscalYear }), transactionDetailSection.find(KeyValue('Amount')).has({ value: amount }), transactionDetailSection.find(KeyValue('Source')).has({ value: source }), transactionDetailSection.find(KeyValue('Type')).has({ value: type }), transactionDetailSection.find(KeyValue('From')).has({ value: fund }), - transactionDetailSection.find(KeyValue('Status')).has({ value: status }) + transactionDetailSection.find(KeyValue('Status')).has({ value: status }), ); }, - checkPaymentInTransactionDetails: ( - indexNumber, - fiscalYear, - source, - fund, - amount - ) => { + checkPaymentInTransactionDetails: (indexNumber, fiscalYear, source, fund, amount) => { cy.do( transactionList .find(MultiColumnListRow({ index: indexNumber })) .find(Link()) - .click() + .click(), ); cy.expect( - transactionDetailSection - .find(KeyValue('Fiscal year')) - .has({ value: fiscalYear }), + transactionDetailSection.find(KeyValue('Fiscal year')).has({ value: fiscalYear }), transactionDetailSection.find(KeyValue('Amount')).has({ value: amount }), transactionDetailSection.find(KeyValue('Source')).has({ value: source }), transactionDetailSection.find(KeyValue('Type')).has({ value: 'Payment' }), - transactionDetailSection.find(KeyValue('From')).has({ value: fund }) + transactionDetailSection.find(KeyValue('From')).has({ value: fund }), ); }, checkStatusInTransactionDetails: (status) => { - cy.expect( - transactionDetailSection.find(KeyValue('Status')).has({ value: status }) - ); + cy.expect(transactionDetailSection.find(KeyValue('Status')).has({ value: status })); }, checkOrderInTransactionList: (fundCode, amount) => { @@ -346,23 +326,42 @@ export default { Button('Increase allocation').click(), amountTextField.fillIn('50'), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); cy.do(addTransferModal.find(confirmButton).click()); }, - transfer: (thisFund, fromFund) => { + transfer: (toFund, fromFund) => { + cy.do([actionsButton.click(), transferButton.click()]); + this.fillAllocationFields({ toFund, fromFund, amount: '10' }); + }, + moveAllocation({ fromFund, toFund, amount }) { + cy.do([actionsButton.click(), moveAllocationButton.click()]); + this.fillAllocationFields({ toFund, fromFund, amount }); + }, + closeTransferModal() { + cy.do(addTransferModal.find(cancelButton).click()); + }, + fillAllocationFields({ toFund, fromFund, amount }) { + if (toFund) { + cy.do([ + addTransferModal.find(Button({ name: 'toFundId' })).click(), + SelectionOption(`${toFund.name} (${toFund.code})`).click(), + ]); + } + + if (fromFund) { + cy.do([ + addTransferModal.find(Button({ name: 'fromFundId' })).click(), + SelectionOption(`${fromFund.name} (${fromFund.code})`).click(), + ]); + } + cy.do([ - actionsButton.click(), - transferButton.click(), - Button({ name: 'toFundId' }).click(), - SelectionOption(`${thisFund.name} (${thisFund.code})`).click(), - Button({ name: 'fromFundId' }).click(), - SelectionOption(`${fromFund.name} (${fromFund.code})`).click(), - amountTextField.fillIn('10'), + addTransferModal.find(amountTextField).fillIn(amount), addTransferModal.find(confirmButton).click(), ]); }, - checkCreatedBudget: (fundCode, fiscalYear) => { cy.expect(budgetSummaryAcordion.exists()); cy.expect(budgetInformationAcordion.exists()); @@ -377,7 +376,7 @@ export default { amountDecreaseInAllocation, amountTotalAllocated, amountNetTransfers, - amountTotalFunding + amountTotalFunding, ) => { cy.expect(budgetSummaryAcordion.exists()); cy.expect(budgetInformationAcordion.exists()); @@ -437,85 +436,51 @@ export default { amountEncumbered, amountAwaitingPayment, amountExpended, - amountUnavailable + amountUnavailable, ) => { cy.expect(budgetSummaryAcordion.exists()); cy.expect(budgetInformationAcordion.exists()); cy.expect([ - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-0' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-0' })) .find(MultiColumnListCell({ content: 'Encumbered' })) .exists(), - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-0' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-0' })) .find(MultiColumnListCell({ content: amountEncumbered })) .exists(), - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-1' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-1' })) .find(MultiColumnListCell({ content: 'Awaiting payment' })) .exists(), - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-1' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-1' })) .find(MultiColumnListCell({ content: amountAwaitingPayment })) .exists(), - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-2' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-2' })) .find(MultiColumnListCell({ content: 'Expended' })) .exists(), - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-2' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-2' })) .find(MultiColumnListCell({ content: amountExpended })) .exists(), - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-3' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-3' })) .find(MultiColumnListCell({ content: 'Unavailable' })) .exists(), - FinancialActivityAndOveragesMCList.find( - MultiColumnListRow({ indexRow: 'row-3' }) - ) + FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-3' })) .find(MultiColumnListCell({ content: amountUnavailable })) .exists(), ]); }, - checkBudgetQuantity: (quantityValue) => { - // TODO: refactor using interactors (Mutli column list) - cy.expect( - Section({ id: budgetPaneId }) - .find(HTML(including('Cash balance: $' + quantityValue.toFixed(2)))) - .exists() - ); - cy.expect( - Section({ id: budgetPaneId }) - .find( - HTML(including('Available balance: $' + quantityValue.toFixed(2))) - ) - .exists() - ); - }, - openTransactions: () => { - cy.expect( - Section({ id: 'information' }).find(KeyValue('Transactions')).exists() - ); + cy.expect(Section({ id: 'information' }).find(KeyValue('Transactions')).exists()); // TODO: refactor via using interactors. Simple click() doesn't work, need to find a way to work with child cy.xpath(viewTransactionsLinkXpath).click(); }, checkTransaction: (rowNumber, transaction) => { - Describer.getProperties(transaction).forEach(function (val) { + Describer.getProperties(transaction).forEach((val) => { cy.expect( Pane({ id: transactionResultPaneId }) .find(MultiColumnListRow({ index: rowNumber })) .find(MultiColumnListCell({ content: transaction[val] })) - .exists() + .exists(), ); }); }, @@ -526,9 +491,7 @@ export default { cy.do([ TextField('Amount*').fillIn(amount.toString()), Selection('From').open(), - SelectionList().select( - fundFrom.name.concat(' ', '(', fundFrom.code, ')') - ), + SelectionList().select(fundFrom.name.concat(' ', '(', fundFrom.code, ')')), Selection('To').open(), SelectionList().select(fundTo.name.concat(' ', '(', fundTo.code, ')')), confirmButton.click(), @@ -536,6 +499,7 @@ export default { }, deleteBudgetViaActions() { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); cy.do([ actionsButton.click(), @@ -562,7 +526,7 @@ export default { cy.expect( Section({ id: budgetSectionId }) .find(HTML(including(noItemsMessage))) - .exists() + .exists(), ); }, @@ -584,44 +548,24 @@ export default { cy.do(Checkbox({ id: 'clickable-filter-fundStatus-inactive' }).click()); break; default: - cy.log( - 'No such status like ' + - fundStatus + - '. Please use frozen, active or inactive' - ); + cy.log('No such status like ' + fundStatus + '. Please use frozen, active or inactive'); } }, - checkFundFilters( - ledgerName, - fundType, - fundStatus, - aUnits, - tags, - groupName, - fundName - ) { + checkFundFilters(ledgerName, fundType, fundStatus, aUnits, tags, groupName, fundName) { // TODO: check how it can be achieved with interactors - cy.xpath('//*[@id="accordion-toggle-button-fundStatus"]').should( - 'be.visible' - ); + cy.xpath('//*[@id="accordion-toggle-button-fundStatus"]').should('be.visible'); this.selectStatusInSearch(fundStatus); // TODO: check how it can be achieved with interactors - cy.xpath('//*[@id="accordion-toggle-button-ledgerId"]').should( - 'be.visible' - ); + cy.xpath('//*[@id="accordion-toggle-button-ledgerId"]').should('be.visible'); cy.do([ Accordion({ id: 'ledgerId' }).clickHeader(), Selection({ id: 'ledgerId-selection' }).open(), - SelectionList({ id: 'sl-container-ledgerId-selection' }).select( - ledgerName - ), + SelectionList({ id: 'sl-container-ledgerId-selection' }).select(ledgerName), Accordion({ id: 'fundTypeId' }).clickHeader(), Selection({ id: 'fundTypeId-selection' }).open(), - SelectionList({ id: 'sl-container-fundTypeId-selection' }).select( - fundType - ), + SelectionList({ id: 'sl-container-fundTypeId-selection' }).select(fundType), Accordion({ id: 'groupFundFY.groupId' }).clickHeader(), Selection({ id: 'groupFundFY.groupId-selection' }).open(), @@ -636,7 +580,7 @@ export default { Accordion({ id: 'tags' }).clickHeader(), MultiSelect({ id: 'acq-tags-filter' }).select(tags), - SearchField({ id: 'input-record-search' }).fillIn(fundName), + searchField.fillIn(fundName), Button('Search').click(), ]); }, @@ -677,19 +621,45 @@ export default { openBudgetDetails: (fundCode, fiscalYear) => { cy.do([ Accordion({ id: 'currentBudget' }) - .find( - MultiColumnListCell({ content: fundCode.concat('-', fiscalYear) }) - ) + .find(MultiColumnListCell({ content: fundCode.concat('-', fiscalYear) })) .click(), ]); }, - - selectBudgetDetails: (rowNumber = 0) => { - cy.do([ - currentBudgetSection - .find(MultiColumnListRow({ index: rowNumber })) - .click(), - ]); + checkBudgetDetails(records) { + records + .sort((a, b) => a.name.localeCompare(b.name)) + .forEach((record, index) => { + cy.expect([ + currentBudgetSection + .find(MultiColumnListRow({ index })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .has({ content: record.name }), + currentBudgetSection + .find(MultiColumnListRow({ index })) + .find(MultiColumnListCell({ columnIndex: 1 })) + .has({ content: `$${record.allocated}.00` }), + currentBudgetSection + .find(MultiColumnListRow({ index })) + .find(MultiColumnListCell({ columnIndex: 2 })) + .has({ content: `$${record.transfers || 0}.00` }), + currentBudgetSection + .find(MultiColumnListRow({ index })) + .find(MultiColumnListCell({ columnIndex: 3 })) + .has({ content: `$${record.unavailable || 0}.00` }), + currentBudgetSection + .find(MultiColumnListRow({ index })) + .find(MultiColumnListCell({ columnIndex: 4 })) + .has({ content: `$${record.available}.00` }), + ]); + }); + }, + selectBudgetDetails(rowNumber = 0) { + cy.do(currentBudgetSection.find(MultiColumnListRow({ index: rowNumber })).click()); + cy.expect(budgetPane.exists()); + }, + closeBudgetDetails() { + cy.do(budgetPane.find(Button({ icon: 'times' })).click()); + cy.expect(fundDetailsPane.visible()); }, selectPlannedBudgetDetails: (rowNumber = 0) => { @@ -701,11 +671,7 @@ export default { }, checkIsBudgetDeleted: (rowNumber = 0) => { - cy.expect([ - currentBudgetSection - .find(MultiColumnListRow({ index: rowNumber })) - .absent(), - ]); + cy.expect([currentBudgetSection.find(MultiColumnListRow({ index: rowNumber })).absent()]); }, editBudget: () => { @@ -718,11 +684,14 @@ export default { Button({ name: 'statusExpenseClasses[0].expenseClassId' }).click(), SelectionOption(firstExpenseClassName).click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); cy.do(saveAndCloseButton.click()); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); }, deleteExpensesClass: () => { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); cy.do([ Section({ id: 'expense-classes' }) @@ -745,30 +714,11 @@ export default { }); }, - addBudgetToFundViaApi: (budgetProperties) => { - return cy - .okapiRequest({ - path: 'finance/budgets', - body: budgetProperties, - method: 'POST', - isDefaultSearchParamsRequired: false, - }) - .then((response) => { - return response.body; - }); - }, - deleteFundViaApi: (fundId) => cy.okapiRequest({ method: 'DELETE', path: `finance/funds/${fundId}`, isDefaultSearchParamsRequired: false, }), - - deleteBudgetViaApi: (budgetId) => cy.okapiRequest({ - method: 'DELETE', - path: `finance/budgets/${budgetId}`, - isDefaultSearchParamsRequired: false, - }), createFundWithAU(fund, ledger, AUName) { cy.do([ newButton.click(), @@ -779,6 +729,7 @@ export default { SelectionList().select(ledger.name), ]); // Need wait, while data is loading + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); cy.do([ MultiSelect({ id: 'fund-acq-units' }) @@ -791,9 +742,7 @@ export default { }, selectTransaction: (indexRowNumber) => { - cy.do([ - MultiColumnListRow({ indexRow: indexRowNumber }).find(Link()).click(), - ]); + cy.do([MultiColumnListRow({ indexRow: indexRowNumber }).find(Link()).click()]); }, checkEncumbrance: (orderNumber) => { @@ -813,23 +762,21 @@ export default { cy.do( Section({ id: 'information' }) .find(Button({ icon: 'info' })) - .click() + .click(), ); }, clickOnFundsTab: () => { cy.do([FundsTab.click()]); }, searchByName: (name) => { - cy.do([ - searchField.selectIndex('Name'), - searchField.fillIn(name), - Button('Search').click(), - ]); + cy.do([searchField.selectIndex('Name'), searchField.fillIn(name), Button('Search').click()]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); }, selectFund: (FundName) => { cy.do(Pane({ id: 'fund-results-pane' }).find(Link(FundName)).click()); + cy.expect(fundDetailsPane.visible()); }, closeMenu: () => { @@ -840,7 +787,7 @@ export default { cy.do( Section({ id: 'pane-transaction-details' }) .find(Button({ icon: 'times' })) - .click() + .click(), ); }, @@ -848,12 +795,13 @@ export default { cy.do( Section({ id: 'pane-transaction-details' }) .find(Button({ icon: 'info' })) - .click() + .click(), ); }, addAUToFund: (AUName) => { cy.do([actionsButton.click(), Button('Edit').click()]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); cy.do([ MultiSelect({ id: 'fund-acq-units' }) @@ -862,22 +810,7 @@ export default { MultiSelectOption(AUName).click(), saveAndCloseButton.click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); }, - - moveAllocationWithError: (secondFund, amount) => { - cy.do([ - actionsButton.click(), - Button('Move allocation').click(), - addTransferModal.find(Button({ name: 'fromFundId' })).click(), - ]); - cy.wait(6000); - cy.get('[role="option"]').contains(`${secondFund.name} (${secondFund.code})`).click(); - cy.do([ - addTransferModal.find(TextField({ name: 'amount' })).fillIn(amount), - addTransferModal.find(confirmButton).click(), - ]); - InteractorsTools.checkCalloutErrorMessage(`$${amount}.00 was not successfully allocated because ${secondFund.code} has no budget`); - cy.do(addTransferModal.find(cancelButton).click()); - }, }; diff --git a/cypress/support/fragments/finance/index.js b/cypress/support/fragments/finance/index.js new file mode 100644 index 0000000000..7002144a93 --- /dev/null +++ b/cypress/support/fragments/finance/index.js @@ -0,0 +1,5 @@ +export { default as Budgets } from './budgets/budgets'; +export { default as FiscalYears } from './fiscalYears/fiscalYears'; +export { default as Funds } from './funds/funds'; +export { default as Ledgers } from './ledgers/ledgers'; +export { default as FinanceHelp } from './financeHelper'; diff --git a/cypress/support/fragments/finance/ledgers/ledgers.js b/cypress/support/fragments/finance/ledgers/ledgers.js index 4e7451447d..82197f3ce1 100644 --- a/cypress/support/fragments/finance/ledgers/ledgers.js +++ b/cypress/support/fragments/finance/ledgers/ledgers.js @@ -1,3 +1,4 @@ +import uuid from 'uuid'; import { Button, Accordion, @@ -20,10 +21,8 @@ import { import FinanceHelper from '../financeHelper'; import getRandomPostfix from '../../../utils/stringTools'; -const createdLedgerNameXpath = - '//*[@id="paneHeaderpane-ledger-details-pane-title"]/h2/span'; -const numberOfSearchResultsHeader = - '//*[@id="paneHeaderledger-results-pane-subtitle"]/span'; +const createdLedgerNameXpath = '//*[@id="paneHeaderpane-ledger-details-pane-title"]/h2/span'; +const numberOfSearchResultsHeader = '//*[@id="paneHeaderledger-results-pane-subtitle"]/span'; const rolloverButton = Button('Rollover'); const continueButton = Button('Continue'); const confirmButton = Button('Confirm'); @@ -52,42 +51,40 @@ export default { code: `test_automation_code_${getRandomPostfix()}`, description: 'This is ledger created by E2E test automation script', }, - + getDefaultLedger() { + return { + id: uuid(), + name: `autotest_ledger_${getRandomPostfix()}`, + ledgerStatus: 'Active', + code: `test_automation_code_${getRandomPostfix()}`, + description: 'This is ledger created by E2E test automation script', + }; + }, waitForLedgerDetailsLoading: () => { cy.do(Section({ id: 'pane-ledger-details' }).visible); }, clickOnFiscalYearTab: () => { - cy.do([ - ledgersFiltersSection.find(Button('Fiscal year')).click() - ]); + cy.do([ledgersFiltersSection.find(Button('Fiscal year')).click()]); }, clickOnGroupTab: () => { - cy.do([ - ledgersFiltersSection.find(Button('Group')).click() - ]); + cy.do([ledgersFiltersSection.find(Button('Group')).click()]); }, clickOnFundTab: () => { - cy.do([ - ledgersFiltersSection.find(Button('Fund')).click() - ]); + cy.do([ledgersFiltersSection.find(Button('Fund')).click()]); }, - rollover : () => { + rollover: () => { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(8000); - cy.do([ - Button('Actions').click(), - - ]); + cy.do([Button('Actions').click()]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(8000); - cy.do([ - - rolloverButton.click() - ]); + cy.do([rolloverButton.click()]); }, closeRolloverInfo: () => { @@ -100,15 +97,14 @@ export default { selectFirstCheckBox: (fiscalYear) => { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); cy.do([ fiscalYearSelect.choose(fiscalYear), Checkbox({ name: 'encumbrancesRollover[0].rollover' }).click(), Select({ name: 'encumbrancesRollover[0].basedOn' }).choose('Expended'), Checkbox({ name: 'encumbrancesRollover[2].rollover' }).click(), - Select({ name: 'encumbrancesRollover[2].basedOn' }).choose( - 'Initial encumbrance' - ), + Select({ name: 'encumbrancesRollover[2].basedOn' }).choose('Initial encumbrance'), Button('Test rollover').click(), continueButton.click(), confirmButton.click(), @@ -125,6 +121,7 @@ export default { fillInRolloverInfo(fiscalYear) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(8000); cy.do([ fiscalYearSelect.choose(fiscalYear), @@ -132,29 +129,23 @@ export default { Checkbox({ name: 'encumbrancesRollover[0].rollover' }).click(), Select({ name: 'encumbrancesRollover[0].basedOn' }).choose('Expended'), Checkbox({ name: 'encumbrancesRollover[2].rollover' }).click(), - Select({ name: 'encumbrancesRollover[2].basedOn' }).choose( - 'Initial encumbrance' - ), + Select({ name: 'encumbrancesRollover[2].basedOn' }).choose('Initial encumbrance'), rolloverButton.click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(8000); this.continueRollover(); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(8000); - cy.do([ - rolloverConfirmButton.click(), - ]); + cy.do([rolloverConfirmButton.click()]); }, continueRollover: () => { - const continueButton = Button('Continue'); cy.get('body').then(($body) => { if ($body.find('[id=unpaid-invoice-list-modal]').length) { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); - cy.do( - Modal({ id: 'unpaid-invoice-list-modal' }) - .find(continueButton) - .click() - ); + cy.do(Modal({ id: 'unpaid-invoice-list-modal' }).find(continueButton).click()); } else { // do nothing if modal is not displayed } @@ -167,13 +158,10 @@ export default { cy.do(Button('Reset all').click()); }, - fillInRolloverForCashBalance( - fiscalYear, - rolloverBudgetValue, - rolloverValueAs - ) { + fillInRolloverForCashBalance(fiscalYear, rolloverBudgetValue, rolloverValueAs) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); cy.do([ fiscalYearSelect.choose(fiscalYear), @@ -182,6 +170,7 @@ export default { addAvailableToSelect.choose(rolloverValueAs), rolloverButton.click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); this.continueRollover(); cy.do([rolloverConfirmButton.click()]); @@ -190,24 +179,25 @@ export default { cy.do( Section({ id: 'fund' }) .find(MultiColumnListRow({ index: 0 })) - .click() + .click(), ); }, selectSecondFund: () => { cy.do( Section({ id: 'fund' }) .find(MultiColumnListRow({ index: 1 })) - .click() + .click(), ); }, fillInRolloverForCashBalanceWithNotActiveAllocation( fiscalYear, rolloverBudgetValue, - rolloverValueAs + rolloverValueAs, ) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); cy.do([ fiscalYearSelect.choose(fiscalYear), @@ -215,18 +205,16 @@ export default { addAvailableToSelect.choose(rolloverValueAs), rolloverButton.click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); this.continueRollover(); cy.do([rolloverConfirmButton.click()]); }, - fillInTestRolloverInfoCashBalance: ( - fiscalYear, - rolloverBudgetValue, - rolloverValueAs - ) => { + fillInTestRolloverInfoCashBalance: (fiscalYear, rolloverBudgetValue, rolloverValueAs) => { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); cy.do([ Select({ name: 'toFiscalYearId' }).choose(fiscalYear), @@ -235,10 +223,9 @@ export default { addAvailableToSelect.choose(rolloverValueAs), Button('Test rollover').click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); - cy.do([ - Button({ id: 'clickable-test-rollover-confirmation-confirm' }).click(), - ]); + cy.do([Button({ id: 'clickable-test-rollover-confirmation-confirm' }).click()]); }, checkZeroSearchResultsHeader: () => { @@ -248,9 +235,7 @@ export default { }, checkCreatedLedgerName: (ledger) => { - cy.xpath(createdLedgerNameXpath) - .should('be.visible') - .and('have.text', ledger.name); + cy.xpath(createdLedgerNameXpath).should('be.visible').and('have.text', ledger.name); }, createDefaultLedger(defaultLedger) { @@ -297,16 +282,12 @@ export default { searchByStatusUnitsAndName(status, acquisitionUnitsName, ledgerName) { // TODO: check how it can be achieved with interactors - cy.xpath('//*[@id="accordion-toggle-button-ledgerStatus"]').should( - 'be.visible' - ); + cy.xpath('//*[@id="accordion-toggle-button-ledgerStatus"]').should('be.visible'); this.selectStatusInSearch(status); cy.do([ Accordion({ id: 'acqUnitIds' }).clickHeader(), Selection({ id: 'acqUnitIds-selection' }).open(), - SelectionList({ id: 'sl-container-acqUnitIds-selection' }).select( - acquisitionUnitsName - ), + SelectionList({ id: 'sl-container-acqUnitIds-selection' }).select(acquisitionUnitsName), SearchField({ id: 'input-record-search' }).fillIn(ledgerName), Button('Search').click(), ]); @@ -322,16 +303,10 @@ export default { cy.do(Checkbox({ id: 'clickable-filter-ledgerStatus-active' }).click()); break; case FinanceHelper.statusInactive: - cy.do( - Checkbox({ id: 'clickable-filter-ledgerStatus-inactive' }).click() - ); + cy.do(Checkbox({ id: 'clickable-filter-ledgerStatus-inactive' }).click()); break; default: - cy.log( - 'No such status like ' + - ledgerStatus + - '. Please use frozen, active or inactive' - ); + cy.log('No such status like ' + ledgerStatus + '. Please use frozen, active or inactive'); } }, @@ -353,7 +328,8 @@ export default { isDefaultSearchParamsRequired: false, }), - selectLedger:(ledgerName) => { + selectLedger: (ledgerName) => { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(8000); cy.do(Pane({ id: 'ledger-results-pane' }).find(Link(ledgerName)).click()); @@ -367,12 +343,12 @@ export default { cy.expect( Section({ id: 'financial-summary' }) .find(HTML(including('Cash balance: $' + quantityValue1))) - .exists() + .exists(), ); cy.expect( Section({ id: 'financial-summary' }) .find(HTML(including('Available balance: $' + quantityValue2))) - .exists() + .exists(), ); }, @@ -407,24 +383,23 @@ export default { totalAllocation, totalFunding, cashBalance, - available + available, ) { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); // wait for the file to load cy.readFile(`cypress/downloads/${fileName}`).then((fileContent) => { // Split the contents of a file into lines const fileRows = fileContent.split('\n'); expect(fileRows[0].trim()).to.equal( - '"Name (Fund)","Code (Fund)","Status (Fund)","Type","Group (Code)","Acquisition unit","Transfer from","Transfer to","External account number","Description","Name (Budget)","Status (Budget)","Allowable encumbrance","Allowable expenditure","Initial allocation","Increase","Decrease","Total allocation","Transfers","Total Funding","Encumbered (Budget)","Awaiting payment (Budget)","Expended (Budget)","Unavailable","Over encumbered","Over expended","Cash balance","Available","Name (Exp Class)","Code (Exp Class)","Status (Exp Class)","Encumbered (Exp Class)","Awaiting payment (Exp Class)","Expended (Exp Class)","Percentage of total expended"' + '"Name (Fund)","Code (Fund)","Status (Fund)","Type","Group (Code)","Acquisition unit","Transfer from","Transfer to","External account number","Description","Name (Budget)","Status (Budget)","Allowable encumbrance","Allowable expenditure","Initial allocation","Increase","Decrease","Total allocation","Transfers","Total Funding","Encumbered (Budget)","Awaiting payment (Budget)","Expended (Budget)","Unavailable","Over encumbered","Over expended","Cash balance","Available","Name (Exp Class)","Code (Exp Class)","Status (Exp Class)","Encumbered (Exp Class)","Awaiting payment (Exp Class)","Expended (Exp Class)","Percentage of total expended"', ); const actualData = fileRows[1].trim().split(','); expect(actualData[0]).to.equal(`"${fund.name}"`); expect(actualData[1]).to.equal(`"${fund.code}"`); expect(actualData[9]).to.equal(`"${fund.description}"`); - expect(actualData[10]).to.equal( - `"${fund.code}-${secondFiscalYear.code}"` - ); + expect(actualData[10]).to.equal(`"${fund.code}-${secondFiscalYear.code}"`); expect(actualData[12]).to.equal(allowableEncumbrance); expect(actualData[13]).to.equal(allowableExpenditure); expect(actualData[14]).to.equal(initialAllocation); @@ -443,10 +418,11 @@ export default { fillInTestRolloverInfoCashBalanceWithNotActiveAllocation: ( fiscalYear, rolloverBudgetValue, - rolloverValueAs + rolloverValueAs, ) => { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); cy.do([ Select({ name: 'toFiscalYearId' }).choose(fiscalYear), @@ -454,9 +430,8 @@ export default { addAvailableToSelect.choose(rolloverValueAs), Button('Test rollover').click(), ]); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); - cy.do([ - Button({ id: 'clickable-test-rollover-confirmation-confirm' }).click(), - ]); + cy.do([Button({ id: 'clickable-test-rollover-confirmation-confirm' }).click()]); }, }; From 82ed75b82927652803956750064bfae532988a9d Mon Sep 17 00:00:00 2001 From: nayimovag Date: Thu, 7 Sep 2023 15:23:26 +0500 Subject: [PATCH 110/437] FAT-7724 (#1552) --- .../circulation-log/filter-closed-loan.cy.js | 72 +++++++++++++++++++ cypress/e2e/ideyalabs/circulationLog.cy.js | 26 ------- .../fragments/circulation-log/searchPane.js | 10 --- cypress/support/ideyaLabs/circulationlog.js | 33 --------- 4 files changed, 72 insertions(+), 69 deletions(-) create mode 100644 cypress/e2e/circulation-log/filter-closed-loan.cy.js delete mode 100644 cypress/e2e/ideyalabs/circulationLog.cy.js delete mode 100644 cypress/support/ideyaLabs/circulationlog.js diff --git a/cypress/e2e/circulation-log/filter-closed-loan.cy.js b/cypress/e2e/circulation-log/filter-closed-loan.cy.js new file mode 100644 index 0000000000..769f3efd3a --- /dev/null +++ b/cypress/e2e/circulation-log/filter-closed-loan.cy.js @@ -0,0 +1,72 @@ +import uuid from 'uuid'; +import moment from 'moment'; +import TopMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +import UserEdit from '../../support/fragments/users/userEdit'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import Users from '../../support/fragments/users/users'; +import SearchPane from '../../support/fragments/circulation-log/searchPane'; +import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; +import Checkout from '../../support/fragments/checkout/checkout'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import getRandomPostfix from '../../support/utils/stringTools'; + +let user; +const item = { + instanceTitle: `Instance ${getRandomPostfix()}`, + barcode: `item-${getRandomPostfix()}` +}; +const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotest receive notice check in', uuid()), +}; + +describe('circulation-log', () => { + before('create test data', () => { + cy.createTempUser([]).then(userProperties => { + user = userProperties; + + ServicePoints.createViaApi(testData.userServicePoint); + UserEdit.addServicePointViaApi(testData.userServicePoint.id, user.userId, testData.userServicePoint.id); + + InventoryInstances.createInstanceViaApi(item.instanceTitle, item.barcode); + Checkout.checkoutItemViaApi({ + itemBarcode: item.barcode, + servicePointId: testData.userServicePoint.id, + userBarcode: user.barcode, + }); + + CheckInActions.checkinItemViaApi({ + itemBarcode: item.barcode, + servicePointId: testData.userServicePoint.id, + checkInDate: moment.utc().format(), + }); + }); + cy.loginAsAdmin({ path: TopMenu.circulationLogPath, waiter: SearchPane.waitLoading }); + }); + + after('delete test data', () => { + UserEdit.changeServicePointPreferenceViaApi(user.userId, [testData.userServicePoint.id]); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); + Users.deleteViaApi(user.userId); + }); + + it('C16999 Filter circulation log by Closed loan(firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + const searchResultsData = { + userBarcode: user.barcode, + itemBarcode: item.barcode, + object: 'Loan', + circAction: 'Closed loan', + servicePoint: testData.userServicePoint.name, + source: 'ADMINISTRATOR, DIKU', + }; + SearchPane.setFilterOptionFromAccordion('loan', 'Closed loan'); + SearchPane.verifyResultCells(); + SearchPane.checkResultSearch(searchResultsData); + + SearchPane.searchByItemBarcode(item.barcode); + SearchPane.verifyResultCells(); + SearchPane.checkResultSearch(searchResultsData); + }); +}); diff --git a/cypress/e2e/ideyalabs/circulationLog.cy.js b/cypress/e2e/ideyalabs/circulationLog.cy.js deleted file mode 100644 index 37215da454..0000000000 --- a/cypress/e2e/ideyalabs/circulationLog.cy.js +++ /dev/null @@ -1,26 +0,0 @@ -import testTypes from '../../support/dictionary/testTypes'; -import searchPane from '../../support/fragments/circulation-log/searchPane'; -import topMenu from '../../support/fragments/topMenu'; -import usersSearchPane from '../../support/fragments/users/usersSearchPane'; -import circulationlog from '../../support/ideyaLabs/circulationlog'; - -const testData = { - itemA: '4502015', -}; - -describe.skip('CirculationLog App', () => { - before('Login', () => { - cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); - }); - - 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/support/fragments/circulation-log/searchPane.js b/cypress/support/fragments/circulation-log/searchPane.js index 6eae2b017f..6515e00ab4 100644 --- a/cypress/support/fragments/circulation-log/searchPane.js +++ b/cypress/support/fragments/circulation-log/searchPane.js @@ -77,16 +77,6 @@ export default { ]); }, - checkElementText: () => { - cy.do([ - Checkbox({ - id: 'clickable-filter-loan-renewed-through-override', - }).click(), - TextField({ name: 'itemBarcode' }).fillIn(data), - ]); - this.clickApplyMainFilter(); - }, - searchByClaimedReturned() { cy.do([ Accordion({ id: 'loan' }).clickHeader(), diff --git a/cypress/support/ideyaLabs/circulationlog.js b/cypress/support/ideyaLabs/circulationlog.js deleted file mode 100644 index 241b161af6..0000000000 --- a/cypress/support/ideyaLabs/circulationlog.js +++ /dev/null @@ -1,33 +0,0 @@ -import { - Button, - Link, - MultiColumnListRow, - PaneContent, - Section, - TextField, -} from '../../../interactors'; -import usersSearchPane from '../fragments/users/usersSearchPane'; - -const userSearchPaneContent = PaneContent({ - id: 'users-search-results-pane-content', -}); - -export default { - clickOnStatus() { - usersSearchPane.searchByStatus('Active'); - cy.do([ - userSearchPaneContent - .find(MultiColumnListRow({ index: 2 }).find(Link('A2L 1, Holly'))) - .click(), - Button({ id: 'accordion-toggle-button-loansSection' }).click(), - Section({ id: 'loansSection' }).find(Link('1 open loan')).click(), - ]); - }, - - checkIn: (barcode) => { - cy.do([ - TextField('Item ID').fillIn(barcode), - Button('Enter').click(), - ]); - }, -}; From d53493b42d17ad8614a69692b1588c7fa1caaff6 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Thu, 7 Sep 2023 16:12:42 +0500 Subject: [PATCH 111/437] FAT-7730/C380755 (#1551) * added test C380755 * deleted idealabs version of the test --- cypress/e2e/ideyalabs/marc_authority.cy.js | 30 ------ ...empty-marc-bib-with-marc-auth-record.cy.js | 101 ++++++++++++++++++ ...marc-bib-from-marc-auth-using-derive.cy.js | 8 +- cypress/fixtures/marcAuthFileForC380755.mrc | 1 + cypress/fixtures/marcBibFileForC380755.mrc | 1 + 5 files changed, 107 insertions(+), 34 deletions(-) create mode 100644 cypress/e2e/marc-authority/manual-linking/link-empty-marc-bib-with-marc-auth-record.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC380755.mrc create mode 100644 cypress/fixtures/marcBibFileForC380755.mrc diff --git a/cypress/e2e/ideyalabs/marc_authority.cy.js b/cypress/e2e/ideyalabs/marc_authority.cy.js index 2a34aa6754..be56a1868a 100644 --- a/cypress/e2e/ideyalabs/marc_authority.cy.js +++ b/cypress/e2e/ideyalabs/marc_authority.cy.js @@ -74,36 +74,6 @@ describe.skip('Feature MARC Authority', () => { } ); - it( - 'C380755 Link of empty MARC Bib field with ""MARC Authority"" record (spitfire)', - { tags: [testTypes.ideaLabsTests] }, - () => { - cy.visit(topMenu.inventoryPath); - inventorySearchAndFilter.switchToHoldings(); - inventorySearchAndFilter.bySource(testData.source); - inventorySearchAndFilter.selectSearchResultByRowIndex( - testData.derive.rowIndex - ); - inventoryInstance.editMarcBibliographicRecord(); - inventoryInstance.verifyAndClickUnlinkIcon(testData.derive.tag700); - marc.popupUnlinkButton(); - inventoryInstance.verifyAndClickLinkIcon(testData.derive.tag700); - marcAuthorities.switchToSearch(); - inventoryInstance.verifySelectMarcAuthorityModal(); - inventoryInstance.verifySearchOptions(); - marcAuthorities.searchBy( - testData.derive.searchOption, - testData.derive.authority700FieldValue - ); - marcAuthorities.clickLinkButton(); - marcAuthority.checkLinkingAuthority700(); - marc.saveAndClose(); - inventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane( - testData.derive.accordion - ); - } - ); - it( 'C376987 User can print ""MARC authority"" record (spitfire)', { tags: [testTypes.ideaLabsTests] }, diff --git a/cypress/e2e/marc-authority/manual-linking/link-empty-marc-bib-with-marc-auth-record.cy.js b/cypress/e2e/marc-authority/manual-linking/link-empty-marc-bib-with-marc-auth-record.cy.js new file mode 100644 index 0000000000..9ac5aa2c98 --- /dev/null +++ b/cypress/e2e/marc-authority/manual-linking/link-empty-marc-bib-with-marc-auth-record.cy.js @@ -0,0 +1,101 @@ +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'; + +describe('Manual Linking Empty Bib field to Authority 1XX', () => { + const testData = { + searchOption: 'Personal name', + marcValue: 'C380755 Lee, Stan, 1922-2018', + markedValue: 'C380755 Lee, Stan,', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC380755.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }, + { + marc: 'marcAuthFileForC380755.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1, + }, + ] + + let createdAuthorityIDs = []; + + before('Creating user and records', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.moduleDataImportEnabled.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.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.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + + after('Deleting created user and records', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + MarcAuthority.deleteViaAPI(createdAuthorityIDs[1]); + }); + + it('C380755 Link of empty MARC Bib field with "MARC Authority" record (spitfire)', { tags: [TestTypes.extendedPath, DevTeams.spitfire] }, () => { + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + + QuickMarcEditor.checkLinkButtonExistByRowIndex(79); + QuickMarcEditor.updateExistingFieldContent(79, ''); + QuickMarcEditor.clickLinkIconInTagField(79); + + MarcAuthorities.switchToBrowse(); + MarcAuthorities.checkDefaultBrowseOptions(); + MarcAuthorities.searchByParameter(testData.searchOption, testData.marcValue); + MarcAuthorities.selectTitle(testData.marcValue); + MarcAuthorities.checkRecordDetailPageMarkedValue(testData.markedValue); + InventoryInstance.clickLinkButton(); + + QuickMarcEditor.verifyAfterLinkingUsingRowIndex('700', 79); + QuickMarcEditor.verifyUnlinkAndViewAuthorityButtons(79); + QuickMarcEditor.verifyTagFieldAfterLinking(79, '700', '1', '\\', '$a C380755 Lee, Stan, $d 1922-2018', '', '$0 id.loc.gov/authorities/names/n83169267', ''); + + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane('Contributor'); + }); +}); \ No newline at end of file diff --git a/cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js b/cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js index 4b3498b0d6..f19d0e5bbd 100644 --- a/cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js +++ b/cypress/e2e/marc-authority/manual-linking/unlink-marc-bib-from-marc-auth-using-derive.cy.js @@ -13,7 +13,7 @@ import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthorit import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; -describe('Manual Linking Bib field to Authority 1XX', () => { +describe('Manual Unlinking Bib field from Authority 1XX', () => { const testData = {}; const marcFiles = [ @@ -46,7 +46,7 @@ describe('Manual Linking Bib field to Authority 1XX', () => { let createdAuthorityIDs = []; - before('Creating user', () => { + before('Creating user and records', () => { cy.createTempUser([ Permissions.inventoryAll.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, @@ -93,7 +93,7 @@ describe('Manual Linking Bib field to Authority 1XX', () => { }); }); - after('Deleting created user', () => { + after('Deleting created user and records', () => { Users.deleteViaApi(testData.userProperties.userId); InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); createdAuthorityIDs.forEach((id, index) => { @@ -101,7 +101,7 @@ describe('Manual Linking Bib field to Authority 1XX', () => { }); }); - it('C365602 Derive | Unlink "MARC Bibliographic" field from "MARC Authority" record and use the "Save & close" button in deriving window. (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + it('C365602 Derive | Unlink "MARC Bibliographic" field from "MARC Authority" record and use the "Save & close" button in deriving window. (spitfire)', { tags: [TestTypes.extendedPath, DevTeams.spitfire] }, () => { cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); InventoryInstance.searchByTitle(createdAuthorityIDs[0]); InventoryInstances.selectInstance(); diff --git a/cypress/fixtures/marcAuthFileForC380755.mrc b/cypress/fixtures/marcAuthFileForC380755.mrc new file mode 100644 index 0000000000..5467985165 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC380755.mrc @@ -0,0 +1 @@ +01950cz a2200313n 4500001000800000005001700008008004100025010001700066035002300083040007300106046003300179053001700212100003400229370008200263372005200345373002900397374005400426374002200480377000800502400004700510400002000557670009400577670004400671670007600715670010600791670064400897670008001541953001501621242619020190610154002.0831201n| azannaabn a aaa  an 83169267  a(OCoLC)oca00990699 aDLCbengerdacDLCdDLCdOCoLCdDLCdDLCdIOrQBIdDLCdViUdDLCdMnU f1922-12-28g2018-11-122edtf 0aPS3562.E36471 aC380755 Lee, Stan,d1922-2018 aManhattan (New York, N.Y.)bLos Angeles (Calif.)eBronx (New York, N.Y.)2naf aComic books, strips, etc.aGraphic novels2lcsh aMarvel Comics Group2naf aAuthorsaEditorsaPublishers and publishing2lcsh aComic book writer aeng1 aC380755 Lieber, Stanley Martin,d1922-20181 wnneaaLee, Stan aHis Stan Lee presents the Incredible Hulk pop-up-book, "Trapped", c1982:bt.p. (Stan Lee) aLC data base, 9-7-83b(hdg.: Lee, Stan) aExcelsior! 2002:bCIP t.p. (Stan Lee) data sheet (b. December 28, 1922) aStan Lee, c2006:bECIP t.p. (Stan Lee) chap. 2 (Stanley Martin Lieber, b. in New York, Dec. 28, 1922) aNew York times WWW site, viewed Nov. 13, 2018b(in obituary published Nov. 12: Stan Lee; b. Stanley Martin Lieber, Dec. 28, 1922, Manhattan; moved with his family to the Bronx; d. Monday [Nov. 12, 2018], Los Angeles, aged 95; superhero of Marvel Comics; helped create Spider-Man, the X-Men, the Fantastic Four, Iron Man, and others while overseeing his company's emergence as a media behemoth; writer, editor, publisher, Hollywood executive; used several pseudonyms to give the impression that Marvel had a large stable of writers; the name that stuck was simply his first name split in two; in the 1970s, he legally changed Lieber to Lee) aOCLC, February 18, 2019b(authorized access point prior to 2009: Lee, Stan) abe26brc15 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC380755.mrc b/cypress/fixtures/marcBibFileForC380755.mrc new file mode 100644 index 0000000000..ccdff8ca83 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC380755.mrc @@ -0,0 +1 @@ +05259cam a2200997 i 4500001001400000008004100014005001700055035002400072040017600096019003600272020004300308020004000351020004300391020004000434020004300474020004000517020004300557020004000600020004300640020004000683020004300723020004000766020004300806020004000849020004300889020004000932020004300972020004001015020004301055020004001098035007601138043001201214050002901226050002601255082001801281100003201299245016401331264009901495300005701594336002601651336003301677337002801710338002701738500005401765521002201819588001401841520037501855505043902230600006902669650004802738650004302786650004202829650004502871650004402916651003802960650004402998650004003042650003603082650003103118651003303149600006803182650004403250650004503294650004203339650004803381650004303429651003803472655002703510655005303537655004603590655004803636655002703684655002903711655003403740655002703774655004703801655003103848700003203879700002903911700005103940700002803991700008404019700007604103938004104179938004104220in00000000144170814m20172019nyua 6 000 1 eng d20220704143031.8 a(OCoLC)on1000535936 aOJ4bengerdacOJ4dYDXdFLWMDdJTDdTOPdMYGdOCLCAdNJRdUABdP@NdNYPdOCLCQdOCLCFdOCLCAdCNNORdCCPLGdOCLCAdCCPLGdOCLdOCLCOdOCLCQdOCLCOdOCLCQdOCLdOCLCOdJPL a964194444a964760322a999445824 a9781302904159q(volume 1 ;qhardcover) a1302904159q(volume 1 ;qhardcover) a9781302900533q(volume 1 ;qpaperback) a1302900536q(volume 1 ;qpaperback) a9781302900540q(volume 2 ;qpaperback) a1302900544q(volume 2 ;qpaperback) a9781302901912q(volume 3 ;qpaperback) a1302901915q(volume 3 ;qpaperback) a9781302906498q(volume 4 ;qpaperback) a1302906496q(volume 4 ;qpaperback) a9781302909888q(volume 5 ;qpaperback) a1302909886q(volume 5 ;qpaperback) a9781302912932q(volume 6 ;qpaperback) a1302912933q(volume 6 ;qpaperback) a9781302912949q(volume 7 ;qpaperback) a1302912941q(volume 7 ;qpaperback) a9781302914462q(volume 8 ;qpaperback) a1302914464q(volume 8 ;qpaperback) a9781302921101q(volume 9 ;qpaperback) a130292110Xq(volume 9 ;qpaperback) a(OCoLC)1000535936z(OCoLC)964194444z(OCoLC)964760322z(OCoLC)999445824 af------14aPN6728.B519338bC63 2017 4aPN6728.B523bC63 201704a741.5/9732231 aCoates, Ta-Nehisi,eauthor.10aBlack Panther /cwriter, Ta-Nehisi Coates ; artist, Brian Stelfreeze ; pencils/layouts, Chris Sprouse ; color artist, Laura Martin ; letterer, VC's Joe Sabino. 1aNew York, NY :bMarvel Worldwide, Inc., a subsidiary of Marvel Entertainment, LLC,c2017-2019. a9 volumes :bchiefly color illustrations ;c26-29 cm atextbtxt2rdacontent astill imagebsti2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier a"Black Panther created by Stan Lee & Jack Kirby."8 aRated T for Teen.0 aVolume 1. aWhen a superhuman terrorist group named The People sparks a violent uprising in Wakanda, the kingdom famed for its incredible technology and proud traditions will be thrown into turmoil like never before! Black Panther knows that if Wakanda is to survive, it must adapt--but will he be able to make it through the transition alive? Heavy is the head that wears the cowl!00gv. 1.tA nation under our feetgv. 2.tA nation under our feet. Book twogv. 3.tA nation under our feet. Book threegv. 4.tAvengers of the new world. Part onegv. 5.tAvengers of the new world. Part two.gv. 6.tThe intergalactic empire of Wakanda. Part one --gv. 7.tThe intergalactic empire of Wakanda. Part two. --gv. 8.tThe intergalactic empire of Wakanda. Part three --gv. 9tThe intergalactic empire of Wakanda. Part four.00aBlack Pantherc(Fictitious character)vComic books, strips, etc. 0aKings and rulersvComic books, strips, etc. 0aSuperheroesvComic books, strips, etc. 0aInsurgencyvComic books, strips, etc. 0aGood and evilvComic books, strips, etc. 0aBlack peoplevComic books, strips, etc. 0aAfricavComic books, strips, etc. 6aRois et souverainsvBandes dessineÌes. 6aBandes dessineÌes de superheÌros. 6aReÌvoltesvBandes dessineÌes. 6aNoirsvBandes dessineÌes. 6aAfriquevBandes dessineÌes.07aBlack Pantherc(Fictitious character)2fast0(OCoLC)fst02000849 7aBlack people.2fast0(OCoLC)fst00833880 7aGood and evil.2fast0(OCoLC)fst00944894 7aInsurgency.2fast0(OCoLC)fst00975461 7aKings and rulers.2fast0(OCoLC)fst00987694 7aSuperheroes.2fast0(OCoLC)fst01765254 7aAfrica.2fast0(OCoLC)fst01239509 7asuperhero comics.2aat 7aComics (Graphic works)2fast0(OCoLC)fst01921613 7aGraphic novels.2fast0(OCoLC)fst01726630 7aSuperhero comics.2fast0(OCoLC)fst01922562 7aGraphic novels.2gsafd 7aSuperhero comics.2lcgft 7aComics (Graphic works)2lcgft 7aGraphic novels.2lcgft 7aBandes dessineÌes de superheÌros.2rvmgf 7aBandes dessineÌes.2rvmgf1 aStelfreeze, Brian,eartist.1 aSprouse, Chris,eartist.1 aMartin, Laurac(Comic book artist),ecolorist.1 aSabino, Joe,eletterer.1 aLee, Stan,d1922-2018,ecreator.0http://id.loc.gov/authorities/names/n831692671 aKirby, Jack,ecreator.0http://id.loc.gov/authorities/names/n2019022493 aYBP Library ServicesbYANKn13260207 aYBP Library ServicesbYANKn13041443 \ No newline at end of file From 773b8c6ee0bebda0112c974c3765ec50f15f418b Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 7 Sep 2023 15:18:46 +0300 Subject: [PATCH 112/437] Fix folijet tests (#1555) * fixed C9215 * added function for waiting * added waiter --- .../e2e/field-protection-settings.cy.js | 17 +++++++++++------ ...-in-incoming-records-not-deleted-scen2.cy.js | 3 +++ .../single-record-import/import-by-oclc.cy.js | 2 ++ .../fragments/inventory/instanceRecordEdit.js | 1 + .../fragments/inventory/instanceRecordView.js | 11 +++++++---- .../fragments/inventory/inventoryInstance.js | 5 +++-- 6 files changed, 27 insertions(+), 12 deletions(-) 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 10ea38f71d..0433b80e19 100644 --- a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js @@ -162,13 +162,17 @@ describe('data-import', () => { JobProfiles.waitFileIsImported(nameMarcFileForCreate); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); Logs.openFileDetails(nameMarcFileForCreate); - Logs.verifyInstanceStatus(0, 2, 'Created'); - Logs.verifyInstanceStatus(0, 3, 'Created'); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - Logs.clickOnHotLink(0, 3, 'Created'); + FileDetails.openInstanceInInventory('Created'); InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; + + InstanceRecordView.waitLoading(); InstanceRecordView.viewSource(); InstanceRecordView.verifySrsMarcRecord(); InventoryViewSource.verifyFieldInMARCBibSource('500', dataForField500); @@ -214,9 +218,10 @@ describe('data-import', () => { JobProfiles.waitFileIsImported(fileNameForUpdate); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); Logs.openFileDetails(fileNameForUpdate); - Logs.verifyInstanceStatus(0, 2, 'Created'); - Logs.verifyInstanceStatus(0, 3, 'Updated'); - Logs.clickOnHotLink(0, 3, 'Updated'); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.openInstanceInInventory('Updated'); + InstanceRecordView.waitLoading(); InstanceRecordView.viewSource(); InstanceRecordView.verifySrsMarcRecord(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js index f60f8e3a29..fa2b4a2cda 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen2.cy.js @@ -12,6 +12,7 @@ import InventoryViewSource from '../../../support/fragments/inventory/inventoryV import Users from '../../../support/fragments/users/users'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import { TARGET_PROFILE_NAMES } from '../../../support/constants'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; describe('data-import', () => { describe('Importing MARC Bib files', () => { @@ -94,6 +95,8 @@ describe('data-import', () => { cy.visit(TopMenu.inventoryPath); InventoryInstances.importWithOclc(oclcForImport); // check fields is presented in .mrc file + InstanceRecordView.waitLoading(); + InstanceRecordView.verifyInstancePaneExists(); InventoryInstance.viewSource(); Object.values(initialFields).forEach((field) => InventoryViewSource.contains(field)); cy.intercept('GET', '/orders/titles?*').as('getOrdersTitles'); diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js index b22ff38ed6..51a12abf04 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js @@ -8,6 +8,7 @@ import InventoryViewSource from '../../../support/fragments/inventory/inventoryV import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import Z3950TargetProfiles from '../../../support/fragments/settings/inventory/integrations/z39.50TargetProfiles'; import DevTeams from '../../../support/dictionary/devTeams'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; let user; const oclc = '1007797324'; @@ -44,6 +45,7 @@ describe('inventory', () => { it('C193953 Overlay existing Source = MARC Instance by import of single MARC Bib record from OCLC (folijet) (prokopovych))', { tags: [testTypes.smoke, DevTeams.folijet] }, () => { InventoryActions.import(oclc); + InstanceRecordView.waitLoading(); InventoryInstance.viewSource(); InventoryViewSource.contains('999\tf f\t‡s'); }); diff --git a/cypress/support/fragments/inventory/instanceRecordEdit.js b/cypress/support/fragments/inventory/instanceRecordEdit.js index 0dff490a45..803c23b49f 100644 --- a/cypress/support/fragments/inventory/instanceRecordEdit.js +++ b/cypress/support/fragments/inventory/instanceRecordEdit.js @@ -123,6 +123,7 @@ export default { ]); }, saveAndClose: () => { + cy.wait(1500); cy.do(saveAndCloseButton.click()); cy.expect(actionsButton.exists()); }, diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index ae5c3e6c28..0662ede5be 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -72,10 +72,13 @@ const verifyImportedFieldExists = (field) => { cy.expect(marcViewSection.find(HTML(including(field))).exists()); }; -const viewSource = () => cy.do([ - instanceDetailsSection.find(actionsButton).click(), - viewSourceButton.click(), -]); +const viewSource = () => { + cy.wait(1500); + cy.do([ + instanceDetailsSection.find(actionsButton).click(), + viewSourceButton.click(), + ]); +}; const verifyAdministrativeNote = (value) => { cy.expect(instanceAdministrativeNote.find(MultiColumnListCell({ content: value })).exists()); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 7f593bbebb..12c91ab1eb 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -269,8 +269,9 @@ export default { }, viewSource: () => { - cy.do(actionsButton.click()); - cy.do(viewSourceButton.click()); + cy.wait(1500); + cy.do([actionsButton.click(), + viewSourceButton.click()]); InventoryViewSource.waitLoading(); }, From 55a777dd71e2e3046bf3900f5eb475d27599e7af Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Thu, 7 Sep 2023 16:12:06 +0300 Subject: [PATCH 113/437] Idea Labs: Implementing of FAT-7704 (#1549) * Idea Labs: Implementing of FAT-7704 * Idea Labs: Implementing of FAT-7704 * Idea Labs: Implementing of FAT-7704 * Idea Labs: Implementing of FAT-7704 * Idea Labs: Implementing of FAT-7704 --- .../check-test-rollover-results.cy.js | 162 ++++++++++++++++++ .../fragments/finance/ledgers/ledgers.js | 45 ++--- 2 files changed, 179 insertions(+), 28 deletions(-) create mode 100644 cypress/e2e/finance/fiscalYears/fiscalYearRollover/check-test-rollover-results.cy.js diff --git a/cypress/e2e/finance/fiscalYears/fiscalYearRollover/check-test-rollover-results.cy.js b/cypress/e2e/finance/fiscalYears/fiscalYearRollover/check-test-rollover-results.cy.js new file mode 100644 index 0000000000..541e205548 --- /dev/null +++ b/cypress/e2e/finance/fiscalYears/fiscalYearRollover/check-test-rollover-results.cy.js @@ -0,0 +1,162 @@ +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'; +import DateTools from '../../../../support/utils/dateTools'; +import NewOrder from '../../../../support/fragments/orders/newOrder'; +import Orders from '../../../../support/fragments/orders/orders'; +import OrderLines from '../../../../support/fragments/orders/orderLines'; +import Organizations from '../../../../support/fragments/organizations/organizations'; +import NewOrganization from '../../../../support/fragments/organizations/newOrganization'; +import NewInvoice from '../../../../support/fragments/invoices/newInvoice'; +import Invoices from '../../../../support/fragments/invoices/invoices'; +import ServicePoints from '../../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../../../support/fragments/settings/tenant/locations/newLocation'; + +describe('ui-finance: Fiscal Year Rollover', () => { + const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + const secondFiscalYear = { + name: `autotest_year_${getRandomPostfix()}`, + code: DateTools.getRandomFiscalYearCodeForRollover(2000, 9999), + periodStart: `${DateTools.getCurrentDateForFiscalYear()}T00:00:00.000+00:00`, + periodEnd: `${DateTools.getDayAfterTomorrowDateForFiscalYear()}T00:00:00.000+00:00`, + description: `This is fiscal year created by E2E test automation script_${getRandomPostfix()}`, + series: 'FY', + }; + 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'; + const todayDate = DateTools.getCurrentDate(); + const fileNameDate = DateTools.getCurrentDateForFileNaming(); + let user; + let firstOrderNumber; + let servicePointId; + let location; + + 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; + 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; + }); + }); + // Create second Fiscal Year for Rollover + FiscalYears.createViaApi(secondFiscalYear) + .then(secondFiscalYearResponse => { + secondFiscalYear.id = secondFiscalYearResponse.id; + }); + + // Prepare 2 Open Orders for Rollover + 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('*', 25); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '40', '1', '40', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(firstOrder).then(secondOrderResponse => { + firstOrder.id = secondOrderResponse.id; + Orders.checkCreatedOrder(firstOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 35); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '10', '1', '10', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + }); + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLineFromPol(firstOrderNumber); + // Need to wait, while data will be loaded + cy.wait(4000); + Invoices.approveInvoice(); + Invoices.payInvoice(); + }); + cy.createTempUser([ + permissions.uiFinanceExecuteFiscalYearRollover.gui, + permissions.uiFinanceViewFiscalYear.gui, + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiFinanceViewLedger.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.ledgerPath, waiter: Ledgers.waitForLedgerDetailsLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C359604 Make more than one preview for one ledger and same fiscal year with "Test rollover", check test rollover results (thunderjet)', { tags: [testType.extendedPath, devTeams.thunderjet] }, () => { + FinanceHelp.searchByName(defaultLedger.name); + Ledgers.selectLedger(defaultLedger.name); + Ledgers.rollover(); + Ledgers.fillInTestRolloverInfoCashBalance(secondFiscalYear.code, 'Cash balance', 'Allocation'); + Ledgers.rolloverLogs(); + Ledgers.exportRollover(todayDate); + Ledgers.checkDownloadedFile(`${fileNameDate}-result.csv`, defaultFund, secondFiscalYear, '100', '100', '160', '160', '160', '160', '160'); + Ledgers.deleteDownloadedFile(`${fileNameDate}-result.csv`); + Ledgers.closeOpenedPage(); + Ledgers.rollover(); + Ledgers.fillInRolloverForCashBalance(secondFiscalYear.code, 'Cash balance', 'Allocation'); + Ledgers.closeRolloverInfo(); + Ledgers.selectFundInLedger(defaultFund.name); + Funds.selectPlannedBudgetDetails(); + Funds.checkFundingInformation('$160.00', '$0.00', '$0.00', '$160.00', '$0.00', '$160.00'); + Funds.checkFinancialActivityAndOverages('$0.00', '$0.00', '$0.00', '$0.00'); + }); +}); diff --git a/cypress/support/fragments/finance/ledgers/ledgers.js b/cypress/support/fragments/finance/ledgers/ledgers.js index 82197f3ce1..e5fabacbe6 100644 --- a/cypress/support/fragments/finance/ledgers/ledgers.js +++ b/cypress/support/fragments/finance/ledgers/ledgers.js @@ -76,15 +76,11 @@ export default { cy.do([ledgersFiltersSection.find(Button('Fund')).click()]); }, - rollover: () => { - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(8000); - - cy.do([Button('Actions').click()]); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(8000); - - cy.do([rolloverButton.click()]); + rollover : () => { + cy.do([ + Button('Actions').click(), + rolloverButton.click() + ]); }, closeRolloverInfo: () => { @@ -121,25 +117,22 @@ export default { fillInRolloverInfo(fiscalYear) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(8000); cy.do([ fiscalYearSelect.choose(fiscalYear), - // rolloverAllocationCheckbox.click(), + rolloverAllocationCheckbox.click(), Checkbox({ name: 'encumbrancesRollover[0].rollover' }).click(), Select({ name: 'encumbrancesRollover[0].basedOn' }).choose('Expended'), Checkbox({ name: 'encumbrancesRollover[2].rollover' }).click(), Select({ name: 'encumbrancesRollover[2].basedOn' }).choose('Initial encumbrance'), - rolloverButton.click(), ]); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(8000); + cy.get('button:contains("Rollover")').eq(2).should('be.visible').trigger('click'); this.continueRollover(); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(8000); - cy.do([rolloverConfirmButton.click()]); + cy.do([ + rolloverConfirmButton.click(), + ]); }, + continueRollover: () => { cy.get('body').then(($body) => { if ($body.find('[id=unpaid-invoice-list-modal]').length) { @@ -168,9 +161,8 @@ export default { rolloverAllocationCheckbox.click(), rolloverBudgetVelue.choose(rolloverBudgetValue), addAvailableToSelect.choose(rolloverValueAs), - rolloverButton.click(), ]); - // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.get('button:contains("Rollover")').eq(2).should('be.visible').trigger('click'); cy.wait(4000); this.continueRollover(); cy.do([rolloverConfirmButton.click()]); @@ -203,9 +195,8 @@ export default { fiscalYearSelect.choose(fiscalYear), rolloverBudgetVelue.choose(rolloverBudgetValue), addAvailableToSelect.choose(rolloverValueAs), - rolloverButton.click(), ]); - // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.get('button:contains("Rollover")').eq(2).should('be.visible').trigger('click'); cy.wait(4000); this.continueRollover(); cy.do([rolloverConfirmButton.click()]); @@ -221,9 +212,8 @@ export default { Checkbox({ name: 'budgetsRollover[0].rolloverAllocation' }).click(), rolloverBudgetVelue.choose(rolloverBudgetValue), addAvailableToSelect.choose(rolloverValueAs), - Button('Test rollover').click(), ]); - // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.get('button:contains("Test rollover")').eq(0).should('be.visible').trigger('click'); cy.wait(2000); cy.do([Button({ id: 'clickable-test-rollover-confirmation-confirm' }).click()]); }, @@ -367,10 +357,10 @@ export default { ]); cy.get('#rollover-logs-list') .find('div[role="gridcell"]') - .contains('result', `${dataFile}-result`); + .contains('a', `${dataFile}-result`); cy.get('#rollover-logs-list') .find('div[role="gridcell"]') - .contains('result', `${dataFile}-settings`); + .contains('a', `${dataFile}-settings`); }, checkDownloadedFile( @@ -428,9 +418,8 @@ export default { Select({ name: 'toFiscalYearId' }).choose(fiscalYear), rolloverBudgetVelue.choose(rolloverBudgetValue), addAvailableToSelect.choose(rolloverValueAs), - Button('Test rollover').click(), ]); - // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.get('button:contains("Test rollover")').eq(0).should('be.visible').trigger('click'); cy.wait(2000); cy.do([Button({ id: 'clickable-test-rollover-confirmation-confirm' }).click()]); }, From 998d0ca3d6d1aae0fd75c7059eb7a2b6f3b7d267 Mon Sep 17 00:00:00 2001 From: GoZaddy Date: Tue, 29 Aug 2023 19:37:10 -0500 Subject: [PATCH 114/437] create test precondition data --- ...ansfer-criteria-example-test-cornell.cy.js | 109 ++++++++++++++++-- .../fragments/users/transferFeeFine.js | 38 ++++-- 2 files changed, 130 insertions(+), 17 deletions(-) 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 index d53fe8c65c..ac9d7c2f19 100644 --- 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 @@ -1,19 +1,106 @@ -import settingsMenu from '../../../../support/fragments/settingsMenu'; import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; +import TransferAccounts from '../../../../support/fragments/settings/users/transferAccounts'; +import ServicePoints from '../../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import getRandomPostfix from '../../../../support/utils/stringTools'; +import UsersOwners from '../../../../support/fragments/settings/users/usersOwners'; +import NewFeeFine from '../../../../support/fragments/users/newFeeFine'; +import settingsMenu from '../../../../support/fragments/settingsMenu'; + describe('Build the Cornell bursar transfer file', () => { - before(() => { + const testData = { + servicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation( + 'Test Service Point', + '00000000-0000-1000-8000-000000000000' + ), + feeFineOwnerOne: { + id: '00000000-0000-1000-9000-000000000000', + owner: 'FeeFineOwner' + getRandomPostfix() + }, + feeFineOwnerTwo: { + id: '10000000-0000-1000-9000-000000000000', + owner: 'FeeFineOwner' + getRandomPostfix() + }, + transferAccount: TransferAccounts.getDefaultNewTransferAccount( + 'a0000000-0000-1000-8000-000000000000', + 'Test Transfer account' + ) + }; + + const feeFineOwnerOne = { + id: testData.feeFineOwnerOne.id, + owner: testData.feeFineOwnerOne.owner, + servicePointOwner: [ + { + value: testData.servicePoint.id, + label: testData.servicePoint.name, + }, + ], + }; + + const feeFineOwnerTwo = { + id: testData.feeFineOwnerTwo.id, + owner: testData.feeFineOwnerTwo.owner, + servicePointOwner: [ + { + value: testData.servicePoint.id, + label: testData.servicePoint.name, + }, + ], + }; + + + // todo: need user and feeFine. see fine-amount-link-absent-in-while-checkout.cy.js + const feeFineAccount = { + id: 'bbc0f7f6-7419-4ff7-aed9-fdae0c5b7d64', + ownerId: testData.feeFineOwnerOne.id, + amount: 10, + feeFineType: 'Test', + }; + + + + before('Preconditions', () => { + cy.getAdminToken(); + + // create test service point + ServicePoints.createViaApi(testData.servicePoint); + + // create fee fine owner + UsersOwners.createViaApi(feeFineOwnerOne); + UsersOwners.createViaApi(feeFineOwnerTwo); + + // Create fee/fine + NewFeeFine.createViaApi(feeFineAccount).then((feeFineAccountId) => { + console.log('feeFineAccountId', feeFineAccountId); + feeFineAccount.id = feeFineAccountId; + }); + + + // create test transfer account + TransferAccounts.createViaApi({ ...testData.transferAccount, ownerId: feeFineOwnerTwo.id }); + cy.loginAsAdmin({ path: settingsMenu.usersTransferCriteria, waiter: TransferFeeFine.waitLoadingTransferCriteria, }); }); + + after('Deleting created entities', () => { + ServicePoints.deleteViaApi(testData.servicePoint.id); + UsersOwners.deleteViaApi(feeFineOwnerOne.id); + UsersOwners.deleteViaApi(feeFineOwnerTwo.id); + NewFeeFine.deleteFeeFineAccountViaApi(feeFineAccount.id); + TransferAccounts.deleteViaApi(testData.transferAccount.id); + }); + it('should be able to open all the panes', () => { TransferFeeFine.openAllPanes(); TransferFeeFine.verifyOpenAllPanes(); }); + it('should be able to set scheduling', () => { TransferFeeFine.setTransferCriteriaScheduling( 'Weeks', @@ -29,9 +116,9 @@ describe('Build the Cornell bursar transfer file', () => { ); }); - it('should be able to set no criteria', () => { - TransferFeeFine.setCriteria(false); - TransferFeeFine.verifyCriteria(false); + it('should be able to set criteria to filter by service point', () => { + TransferFeeFine.setCriteriaFeeFineOwner(testData.feeFineOwnerOne.owner); + TransferFeeFine.verifyCriteriaFeeFineOwner(testData.feeFineOwnerOne.id); }); // Aggregate by patron: Box unchecked @@ -62,14 +149,20 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.verifyClearFormat('footer'); }); - // Transer account data to + + // Transfer 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'); + TransferFeeFine.setTransferAccount(feeFineOwnerTwo.owner, testData.transferAccount.accountName); + TransferFeeFine.verifyTransferAccount(feeFineOwnerTwo.id, testData.transferAccount.id); }); it('should be able to run manually', () => { TransferFeeFine.runManually(); TransferFeeFine.verifyRunManually(); }); + + // todo: go to export manager + // maybe get job id from intercept api request on 'run manually' + // select job link using job id + // read downloaded file and check that it has the expected content }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index ed4b75035f..4d63f253be 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,12 +1,4 @@ -import { el } from 'date-fns/locale'; -import { - Button, - Modal, - TextField, - Select, - Pane, - MultiSelect, -} from '../../../../interactors'; +import { Button, Modal, MultiSelect, Pane, Select, TextField } from '../../../../interactors'; const rootModal = Modal({ id: 'transfer-modal' }); const amountTextfield = rootModal.find(TextField({ id: 'amount' })); @@ -79,6 +71,20 @@ export default { // Currently don't have any test cases for criteria }, + setCriteriaItemServicePoint(servicePointName) { + cy.do([ + Select({ name: 'criteria.type' }).choose('Item service point'), + Select({ name: 'criteria.servicePointId' }).choose(servicePointName) + ]); + }, + + setCriteriaFeeFineOwner(feeFineOwner) { + cy.do([ + Select({ name: 'criteria.type' }).choose('Fee/fine owner'), + Select({ name: 'criteria.feeFineOwnerId' }).choose(feeFineOwner) + ]); + }, + setTransferAccount(feeFineOwner, transferAccount) { cy.do([ Select({ name: 'transferInfo.else.owner' }).choose(feeFineOwner), @@ -161,6 +167,20 @@ export default { } }, + verifyCriteriaItemServicePoint(servicePointId) { + cy.expect([ + Select({ name: 'criteria.type', value: 'ServicePoint' }).exists(), + Select({ name: 'criteria.servicePointId', value: servicePointId }).exists() + ]); + }, + + verifyCriteriaFeeFineOwner(feeFineOwnerId) { + cy.expect([ + Select({ name: 'criteria.type', value: 'FeeFineOwner' }).exists(), + Select({ name: 'criteria.feeFineOwnerId', value: feeFineOwnerId }).exists() + ]); + }, + verifyTransferAccount(feeFineOwner, transferAccount) { cy.expect( Select({ name: 'transferInfo.else.owner', value: feeFineOwner }).exists() From 0bcf3f1f2cb087d2ae9ac64d1058128dcad2fade Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:35:48 +0500 Subject: [PATCH 115/437] FAT-7735/C11096 (#1559) * fixed C11096 * fixed bug --- cypress/e2e/ideyalabs/users.cy.js | 78 +++---------- ...st-name-displays-in-user-record-view.cy.js | 72 ++++++++++++ .../user-able-to-edit-user-records.cy.js | 5 +- cypress/support/fragments/users/userEdit.js | 39 ++++--- cypress/support/fragments/users/users.js | 108 ++++++++---------- 5 files changed, 159 insertions(+), 143 deletions(-) create mode 100644 cypress/e2e/users/preferred-first-name-displays-in-user-record-view.cy.js diff --git a/cypress/e2e/ideyalabs/users.cy.js b/cypress/e2e/ideyalabs/users.cy.js index bc61340c72..8cc4e5118d 100644 --- a/cypress/e2e/ideyalabs/users.cy.js +++ b/cypress/e2e/ideyalabs/users.cy.js @@ -29,19 +29,6 @@ const userTwo = { }, }; -const userThree = { - patronGroup: 'A1A1', - barcode: `678${randomFourDigitNumber}`, - userName: `Mann${randomFourDigitNumber}`, - personal: { - lastName: 'Script', - firstName: 'Auto', - email: `dan${randomFourDigitNumber}@yopmail.com`, - middleName: 'Test', - preferredFirstName: 'Dan', - }, -}; - const deleteData = { name: 'User Delete', selectName: 'User, Delete', @@ -49,14 +36,6 @@ const deleteData = { selectLastName: 'Script Test', }; -const verifyData = { - verifyLastNameOnUserDetailsPane: 'Script', - verifyPreferredfirstnameOnUserDetailsPane: 'Dan', - verifyFirstNameOnUserDetailsPane: 'Auto', - verifyMiddleNameOnUserDetailsPane: 'Test', - verifyClearFirstNameDetailsPane: 'No value set-' -}; - describe.skip('create a users', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); @@ -70,45 +49,20 @@ describe.skip('create a users', () => { users.checkZeroSearchResultsHeader(); }); - it('C421 Create: new user; required: contact info, email, phone, external system ID, address (Prokopovych)', { tags: [testTypes.ideaLabsTests] }, () => { - users.createViaUi(userOne); - cy.visit(topMenu.usersPath); - users.createViaUi(userTwo); - users.assertion(); - ledgers.closeOpenedPage(); - users.closeWithoutSavingButton(); - usersSearchPane.searchByKeywords(deleteData.name); - usersSearchPane.selectUsersFromList(deleteData.selectName); - users.deleteUser(); - users.checkZeroSearchResultsHeader(); - }); - - it('C11096 Add Preferred first name and confirm its display in the User record View and Edit screens (Volaris)', { tags: [testTypes.ideaLabsTests] }, () => { - users.createData(userThree); - users.verifyPreferredfirstnameOnUserDetailsPane( - verifyData.verifyPreferredfirstnameOnUserDetailsPane - ); - users.verifyLastNameOnUserDetailsPane( - verifyData.verifyLastNameOnUserDetailsPane - ); - users.verifyMiddleNameOnUserDetailsPane( - verifyData.verifyMiddleNameOnUserDetailsPane - ); - users.editButton(); - users.clearTextField(); - users.saveButton(); - users.verifyLastNameOnUserDetailsPane( - verifyData.verifyLastNameOnUserDetailsPane - ); - users.verifyMiddleNameOnUserDetailsPane( - verifyData.verifyMiddleNameOnUserDetailsPane - ); - users.verifyFirstNameOnUserDetailsPane( - verifyData.verifyFirstNameOnUserDetailsPane - ); - users.editButton(); - users.clearTextFieldFirstName(); - users.saveButton(); - users.verifyFirstNameOnUserDetailsPane(verifyData.verifyClearFirstNameDetailsPane); - }); + it( + 'C421 Create: new user; required: contact info, email, phone, external system ID, address (Prokopovych)', + { tags: [testTypes.ideaLabsTests] }, + () => { + users.createViaUi(userOne); + cy.visit(topMenu.usersPath); + users.createViaUi(userTwo); + users.assertion(); + ledgers.closeOpenedPage(); + users.closeWithoutSavingButton(); + usersSearchPane.searchByKeywords(deleteData.name); + usersSearchPane.selectUsersFromList(deleteData.selectName); + users.deleteUser(); + users.checkZeroSearchResultsHeader(); + }, + ); }); diff --git a/cypress/e2e/users/preferred-first-name-displays-in-user-record-view.cy.js b/cypress/e2e/users/preferred-first-name-displays-in-user-record-view.cy.js new file mode 100644 index 0000000000..f916f46e02 --- /dev/null +++ b/cypress/e2e/users/preferred-first-name-displays-in-user-record-view.cy.js @@ -0,0 +1,72 @@ +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 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 UsersSearchPane from '../../support/fragments/users/usersSearchPane'; + +describe('Permissions Tags', () => { + let userData; + let servicePointId; + const patronGroup = { + name: getTestEntityValue('groupUserChange'), + }; + + 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.uiUserEdit.gui, permissions.uiUsersPermissionsView.gui], + patronGroup.name, + ).then((userProperties) => { + userData = userProperties; + userData.middleName = getTestEntityValue('MiddleName'); + userData.preferredFirstName = getTestEntityValue('PreferredFirstName'); + UserEdit.addServicePointViaApi(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password, { + path: TopMenu.usersPath, + waiter: UsersSearchPane.waitLoading, + }); + }); + }); + }); + + after('Deleting created entities', () => { + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + }); + + it( + 'C11096 Add Preferred first name and confirm its display in the User record View and Edit screens (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByUsername(userData.username); + UserEdit.openUserEdit(); + UserEdit.changeMiddleName(userData.middleName); + UserEdit.changePreferredFirstName(userData.preferredFirstName); + UserEdit.saveAndClose(); + UsersSearchPane.waitLoading(); + Users.verifyFullNameIsDisplayedCorrectly( + `${userData.lastName}, ${userData.preferredFirstName} ${userData.middleName}`, + ); + + UserEdit.openUserEdit(); + UserEdit.changePreferredFirstName(''); + UserEdit.saveAndClose(); + UsersSearchPane.waitLoading(); + Users.verifyFullNameIsDisplayedCorrectly( + `${userData.lastName}, ${userData.firstName} ${userData.middleName}`, + ); + }, + ); +}); diff --git a/cypress/e2e/users/user-able-to-edit-user-records.cy.js b/cypress/e2e/users/user-able-to-edit-user-records.cy.js index bf53f73176..8cdc139cb2 100644 --- a/cypress/e2e/users/user-able-to-edit-user-records.cy.js +++ b/cypress/e2e/users/user-able-to-edit-user-records.cy.js @@ -27,7 +27,7 @@ describe('Permissions Tags', () => { }); cy.createTempUser( [permissions.uiUserEdit.gui, permissions.uiUsersPermissionsView.gui], - patronGroup.name + patronGroup.name, ).then((userProperties) => { userData = userProperties; UserEdit.addServicePointViaApi(servicePointId, userData.userId, servicePointId); @@ -49,9 +49,10 @@ describe('Permissions Tags', () => { { tags: [TestTypes.extendedPath, devTeams.volaris] }, () => { UsersSearchPane.searchByUsername(userData.username); + UserEdit.openUserEdit(); UserEdit.changeMiddleName(newMiddleName); UserEdit.saveAndClose(); Users.verifyMiddleNameOnUserDetailsPane(newMiddleName); - } + }, ); }); diff --git a/cypress/support/fragments/users/userEdit.js b/cypress/support/fragments/users/userEdit.js index 88373f722b..eab48f8b9e 100644 --- a/cypress/support/fragments/users/userEdit.js +++ b/cypress/support/fragments/users/userEdit.js @@ -11,7 +11,7 @@ import { Select, MultiSelect, TextArea, - HTML + HTML, } from '../../../../interactors'; import TopMenu from '../topMenu'; import defaultUser from './userDefaultObjects/defaultUser'; @@ -43,12 +43,16 @@ const addServicePointsViaApi = (servicePointIds, userId, defaultServicePointId) export default { addServicePointsViaApi, + openUserEdit() { + cy.do([userDetailsPane.find(actionsButton).click(), editButton.click()]); + }, + changeMiddleName(midName) { - cy.do([ - userDetailsPane.find(actionsButton).click(), - editButton.click(), - TextField({ id: 'adduser_middlename' }).fillIn(midName), - ]); + cy.do(TextField({ id: 'adduser_middlename' }).fillIn(midName)); + }, + + changePreferredFirstName(prefName) { + cy.do(TextField({ id: 'adduser_preferredname' }).fillIn(prefName)); }, addPermissions(permissions) { @@ -56,10 +60,10 @@ export default { userDetailsPane.find(actionsButton).click(), editButton.click(), permissionsAccordion.clickHeader(), - addPermissionsButton.click() + addPermissionsButton.click(), ]); - permissions.forEach(permission => { + permissions.forEach((permission) => { cy.do(userSearch.fillIn(permission)); cy.expect(userSearch.is({ value: permission })); // wait is needed to avoid so fast robot clicks @@ -71,9 +75,7 @@ export default { }, verifyPermissionDoesNotExist(permission) { - cy.do([ - addPermissionsButton.click(), - userSearch.fillIn(permission)]); + cy.do([addPermissionsButton.click(), userSearch.fillIn(permission)]); cy.expect(userSearch.is({ value: permission })); // wait is needed to avoid so fast robot clicks cy.wait(1000); @@ -88,7 +90,7 @@ export default { Button({ id: 'add-service-point-btn' }).click(), ]); - points.forEach(point => { + points.forEach((point) => { cy.do(MultiColumnListRow({ content: point, isContainer: true }).find(Checkbox()).click()); }); @@ -114,11 +116,12 @@ export default { cy.do(Button({ id: 'clickable-save' }).click()); }, - changeServicePointPreferenceViaApi: (userId, servicePointIds, defaultServicePointId = null) => cy.okapiRequest({ - method: 'GET', - path: `service-points-users?query="userId"="${userId}"`, - isDefaultSearchParamsRequired: false, - }) + changeServicePointPreferenceViaApi: (userId, servicePointIds, defaultServicePointId = null) => cy + .okapiRequest({ + method: 'GET', + path: `service-points-users?query="userId"="${userId}"`, + isDefaultSearchParamsRequired: false, + }) .then((servicePointsUsers) => { cy.okapiRequest({ method: 'PUT', @@ -135,7 +138,7 @@ export default { updateExternalIdViaApi(user, externalSystemId) { cy.updateUser({ ...user, - externalSystemId + externalSystemId, }); }, diff --git a/cypress/support/fragments/users/users.js b/cypress/support/fragments/users/users.js index a5f994cc64..fcad149338 100644 --- a/cypress/support/fragments/users/users.js +++ b/cypress/support/fragments/users/users.js @@ -11,6 +11,7 @@ import { Select, TextField, Callout, + HTML, } from '../../../../interactors'; import getRandomPostfix from '../../utils/stringTools'; @@ -45,17 +46,21 @@ const defaultUser = { export default { defaultUser, - createViaApi: (user) => cy.okapiRequest({ - method: 'POST', - path: 'users', - body: user, - isDefaultSearchParamsRequired: false - }).then(response => ({ id: response.body.id, - username: response.body.username, - barcode: response.body.barcode, - lastName: response.body.personal.lastName, - firstName : response.body.personal.firstName, - middleName : response.body.personal.middleName })), + createViaApi: (user) => cy + .okapiRequest({ + method: 'POST', + path: 'users', + body: user, + isDefaultSearchParamsRequired: false, + }) + .then((response) => ({ + id: response.body.id, + username: response.body.username, + barcode: response.body.barcode, + lastName: response.body.personal.lastName, + firstName: response.body.personal.firstName, + middleName: response.body.personal.middleName, + })), deleteViaApi: (userId) => cy.okapiRequest({ method: 'DELETE', @@ -64,18 +69,21 @@ export default { }), createViaUi: (userData) => { - return cy.do([ - Dropdown('Actions').find(Button()).click(), - Button({ id: 'clickable-newuser' }).click(), - TextField({ id: 'adduser_lastname' }).fillIn(userData.personal.lastName), - Select({ id: 'adduser_group' }).choose(userData.patronGroup), - TextField({ name: 'barcode' }).fillIn(userData.barcode), - TextField({ name: 'username' }).fillIn(userData.username), - TextField({ id: 'adduser_email' }).fillIn(userData.personal.email), - Button({ id: 'clickable-save' }).click()]).then(() => { - cy.intercept('/users').as('user'); - return cy.wait('@user', { timeout: 80000 }).then((xhr) => xhr.response.body.id); - }); + return cy + .do([ + Dropdown('Actions').find(Button()).click(), + Button({ id: 'clickable-newuser' }).click(), + TextField({ id: 'adduser_lastname' }).fillIn(userData.personal.lastName), + Select({ id: 'adduser_group' }).choose(userData.patronGroup), + TextField({ name: 'barcode' }).fillIn(userData.barcode), + TextField({ name: 'username' }).fillIn(userData.username), + TextField({ id: 'adduser_email' }).fillIn(userData.personal.email), + Button({ id: 'clickable-save' }).click(), + ]) + .then(() => { + cy.intercept('/users').as('user'); + return cy.wait('@user', { timeout: 80000 }).then((xhr) => xhr.response.body.id); + }); }, assertion: () => { @@ -91,19 +99,13 @@ export default { Dropdown('Actions').find(Button()).click(), Button({ id: 'clickable-newuser' }).click(), TextField({ id: 'adduser_lastname' }).fillIn(userData.personal.lastName), - TextField({ id: 'adduser_middlename' }).fillIn( - userData.personal.middleName - ), - TextField({ id: 'adduser_firstname' }).fillIn( - userData.personal.firstName - ), + TextField({ id: 'adduser_middlename' }).fillIn(userData.personal.middleName), + TextField({ id: 'adduser_firstname' }).fillIn(userData.personal.firstName), Select({ id: 'adduser_group' }).choose(userData.patronGroup), TextField({ name: 'barcode' }).fillIn(userData.barcode), TextField({ name: 'username' }).fillIn(userData.userName), TextField({ id: 'adduser_email' }).fillIn(userData.personal.email), - TextField({ id: 'adduser_preferredname' }).fillIn( - userData.personal.preferredFirstName - ), + TextField({ id: 'adduser_preferredname' }).fillIn(userData.personal.preferredFirstName), Button({ id: 'clickable-save' }).click(), ]); }, @@ -127,65 +129,49 @@ export default { }); }, + verifyFullNameIsDisplayedCorrectly(fullName) { + cy.expect(Section({ id: 'pane-userdetails' }).find(HTML(fullName)).exists()); + }, + verifyFirstNameOnUserDetailsPane(firstName) { - cy.expect( - userDetailsPane - .find(KeyValue('First name')) - .has({ value: `${firstName}` }) - ); + cy.expect(userDetailsPane.find(KeyValue('First name')).has({ value: `${firstName}` })); }, verifyLastNameOnUserDetailsPane(lastName) { - cy.expect( - userDetailsPane.find(KeyValue('Last name')).has({ value: `${lastName}` }) - ); + cy.expect(userDetailsPane.find(KeyValue('Last name')).has({ value: `${lastName}` })); }, verifyMiddleNameOnUserDetailsPane(middleName) { - cy.expect( - userDetailsPane - .find(KeyValue('Middle name')) - .has({ value: `${middleName}` }) - ); + cy.expect(userDetailsPane.find(KeyValue('Middle name')).has({ value: `${middleName}` })); }, verifyPreferredfirstnameOnUserDetailsPane(Preferredfirstname) { cy.expect( userDetailsPane .find(KeyValue('Preferred first name')) - .has({ value: `${Preferredfirstname}` }) + .has({ value: `${Preferredfirstname}` }), ); }, verifyPatronGroupOnUserDetailsPane(patronGroup) { - cy.expect( - userDetailsPane - .find(KeyValue('Patron group')) - .has({ value: `${patronGroup}` }) - ); + cy.expect(userDetailsPane.find(KeyValue('Patron group')).has({ value: `${patronGroup}` })); }, verifyEmailDomainOnUserDetailsPane(emailDomain) { cy.do(contactInformationAccordion.clickHeader()); - cy.expect( - userDetailsPane - .find(KeyValue('Email')) - .has({ value: including(`@${emailDomain}`) }) - ); + cy.expect(userDetailsPane.find(KeyValue('Email')).has({ value: including(`@${emailDomain}`) })); }, verifyExpirationDateOnUserDetailsPane(expirationDate) { cy.expect( - userDetailsPane - .find(KeyValue('Expiration date')) - .has({ value: `${expirationDate}` }) + userDetailsPane.find(KeyValue('Expiration date')).has({ value: `${expirationDate}` }), ); }, verifyCustomFieldOnUserDetailsPane(name, text) { cy.expect(userDetailsPane.find(KeyValue(name)).has({ value: text })); }, - + clearTextField() { cy.do(TextField({ id: 'adduser_preferredname' }).clear()); }, @@ -201,7 +187,7 @@ export default { .find(Button('Actions')) .click(), deleteUser.click(), - deleteYesButton.click() + deleteYesButton.click(), ]); }, From 1a19afa8b869dc6c9f62ef6a7bd89f27c4d17e51 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Fri, 8 Sep 2023 12:45:22 +0300 Subject: [PATCH 116/437] FAT-2664-C350646 (#1557) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-2664: initial implementation * FAT-2664: all steps added --- .../holdings/create-new-marc-holdings.cy.js | 79 +++++++++++++++---- .../fragments/inventory/holdingsRecordView.js | 6 ++ cypress/support/fragments/quickMarcEditor.js | 6 +- 3 files changed, 73 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js b/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js index 3fdf558696..f0cabe1516 100644 --- a/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js +++ b/cypress/e2e/inventory/holdings/create-new-marc-holdings.cy.js @@ -15,12 +15,23 @@ import InventorySteps from '../../../support/fragments/inventory/inventorySteps' import { getCurrentDateYYMMDD } from '../../../support/utils/dateTools'; describe('Create holding records with MARC source', () => { - const marcFile = { - marc: 'oneMarcBib.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, - jobProfileToRun: 'Default - Create instance and SRS MARC Bib', - numOfRecords: 1, + const testData = { + tag852: '852', + tag866: '866', + tag866Value: 'Test' }; + const marcFiles = [ + { + marc: 'oneMarcBib.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib' + }, + { + marc: 'oneMarcBib.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib' + } + ]; let user; const recordIDs = []; @@ -33,26 +44,34 @@ describe('Create holding records with MARC source', () => { ]).then(createdUserProperties => { user = 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]); + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(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.login(user.username, user.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); }); }); }); + beforeEach('Login', () => { + cy.login(user.username, user.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + after('Deleting created user, data', () => { Users.deleteViaApi(user.userId); - cy.deleteHoldingRecordViaApi(recordIDs[1]); + cy.deleteHoldingRecordViaApi(recordIDs[2]); + cy.deleteHoldingRecordViaApi(recordIDs[3]); InventoryInstance.deleteInstanceViaApi(recordIDs[0]); + InventoryInstance.deleteInstanceViaApi(recordIDs[1]); }); it('C387450 "008" field existence validation when create new "MARC Holdings" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire], retries: 1 }, () => { @@ -84,4 +103,30 @@ describe('Create holding records with MARC source', () => { recordIDs.push(holdingsID); }); }); + + it('C350646 Create a new MARC Holdings record for existing "Instance" record (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstances.searchBySource('MARC'); + InventoryInstance.searchByTitle(recordIDs[1]); + InventoryInstance.checkExpectedMARCSource(); + InventoryInstance.goToMarcHoldingRecordAdding(); + QuickMarcEditor.waitLoading(); + QuickMarcEditor.updateExistingField(testData.tag852, QuickMarcEditor.getExistingLocation()); + QuickMarcEditor.addEmptyFields(5); + QuickMarcEditor.updateExistingTagValue(6, testData.tag866); + QuickMarcEditor.updateExistingField(testData.tag866, testData.tag866Value); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveHoldings(); + HoldingsRecordView.getHoldingsIDInDetailView().then((holdingsID) => { + recordIDs.push(holdingsID); + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); + HoldingsRecordView.viewSource(); + HoldingsRecordView.closeSourceView(); + InventoryInstance.verifyLastUpdatedDate(); + InventoryInstance.verifyRecordStatus(`Source: ${user.lastName}, ${user.firstName}`); + HoldingsRecordView.editInQuickMarc(); + QuickMarcEditor.waitLoading(); + QuickMarcEditor.checkUserNameInHeader(user.firstName, user.lastName); + }); + }); }); diff --git a/cypress/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index 5a403d5d5d..5f4f11c06d 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -8,6 +8,7 @@ import { Section, MultiColumnList, Pane, + PaneHeader, Select, TextArea, Link @@ -185,5 +186,10 @@ export default { cy.wrap(holdingsID).as('holdingsID'); }); return cy.get('@holdingsID'); + }, + closeSourceView() { + cy.do(PaneHeader().find(closeButton).click()); + cy.expect(root.exists()); + this.waitLoading(); } }; diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 2f3029d3d4..9c2ae8d6c8 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -863,7 +863,7 @@ export default { clickKeepLinkingButton() { cy.do(keepLinkingButton.click()); }, - + verifyAndDismissWrongTagLengthCallout() { cy.expect(calloutMarcTagWrongLength.exists()); cy.do(calloutMarcTagWrongLength.dismiss()); @@ -888,5 +888,9 @@ export default { verifyMultiple001TagCallout() { cy.expect(calloutMultiple001MarcTags.exists()); + }, + + checkUserNameInHeader(firstName, lastName) { + cy.expect(PaneHeader().find(HTML(including(`Source: ${lastName}, ${firstName}`))).exists()); } }; From 731e181c4f76a0b77d6b4827ce89a71105a6ef6c Mon Sep 17 00:00:00 2001 From: nayimovag Date: Fri, 8 Sep 2023 17:16:41 +0500 Subject: [PATCH 117/437] Fat 6918 (#1562) --- ...bulk-edit-in-app-holdings-line-break.cy.js | 8 +++- .../bulk-edit-logs-csv-users-barcodes.cy.js | 37 ++++++++++++------- .../bulk-edit-logs-csv-users-usernames.cy.js | 5 ++- ...-logs-in-app-holdings-instance-hrids.cy.js | 28 ++++++++------ .../bulk-edit-logs-in-app-holdings.cy.js | 5 ++- ...bulk-edit-logs-in-app-items-barcodes.cy.js | 5 ++- .../bulk-edit-logs-in-app-items-hrids.cy.js | 30 +++++++++------ ...ulk-edit-logs-in-app-users-usernames.cy.js | 5 ++- .../bulk-edit-logs-in-app-users-uuids.cy.js | 28 ++++++++------ .../filter-declared-lost.cy.js | 5 --- .../filter-renewed-through-override.cy.js | 36 +++++++++++++----- 11 files changed, 119 insertions(+), 73 deletions(-) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-line-break.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-line-break.cy.js index 965a66cad5..db23f31a79 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-line-break.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-line-break.cy.js @@ -56,7 +56,9 @@ describe('bulk-edit', () => { }); [items[0].instanceName, items[1].instanceName].forEach(instance => { InventorySearchAndFilter.searchInstanceByTitle(instance); - InventorySearchAndFilter.selectViewHoldings(); + InventoryInstances.selectInstance(); + InventoryInstance.waitLoading(); + InventoryInstance.openHoldingView(); HoldingsRecordView.edit(); HoldingsRecordEdit.addHoldingsNotes(holdingsNote); HoldingsRecordEdit.saveAndClose(); @@ -104,7 +106,9 @@ describe('bulk-edit', () => { cy.visit(TopMenu.inventoryPath); items.forEach(item => { InventorySearchAndFilter.searchInstanceByTitle(item.instanceName); - InventorySearchAndFilter.selectViewHoldings(); + InventoryInstances.selectInstance(); + InventoryInstance.waitLoading(); + InventoryInstance.openHoldingView(); InventoryInstance.verifyHoldingsTemporaryLocation(location); InventoryInstance.closeHoldingsView(); }); diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js index f3b12bc6ea..1eff7e26a1 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-barcodes.cy.js @@ -9,24 +9,25 @@ import FileManager from '../../../../support/utils/fileManager'; import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-actions'; import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files'; -// TODO: Update test after MODBULKOPS-123 is done - let user; let userWithoutPermissions; const newFirstName = `testNewFirstName_${getRandomPostfix()}`; const invalidUserBarcode = getRandomPostfix(); const invalidAndValidUserBarcodesFileName = `invalidAndValidUserBarcodes_${getRandomPostfix()}.csv`; const matchedRecordsFileName = `Matched-Records-${invalidAndValidUserBarcodesFileName}`; -// const errorsFromMatchingFileName = `*Errors-${invalidAndValidUserBarcodesFileName}`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${invalidAndValidUserBarcodesFileName}`; const editedFileName = `edited-records-${getRandomPostfix()}.csv`; const changedRecordsFileName = `*-Changed-Records-${editedFileName}`; -// const errorsInChangedRecordsFileName = `*-Errors-${editedFileName}`; +const otherErrors = { + first: `*-Errors-${invalidAndValidUserBarcodesFileName}`, + second: `*-Errors-${editedFileName}` +}; const previewOfProposedChangesFileName = { first: `*-Updates-Preview-${invalidAndValidUserBarcodesFileName}`, second: `*-Updates-Preview-${editedFileName}` }; const updatedRecordsFileName = `*-Changed-Records*-${invalidAndValidUserBarcodesFileName}`; -// const errorsFromCommittingFileName = `*Errors-*-${matchedRecordsFileName}`; +const errorsFromCommittingFileName = `*-Committing-changes-Errors-${invalidAndValidUserBarcodesFileName}`; describe('Bulk Edit - Logs', () => { before('create test data', () => { @@ -55,8 +56,18 @@ describe('Bulk Edit - Logs', () => { FileManager.deleteFile(`cypress/fixtures/${editedFileName}`); Users.deleteViaApi(user.userId); Users.deleteViaApi(userWithoutPermissions.userId); - FileManager.deleteFileFromDownloadsByMask(invalidAndValidUserBarcodesFileName, `*${matchedRecordsFileName}`, changedRecordsFileName, previewOfProposedChangesFileName.first, previewOfProposedChangesFileName.second, updatedRecordsFileName); - // FileManager.deleteFileFromDownloadsByMask(errorsFromCommittingFileName, errorsInChangedRecordsFileName, errorsFromMatchingFileName); + FileManager.deleteFileFromDownloadsByMask( + invalidAndValidUserBarcodesFileName, + `*${matchedRecordsFileName}`, + changedRecordsFileName, + previewOfProposedChangesFileName.first, + previewOfProposedChangesFileName.second, + updatedRecordsFileName, + errorsFromCommittingFileName, + errorsFromMatchingFileName, + otherErrors.first, + otherErrors.second + ); }); it('C375215 Verify generated Logs files for Users CSV - with errors (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { @@ -65,7 +76,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.waitFileUploading(); BulkEditActions.downloadMatchedResults(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditActions.prepareValidBulkEditFile(matchedRecordsFileName, editedFileName, user.firstName, newFirstName); @@ -78,7 +89,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.verifyChangedResults(newFirstName); BulkEditActions.openActions(); BulkEditActions.downloadChangedCSV(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditSearchPane.openLogsSearch(); BulkEditSearchPane.verifyLogsPane(); @@ -92,8 +103,8 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.downloadFileWithMatchingRecords(); BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileName}`, [user.barcode, userWithoutPermissions.barcode], 'userBarcode', true); - // BulkEditSearchPane.downloadFileWithErrorsEncountered(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidUserBarcode], 'firstElement', false); + BulkEditSearchPane.downloadFileWithErrorsEncountered(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidUserBarcode], 'firstElement', false); BulkEditSearchPane.downloadFileWithProposedChanges(); BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName.first, [newFirstName, userWithoutPermissions.firstName], 'firstName', true); @@ -101,7 +112,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.downloadFileWithUpdatedRecords(); BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, [newFirstName, userWithoutPermissions.firstName], 'firstName', true); - // BulkEditSearchPane.downloadFileWithCommitErrors(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [userWithoutPermissions.barcode], 'firstElement', false); + BulkEditSearchPane.downloadFileWithCommitErrors(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [userWithoutPermissions.barcode], 'firstElement', false); }); }); diff --git a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-usernames.cy.js b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-usernames.cy.js index 34f0cbd150..991cc7b1fd 100644 --- a/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-usernames.cy.js +++ b/cypress/e2e/bulk-edit/logs/csv/bulk-edit-logs-csv-users-usernames.cy.js @@ -12,7 +12,8 @@ import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-a let user; const invalidUsername = `username${getRandomPostfix()}`; const invalidUsernamesFileName = `invalidUserUUIDs_${getRandomPostfix()}.csv`; -const errorsFromMatchingFileName = `*Errors-${invalidUsernamesFileName}*`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${invalidUsernamesFileName}*`; +const otherError = `*-Errors-${invalidUsernamesFileName}`; describe('Bulk Edit - Logs', () => { before('create test data', () => { @@ -35,7 +36,7 @@ describe('Bulk Edit - Logs', () => { after('delete test data', () => { FileManager.deleteFile(`cypress/fixtures/${invalidUsernamesFileName}`); Users.deleteViaApi(user.userId); - FileManager.deleteFileFromDownloadsByMask(invalidUsernamesFileName, errorsFromMatchingFileName); + FileManager.deleteFileFromDownloadsByMask(invalidUsernamesFileName, errorsFromMatchingFileName, otherError); }); it('C375216 Verify generated Logs files for Users CSV -- only errors (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js index 9a7bf1d9d0..0a6902ecdd 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings-instance-hrids.cy.js @@ -16,16 +16,15 @@ import ServicePoints from '../../../../support/fragments/settings/tenant/service import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files'; import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; -// TODO: Update test after MODBULKOPS-123 is done - let user; const invalidInstanceHRID = `123-${getRandomPostfix()}`; const validAndInvalidInstanceHRIDsFileName = `validAndInvalidInstanceHRIDS-${getRandomPostfix()}.csv`; const matchedRecordsFileName = `Matched-Records-${validAndInvalidInstanceHRIDsFileName}`; -// const errorsFromMatchingFileName = `*Errors-${validAndInvalidInstanceHRIDsFileName}`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${validAndInvalidInstanceHRIDsFileName}`; const previewOfProposedChangesFileName = `*-Updates-Preview-${validAndInvalidInstanceHRIDsFileName}`; const updatedRecordsFileName = `*-Changed-Records*-${validAndInvalidInstanceHRIDsFileName}`; -// const errorsFromCommittingFileName = `*Errors-*-${matchedRecordsFileName}`; +const errorsFromCommittingFileName = `*-Committing-changes-Errors-${validAndInvalidInstanceHRIDsFileName}`; +const otherErrors = `*-Errors-${validAndInvalidInstanceHRIDsFileName}`; const item = { barcode: `456-${getRandomPostfix()}` @@ -170,8 +169,13 @@ describe('Bulk Edit - Logs', () => { InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item2.barcode); Users.deleteViaApi(user.userId); FileManager.deleteFile(`cypress/fixtures/${validAndInvalidInstanceHRIDsFileName}`); - FileManager.deleteFileFromDownloadsByMask(validAndInvalidInstanceHRIDsFileName, `*${matchedRecordsFileName}`, previewOfProposedChangesFileName, updatedRecordsFileName); - // FileManager.deleteFileFromDownloadsByMask(errorsFromCommittingFileName, errorsFromMatchingFileName); + FileManager.deleteFileFromDownloadsByMask(validAndInvalidInstanceHRIDsFileName, + `*${matchedRecordsFileName}`, + previewOfProposedChangesFileName, + updatedRecordsFileName, + errorsFromCommittingFileName, + errorsFromMatchingFileName, + otherErrors); }); it('C375298 Verify generated Logs files for Holdings In app -- valid and invalid records (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { @@ -181,7 +185,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.uploadFile(validAndInvalidInstanceHRIDsFileName); BulkEditSearchPane.waitFileUploading(); BulkEditActions.downloadMatchedResults(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.clearTemporaryLocation('holdings', 0); BulkEditActions.addNewBulkEditFilterString(); @@ -193,7 +197,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.waitFileUploading(); BulkEditActions.openActions(); BulkEditActions.downloadChangedCSV(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditSearchPane.openLogsSearch(); BulkEditSearchPane.checkHoldingsCheckbox(); @@ -206,8 +210,8 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.downloadFileWithMatchingRecords(); BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileName}`, [instance.hrid, instance2.hrid], 'instanceHrid', true); - // BulkEditSearchPane.downloadFileWithErrorsEncountered(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidInstanceHRID], 'firstElement', false); + BulkEditSearchPane.downloadFileWithErrorsEncountered(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidInstanceHRID], 'firstElement', false); BulkEditSearchPane.downloadFileWithProposedChanges(); BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName, ['', ''], 'temporaryLocation', true); @@ -217,8 +221,8 @@ describe('Bulk Edit - Logs', () => { BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, ['', ''], 'temporaryLocation', true); BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, [instance.defaultLocation.name], 'permanentLocation', true); - // BulkEditSearchPane.downloadFileWithCommitErrors(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [instance.hrid], 'firstElement', false); + BulkEditSearchPane.downloadFileWithCommitErrors(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [instance.hrid], 'firstElement', false); // Go to inventory app and verify changes cy.visit(TopMenu.inventoryPath); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js index fa0fea8f8f..6b018e9969 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-holdings.cy.js @@ -12,7 +12,8 @@ import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-a let user; const invalidHoldingHRID = getRandomPostfix(); const invalidHoldingHRIDsFileName = `invalidHoldingHRIDs_${getRandomPostfix()}.csv`; -const errorsFromMatchingFileName = `*Errors-${invalidHoldingHRIDsFileName}`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${invalidHoldingHRIDsFileName}*`; +const otherError = `*-Errors-${invalidHoldingHRIDsFileName}`; describe('Bulk Edit - Logs', () => { before('create test data', () => { @@ -35,7 +36,7 @@ describe('Bulk Edit - Logs', () => { after('delete test data', () => { FileManager.deleteFile(`cypress/fixtures/${invalidHoldingHRIDsFileName}`); Users.deleteViaApi(user.userId); - FileManager.deleteFileFromDownloadsByMask(invalidHoldingHRIDsFileName, errorsFromMatchingFileName); + FileManager.deleteFileFromDownloadsByMask(invalidHoldingHRIDsFileName, errorsFromMatchingFileName, otherError); }); it('C375299 Verify generated Logs files for Holdings In app -- only invalid records (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-barcodes.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-barcodes.cy.js index 28f1abc2af..12fbeb769a 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-barcodes.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-barcodes.cy.js @@ -11,7 +11,8 @@ import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-fil let user; const itemBarcodesFileName = `invalidItemBarcodes_${getRandomPostfix()}.csv`; -const errorsFromMatchingFileName = `*Errors-${itemBarcodesFileName}*`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${itemBarcodesFileName}*`; +const otherError = `*-Errors-${itemBarcodesFileName}`; const invalidItemBrcode = getRandomPostfix(); @@ -37,7 +38,7 @@ describe('Bulk Edit - Logs', () => { after('delete test data', () => { Users.deleteViaApi(user.userId); FileManager.deleteFile(`cypress/fixtures/${itemBarcodesFileName}`); - FileManager.deleteFileFromDownloadsByMask(errorsFromMatchingFileName, itemBarcodesFileName); + FileManager.deleteFileFromDownloadsByMask(errorsFromMatchingFileName, itemBarcodesFileName, otherError); }); it('C375284 Verify generated Logs files for Items In app -- only invalid records (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-hrids.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-hrids.cy.js index a80757dbe7..4b81256852 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-hrids.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-items-hrids.cy.js @@ -17,15 +17,14 @@ import ItemRecordView from '../../../../support/fragments/inventory/item/itemRec import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; import { ITEM_STATUS_NAMES } from '../../../../support/constants'; -// TODO: Update test after MODBULKOPS-123 is done - let user; const itemHRIDsFileName = `validItemHRIDs_${getRandomPostfix()}.csv`; const matchedRecordsFileNameInvalidAndValid = `Matched-Records-${itemHRIDsFileName}`; -// const errorsFromMatchingFileName = `*Errors-${itemHRIDsFileName}`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${itemHRIDsFileName}`; const previewOfProposedChangesFileName = `*-Updates-Preview-${itemHRIDsFileName}`; const updatedRecordsFileName = `*-Changed-Records*-${itemHRIDsFileName}`; -// const errorsFromCommittingFileName = `*Errors-*-${matchedRecordsFileNameInvalidAndValid}`; +const errorsFromCommittingFileName = `*-Committing-changes-Errors-${itemHRIDsFileName}`; +const otherError = `*-Errors-${itemHRIDsFileName}`; const invalidItemHRID = getRandomPostfix(); const instance = { @@ -125,8 +124,15 @@ describe('Bulk Edit - Logs', () => { InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item1.barcode); Users.deleteViaApi(user.userId); FileManager.deleteFile(`cypress/fixtures/${itemHRIDsFileName}`); - FileManager.deleteFileFromDownloadsByMask(itemHRIDsFileName, `*${matchedRecordsFileNameInvalidAndValid}`, previewOfProposedChangesFileName, updatedRecordsFileName); - // FileManager.deleteFileFromDownloadsByMask(errorsFromCommittingFileName, errorsFromMatchingFileName); + FileManager.deleteFileFromDownloadsByMask( + itemHRIDsFileName, + `*${matchedRecordsFileNameInvalidAndValid}`, + previewOfProposedChangesFileName, + updatedRecordsFileName, + errorsFromCommittingFileName, + errorsFromMatchingFileName, + otherError + ); }); it('C375281 Verify generated Logs files for Items In app -- valid and invalid records (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { @@ -136,7 +142,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.uploadFile(itemHRIDsFileName); BulkEditSearchPane.waitFileUploading(); BulkEditActions.downloadMatchedResults(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.clearPermanentLocation('item', 0); @@ -150,7 +156,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.waitFileUploading(); BulkEditActions.openActions(); BulkEditActions.downloadChangedCSV(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditSearchPane.openLogsSearch(); BulkEditSearchPane.checkItemsCheckbox(); @@ -163,8 +169,8 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.downloadFileWithMatchingRecords(); BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileNameInvalidAndValid}`, [item1.hrid, item2.hrid], 'hrid', true); - // BulkEditSearchPane.downloadFileWithErrorsEncountered(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidItemHRID], 'firstElement', false); + BulkEditSearchPane.downloadFileWithErrorsEncountered(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidItemHRID], 'firstElement', false); BulkEditSearchPane.downloadFileWithProposedChanges(); BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName, [item1.id, item2.id], 'firstElement', true); @@ -172,8 +178,8 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.downloadFileWithUpdatedRecords(); BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, [item1.id, item2.id], 'firstElement', true); - // BulkEditSearchPane.downloadFileWithCommitErrors(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [item2.hrid], 'firstElement', false); + BulkEditSearchPane.downloadFileWithCommitErrors(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [item2.hrid], 'firstElement', false); cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.switchToItem(); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-usernames.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-usernames.cy.js index 11d7ba16a7..e5850789db 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-usernames.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-usernames.cy.js @@ -12,7 +12,8 @@ import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-fil let user; const invalidUsername = `invalidUsername_${getRandomPostfix()}`; const invalidUsernamesFilename = `invalidUsername_${getRandomPostfix()}.csv`; -const errorsFromMatchingFileName = `*Errors-${invalidUsernamesFilename}`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${invalidUsernamesFilename}*`; +const otherError = `*-Errors-${invalidUsernamesFilename}`; describe('Bulk Edit - Logs', () => { before('create test data', () => { @@ -34,7 +35,7 @@ describe('Bulk Edit - Logs', () => { after('delete test data', () => { FileManager.deleteFile(`cypress/fixtures/${invalidUsernamesFilename}`); Users.deleteViaApi(user.userId); - FileManager.deleteFileFromDownloadsByMask(invalidUsernamesFilename, errorsFromMatchingFileName); + FileManager.deleteFileFromDownloadsByMask(invalidUsernamesFilename, errorsFromMatchingFileName, otherError); }); it('C375246 Verify generated Logs files for Users In app -- only invalid records (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js index 29264d79d2..2d7afc6c2c 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-users-uuids.cy.js @@ -10,17 +10,16 @@ import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-a import UsersSearchPane from '../../../../support/fragments/users/usersSearchPane'; import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files'; -// TODO: Update test after MODBULKOPS-123 is done - let user; let userWithoutPermissions; const invalidUserUUID = `invalidUserUUID_${getRandomPostfix()}`; const invalidAndValidUserUUIDsFileName = `invalidAndValidUserUUIDS_${getRandomPostfix()}.csv`; const matchedRecordsFileNameInvalidAndValid = `Matched-Records-${invalidAndValidUserUUIDsFileName}`; -// const errorsFromMatchingFileName = `*Errors-${invalidAndValidUserUUIDsFileName}`; +const errorsFromMatchingFileName = `*-Matching-Records-Errors-${invalidAndValidUserUUIDsFileName}`; const previewOfProposedChangesFileName = `*-Updates-Preview-${invalidAndValidUserUUIDsFileName}`; const updatedRecordsFileName = `*-Changed-Records*-${invalidAndValidUserUUIDsFileName}`; -// const errorsFromCommittingFileName = `*Errors-*-${matchedRecordsFileNameInvalidAndValid}`; +const errorsFromCommittingFileName = `*-Committing-changes-Errors-${invalidAndValidUserUUIDsFileName}`; +const otherError = `*-Errors-${invalidAndValidUserUUIDsFileName}`; describe('Bulk Edit - Logs', () => { before('create test data', () => { @@ -46,8 +45,13 @@ describe('Bulk Edit - Logs', () => { after('delete test data', () => { FileManager.deleteFile(`cypress/fixtures/${invalidAndValidUserUUIDsFileName}`); Users.deleteViaApi(user.userId); - FileManager.deleteFileFromDownloadsByMask(invalidAndValidUserUUIDsFileName, `*${matchedRecordsFileNameInvalidAndValid}`, previewOfProposedChangesFileName, updatedRecordsFileName); - // FileManager.deleteFileFromDownloadsByMask(errorsFromCommittingFileName, errorsFromMatchingFileName); + FileManager.deleteFileFromDownloadsByMask(invalidAndValidUserUUIDsFileName, + `*${matchedRecordsFileNameInvalidAndValid}`, + previewOfProposedChangesFileName, + updatedRecordsFileName, + errorsFromCommittingFileName, + errorsFromMatchingFileName, + otherError); }); it('C375245 Verify genetated Logs files for Users In app -- valid and invalid records (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { @@ -56,7 +60,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.waitFileUploading(); BulkEditActions.downloadMatchedResults(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.verifyBulkEditForm(); @@ -68,7 +72,7 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.waitFileUploading(); BulkEditActions.openActions(); BulkEditActions.downloadChangedCSV(); - // BulkEditActions.downloadErrors(); + BulkEditActions.downloadErrors(); BulkEditSearchPane.openLogsSearch(); BulkEditSearchPane.verifyLogsPane(); @@ -82,8 +86,8 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.downloadFileWithMatchingRecords(); BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileNameInvalidAndValid}`, [user.userId, userWithoutPermissions.userId], 'userId', true); - // BulkEditSearchPane.downloadFileWithErrorsEncountered(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidUserUUID], 'firstElement', false); + BulkEditSearchPane.downloadFileWithErrorsEncountered(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromMatchingFileName, [invalidUserUUID], 'firstElement', false); BulkEditSearchPane.downloadFileWithProposedChanges(); BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName, ['staff', 'staff'], 'patronGroup', true); @@ -91,8 +95,8 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.downloadFileWithUpdatedRecords(); BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, ['staff'], 'patronGroup', true); - // BulkEditSearchPane.downloadFileWithCommitErrors(); - // BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [user.userId], 'firstElement', false); + BulkEditSearchPane.downloadFileWithCommitErrors(); + BulkEditFiles.verifyMatchedResultFileContent(errorsFromCommittingFileName, [user.userId], 'firstElement', false); cy.visit(TopMenu.usersPath); UsersSearchPane.searchByUsername(user.username); diff --git a/cypress/e2e/circulation-log/filter-declared-lost.cy.js b/cypress/e2e/circulation-log/filter-declared-lost.cy.js index b5b94c44b6..1a5130fc19 100644 --- a/cypress/e2e/circulation-log/filter-declared-lost.cy.js +++ b/cypress/e2e/circulation-log/filter-declared-lost.cy.js @@ -12,7 +12,6 @@ import Checkout from '../../support/fragments/checkout/checkout'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import UserLoans from '../../support/fragments/users/loans/userLoans'; import UsersOwners from '../../support/fragments/settings/users/usersOwners'; -import PaymentMethods from '../../support/fragments/settings/users/paymentMethods'; import Location from '../../support/fragments/settings/tenant/locations/newLocation'; import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; @@ -58,9 +57,6 @@ describe('circulation-log', () => { UsersOwners.createViaApi(ownerBody).then((ownerResponse) => { testData.ownerId = ownerResponse.id; - PaymentMethods.createViaApi(testData.ownerId).then((paymentMethod) => { - testData.paymentMethodId = paymentMethod.id; - }); }); UserLoans.getUserLoansIdViaApi(user.userId).then((userLoans) => { UserLoans.declareLoanLostViaApi({ @@ -79,7 +75,6 @@ describe('circulation-log', () => { checkInDate: new Date().toISOString(), }); InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); - PaymentMethods.deleteViaApi(testData.paymentMethodId); Users.deleteViaApi(user.userId); UsersOwners.deleteViaApi(testData.ownerId); }); diff --git a/cypress/e2e/circulation-log/filter-renewed-through-override.cy.js b/cypress/e2e/circulation-log/filter-renewed-through-override.cy.js index d00b30a162..8983d99c2d 100644 --- a/cypress/e2e/circulation-log/filter-renewed-through-override.cy.js +++ b/cypress/e2e/circulation-log/filter-renewed-through-override.cy.js @@ -12,33 +12,51 @@ import Checkout from '../../support/fragments/checkout/checkout'; import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; import getRandomPostfix from '../../support/utils/stringTools'; import UserLoans from '../../support/fragments/users/loans/userLoans'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; +import UsersOwners from '../../support/fragments/settings/users/usersOwners'; let user; const item = { - instanceTitle: `Instance ${getRandomPostfix()}`, - barcode: `item-${getRandomPostfix()}` + instanceName: `instance-name-${getRandomPostfix()}`, + barcode: `barcode-${getRandomPostfix()}`, }; const testData = { - userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotest receive notice check in', uuid()), + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotest lost items', uuid()), +}; +const ownerBody = { + owner: 'AutotestOwner' + getRandomPostfix(), + servicePointOwner: [{ + value: testData.userServicePoint.id, + label: testData.userServicePoint.name, + }], }; describe('circulation-log', () => { before('create test data', () => { cy.createTempUser([]).then(userProperties => { user = userProperties; - ServicePoints.createViaApi(testData.userServicePoint); - UserEdit.addServicePointViaApi(testData.userServicePoint.id, user.userId, testData.userServicePoint.id); + testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); + Location.createViaApi(testData.defaultLocation); + UserEdit.addServicePointViaApi(testData.userServicePoint.id, user.userId); + + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); + cy.getHoldings({ limit: 1, query: `"instanceId"="${item.instanceId}"` }) + .then((holdings) => { + cy.updateHoldingRecord(holdings[0].id, { + ...holdings[0], + permanentLocationId: testData.defaultLocation.id + }); + }); - InventoryInstances.createInstanceViaApi(item.instanceTitle, item.barcode); Checkout.checkoutItemViaApi({ - id: uuid(), itemBarcode: item.barcode, - loanDate: moment.utc().format(), - servicePointId: testData.userServicePoint.id, userBarcode: user.barcode, + servicePointId: testData.userServicePoint.id, }); + UsersOwners.createViaApi(ownerBody); + const renewBody = { id: uuid(), itemBarcode: item.barcode, From 6cdb63a6598e6142f157e7efbcdb2031086502fe Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Fri, 8 Sep 2023 18:24:30 +0500 Subject: [PATCH 118/437] FAT-7813/C387439 (#1563) * added C387439 * fixed bug --- ...etadata-info-patron-notice-templates.cy.js | 67 +++++++++++++++++++ .../circulation/notice-policy-template.js | 62 +++++++++++------ 2 files changed, 107 insertions(+), 22 deletions(-) create mode 100644 cypress/e2e/settings/circulation/patron-notices/metadata-info-patron-notice-templates.cy.js diff --git a/cypress/e2e/settings/circulation/patron-notices/metadata-info-patron-notice-templates.cy.js b/cypress/e2e/settings/circulation/patron-notices/metadata-info-patron-notice-templates.cy.js new file mode 100644 index 0000000000..40c0d381e0 --- /dev/null +++ b/cypress/e2e/settings/circulation/patron-notices/metadata-info-patron-notice-templates.cy.js @@ -0,0 +1,67 @@ +import devTeams from '../../../../support/dictionary/devTeams'; +import permissions from '../../../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../../../support/utils/stringTools'; +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 NewNoticePolicyTemplate from '../../../../support/fragments/circulation/newNoticePolicyTemplate'; +import SettingsMenu from '../../../../support/fragments/settingsMenu'; +import NoticePolicyTemplate from '../../../../support/fragments/circulation/notice-policy-template'; + +describe('Patron Notices', () => { + let userData; + let servicePointId; + const testData = {}; + const patronGroup = { + name: getTestEntityValue('groupUserChange'), + }; + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }).then((servicePoints) => { + servicePointId = servicePoints[0].id; + }); + NoticePolicyTemplate.createViaApi().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(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password, { + path: SettingsMenu.circulationPatronNoticeTemplatesPath, + waiter: NewNoticePolicyTemplate.waitLoading, + }); + }); + }); + }); + + after('Deleting created entities', () => { + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + NoticePolicyTemplate.deleteViaApi(testData.noticeTemplateBody.id); + }); + + it( + 'C387439 Add metadata info to view of Patron Notice Templates scenario 1,4,5 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + NewNoticePolicyTemplate.openToSide({ name: testData.noticeTemplateBody.name }); + NewNoticePolicyTemplate.checkAfterSaving({ + name: testData.noticeTemplateBody.name, + description: testData.noticeTemplateBody.description, + category: testData.noticeTemplateBody.category, + }); + cy.wait(2000); + NoticePolicyTemplate.collapseAll(); + NoticePolicyTemplate.expandAll(); + }, + ); +}); diff --git a/cypress/support/fragments/circulation/notice-policy-template.js b/cypress/support/fragments/circulation/notice-policy-template.js index fd71150c5b..c8e874a67b 100644 --- a/cypress/support/fragments/circulation/notice-policy-template.js +++ b/cypress/support/fragments/circulation/notice-policy-template.js @@ -1,11 +1,10 @@ import uuid from 'uuid'; import getRandomPostfix from '../../utils/stringTools'; -import { Button, Modal, including } from '../../../../interactors'; - +import { Button, Modal, Accordion, including } from '../../../../interactors'; const defaultNoticeTemplateBody = { active: true, - category: "Loan", + category: 'Loan', description: 'Notice_policy_template_description', id: uuid(), localizedTemplates: { @@ -30,30 +29,49 @@ export default { cy.do(Button('Close').click()); }, createViaApi(body = defaultNoticeTemplateBody) { - return cy.okapiRequest({ - method: 'POST', - path: 'templates', - body, - searchParams: { - query: '(cq l.allRecords=1) and category=""', - limit: 1000, - } }).then(({ res }) => { - return res; - }); + return cy + .okapiRequest({ + method: 'POST', + path: 'templates', + body, + searchParams: { + query: '(cq l.allRecords=1) and category=""', + limit: 1000, + }, + }) + .then(({ res }) => { + return res; + }); }, getViaApi(query) { - return cy.okapiRequest({ - path: 'templates', - searchParams: query - }).then((res) => { - return res.body.templates[0].id; - }); + return cy + .okapiRequest({ + path: 'templates', + searchParams: query, + }) + .then((res) => { + return res.body.templates[0].id; + }); }, deleteViaApi(templateId) { - return cy.okapiRequest({ method: 'DELETE', + return cy.okapiRequest({ + method: 'DELETE', path: `templates/${templateId}`, searchParams: { - query: '(cql.allRecords=1) and category=""' - } }); + query: '(cql.allRecords=1) and category=""', + }, + }); + }, + collapseAll() { + cy.do(Button('Collapse all').click()); + cy.wrap(['General information', 'Email']).each((accordion) => { + cy.expect(Button(accordion).has({ ariaExpanded: 'false' })); + }); + }, + expandAll() { + cy.do(Button('Expand all').click()); + cy.wrap(['General information', 'Email']).each((accordion) => { + cy.expect(Button(accordion).has({ ariaExpanded: 'true' })); + }); }, }; From 45ca4123f485f17ee15fdb44dec1271b86db768a Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Fri, 8 Sep 2023 18:28:14 +0500 Subject: [PATCH 119/437] added C387437 (#1564) --- ...ata-information-staff-slips-scenario.cy.js | 54 ++++++++++++++++ .../fragments/circulation/editStaffClips.js | 63 +++++++++++-------- 2 files changed, 92 insertions(+), 25 deletions(-) create mode 100644 cypress/e2e/staff-slips/metadata-information-staff-slips-scenario.cy.js diff --git a/cypress/e2e/staff-slips/metadata-information-staff-slips-scenario.cy.js b/cypress/e2e/staff-slips/metadata-information-staff-slips-scenario.cy.js new file mode 100644 index 0000000000..12945ae2b9 --- /dev/null +++ b/cypress/e2e/staff-slips/metadata-information-staff-slips-scenario.cy.js @@ -0,0 +1,54 @@ +import devTeams from '../../support/dictionary/devTeams'; +import permissions from '../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../support/utils/stringTools'; +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 SettingsMenu from '../../support/fragments/settingsMenu'; +import EditStaffClips from '../../support/fragments/circulation/editStaffClips'; + +describe('Staff slips', () => { + let userData; + let servicePointId; + const patronGroup = { + name: getTestEntityValue('groupUserChange'), + }; + + 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.uiCirculationCreateEditRemoveStaffSlips.gui], + patronGroup.name, + ).then((userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password); + }); + }); + }); + + after('Deleting created entities', () => { + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + }); + + it( + 'C387437 Add metadata information to view of Staff Slips scenario 1,4,5 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.circulationStaffSlipsPath); + EditStaffClips.chooseStaffClip('Hold'); + EditStaffClips.openLastUpdateInfo(); + EditStaffClips.collapseAll(); + EditStaffClips.expandAll(); + }, + ); +}); diff --git a/cypress/support/fragments/circulation/editStaffClips.js b/cypress/support/fragments/circulation/editStaffClips.js index 4cabc4b762..8ef2fa16ad 100644 --- a/cypress/support/fragments/circulation/editStaffClips.js +++ b/cypress/support/fragments/circulation/editStaffClips.js @@ -1,5 +1,13 @@ import { including } from 'bigtest'; -import { Button, TextArea, NavListItem, Checkbox, Modal, RichEditor, Pane } from '../../../../interactors'; +import { + Button, + TextArea, + NavListItem, + Checkbox, + Modal, + RichEditor, + Pane, +} from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; const editButton = Button({ id: 'clickable-edit-item' }); @@ -9,32 +17,26 @@ const saveButton = Button('Save & close'); const staffClipsEditor = RichEditor(); export default { - defaultUiEditStaffClips : { + defaultUiEditStaffClips: { description: 'Created by autotest team', }, + chooseStaffClip(name) { + cy.do(NavListItem(name).click()); + }, + openLastUpdateInfo() { + cy.do(Button(including('Record last updated')).click()); + }, editHold() { - cy.do([ - NavListItem('Hold').click(), - editButton.click(), - ]); + cy.do([NavListItem('Hold').click(), editButton.click()]); }, editPickslip() { - cy.do([ - NavListItem('Pick slip').click(), - editButton.click(), - ]); + cy.do([NavListItem('Pick slip').click(), editButton.click()]); }, editRequestDelivery() { - cy.do([ - NavListItem('Request delivery').click(), - editButton.click(), - ]); + cy.do([NavListItem('Request delivery').click(), editButton.click()]); }, editTransit() { - cy.do([ - NavListItem('Transit').click(), - editButton.click(), - ]); + cy.do([NavListItem('Transit').click(), editButton.click()]); }, addToken: (tokens) => { cy.do(Button({ className: 'ql-token' }).click()); @@ -50,21 +52,18 @@ export default { Checkbox('item.title').click(), Checkbox('item.copy').click(), Button('Add token').click(), - saveButton.click() + saveButton.click(), ]); }, previewStaffClips: () => { - cy.do([ - Button('Preview').click(), - Button('Close').click(), - ]); + cy.do([Button('Preview').click(), Button('Close').click()]); cy.expect(Modal({ id: 'preview-modal' }).exists(textCheck)); }, checkPreview: (staffSlipType, displayText) => { cy.do(Button('Preview').click()); cy.expect([ Modal(`Preview of staff slip - ${staffSlipType}`).exists(), - Modal({ content: including(displayText) }).exists() + Modal({ content: including(displayText) }).exists(), ]); cy.do(Button('Close').click()); }, @@ -81,7 +80,9 @@ export default { cy.do(saveButton.click()); }, checkAfterUpdate(staffSlipType) { - InteractorsTools.checkCalloutMessage(`The Staff slip ${staffSlipType} was successfully updated.`); + InteractorsTools.checkCalloutMessage( + `The Staff slip ${staffSlipType} was successfully updated.`, + ); cy.expect(Pane(staffSlipType).exists()); }, editAndClearHold() { @@ -103,4 +104,16 @@ export default { this.editTransit(); this.clearStaffClips(); }, + collapseAll() { + cy.do(Button('Collapse all').click()); + cy.wrap(['General information', 'Template content']).each((accordion) => { + cy.expect(Button(accordion).has({ ariaExpanded: 'false' })); + }); + }, + expandAll() { + cy.do(Button('Expand all').click()); + cy.wrap(['General information', 'Template content']).each((accordion) => { + cy.expect(Button(accordion).has({ ariaExpanded: 'true' })); + }); + }, }; From 85f8af1fff028149aaa7cf9558ba2ca08e470ca8 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:23:28 +0300 Subject: [PATCH 120/437] Idea Labs: Implementing of FAT-7703 (#1556) * Idea Labs: Implementing of FAT-7703 * Idea Labs: Implementing of FAT-7703 --- .../encumbrances-are-rolled-over.cy.js | 162 ++++++++++++++++++ .../support/fragments/finance/funds/funds.js | 2 +- 2 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/finance/fiscalYears/fiscalYearRollover/encumbrances-are-rolled-over.cy.js diff --git a/cypress/e2e/finance/fiscalYears/fiscalYearRollover/encumbrances-are-rolled-over.cy.js b/cypress/e2e/finance/fiscalYears/fiscalYearRollover/encumbrances-are-rolled-over.cy.js new file mode 100644 index 0000000000..f86a37149e --- /dev/null +++ b/cypress/e2e/finance/fiscalYears/fiscalYearRollover/encumbrances-are-rolled-over.cy.js @@ -0,0 +1,162 @@ +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'; +import DateTools from '../../../../support/utils/dateTools'; +import NewOrder from '../../../../support/fragments/orders/newOrder'; +import Orders from '../../../../support/fragments/orders/orders'; +import OrderLines from '../../../../support/fragments/orders/orderLines'; +import Organizations from '../../../../support/fragments/organizations/organizations'; +import NewOrganization from '../../../../support/fragments/organizations/newOrganization'; +import NewInvoice from '../../../../support/fragments/invoices/newInvoice'; +import Invoices from '../../../../support/fragments/invoices/invoices'; +import ServicePoints from '../../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../../../support/fragments/settings/tenant/locations/newLocation'; + +describe('ui-finance: Fiscal Year Rollover', () => { + const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + const secondFiscalYear = { + name: `autotest_year_${getRandomPostfix()}`, + code: DateTools.getRandomFiscalYearCodeForRollover(2000, 9999), + periodStart: `${DateTools.getCurrentDateForFiscalYear()}T00:00:00.000+00:00`, + periodEnd: `${DateTools.getDayAfterTomorrowDateForFiscalYear()}T00:00:00.000+00:00`, + description: `This is fiscal year created by E2E test automation script_${getRandomPostfix()}`, + series: 'FY', + }; + 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'; + const todayDate = DateTools.getCurrentDate(); + const fileNameDate = DateTools.getCurrentDateForFileNaming(); + let user; + let firstOrderNumber; + let servicePointId; + let location; + + 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; + 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; + }); + }); + // Create second Fiscal Year for Rollover + FiscalYears.createViaApi(secondFiscalYear) + .then(secondFiscalYearResponse => { + secondFiscalYear.id = secondFiscalYearResponse.id; + }); + + // Prepare 2 Open Orders for Rollover + 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('*', 25); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '40', '1', '40', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(firstOrder).then(secondOrderResponse => { + firstOrder.id = secondOrderResponse.id; + Orders.checkCreatedOrder(firstOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 35); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '10', '1', '10', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + }); + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLineFromPol(firstOrderNumber); + // Need to wait, while data will be loaded + cy.wait(4000); + Invoices.approveInvoice(); + Invoices.payInvoice(); + }); + cy.createTempUser([ + permissions.uiFinanceExecuteFiscalYearRollover.gui, + permissions.uiFinanceViewFiscalYear.gui, + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiFinanceViewLedger.gui, + permissions.uiOrdersView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.ledgerPath, waiter: Ledgers.waitForLedgerDetailsLoading }); + }); + }); + + after(() => { + Users.deleteViaApi(user.userId); + }); + + it('C375267 Encumbrances are rolled over correctly when order fund distribution was changed and related paid invoice exists (based on Remaining) (thunderjet)', { tags: [testType.extendedPath, devTeams.thunderjet] }, () => { + FinanceHelp.searchByName(defaultLedger.name); + Ledgers.selectLedger(defaultLedger.name); + Ledgers.rollover(); + Ledgers.fillInTestRolloverInfoCashBalance(secondFiscalYear.code, 'Cash balance', 'Allocation'); + Ledgers.rolloverLogs(); + Ledgers.exportRollover(todayDate); + Ledgers.checkDownloadedFile(`${fileNameDate}-result.csv`, defaultFund, secondFiscalYear, '100', '100', '160', '160', '160', '160', '160'); + Ledgers.deleteDownloadedFile(`${fileNameDate}-result.csv`); + Ledgers.closeOpenedPage(); + Ledgers.rollover(); + Ledgers.fillInRolloverForCashBalance(secondFiscalYear.code, 'Cash balance', 'Allocation'); + Ledgers.closeRolloverInfo(); + Ledgers.selectFundInLedger(defaultFund.name); + Funds.selectPlannedBudgetDetails(); + Funds.checkFundingInformation('$160.00', '$0.00', '$0.00', '$160.00', '$0.00', '$160.00'); + Funds.checkFinancialActivityAndOverages('$0.00', '$0.00', '$0.00', '$0.00'); + }); +}); diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index db27ab2da2..e8d23a5005 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -331,7 +331,7 @@ export default { cy.do(addTransferModal.find(confirmButton).click()); }, - transfer: (toFund, fromFund) => { + transfer(toFund, fromFund) { cy.do([actionsButton.click(), transferButton.click()]); this.fillAllocationFields({ toFund, fromFund, amount: '10' }); }, From 1f0766c769dcc9022292eea5ebd9a25ce389c347 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Fri, 8 Sep 2023 19:27:50 +0300 Subject: [PATCH 121/437] Idea Labs: Implementing of FAT-7702 (#1565) * Idea Labs: Implementing of FAT-7702 * Idea Labs: Implementing of FAT-7702 * Idea Labs: Implementing of FAT-7702 * Idea Labs: Implementing of FAT-7702 --- .../downloading-the-exact-edi-file.cy.js | 158 ++++++++++++++++++ .../B_exportManager.cy.js | 55 ------ .../available-balance-is-displayed.cy.js | 93 ----------- ...cumbrances-are-rolled-over-correctly.cy.js | 115 ------------- ...-for-one-ledger-and-same-fiscal year.cy.js | 62 ------- 5 files changed, 158 insertions(+), 325 deletions(-) create mode 100644 cypress/e2e/export-manager/orders-export-to-a-vendor/downloading-the-exact-edi-file.cy.js delete mode 100644 cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js delete mode 100644 cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js delete mode 100644 cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js delete mode 100644 cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js diff --git a/cypress/e2e/export-manager/orders-export-to-a-vendor/downloading-the-exact-edi-file.cy.js b/cypress/e2e/export-manager/orders-export-to-a-vendor/downloading-the-exact-edi-file.cy.js new file mode 100644 index 0000000000..a10be4b61d --- /dev/null +++ b/cypress/e2e/export-manager/orders-export-to-a-vendor/downloading-the-exact-edi-file.cy.js @@ -0,0 +1,158 @@ +import permissions from '../../../support/dictionary/permissions'; +import devTeams from '../../../support/dictionary/devTeams'; +import TopMenu from '../../../support/fragments/topMenu'; +import Orders from '../../../support/fragments/orders/orders'; +import TestTypes from '../../../support/dictionary/testTypes'; +import Users from '../../../support/fragments/users/users'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import ExportManagerSearchPane from '../../../support/fragments/exportManager/exportManagerSearchPane'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../../support/fragments/settings/tenant/locations/newLocation'; +import DateTools from '../../../support/utils/dateTools'; + +describe('Export Orders in EDIFACT format: Orders Export to a Vendor', () => { + const order = { ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout2', + notes: '', + paymentMethod: 'Cash', + }, + ] + }; + const integrationName1 = `FirstIntegrationName${getRandomPostfix()}`; + const integrationName2 = `SecondIntegrationName${getRandomPostfix()}`; + const integartionDescription1 = 'Test Integation descripton1'; + const integartionDescription2 = 'Test Integation descripton2'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + const vendorEDICodeFor2Integration = getRandomPostfix(); + const libraryEDICodeFor2Integration = getRandomPostfix(); + let user; + let location; + let servicePointId; + let orderNumber; + const UTCTime = DateTools.getUTCDateForScheduling(); + + before(() => { + cy.getAdminToken(); + + ServicePoints.getViaApi() + .then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) + .then(res => { + location = res; + }); + }); + Organizations.createOrganizationViaApi(organization) + .then(organizationsResponse => { + organization.id = organizationsResponse; + order.vendor = organizationsResponse; + }); + cy.loginAsAdmin({ path:TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformation(integrationName1, integartionDescription1, vendorEDICodeFor1Integration, libraryEDICodeFor1Integration, organization.accounts[0].accountNo, 'Purchase', UTCTime); + Organizations.addIntegration(); + cy.wait(2000); + Organizations.fillIntegrationInformation(integrationName2, integartionDescription2, vendorEDICodeFor2Integration, libraryEDICodeFor2Integration, organization.accounts[1].accountNo, 'Purchase At Vendor System', UTCTime); + + cy.createOrderApi(order) + .then((response) => { + orderNumber = response.body.poNumber; + // Need to wait while first job will be runing + cy.wait(70000); + cy.visit(TopMenu.ordersPath); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 5); + OrderLines.fillInPOLineInfoForExportWithLocation(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.exportManagerOrganizationsPath); + ExportManagerSearchPane.selectOrganizationsSearch(); + ExportManagerSearchPane.selectExportMethod(integrationName1); + ExportManagerSearchPane.selectJobByIntegrationInList(integrationName1); + ExportManagerSearchPane.rerunJob(); + cy.reload(); + ExportManagerSearchPane.verifyResult('Successful'); + }); + + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrganizationsViewEditCreate.gui, + permissions.uiOrganizationsView.gui, + permissions.uiExportOrders.gui, + permissions.exportManagerAll.gui, + permissions.exportManagerDownloadAndResendFiles.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { path:TopMenu.exportManagerOrganizationsPath, waiter: ExportManagerSearchPane.waitLoading }); + }); + }); + + after(() => { + cy.loginAsAdmin({ path:TopMenu.ordersPath, waiter: Orders.waitLoading }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + Orders.unOpenOrder(orderNumber); + // Need to wait until the order is opened before deleting it + cy.wait(2000); + Orders.deleteOrderViaApi(order.id); + + Organizations.deleteOrganizationViaApi(organization.id); + NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + location.institutionId, + location.campusId, + location.libraryId, + location.id + ); + Users.deleteViaApi(user.userId); + }); + + it('C365123: Downloading the exact ".edi" file that was exported for a given export job with "Successful" status (thunderjet)', { tags: [TestTypes.smoke, devTeams.thunderjet] }, () => { + cy.visit(TopMenu.exportManagerOrganizationsPath); + ExportManagerSearchPane.selectOrganizationsSearch(); + ExportManagerSearchPane.selectExportMethod(integrationName1); + ExportManagerSearchPane.verifyResult('Successful'); + ExportManagerSearchPane.selectJob('Successful'); + ExportManagerSearchPane.downloadJob(); + ExportManagerSearchPane.resetAll(); + }); +}); 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 deleted file mode 100644 index ed58cb34ae..0000000000 --- a/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js +++ /dev/null @@ -1,55 +0,0 @@ -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.skip('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 deleted file mode 100644 index 4e4aee55fb..0000000000 --- a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js +++ /dev/null @@ -1,93 +0,0 @@ -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.skip('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 deleted file mode 100644 index 1fd14d6a9a..0000000000 --- a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js +++ /dev/null @@ -1,115 +0,0 @@ -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.skip('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(testData.searchByName); - financeHelper.selectFirstLedger(rollOverData.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 deleted file mode 100644 index 3675a18ff6..0000000000 --- a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js +++ /dev/null @@ -1,62 +0,0 @@ -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.skip('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 - ); - }); -}); From 55001f5f0ad31cd01e7dcbad0de5cdca31ec9be7 Mon Sep 17 00:00:00 2001 From: nhanaa Date: Fri, 8 Sep 2023 11:31:32 -0500 Subject: [PATCH 122/437] Select duplicate timezone and set length control for Cypress tests --- .../fragments/users/transferFeeFine.js | 62 +++++++++++++++---- 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 0de79fbeba..7942cbc5f4 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -6,6 +6,7 @@ import { Select, Pane, MultiSelect, + Checkbox } from '../../../../interactors'; const rootModal = Modal({ id: 'transfer-modal' }); @@ -86,6 +87,17 @@ export default { ]); }, + setLengthControl(item, length, character, truncate, direction) { + cy.get(`select[name="${item}.type"]`).parents('div.header---ynqPZ').find('button[icon="gear"]').click(); + cy.expect(TextField({ name: `${item}.lengthControl.length` }).exists()); + cy.do(TextField({ name: `${item}.lengthControl.length` }).fillIn(length)); + cy.do(TextField({ name: `${item}.lengthControl.character` }).fillIn(character)); + if (truncate) { + cy.do(Checkbox({ name: `${item}.lengthControl.truncate` }).click()); + } + cy.do(Select({ name: `${item}.lengthControl.direction` }).choose(direction)); + }, + openAllPanes() { if (!Button({ text: 'Collapse all' }).exists()) { cy.do([Button({ text: 'Expand all' }).click()]); @@ -185,6 +197,13 @@ export default { } }, + verifyLengthControl(item, length, character, truncate, direction) { + cy.expect(TextField({ name: `${item}.lengthControl.length`, value: length }).exists()); + cy.expect(TextField({ name: `${item}.lengthControl.character`, value: character }).exists()); + cy.expect(Checkbox({ name: `${item}.lengthControl.truncate`, checked: truncate }).exists()); + cy.expect(Select({ name: `${item}.lengthControl.direction`, value: direction }).exists()); + }, + // Cornell format Helper functions addCornellHeaderFormat() { @@ -223,8 +242,11 @@ export default { cy.do(Select({ name: 'data[4].type' }).choose('Account date')); cy.do(Select({ name: 'data[4].dateProperty' }).choose('Creation date')); cy.do(Select({ name: 'data[4].format' }).choose('Year (4-digit)')); - // There is two America/New_York in the list, so we need to find out the second one - // cy.do(Select({ name: 'data[4].timezone' }).choose('America/New_York')); + cy.get('select[name="data[4].timezone"]').find('option[value="America/New_York"]').eq(1).then($option => { + const $select = $option.prevObject.prevObject; + cy.wrap($select).select($option.index()); + }); + cy.do(TextField({ name: 'data[4].placeholder' }).fillIn('')); cy.do(Select({ name: 'data[5].type' }).choose('Newline (LF)')); @@ -260,7 +282,7 @@ export default { cy.expect(Select({ name: 'data[4].type', value: 'FeeDate' }).exists()); cy.expect(Select({ name: 'data[4].dateProperty', value: 'CREATED' }).exists()); cy.expect(Select({ name: 'data[4].format', value: 'YEAR_LONG' }).exists()); - // cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); + cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); cy.expect(TextField({ name: 'data[4].placeholder', value: '' }).exists()); cy.expect(Select({ name: 'data[5].type', value: 'Newline' }).exists()); @@ -290,7 +312,10 @@ export default { cy.do(Select({ name: 'header[2].type' }).choose('Current date')); cy.do(Select({ name: 'header[2].format' }).choose('YYYYMMDD')); - // cy.do(Select({ name: 'header[2].timezone' }).choose('America/New_York')); + cy.get('select[name="header[2].timezone"]').find('option[value="America/New_York"]').eq(1).then($option => { + const $select = $option.prevObject.prevObject; + cy.wrap($select).select($option.index()); + }); cy.do(Select({ name: 'header[3].type' }).choose('Whitespace')); cy.do(TextField({ name: 'header[3].repeat' }).fillIn('1')); @@ -304,7 +329,10 @@ export default { cy.do(Select({ name: 'header[6].type' }).choose('Current date')); cy.do(Select({ name: 'header[6].format' }).choose('Quarter')); - // cy.do(Select({ name: 'header[6].timezone' }).choose('America/New_York')); + cy.get('select[name="header[6].timezone"]').find('option[value="America/New_York"]').eq(1).then($option => { + const $select = $option.prevObject.prevObject; + cy.wrap($select).select($option.index()); + }); cy.do(Select({ name: 'header[7].type' }).choose('Total amount')); cy.get('input[name="header[7].decimal"]').check(); @@ -329,7 +357,7 @@ export default { cy.expect(Select({ name: 'header[2].type', value: 'CurrentDate' }).exists()); cy.expect(Select({ name: 'header[2].format', value: 'YYYYMMDD' }).exists()); - // cy.expect(Select({ name: 'header[2].timezone', value: 'America/New_York' }).exists()); + cy.expect(Select({ name: 'header[2].timezone', value: 'America/New_York' }).exists()); cy.expect(Select({ name: 'header[3].type', value: 'Space' }).exists()); cy.expect(TextField({ name: 'header[3].repeat', value: '1' }).exists()); @@ -342,7 +370,7 @@ export default { cy.expect(Select({ name: 'header[6].type', value: 'CurrentDate' }).exists()); cy.expect(Select({ name: 'header[6].format', value: 'QUARTER' }).exists()); - // cy.expect(Select({ name: 'header[6].timezone', value: 'America/New_York' }).exists()); + cy.expect(Select({ name: 'header[6].timezone', value: 'America/New_York' }).exists()); cy.expect(Select({ name: 'header[7].type', value: 'AggregateTotal' }).exists()); cy.get('input[name="header[7].decimal"]').should('be.checked'); @@ -373,26 +401,32 @@ export default { cy.do(Select({ name: 'data[2].type' }).choose('User info')); cy.do(Select({ name: 'data[2].userAttribute' }).choose('Username')); - // click on gear icon within data[2] section + this.setLengthControl('data[2]', '30', ' ', true, 'End'); cy.do(Select({ name: 'data[3].type' }).choose('Tab')); cy.do(Select({ name: 'data[4].type' }).choose('Account date')); cy.do(Select({ name: 'data[4].dateProperty' }).choose('Item due date')); cy.do(Select({ name: 'data[4].format' }).choose('YYYYMMDD')); - // There is two America/New_York in the list, so we need to find out the second one - // cy.do(Select({ name: 'data[4].timezone' }).choose('America/New_York')); + cy.get('select[name="data[4].timezone"]').find('option[value="America/New_York"]').eq(1).then($option => { + const $select = $option.prevObject.prevObject; + cy.wrap($select).select($option.index()); + }); cy.do(Select({ name: 'data[5].type' }).choose('Tab')); cy.do(Select({ name: 'data[6].type' }).choose('Current date')); cy.do(Select({ name: 'data[6].format' }).choose('Quarter')); + cy.get('select[name="data[6].timezone"]').find('option[value="America/New_York"]').eq(1).then($option => { + const $select = $option.prevObject.prevObject; + cy.wrap($select).select($option.index()); + }); cy.do(Select({ name: 'data[7].type' }).choose('Tab')); cy.do(Select({ name: 'data[8].type' }).choose('Fee/fine type')); cy.do(Select({ name: 'data[8].feeFineAttribute' }).choose('Type name')); - // gear icon + this.setLengthControl('data[8]', '12', ' ', true, 'End'); cy.do(Select({ name: 'data[9].type' }).choose('Tab')); @@ -416,24 +450,26 @@ export default { cy.expect(Select({ name: 'data[2].type', value: 'UserData' }).exists()); cy.expect(Select({ name: 'data[2].userAttribute', value: 'USERNAME' }).exists()); + this.verifyLengthControl('data[2]', '30', ' ', true, 'BACK'); cy.expect(Select({ name: 'data[3].type', value: 'Tab' }).exists()); cy.expect(Select({ name: 'data[4].type', value: 'FeeDate' }).exists()); cy.expect(Select({ name: 'data[4].dateProperty', value: 'DUE' }).exists()); cy.expect(Select({ name: 'data[4].format', value: 'YYYYMMDD' }).exists()); - // cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); + cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); cy.expect(Select({ name: 'data[5].type', value: 'Tab' }).exists()); cy.expect(Select({ name: 'data[6].type', value: 'CurrentDate' }).exists()); cy.expect(Select({ name: 'data[6].format', value: 'QUARTER' }).exists()); - // cy.expect(Select({ name: 'data[6].timezone', value: 'America/New_York' }).exists()); + cy.expect(Select({ name: 'data[6].timezone', value: 'America/New_York' }).exists()); cy.expect(Select({ name: 'data[7].type', value: 'Tab' }).exists()); cy.expect(Select({ name: 'data[8].type', value: 'FeeFineMetadata' }).exists()); cy.expect(Select({ name: 'data[8].feeFineAttribute', value: 'FEE_FINE_TYPE_NAME' }).exists()); + this.verifyLengthControl('data[8]', '12', ' ', true, 'BACK'); cy.expect(Select({ name: 'data[9].type', value: 'Tab' }).exists()); From b0d858309e5d64fe7d611f7409fc69652750fdd0 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Mon, 11 Sep 2023 14:30:29 +0300 Subject: [PATCH 123/437] Master lint v2 (#1568) * Lint fix * run prettier and lint --- .eslintrc | 5 +- .github/workflows/build-npm-release.yml | 42 +- .github/workflows/build-npm.yml | 40 +- .travis.yml | 11 +- CHANGELOG.md | 207 +++-- README.md | 28 +- accessibility/axeHelpers.js | 40 +- cypress.config.js | 3 +- .../bulk-edit/bulk-edit-landing-page.cy.js | 94 +- .../csv/bulk-edit-csv-external-ids.cy.js | 62 +- .../csv/bulk-edit-csv-ids-uploading.cy.js | 56 +- .../csv/bulk-edit-csv-invalid-date.cy.js | 62 +- .../bulk-edit-csv-user-barcodes-preview.cy.js | 71 +- .../csv/bulk-edit-csv-user-barcodes.cy.js | 58 +- ...k-edit-csv-user-new-bulk-edit-button.cy.js | 120 ++- ...t-csv-user-records-confirmation-page.cy.js | 81 +- .../bulk-edit-csv-user-uuids-with-null.cy.js | 65 +- .../csv/bulk-edit-csv-usernames.cy.js | 61 +- .../csv/bulk-edit-csv-users-ids-error.cy.js | 45 +- ...ulk-edit-csv-users-ids-label-cleanup.cy.js | 64 +- .../csv/bulk-edit-csv-users-ids.cy.js | 88 +- .../bulk-edit-in-app-correct-user.cy.js | 131 +-- ...lk-edit-in-app-different-identifiers.cy.js | 96 +- .../in-app/bulk-edit-in-app-elements.cy.js | 211 +++-- .../in-app/bulk-edit-in-app-former-ids.cy.js | 64 +- ...t-in-app-holdings-effective-location.cy.js | 96 +- ...it-in-app-holdings-electronic-access.cy.js | 101 +- ...-edit-in-app-holdings-instance-hrids.cy.js | 92 +- ...bulk-edit-in-app-holdings-line-break.cy.js | 136 +-- .../bulk-edit-in-app-holdings-source.cy.js | 65 +- ...k-edit-in-app-holdings-special-chars.cy.js | 78 +- .../bulk-edit-in-app-holdings-user.cy.js | 131 +-- .../in-app/bulk-edit-in-app-holdings.cy.js | 270 +++--- .../bulk-edit-in-app-intellectual-item.cy.js | 64 +- ...k-edit-in-app-item-add-notes-actions.cy.js | 103 +- ...it-in-app-item-barcodes-less-than-10.cy.js | 62 +- .../bulk-edit-in-app-item-barcodes.cy.js | 301 +++--- ...-edit-in-app-item-effective-location.cy.js | 76 +- .../in-app/bulk-edit-in-app-item-hrids.cy.js | 56 +- .../bulk-edit-in-app-item-line-break.cy.js | 119 +-- ...-edit-in-app-item-staff-only-actions.cy.js | 125 +-- ...lk-edit-in-app-items-matched-records.cy.js | 57 +- ...bulk-edit-in-app-items-with-deleting.cy.js | 67 +- .../bulk-edit-in-app-items-with-nulls.cy.js | 82 +- .../in-app/bulk-edit-in-app-items.cy.js | 179 ++-- .../bulk-edit-in-app-location-filter.cy.js | 68 +- .../in-app/bulk-edit-in-app-navigation.cy.js | 61 +- .../bulk-edit-in-app-several-holdings.cy.js | 116 ++- ...dit-in-app-suppressed-holdings-false.cy.js | 108 ++- ...edit-in-app-suppressed-holdings-true.cy.js | 85 +- .../bulk-edit-in-app-suppressed-items.cy.js | 70 +- ...bulk-edit-in-app-user-barcodes-error.cy.js | 72 +- .../bulk-edit-in-app-user-barcodes.cy.js | 97 +- ...dit-in-app-user-custom-fields-recent.cy.js | 147 +-- ...-in-app-user-custom-fields-semicolon.cy.js | 92 +- .../bulk-edit-in-app-user-date-picker.cy.js | 71 +- ...ulk-edit-in-app-user-expiration-date.cy.js | 57 +- .../in-app/bulk-edit-in-app-user-forms.cy.js | 47 +- .../bulk-edit-in-app-user-line-break.cy.js | 98 +- .../bulk-edit-in-app-user-uuids-view.cy.js | 71 +- ...ulk-edit-in-app-user-uuids-with-null.cy.js | 81 +- .../in-app/bulk-edit-in-app-user-uuids.cy.js | 249 ++--- .../logs/bulk-edit-logs-table-view.cy.js | 41 +- .../bulk-edit-logs-csv-users-barcodes.cy.js | 137 ++- .../bulk-edit-logs-csv-users-usernames.cy.js | 62 +- .../csv/bulk-edit-logs-csv-users-valid.cy.js | 114 ++- ...-edit-logs-csv-users-view-permission.cy.js | 94 +- .../logs/csv/bulk-edit-logs-csv-users.cy.js | 121 ++- ...-logs-in-app-holdings-instance-hrids.cy.js | 356 ++++--- ...-logs-in-app-holdings-items-barcodes.cy.js | 333 ++++--- ...bulk-edit-logs-in-app-holdings-uuids.cy.js | 151 +-- .../bulk-edit-logs-in-app-holdings.cy.js | 62 +- ...bulk-edit-logs-in-app-items-barcodes.cy.js | 63 +- ...dit-logs-in-app-items-holdings-uuids.cy.js | 196 ++-- .../bulk-edit-logs-in-app-items-hrids.cy.js | 273 +++--- .../bulk-edit-logs-in-app-items-uuids.cy.js | 147 +-- ...-suppressed-holdings-false-items-not.cy.js | 193 ++-- ...p-suppressed-holdings-true-items-not.cy.js | 181 ++-- ...lk-edit-logs-in-app-suppressed-items.cy.js | 129 ++- ...bulk-edit-logs-in-app-users-barcodes.cy.js | 123 ++- ...-edit-logs-in-app-users-external-ids.cy.js | 114 ++- ...ulk-edit-logs-in-app-users-usernames.cy.js | 66 +- .../bulk-edit-logs-in-app-users-uuids.cy.js | 153 +-- .../bulk-edit-actions-button.cy.js | 29 +- .../bulk-edit-all-permissions.cy.js | 84 +- ...-edit-csv-export-manager-permissions.cy.js | 27 +- ...sv-in-app-export-manager-permissions.cy.js | 47 +- .../bulk-edit-csv-permissions.cy.js | 49 +- .../bulk-edit-csv-query-permissions.cy.js | 74 +- ...bulk-edit-export-manager-permissions.cy.js | 63 +- ...it-in-app-export-manager-permissions.cy.js | 32 +- .../bulk-edit-in-app-permissions.cy.js | 21 +- .../bulk-edit-in-app-query-permissions.cy.js | 82 +- ...n-app-query-tab-holdings-permissions.cy.js | 79 +- ...t-in-app-query-tab-items-permissions.cy.js | 79 +- .../bulk-edit-logs-permissions.cy.js | 24 +- ...k-edit-permission-for-all-approaches.cy.js | 60 +- ...it-try-to-upload-without-permissions.cy.js | 90 +- .../bulk-edit-user-permissions.cy.js | 47 +- .../bulk-edit-with-logs-permissions.cy.js | 36 +- .../bulk-edit-without-logs-permissions.cy.js | 29 +- .../bulk-edit-without-permissions.cy.js | 53 +- .../check-in-claimed-returned-items.cy.js | 36 +- .../check-in-item-with-open-request.cy.js | 66 +- cypress/e2e/checkin/checkin.basic.cy.js | 99 +- .../checkin/sessionId-while-check-in.cy.js | 213 +++-- cypress/e2e/checkout/checkout.basic.cy.js | 46 +- .../checkout/checkout.multipiece.items.cy.js | 168 ++-- .../filter-claimed-returned.cy.js | 108 ++- .../circulation-log/filter-closed-loan.cy.js | 51 +- .../filter-declared-lost.cy.js | 83 +- .../filter-marked-as-missing.cy.js | 63 +- .../circulation-log/filter-notice-send.cy.js | 154 +-- .../filter-renewed-through-override.cy.js | 82 +- ...-circulation-log-by-fee-fine-actions.cy.js | 62 +- ...g-circulation-log-by-request-actions.cy.js | 40 +- cypress/e2e/circulation-log/search.cy.js | 344 ++++--- cypress/e2e/circulation-log/show-log.cy.js | 13 +- ...select-filters-but-not-actions-menus.cy.js | 9 +- .../data-export/data-export-invalid-cql.cy.js | 55 +- .../data-export-marc-negative.cy.js | 14 +- ...ort-instance-records-invalid-profile.cy.js | 52 +- .../data-export/export-instance-records.cy.js | 53 +- .../data-export/instance-hrid-004-field.cy.js | 73 +- .../delete-all-logs-from-landing-page.cy.js | 28 +- ...mport-file-for-create-invoice-record.cy.js | 54 +- .../e2e/edi-import-large-invoice-file.cy.js | 80 +- .../e2e/field-protection-overrides.cy.js | 452 +++++---- .../e2e/field-protection-settings.cy.js | 267 +++--- ...r-and-delete-import-logs-on-view-all.cy.js | 107 +-- .../e2e/match-on-holdings-856-u.cy.js | 188 ++-- .../match-on-instance-identifier-scen1.cy.js | 87 +- .../match-on-instance-identifier-scen2.cy.js | 160 ++-- .../match-on-pol-and-update-instance.cy.js | 182 ++-- .../e2e/match-on-pol-and-update-items.cy.js | 332 ++++--- .../e2e/match-on-vrn-and-update-items.cy.js | 174 ++-- .../mrc-import-file-for-create-items.cy.js | 147 +-- ...mport-file-for-modify-marcBib-record.cy.js | 190 ++-- .../mrc-import-file-for-update-items.cy.js | 426 +++++---- .../e2e/mrc-import-with-matching-001.cy.js | 153 +-- .../e2e/mrc-import-with-matching-999ff.cy.js | 192 ++-- .../e2e/data-import/e2e/view-all-filter.cy.js | 124 +-- cypress/e2e/data-import/e2e/view-all.cy.js | 42 +- ...scription-is-incorrectly-constructed.cy.js | 41 +- ...ecords-with-999-ff-field-and-without.cy.js | 46 +- .../importing-marc-authority-files.cy.js | 87 +- ...ndling-for-new-and-update-srs-record.cy.js | 295 +++--- ...-for-holdings-proceed-without-errors.cy.js | 194 ++-- ...on-and-field-mapping-create-instance.cy.js | 137 +-- .../add-subfields-to-linked-fields.cy.js | 211 +++-- ...when-job-profile-not-create-instance.cy.js | 168 ++-- ...-fields-using-update-marcbib-profile.cy.js | 283 ++++-- ...-not-processed-for-invalid-marc-bibs.cy.js | 39 +- ...it-file-and-reimport-to-update-items.cy.js | 223 +++-- .../field-protection-modification.cy.js | 60 +- ...import-a-bunch-of-marc-files-at-once.cy.js | 19 +- ...stopping-running-job-and-deleting-it.cy.js | 28 +- ...-edit-derive-bib-with-minimum-fields.cy.js | 97 +- ...import-of-orders-with-pending-status.cy.js | 61 +- ...lectronic-resource-with-no-inventory.cy.js | 48 +- ...-orders-other-with-instance-holdings.cy.js | 109 ++- ...source-with-instances-holdings-items.cy.js | 147 ++- ...orting-ebook-orders-with-open-status.cy.js | 34 +- .../item-update-via-match-by-status.cy.js | 123 ++- ...d-check-in-out-notes-from-marc-field.cy.js | 147 ++- ...lationship-between-url-and-link-test.cy.js | 144 +-- .../marc-bib-import-delete-linked-field.cy.js | 177 ++-- ...-update-select-fields-works-properly.cy.js | 59 +- .../match-on-instance-identifier-scen3.cy.js | 139 ++- .../match-on-instance-identifier-scen4.cy.js | 139 ++- .../match-on-location.cy.js | 397 ++++---- .../match-on-oclc-and-update-instance.cy.js | 168 ++-- ...g-on-newly-created-035-does-not-work.cy.js | 151 +-- ...-pe-mix-with-instance-holdings-items.cy.js | 132 ++- ...rc-import-with-999-field-and-without.cy.js | 48 +- ...critics-or-nonRoman-alphabet-records.cy.js | 49 +- ...tches-under-actions-in-a-job-profile.cy.js | 323 ++++--- ...es-does-not-duplicate-control-fields.cy.js | 45 +- ...n-incoming-records-not-deleted-scen1.cy.js | 93 +- ...n-incoming-records-not-deleted-scen2.cy.js | 83 +- ...record-import-with-running-large-job.cy.js | 41 +- ...or-marc-indicators-in-match-profiles.cy.js | 214 +++-- .../test-remove-field-mapping-option.cy.js | 321 +++++-- .../update-controllable-subfield0.cy.js | 117 ++- ...trolled-and-not-controlled-subfields.cy.js | 183 ++-- ...e-holdings-via-static-value-submatch.cy.js | 173 +++- .../updates-should-add-035-field.cy.js | 202 ++-- ...aking-incorrect-records-into-account.cy.js | 127 +-- ...-records-do-or-do-not-have-999-field.cy.js | 56 +- .../delete-logs-from-view-all.cy.js | 38 +- ...-discarded-error-actions-for-invoice.cy.js | 45 +- ...instance-using-marc-to-marc-submatch.cy.js | 515 ++++++---- ...t-summary-table-for-creating-actions.cy.js | 135 ++- ...ary-table-with-create-update-actions.cy.js | 390 +++++--- ...t-summury-table-for-updating-actions.cy.js | 420 ++++++--- ...orting-of-orders-with-pending-status.cy.js | 64 +- ...ile-has-modify-after-instance-create.cy.js | 50 +- ...s-for-created-imported-order-records.cy.js | 63 +- ...ngs-for-physical-resource-open-order.cy.js | 165 ++-- ...-multiple-items-in-multiple-holdings.cy.js | 132 ++- ...ems-with-errors-in-multiple-holdings.cy.js | 132 ++- ...y-records-created-after-not-matching.cy.js | 109 ++- ...not-exceed-number-of-records-in-file.cy.js | 145 +-- ...ile-only-involves-holdings-and-items.cy.js | 484 ++++++---- ...ance-is-not-updated-due-to-non-match.cy.js | 55 +- .../can-view-only-permission.cy.js | 38 +- .../permission-only-viewing-settings.cy.js | 51 +- .../user-cannot-delete-import-logs.cy.js | 23 +- ...-limited-permissions-can-import-file.cy.js | 114 ++- ...auses-invoices-to-import-with-errors.cy.js | 43 +- ...add-and-remove-tags-to-a-job-profile.cy.js | 11 +- ...ve-mapping-profile-to-action-profile.cy.js | 58 +- .../delete-an-existing-job-profile.cy.js | 11 +- .../duplicate-an-existing-job-profile.cy.js | 34 +- ...-fields-mapping-into-1-invoice-field.cy.js | 97 +- ...-profile-with-associated-job-profile.cy.js | 92 +- .../edit-existing-action-profile.cy.js | 50 +- ...xisting-job-profile-adding-long-name.cy.js | 28 +- .../edit-existing-mapping-profile.cy.js | 50 +- .../edit-existing-match-profile.cy.js | 51 +- .../fund-and-expense-class-mappings.cy.js | 153 +-- ...elds-required-in-invoice-map-profile.cy.js | 21 +- ...-after-editing-marc-bib-in-quickMarc.cy.js | 98 +- ...ields-after-editing-marc-bib-outside.cy.js | 100 +- ...job-profile-with-repeatable-profiles.cy.js | 291 ++++-- .../eholdings/eholdings-custom-packages.cy.js | 35 +- .../eholdings/eholdings-packages-export.cy.js | 35 +- .../eholdings/eholdings-packages-search.cy.js | 27 +- .../e2e/eholdings/eholdings-packages.cy.js | 153 +-- .../eholdings/eholdings-titles-packages.cy.js | 73 +- cypress/e2e/eholdings/eholdings-titles.cy.js | 230 +++-- cypress/e2e/eholdings/provider-edit.cy.js | 38 +- .../cannot-view-export-manager.cy.js | 23 +- .../e2e/export-manager/check-view-jobs.cy.js | 178 ++-- .../downloading-the-exact-edi-file.cy.js | 132 +-- .../export-manager/search-filter-verify.cy.js | 117 ++- cypress/e2e/fee-fine/fee-fine-history.cy.js | 213 +++-- ...amount-link-absent-in-while-checkout.cy.js | 74 +- .../fine-amount-link-in-while-checkout.cy.js | 77 +- cypress/e2e/fee-fine/lostItemFee.cy.js | 22 +- ...s-by-fee-fine-type-charge-and-action.cy.js | 33 +- .../e2e/fee-fine/manual-patron-block.cy.js | 59 +- cypress/e2e/fee-fine/newFeeFines.cy.js | 263 +++--- .../overdue-fine-renewed-triggers.cy.js | 66 +- .../overdue-fine-returned-triggers.cy.js | 66 +- .../e2e/finance/check-available-balance.cy.js | 126 +-- ...playing-settings-for-common-rollover.cy.js | 124 +-- ...isplaying-settings-for-test-rollover.cy.js | 122 +-- .../check-test-rollover-results.cy.js | 154 +-- .../encumbrances-are-rolled-over.cy.js | 154 +-- .../fiscalYears/fiscalYears-create.cy.js | 26 +- .../fiscalYears/fiscalYears-viewDetails.cy.js | 16 +- ...ance-as-allocation-not-active-option.cy.js | 214 +++-- .../rollover-cash-balance-as-allocation.cy.js | 154 +-- ...over-cash-balance-as-none-allocation.cy.js | 150 +-- .../fiscalYears/rollover-fiscal-year.cy.js | 178 ++-- .../fiscalYears/search-and-filter.cy.js | 58 +- .../funds/add-allocation-to-budget.cy.js | 69 +- .../funds/add-expense-class-to-budget.cy.js | 57 +- .../funds/add-transfer-to-budget.cy.js | 84 +- .../funds/create-encumbrance-from-order.cy.js | 97 +- .../funds/filter-transer-from-in-fund.cy.js | 62 +- .../e2e/finance/funds/funds.addBudget.cy.js | 29 +- cypress/e2e/finance/funds/funds.create.cy.js | 29 +- .../finance/funds/funds.deleteBudget.cy.js | 53 +- .../funds.deleteBudgetWithTransfer.cy.js | 60 +- cypress/e2e/finance/funds/funds.search.cy.js | 116 +-- ...uisition-unit-restrictions-for-funds.cy.js | 80 +- .../e2e/finance/funds/warning-message.cy.js | 37 +- .../finance/groups/add-funds-to-group.cy.js | 124 +-- .../groups/add-multiple-funds-to-group.cy.js | 85 +- cypress/e2e/finance/groups/create.cy.js | 20 +- .../finance/groups/search-and-filter.cy.js | 95 +- .../e2e/finance/ledgers/ledgers.create.cy.js | 26 +- .../e2e/finance/ledgers/ledgers.search.cy.js | 64 +- .../transactions/unrelease-encumbrance.cy.js | 145 +-- .../e2e/ideyalabs/agreements/agreements.cy.js | 25 +- cypress/e2e/ideyalabs/checkin.cy.js | 60 +- cypress/e2e/ideyalabs/checkout.cy.js | 8 +- .../create-text-field-custom-field.cy.js | 12 +- cypress/e2e/ideyalabs/eHoldingsExports.cy.js | 26 +- .../e2e/ideyalabs/eholdings/G_eholdings.cy.js | 86 +- cypress/e2e/ideyalabs/eholdings/eHolding.js | 18 +- .../funds/correct-fund-validation.cy.js | 4 +- cypress/e2e/ideyalabs/marc_authority.cy.js | 27 +- cypress/e2e/ideyalabs/notes/note-type.cy.js | 4 +- .../editing-fund-distribution-in-pol.cy.js | 7 +- .../re-exported-order.cy.js | 20 +- ...ses-with-payment-not-required-status.cy.js | 38 +- .../add-and-assign-contact.cy.js | 9 +- .../add-tags-to-organization.cy.js | 8 +- .../assign-categories-to-contact.cy.js | 7 +- .../organizations/create-new-categories.cy.js | 26 +- .../organizations/delete-contact.cy.js | 29 +- .../organizations/delete-organization.cy.js | 7 +- .../filter-organizations-by-status.cy.js | 2 +- .../filter-organizations-by-tags.cy.js | 14 +- .../make-existing-organization-vendor.cy.js | 2 +- .../search-alternate-organization.cy.js | 7 +- cypress/e2e/ideyalabs/serviceshift.cy.js | 36 +- cypress/e2e/ideyalabs/settings.cy.js | 17 +- .../patron-notice.cy.js | 2 - cypress/e2e/inventory/actions-menu.cy.js | 57 +- .../inventory/assign-preceding-title.cy.js | 41 +- .../assing-tags-to-an-instance-record.cy.js | 38 +- ...catalogue-new-ordered-recieved-title.cy.js | 180 ++-- .../create-edit-delete-material-types.cy.js | 34 +- .../inventory/create-fast-add-record.cy.js | 89 +- .../create-instance-with-add-new.cy.js | 26 +- .../inventory/create-page-type-request.cy.js | 73 +- .../inventory/derive-linked-marc-bib.cy.js | 83 +- .../enter-different-type-of-identifiers.cy.js | 25 +- cypress/e2e/inventory/export.cy.js | 125 +-- .../filter/filter-instances-by-tags.cy.js | 57 +- .../filter/filter-items-with-status.cy.js | 140 +-- .../create-holdings-as-different-user.cy.js | 37 +- .../holdings/create-new-marc-holdings.cy.js | 172 ++-- .../holdings/edit-marc-holdings.cy.js | 59 +- .../holdings-record-through-upload.cy.js | 46 +- ...oldings-records-Instancesource-folio.cy.js | 32 +- ...holdings-records-Instancesource-marc.cy.js | 54 +- .../see-holdings-with-1000+-items.cy.js | 89 +- .../inventory/item-status-date-updates.cy.js | 155 ++-- ...culation-history-for-checked-in-loan.cy.js | 123 ++- ...tion-is-populated-on-duplicated-item.cy.js | 92 +- .../e2e/inventory/keyboard-shortcuts.cy.js | 77 +- .../inventory/locations/item-locations.cy.js | 141 +-- .../update-effective-location-for-item.cy.js | 95 +- cypress/e2e/inventory/marc-bib-edit.cy.js | 94 +- .../e2e/inventory/marc-bibliographic.cy.js | 242 +++-- .../marking/mark-item-as-missing.cy.js | 117 +-- .../marking/mark-item-as-withdrawn.cy.js | 118 ++- cypress/e2e/inventory/moving-holdings.cy.js | 118 ++- .../inventory/moving-items-non-remote.cy.js | 118 +-- .../e2e/inventory/moving-items-remote.cy.js | 97 +- cypress/e2e/inventory/moving-items.cy.js | 173 ++-- cypress/e2e/inventory/query-search.cy.js | 52 +- cypress/e2e/inventory/quick-marc.cy.js | 28 +- .../search/advanced-search-in-inventory.cy.js | 195 ++-- .../browse-call-number-with-space.cy.js | 282 +++--- .../search/browse-call-numbers.cy.js | 112 ++- .../search/browse-contributors-exact.cy.js | 49 +- ...rowse-contributors-linked-not-linked.cy.js | 76 +- .../search/browse-contributors-linked.cy.js | 66 +- .../browse-contributors-non-exact.cy.js | 49 +- .../search/browse-contributors.cy.js | 289 +++--- .../search/browse-deleted-contributors.cy.js | 112 ++- .../search/browse-in-inventory.cy.js | 85 +- .../search/browse-search-permissions.cy.js | 86 +- .../search/browse-subjects-linked.cy.js | 100 +- .../inventory/search/browse-subjects.cy.js | 52 +- .../search-in-inventory-linked-authID.cy.js | 84 +- .../search/search-in-inventory-linked.cy.js | 131 +-- .../search/search-in-inventory-symbols.cy.js | 87 +- .../search/search-in-inventory.cy.js | 147 +-- .../e2e/inventory/search/subject-browse.cy.js | 41 +- cypress/e2e/inventory/selected-records.cy.js | 80 +- .../create-edit-mode-for-isri-profiles.cy.js | 38 +- .../settings/view-mode-of-isri-profiles.cy.js | 88 +- .../import-by-oclc-source-folio.cy.js | 51 +- .../single-record-import/import-by-oclc.cy.js | 52 +- ...ls-menu-for-multiple-target-profiles.cy.js | 47 +- ...-create-for-multiple-target-profiles.cy.js | 64 +- ...rt-create-for-single-target-profiles.cy.js | 33 +- ...enu-for-single-target-profile-update.cy.js | 71 +- ...ent-amount-to-invoice-line-in-dollar.cy.js | 155 ++-- ...nt-amount-to-invoice-line-in-percent.cy.js | 155 ++-- .../approve-invoice-with-payment-credit.cy.js | 148 +-- cypress/e2e/invoices/approve-invoice.cy.js | 94 +- .../cancelling-approved-invoices.cy.js | 157 ++-- .../change-fund-before-approve-invoice.cy.js | 116 +-- cypress/e2e/invoices/filter-invoices.cy.js | 170 ++-- .../invoices.createCreditInvoice.cy.js | 93 +- .../invoices.exportBatchVoucher.cy.js | 83 +- .../invoices/invoices.manuallyCreate.cy.js | 34 +- .../invoices.manuallyCreateLine.cy.js | 36 +- .../invoices.manuallyCreateLineFromPol.cy.js | 73 +- .../invoices.testPolSearchPlugin.cy.js | 101 +- ...invoice-with-multiple-xpense-classes.cy.js | 124 +-- cypress/e2e/invoices/pay-invoice.cy.js | 119 ++- ...-year-after-fund-distribution-change.cy.js | 144 ++- cypress/e2e/invoices/search-invoices.cy.js | 147 +-- .../test-acquisition-unit-for-invoices.cy.js | 96 +- cypress/e2e/loans/export-loans.cy.js | 150 +-- cypress/e2e/loans/loan-dates.cy.js | 197 ++-- cypress/e2e/loans/loans-claim-returned.cy.js | 247 +++-- cypress/e2e/loans/renewal-failure.cy.js | 137 +-- cypress/e2e/loans/renewal-success.cy.js | 135 +-- .../marc-authority-update.cy.js | 159 ++-- .../create-new-marc-bib-edit-ldr.cy.js | 133 ++- .../marc-authority/create-new-marc-bib.cy.js | 107 ++- ...e_two_marc_bib_linked_marc_authority.cy.js | 180 ++-- ...empty-marc-bib-with-marc-auth-record.cy.js | 138 +-- ...d100-to-authority100-with-subfield-0.cy.js | 117 ++- ...d240-to-authority100-with-subfield-t.cy.js | 191 ++-- ...marc-bib-from-marc-auth-using-derive.cy.js | 160 ++-- ...h-permissions-downloadAndResendFiles.cy.js | 33 +- ...ew-with-permissions-exportManagerAll.cy.js | 17 +- .../marc-authority-advanced-search.cy.js | 257 +++-- .../marc-authority-delete.cy.js | 81 +- .../marc-authority-edit-linked-modals.cy.js | 130 +-- ...-authority-edit-linked-update-header.cy.js | 110 ++- .../marc-authority-edit-linked.cy.js | 116 ++- .../marc-authority/marc-authority-edit.cy.js | 542 ++++++----- .../marc-authority-import.cy.js | 371 +++++--- .../marc-authority-reporting.cy.js | 178 ++-- .../marc-authority-search.cy.js | 26 +- .../marc-authority/marc-authority-sort.cy.js | 168 ++-- .../marc-authority/marc-authority-view.cy.js | 31 +- .../e2e/marc-authority/marc-authority.cy.js | 276 ++++-- .../marc-authority/marc-bibliographic.cy.js | 48 +- ...modify-marc-holdings-of-deleted-user.cy.js | 73 +- .../modify-marc-file-of-deleted-user.cy.js | 118 ++- ...110-field-using-number-of-title-link.cy.js | 63 +- ...130-field-using-number-of-title-link.cy.js | 63 +- ...610-field-using-number-of-title-link.cy.js | 66 +- ...650-field-using-number-of-title-link.cy.js | 66 +- ...711-field-using-number-of-title-link.cy.js | 66 +- ...n-marc-authority-browse-by-corporate.cy.js | 129 +-- ...ug-in-marc-authority-browse-by-genre.cy.js | 85 +- ...-authority-browse-by-geographic-name.cy.js | 85 +- ...-marc-authority-browse-by-name-title.cy.js | 89 +- ...rc-authority-browse-by-personal-name.cy.js | 79 +- ...-in-marc-authority-browse-by-subject.cy.js | 117 +-- ...rc-authority-browse-by-uniform-title.cy.js | 83 +- ...-search-by-childrens-subject-heading.cy.js | 76 +- ...ug-in-marc-authority-search-by-genre.cy.js | 75 +- ...-in-marc-authority-search-by-subject.cy.js | 146 +-- .../plug-in-marc-authority-search.cy.js | 474 +++++----- cypress/e2e/notes/notes-permission.cy.js | 105 ++- cypress/e2e/notes/notes.cy.js | 97 +- ...-pmh-behavior-record-source-dropdown.cy.js | 77 +- ...PO-line-has-related-approved-invoice.cy.js | 118 +-- .../change-location-during-receiving.cy.js | 87 +- cypress/e2e/orders/check-duplicate-POL.cy.js | 93 +- cypress/e2e/orders/close-order.cy.js | 34 +- cypress/e2e/orders/connected-pol.cy.js | 39 +- cypress/e2e/orders/create-ongoing-order.cy.js | 47 +- .../orders/create-order-line-for-PEMix.cy.js | 36 +- ...eate-order-withPol-different-formats.cy.js | 127 +-- cypress/e2e/orders/create-order.cy.js | 9 +- cypress/e2e/orders/duplicate-order.cy.js | 85 +- .../orders/edifact-export-to-a-vendor.cy.js | 134 +-- .../check-alert-open-order.cy.js | 102 +- .../create-order-to-edifact-export.cy.js | 78 +- .../delete-order-by-user.cy.js | 90 +- cypress/e2e/orders/edit-an-existing-PO.cy.js | 63 +- ...edit-fund-when-invoice-are-cancelled.cy.js | 159 ++-- .../edit-fund-when-invoice-are-open.cy.js | 163 ++-- .../edit-fund-with-reviewed-invoice.cy.js | 166 ++-- .../e2e/orders/edit-pol-in-open-order.cy.js | 105 ++- cypress/e2e/orders/edit-pol.cy.js | 90 +- ...ting-fund-and-increasing-cost-in-pol.cy.js | 159 ++-- cypress/e2e/orders/export-orders.cy.js | 81 +- .../create-new-holdings.cy.js | 182 ++-- ...iving-includes-order-closed-statuses.cy.js | 219 +++-- cypress/e2e/orders/not-connected-POL.cy.js | 33 +- .../open-order-for-physical-material.cy.js | 44 +- ...s-export-to-a-vendor-with-open-order.cy.js | 63 +- .../orders/orders-export-to-a-vendor.cy.js | 57 +- .../e2e/orders/orders.unreceivePiece.cy.js | 42 +- .../orders/po-filters-with-cLose-order.cy.js | 93 +- cypress/e2e/orders/po-filters.cy.js | 75 +- cypress/e2e/orders/po-search.cy.js | 48 +- .../e2e/orders/pol-export-by-filters.cy.js | 111 +-- cypress/e2e/orders/pol-filters.cy.js | 118 ++- cypress/e2e/orders/pol-search-am-filter.cy.js | 87 +- cypress/e2e/orders/pol-search.cy.js | 95 +- .../e2e/orders/receive-piece-from-order.cy.js | 83 +- ...tem-statuses-are-set-to-status-other.cy.js | 311 ++++--- .../receive-pieces-for-package-order.cy.js | 149 +-- ...ceiving-pieces-from-order-for-PE-mix.cy.js | 117 ++- .../serials-receiving.cy.js | 90 +- .../status-is-updated-from-n-order.cy.js | 79 +- .../update-barcode.cy.js | 123 +-- .../renewal-date-are-not-requaired.cy.js | 86 +- .../select-acquisition-method-from-POL.cy.js | 50 +- .../select-random-currancy-in-order.cy.js | 102 +- .../test-acquisition-unit-for-orders.cy.js | 95 +- ...order-with-changed-fund-distribution.cy.js | 209 +++-- .../version-history-for-order-lines.cy.js | 200 ++-- .../orders/version-history-for-order.cy.js | 132 +-- .../create-interface-to-organization.cy.js | 47 +- .../organizations/create-organization.cy.js | 19 +- .../edit-contact-of-organization.cy.js | 53 +- .../e2e/organizations/edit-organization.cy.js | 37 +- .../organizations/filter-organization.cy.js | 27 +- .../integration-organization.cy.js | 51 +- .../organizations/search-organization.cy.js | 23 +- ...t-acquisition-unit-for-organizations.cy.js | 75 +- .../user-integration-organization.cy.js | 75 +- .../organizations/view-existing-record.cy.js | 23 +- ...-enable-or-disable-tags-for-all-apps.cy.js | 4 +- .../create-new-permission-set.cy.js | 2 +- ...-view-all-settings-works-as-expected.cy.js | 60 +- ...n-to-view-all-tags-settings-is-added.cy.js | 4 +- ...bled-in-case-of-errors-on-my-profile.cy.js | 4 +- cypress/e2e/quickmark/holding-quickmark.cy.js | 67 +- .../e2e/quickmark/instance-quickmark.cy.js | 178 ++-- .../item-aged-to-lost-triggers.cy.js | 60 +- ...ickup-hold-shelf-expiration-triggers.cy.js | 115 ++- ...page-request-cancel-request-triggers.cy.js | 67 +- ...notice-duplication-works-as-expected.cy.js | 31 +- .../recieve-notice-checkin.cy.js | 258 ++++-- .../recieve-notice-checkout.cy.js | 298 +++--- .../recieve-notice-triggers.cy.js | 73 +- .../e2e/requests/assign-tags-to-request.cy.js | 49 +- cypress/e2e/requests/edit-request.cy.js | 30 +- .../e2e/requests/request-types-filter.cy.js | 49 +- cypress/e2e/requests/requests-sort.cy.js | 42 +- .../create-acquisition-unit.cy.js | 33 +- .../edit-acquisition-unit.cy.js | 34 +- .../test-au-for-orders-invoices-funds.cy.js | 190 ++-- .../fee-fine/overdue-fine-policies.cy.js | 193 ++-- ...chedule-does-not-cover-the-test-date.cy.js | 204 ++-- .../general/edit-circulation-rules.cy.js | 212 +++-- .../create-patron-notice-policies.cy.js | 5 +- .../create-patron-notice-template.cy.js | 5 +- .../default-field-mapping-profiles.cy.js | 50 +- .../data-export/default-job-profile.cy.js | 29 +- .../delete-the-existing-mapping-profile.cy.js | 44 +- .../data-export/duplicate-job-profile.cy.js | 81 +- ...edit-duplicate-field-mapping-profile.cy.js | 94 +- .../data-export/edit-job-profile.cy.js | 87 +- .../new-field-mapping-profile.cy.js | 47 +- .../data-export/new-job-profile.cy.js | 95 +- ...ew-mapping-profile-holdings-instance.cy.js | 77 +- .../new-mapping-profile-holdings-items.cy.js | 92 +- ...pping-profile-holdings-source-record.cy.js | 84 +- .../data-export/search-job-profile.cy.js | 37 +- .../data-export/transformation-form.cy.js | 122 +-- .../view-field-mapping-profile.cy.js | 47 +- .../finance/expense-classes-create.cy.js | 24 +- ...oices.settings.checkSystemBatchGroup.cy.js | 28 +- .../invoices.settings.createBatchGroup.cy.js | 24 +- .../orders/acquisition-method-create.cy.js | 23 +- .../e2e/settings/orders/adjust-instance.cy.js | 103 +- .../settings/orders/change-PO-number.cy.js | 62 +- .../orders/change-the-POL-limit.cy.js | 101 +- .../orders/create-order-template.cy.js | 46 +- .../settings/orders/edit-order-template.cy.js | 51 +- .../settings/orders/increase-pol-limit.cy.js | 103 +- .../orders/preffix-suffix-create.cy.js | 50 +- ...acquisition-method-in-order-template.cy.js | 42 +- .../remote-storage/accession-tables.cy.js | 66 +- .../remote-storage/configurations.cy.js | 59 +- .../remote-storage/remote-storage.cy.js | 106 ++- .../e2e/settings/tenant/service-points.cy.js | 49 +- cypress/e2e/settings/users/conditions.cy.js | 2 +- ...mber-of-items-borrower-for-loan-type.cy.js | 155 ++-- .../users/fee&Fine/schedule-time.cy.js | 27 +- ...ved-after-lost-item-returned-renewed.cy.js | 84 +- ...-removed-after-charged-item-returned.cy.js | 33 +- ...-after-overdue-item-renewed-returned.cy.js | 55 +- ...after-overdue-recalled-item-returned.cy.js | 84 +- cypress/e2e/settings/users/patronGroups.cy.js | 73 +- .../e2e/settings/users/paymentMethods.cy.js | 17 +- cypress/e2e/settings/users/waiveReasons.cy.js | 13 +- .../e2e/staff-slips/add-notice-token.cy.js | 29 +- .../add-staff-slip-tokens-in-settings.cy.js | 12 +- cypress/e2e/staff-slips/hold-slip.cy.js | 118 ++- .../tlr-Item-renewable.cy.js | 31 +- .../user-can-change-type-for-request.cy.js | 61 +- .../user-can-choose-item-to-move-tlr.cy.js | 13 +- .../user-can-create-hold-tlr.cy.js | 43 +- ...-item-level-request-from-item-record.cy.js | 34 +- ...r-can-create-page-Item-level-request.cy.js | 34 +- ...r-can-see-request-detail-for-request.cy.js | 40 +- .../user-can-see-tlr-in-crculation.cy.js | 4 +- cypress/e2e/users/browse-permissions.cy.js | 60 +- cypress/e2e/users/create-users.cy.js | 19 +- cypress/e2e/users/delete-users.cy.js | 117 ++- ...-processing-fee-on-actual-lost-items.cy.js | 72 +- .../users/feeFines/waiveClosedFeeFines.cy.js | 68 +- .../e2e/users/feeFines/waiveFeeFines.cy.js | 72 +- cypress/e2e/users/loans/declare-lost.cy.js | 79 +- .../loans/loan-reached-maximum-renewals.cy.js | 213 ++--- .../manual-anonymization-closed-loans.cy.js | 55 +- cypress/e2e/users/search-by-middle-name.cy.js | 33 +- cypress/support/api/acq-units.js | 9 +- cypress/support/api/auth.js | 36 +- cypress/support/api/batch-groups.js | 16 +- cypress/support/api/blocks.js | 51 +- cypress/support/api/circulation.js | 82 +- cypress/support/api/data-import.js | 96 +- cypress/support/api/fees-fines.js | 50 +- cypress/support/api/finance.js | 38 +- cypress/support/api/instance.js | 16 +- cypress/support/api/inventory.js | 283 +++--- cypress/support/api/invoice.js | 6 +- cypress/support/api/loan-history.js | 16 +- cypress/support/api/orders.js | 35 +- cypress/support/api/permissions.js | 20 +- cypress/support/api/proxy.js | 25 +- .../support/api/request-preference-storage.js | 37 +- cypress/support/api/requests.js | 50 +- cypress/support/api/servicePoints.js | 9 +- cypress/support/api/tags.js | 18 +- cypress/support/api/users.js | 140 +-- cypress/support/checkout.js | 8 +- cypress/support/constants.js | 62 +- cypress/support/data-import.js | 35 +- cypress/support/dictionary/devTeams.js | 2 +- cypress/support/dictionary/features.js | 4 +- cypress/support/dictionary/parallelization.js | 3 +- cypress/support/dictionary/permissions.js | 865 +++++++++++++---- cypress/support/dictionary/testTypes.js | 6 +- cypress/support/e2e.js | 3 +- cypress/support/eholdings.js | 5 +- .../fragments/agreements/agreements.js | 23 +- .../fragments/agreements/agreementsDetails.js | 85 +- .../fragments/agreements/newAgreement.js | 106 ++- cypress/support/fragments/app-paths.js | 2 +- .../fragments/bulk-edit/bulk-edit-actions.js | 285 ++++-- .../fragments/bulk-edit/bulk-edit-files.js | 104 ++- .../bulk-edit/bulk-edit-search-pane.js | 359 +++++-- .../check-in-actions/checkInActions.js | 123 +-- .../fragments/check-in-actions/checkInPane.js | 56 +- .../check-in-actions/confirmItemInModal.js | 12 +- .../check-out-actions/check-out-actions.js | 73 +- .../fragments/check-out-actions/selectUser.js | 17 +- .../modals/awaitingPickupForARequest.js | 9 +- .../modals/checkInClaimedReturnedItem.js | 10 +- .../checkin/modals/checkInDeclareLostItem.js | 8 +- .../support/fragments/checkout/checkout.js | 39 +- .../checkout/modals/limitCheckOut.js | 16 +- .../checkout/modals/multipieceCheckOut.js | 41 +- .../fragments/circulation-log/searchPane.js | 71 +- .../circulation-log/searchResults.js | 4 +- .../circulation/circulation-rules.js | 56 +- .../circulation/fixedDueDateSchedules.js | 34 +- .../fragments/circulation/loan-policy.js | 6 +- .../circulation/lost-item-fee-policy.js | 26 +- .../fragments/circulation/newNoticePolicy.js | 54 +- .../circulation/newNoticePolicyTemplate.js | 64 +- .../fragments/circulation/notice-policy.js | 76 +- .../circulation/overdue-fine-policy.js | 8 +- .../fragments/circulation/request-policy.js | 4 +- .../fragments/data-export/dataExportLogs.js | 23 +- .../data-export/dataExportResults.js | 151 +-- .../fragments/data-export/exportFile.js | 128 +-- .../exportJobProfile/exportJobProfiles.js | 10 +- .../exportJobProfile/exportNewJobProfile.js | 35 +- .../exportJobProfile/singleJobProfile.js | 19 +- .../deleteFieldMappingProfile.js | 10 +- .../exportFieldMappingProfiles.js | 37 +- .../exportNewFieldMappingProfile.js | 59 +- .../modalSelectTransformations.js | 55 +- .../singleFieldMappingProfilePane.js | 23 +- .../action_profiles/actionProfileEdit.js | 34 +- .../action_profiles/actionProfileView.js | 42 +- .../action_profiles/actionProfiles.js | 72 +- .../action_profiles/modals/confirmChanges.js | 4 +- .../action_profiles/modals/confirmRemoval.js | 6 +- .../modals/selectMappingProfile.js | 13 +- .../action_profiles/newActionProfile.js | 94 +- .../fragments/data_import/dataImport.js | 262 +++--- .../job_profiles/jobProfileEdit.js | 13 +- .../job_profiles/jobProfileView.js | 130 +-- .../data_import/job_profiles/jobProfiles.js | 108 ++- .../job_profiles/modalSelectProfile.js | 13 +- .../data_import/job_profiles/newJobProfile.js | 270 ++++-- .../logs/deleteDataImportLogsModal.js | 48 +- .../fragments/data_import/logs/fileDetails.js | 466 ++++++---- .../fragments/data_import/logs/logs.js | 46 +- .../fragments/data_import/logs/logsViewAll.js | 228 +++-- .../fieldMappingProfileEdit.js | 23 +- .../fieldMappingProfileView.js | 116 ++- .../mapping_profiles/fieldMappingProfiles.js | 81 +- .../newFieldMappingProfile.js | 484 ++++++---- .../fragments/data_import/matchOnVRN.js | 87 +- .../match_profiles/matchProfileEdit.js | 22 +- .../match_profiles/matchProfileView.js | 14 +- .../match_profiles/matchProfiles.js | 71 +- .../match_profiles/newMatchProfile.js | 264 +++--- .../fragments/data_import/url-params.js | 14 +- .../eholdings/eHoldingResourceEdit.js | 16 +- .../eholdings/eHoldingsNewCustomPackage.js | 13 +- .../eholdings/eHoldingsNewCustomTitle.js | 15 +- .../fragments/eholdings/eHoldingsPackage.js | 67 +- .../eholdings/eHoldingsPackageView.js | 37 +- .../fragments/eholdings/eHoldingsPackages.js | 128 +-- .../eholdings/eHoldingsPackagesSearch.js | 30 +- .../eholdings/eHoldingsProviderEdit.js | 17 +- .../eholdings/eHoldingsProviderView.js | 4 +- .../fragments/eholdings/eHoldingsProviders.js | 33 +- .../eholdings/eHoldingsProvidersSearch.js | 3 +- .../eholdings/eHoldingsResourceView.js | 71 +- .../fragments/eholdings/eHoldingsSearch.js | 3 +- .../fragments/eholdings/eHoldingsTitle.js | 75 +- .../fragments/eholdings/eHoldingsTitles.js | 50 +- .../eholdings/eHoldingsTitlesSearch.js | 53 +- .../exportManager/exportManagerSearchPane.js | 62 +- .../finance/fabrics/newTransaction.js | 1 - .../fragments/finance/financeHelper.js | 62 +- .../finance/fiscalYears/newFiscalYear.js | 22 +- .../fragments/finance/funds/newFund.js | 6 +- .../fragments/finance/groups/groups.js | 70 +- .../fragments/finance/groups/newGroup.js | 4 +- .../fragments/finance/ledgers/ledgers.js | 16 +- .../fragments/finance/ledgers/newLedger.js | 30 +- .../support/fragments/ideyalabs/invoice.js | 32 +- .../inventory/createPageTypeRequest.js | 53 +- .../fragments/inventory/fastAddNewRecord.js | 21 +- .../fragments/inventory/filterItems.js | 34 +- .../inventory/holdings/inventoryHoldings.js | 14 +- .../defaultInstanceHoldingItem.js | 26 +- .../inventoryInstanceSelectInstanceModal.js | 28 +- .../inventoryInstancesMovement.js | 37 +- .../fragments/inventory/holdingsRecordEdit.js | 23 +- .../fragments/inventory/holdingsRecordView.js | 184 ++-- .../fragments/inventory/instanceRecordEdit.js | 53 +- .../fragments/inventory/instanceRecordView.js | 129 ++- .../fragments/inventory/inventoryActions.js | 29 +- .../inventory/inventoryEditMarcRecord.js | 50 +- .../fragments/inventory/inventoryInstance.js | 416 +++++---- .../fragments/inventory/inventoryInstances.js | 314 ++++--- .../inventory/inventoryItem/itemActions.js | 68 +- .../inventory/inventoryKeyboardShortcuts.js | 36 +- .../fragments/inventory/inventoryModals.js | 16 +- .../inventory/inventoryNewHoldings.js | 12 +- .../inventory/inventoryNewInstance.js | 24 +- .../inventory/inventorySearchAndFilter.js | 136 ++- .../fragments/inventory/inventorySteps.js | 10 +- .../inventory/inventoryViewSource.js | 35 +- cypress/support/fragments/inventory/item.js | 1 + .../inventory/item/itemRecordEdit.js | 12 +- .../fragments/inventory/item/itemRecordNew.js | 18 +- .../inventory/item/itemRecordView.js | 159 ++-- .../fragments/inventory/markItemAsMissing.js | 129 +-- .../inventory/markItemAsWithdrawn.js | 9 +- .../inventory/newInctanceHoldingsItem.js | 6 +- .../fragments/inventory/reImportModal.js | 25 +- .../inventory/search/browseCallNumber.js | 42 +- .../inventory/search/browseContributors.js | 99 +- .../inventory/search/browseSubjects.js | 74 +- .../inventory/singleRecordImportModal.js | 37 +- .../support/fragments/invoices/invoiceView.js | 82 +- .../support/fragments/invoices/invoices.js | 141 +-- .../fragments/invoices/newBatchGroup.js | 4 +- .../support/fragments/invoices/newInvoice.js | 6 +- .../fragments/invoices/newInvoiceLine.js | 6 +- .../fragments/invoices/settingsInvoices.js | 94 +- .../fragments/invoices/vendorAddress.js | 6 +- .../fragments/loans/changeDueDateForm.js | 7 +- cypress/support/fragments/loans/loansPage.js | 32 +- cypress/support/fragments/loans/renewals.js | 38 +- .../marcAuthority/MarcAuthorityBrowse.js | 90 +- .../marcAuthority/marcAuthorities.js | 246 +++-- .../marcAuthoritiesBrowseSearch.js | 6 +- .../marcAuthority/marcAuthoritiesDelete.js | 52 +- .../marcAuthority/marcAuthoritiesSearch.js | 6 +- .../fragments/marcAuthority/marcAuthority.js | 172 ++-- .../fragments/notes/existingNoteEdit.js | 56 +- .../fragments/notes/existingNoteView.js | 2 +- cypress/support/fragments/notes/newNote.js | 13 +- .../support/fragments/notes/notesEholdings.js | 47 +- .../support/fragments/oai-pmh/behaviorPane.js | 14 +- .../support/fragments/oai-pmh/oaipmhPane.js | 8 +- .../fragments/orders/basicOrderLine.js | 41 +- .../fragments/orders/enchancedOrderLine.js | 46 +- cypress/support/fragments/orders/newOrder.js | 15 +- .../support/fragments/orders/orderLines.js | 430 +++++---- cypress/support/fragments/orders/orderView.js | 22 +- cypress/support/fragments/orders/orders.js | 286 +++--- .../support/fragments/orders/ordersHelper.js | 22 +- .../fragments/orders/selectInstanceModal.js | 14 +- .../organizations/newOrganization.js | 32 +- .../fragments/organizations/organizations.js | 119 +-- cypress/support/fragments/quickMarcEditor.js | 876 ++++++++++++------ .../fragments/receiving/addNewPieceModal.js | 4 +- .../support/fragments/receiving/receiving.js | 63 +- .../fragments/receiving/receivingItemView.js | 6 +- .../fragments/requests/edit-request.js | 12 +- .../support/fragments/requests/newRequest.js | 49 +- .../fragments/requests/requestDetail.js | 28 +- .../support/fragments/requests/requests.js | 230 +++-- .../requests/requestsSearchResultsPane.js | 49 +- .../support/fragments/requests/selectUser.js | 17 +- .../servicePoint/selectServicePointModal.js | 4 +- .../servicePoint/switchServicePoint.js | 13 +- .../acquisitionUnits/acquisitionUnits.js | 48 +- .../calendar/library-hours/library-hours.js | 12 +- .../fee-fine/overdueFinePolicies.js | 87 +- .../settings/circulation/otherSettings.js | 13 +- .../circulation/titleLevelRequests.js | 18 +- .../settings/dataImport/fileExtensions.js | 10 +- .../dataImport/marcFieldProtection.js | 51 +- .../dataImport/settingsActionProfiles.js | 34 +- .../dataImport/settingsJobProfiles.js | 42 +- .../dataImport/settingsMappingProfiles.js | 64 +- .../dataImport/settingsMatchProfiles.js | 82 +- .../settings/finance/newExpenseClass.js | 4 +- .../settings/finance/settingsFinance.js | 82 +- .../instance-holdings-item/fastAdd.js | 10 +- .../statisticalCodes.js | 10 +- .../instance-holdings-item/urlRelationship.js | 7 +- .../instanceStatusTypes.js | 6 +- .../newInstanceStatusType.js | 6 +- .../integrations/editTargetProfile.js | 4 +- .../integrations/newTargetProfile.js | 147 +-- .../integrations/viewTargetProfile.js | 4 +- .../integrations/z39.50TargetProfiles.js | 198 ++-- .../settings/inventory/materialTypes.js | 18 +- .../inventory/modalDeleteMaterialType.js | 2 +- .../settings/inventory/newMaterialType.js | 4 +- .../settings/invoices/batch-groups.js | 4 +- .../settings/orders/acquisitionMethods.js | 66 +- .../orders/inventoryInteractionsDefaults.js | 18 +- .../settings/orders/newPreffixSuffix.js | 9 +- .../settings/orders/orderLinesLimit.js | 18 +- .../settings/orders/orderTemplates.js | 34 +- .../settings/orders/settingsOrders.js | 69 +- .../remote-storage-configuration.js | 57 +- .../fragments/settings/tenant/campuses.js | 17 +- .../fragments/settings/tenant/institutions.js | 17 +- .../fragments/settings/tenant/libraries.js | 17 +- .../tenant/locations/createLocations.js | 7 +- .../settings/tenant/locations/locations.js | 6 +- .../settings/tenant/locations/newLocation.js | 71 +- .../tenant/servicePoints/newServicePoint.js | 6 +- .../tenant/servicePoints/servicePoints.js | 20 +- .../fragments/settings/users/condition.js | 43 +- .../fragments/settings/users/conditions.js | 58 +- .../fragments/settings/users/customFields.js | 22 +- .../fragments/settings/users/limits.js | 26 +- .../fragments/settings/users/manualCharges.js | 40 +- .../settings/users/patronBlockTemplates.js | 17 +- .../fragments/settings/users/patronGroups.js | 42 +- .../settings/users/paymentMethods.js | 104 ++- .../settings/users/permissionSets.js | 4 +- .../fragments/settings/users/refundReasons.js | 26 +- .../settings/users/transferAccounts.js | 26 +- .../settings/users/usersSettingsGeneral.js | 2 +- .../fragments/settings/users/waiveReasons.js | 78 +- cypress/support/fragments/topMenu.js | 11 +- .../support/fragments/topMenuNavigation.js | 4 +- .../fragments/users/addNewStaffInfo.js | 3 +- .../support/fragments/users/feeFineDetails.js | 5 +- cypress/support/fragments/users/feeFines.js | 19 +- .../users/loans/confirmClaimReturnedModal.js | 21 +- .../users/loans/confirmItemStatusModal.js | 8 +- .../users/loans/overrideAndRenewModal.js | 4 +- .../users/loans/renewConfirmationModal.js | 4 +- .../fragments/users/loans/userLoans.js | 120 ++- cypress/support/fragments/users/newFeeFine.js | 103 +- .../support/fragments/users/payFeeFaine.js | 31 +- .../support/fragments/users/refundFeeFine.js | 21 +- .../fragments/users/transferFeeFine.js | 11 +- .../fragments/users/userAllFeesFines.js | 79 +- cypress/support/fragments/users/userCharge.js | 14 +- .../users/userDefaultObjects/defaultUser.js | 21 +- .../users/userDefaultObjects/loanDetails.js | 142 ++- .../users/userDefaultObjects/loans.js | 53 +- .../users/userDefaultObjects/newUser.js | 6 +- cypress/support/fragments/users/usersCard.js | 83 +- .../fragments/users/usersSearchPane.js | 53 +- .../fragments/users/usersSearchResultsPane.js | 23 +- .../fragments/users/waiveFeeFineModal.js | 72 +- .../users/waiveFeeFineWarningModal.js | 19 +- cypress/support/ideyaLabs/checkinitems.js | 19 +- cypress/support/ideyaLabs/marc.js | 37 +- cypress/support/ideyaLabs/users.js | 45 +- cypress/support/inventory.js | 2 +- cypress/support/login.js | 68 +- cypress/support/stripes.js | 51 +- cypress/support/utils/arrays.js | 5 +- cypress/support/utils/dateTools.js | 65 +- cypress/support/utils/fileManager.js | 37 +- .../support/utils/generateIdentifierCode.js | 2 +- cypress/support/utils/interactorsTools.js | 101 +- cypress/support/utils/stringTools.js | 4 +- cypress/support/utils/users.js | 3 +- doc/axeTesting.md | 8 +- doc/bigtest.md | 8 +- ...fferences-in-stripes-components-testing.md | 28 +- doc/interactors.md | 31 +- doc/nightmare.md | 120 +-- interactors/accordion.js | 34 +- interactors/address-edit-list.js | 7 +- interactors/advanced-search-inventory.js | 20 +- interactors/advanced-search.js | 15 +- interactors/applist.js | 4 +- interactors/autosuggest.js | 14 +- interactors/avatar.js | 14 +- interactors/badge.js | 4 +- interactors/baseHTML.js | 9 +- interactors/buttongroup.js | 2 +- interactors/callout.js | 5 +- interactors/card.js | 5 +- interactors/code-mirror.js | 6 +- interactors/confirmation-modal.js | 9 +- interactors/dataImportUploadFile.js | 4 +- interactors/datepicker.js | 98 +- interactors/dropdown.js | 37 +- interactors/editablelist.js | 35 +- interactors/entrymanager.js | 5 +- interactors/fieldset.js | 18 +- interactors/form.js | 2 +- interactors/helpers.js | 32 +- interactors/icon-button.js | 6 +- interactors/index.js | 37 +- interactors/key-value.js | 4 +- interactors/keyboard.js | 37 +- interactors/layer.js | 4 +- interactors/list.js | 10 +- interactors/messagebanner.js | 5 +- interactors/metasection.js | 17 +- interactors/modal.js | 4 +- interactors/multi-column-list.js | 71 +- interactors/multi-select.js | 56 +- interactors/navlist.js | 4 +- interactors/pane.js | 14 +- interactors/quickMarcEditor.js | 32 +- interactors/quickMarcEditorRow.js | 9 +- interactors/radio-button-group.js | 11 +- interactors/radio-button.js | 4 +- interactors/repeatablefield.js | 27 +- interactors/rich-text-editor.js | 6 +- interactors/search-field.js | 12 +- interactors/section.js | 2 +- interactors/select.js | 26 +- interactors/selection.js | 33 +- interactors/spinner.js | 3 +- interactors/text-field.js | 19 +- interactors/textarea.js | 20 +- interactors/tooltip.js | 6 +- interactors/util.js | 6 +- 928 files changed, 44136 insertions(+), 31235 deletions(-) diff --git a/.eslintrc b/.eslintrc index b2398babd2..daea0b31c7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,10 +10,7 @@ "ecmaVersion": 6, "sourceType": "module" }, - "plugins": [ - "cypress", - "import" - ], + "plugins": ["cypress", "import"], "rules": { "cypress/no-assigning-return-values": "error", "cypress/assertion-before-screenshot": "warn", diff --git a/.github/workflows/build-npm-release.yml b/.github/workflows/build-npm-release.yml index 8bb81e61aa..ecbfb60625 100644 --- a/.github/workflows/build-npm-release.yml +++ b/.github/workflows/build-npm-release.yml @@ -19,7 +19,7 @@ on: jobs: github-actions-ci: - if : ${{ startsWith(github.ref, 'refs/tags/v') }} + if: ${{ startsWith(github.ref, 'refs/tags/v') }} env: YARN_TEST_OPTIONS: '' SQ_ROOT_DIR: '.' @@ -91,7 +91,7 @@ jobs: run: xvfb-run --server-args="-screen 0 1024x768x24" yarn test $YARN_TEST_OPTIONS - name: Run yarn formatjs-compile - if : ${{ env.COMPILE_TRANSLATION_FILES == 'true' }} + if: ${{ env.COMPILE_TRANSLATION_FILES == 'true' }} run: yarn formatjs-compile - name: Generate FOLIO module descriptor @@ -145,7 +145,7 @@ jobs: if: always() with: github_token: ${{ github.token }} - files: "${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml" + files: '${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml' check_name: Jest Unit Test Results comment_mode: update last comment_title: Jest Unit Test Statistics @@ -163,7 +163,7 @@ jobs: if: always() with: github_token: ${{ github.token }} - files: "${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml" + files: '${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml' check_name: BigTest Unit Test Results comment_mode: update last comment_title: BigTest Unit Test Statistics @@ -187,23 +187,23 @@ jobs: - name: Set default branch as env variable run: echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV - # - name: Fetch branches for SonarCloud - # run: git fetch --no-tags ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} +refs/heads/${{ env.DEFAULT_BRANCH }}:refs/remotes/origin/${{ env.DEFAULT_BRANCH }} - - # - name: Run SonarCloud scan - # uses: sonarsource/sonarcloud-github-action@master - # with: - # args: > - # -Dsonar.organization=folio-org - # -Dsonar.projectKey=org.folio:${{ github.event.repository.name }} - # -Dsonar.projectName=${{ github.event.repository.name }} - # -Dsonar.sources=${{ env.SQ_ROOT_DIR }} - # -Dsonar.language=js - # -Dsonar.javascript.lcov.reportPaths=${{ env.SQ_LCOV_REPORT }} - # -Dsonar.exclusions=${{ env.SQ_EXCLUSIONS }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # - name: Fetch branches for SonarCloud + # run: git fetch --no-tags ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} +refs/heads/${{ env.DEFAULT_BRANCH }}:refs/remotes/origin/${{ env.DEFAULT_BRANCH }} + + # - name: Run SonarCloud scan + # uses: sonarsource/sonarcloud-github-action@master + # with: + # args: > + # -Dsonar.organization=folio-org + # -Dsonar.projectKey=org.folio:${{ github.event.repository.name }} + # -Dsonar.projectName=${{ github.event.repository.name }} + # -Dsonar.sources=${{ env.SQ_ROOT_DIR }} + # -Dsonar.language=js + # -Dsonar.javascript.lcov.reportPaths=${{ env.SQ_LCOV_REPORT }} + # -Dsonar.exclusions=${{ env.SQ_EXCLUSIONS }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Set up NPM environment for publishing uses: actions/setup-node@v3 diff --git a/.github/workflows/build-npm.yml b/.github/workflows/build-npm.yml index d4503f0179..eb2c5f8bab 100644 --- a/.github/workflows/build-npm.yml +++ b/.github/workflows/build-npm.yml @@ -10,8 +10,6 @@ # - PUBLISH_MOD_DESCRIPTOR (boolean 'true' or 'false') # - COMPILE_TRANSLATION_FILES (boolean 'true' or 'false') - - name: buildNPM Snapshot on: [push, pull_request] @@ -89,7 +87,7 @@ jobs: if: always() with: github_token: ${{ github.token }} - files: "${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml" + files: '${{ env.JEST_JUNIT_OUTPUT_DIR }}/*.xml' check_name: Jest Unit Test Results comment_mode: update last comment_title: Jest Unit Test Statistics @@ -107,7 +105,7 @@ jobs: if: always() with: github_token: ${{ github.token }} - files: "${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml" + files: '${{ env.BIGTEST_JUNIT_OUTPUT_DIR }}/*.xml' check_name: BigTest Unit Test Results comment_mode: update last comment_title: BigTest Unit Test Statistics @@ -131,23 +129,23 @@ jobs: - name: Set default branch as env variable run: echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV - # - name: Fetch branches for SonarCloud - # run: git fetch --no-tags ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} +refs/heads/${{ env.DEFAULT_BRANCH }}:refs/remotes/origin/${{ env.DEFAULT_BRANCH }} - - # - name: Run SonarCloud scan - # uses: sonarsource/sonarcloud-github-action@master - # with: - # args: > - # -Dsonar.organization=folio-org - # -Dsonar.projectKey=org.folio:${{ github.event.repository.name }} - # -Dsonar.projectName=${{ github.event.repository.name }} - # -Dsonar.sources=${{ env.SQ_ROOT_DIR }} - # -Dsonar.language=js - # -Dsonar.javascript.lcov.reportPaths=${{ env.SQ_LCOV_REPORT }} - # -Dsonar.exclusions=${{ env.SQ_EXCLUSIONS }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # - name: Fetch branches for SonarCloud + # run: git fetch --no-tags ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} +refs/heads/${{ env.DEFAULT_BRANCH }}:refs/remotes/origin/${{ env.DEFAULT_BRANCH }} + + # - name: Run SonarCloud scan + # uses: sonarsource/sonarcloud-github-action@master + # with: + # args: > + # -Dsonar.organization=folio-org + # -Dsonar.projectKey=org.folio:${{ github.event.repository.name }} + # -Dsonar.projectName=${{ github.event.repository.name }} + # -Dsonar.sources=${{ env.SQ_ROOT_DIR }} + # -Dsonar.language=js + # -Dsonar.javascript.lcov.reportPaths=${{ env.SQ_LCOV_REPORT }} + # -Dsonar.exclusions=${{ env.SQ_EXCLUSIONS }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Set up NPM environment for publishing if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} diff --git a/.travis.yml b/.travis.yml index 67158fb522..a08775a54d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,13 @@ dist: trusty node_js: #- "6" - - "7" + - '7' before_script: - - "export DISPLAY=:99" - - "sh -e /etc/init.d/xvfb start" + - 'export DISPLAY=:99' + - 'sh -e /etc/init.d/xvfb start' - sleep 1 # give xvfb some time to start script: - - yarn install - - FOLIO_UI_URL="http://folio-uidemo-test.indexdata.com" DEBUG= yarn test - + - yarn install + - FOLIO_UI_URL="http://folio-uidemo-test.indexdata.com" DEBUG= yarn test diff --git a/CHANGELOG.md b/CHANGELOG.md index 23ee9eeea0..5b332d4fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,190 +2,213 @@ ## 4.6.0 IN PROGRESS -* Export some `@bigtest/react` functions. Refs UITEST-108. +- Export some `@bigtest/react` functions. Refs UITEST-108. ## [4.5.0](https://github.com/folio-org/stripes-testing/tree/v4.5.0) (2023-02-01) + [Full Changelog](https://github.com/folio-org/stripes-testing/compare/v4.4.0...v4.5.0) -* Implement many e-2-e automation tests. -* `