From 754b3bb191296c2896fbbc6772aee1d4f2a5e568 Mon Sep 17 00:00:00 2001 From: Vadym Shchekotilin <86330150+vashjs@users.noreply.github.com> Date: Tue, 16 Apr 2024 23:37:08 +0200 Subject: [PATCH 1/5] FAT-12744 Adjust to changes with "Find" action in bulk edit (#3477) --- ...t-in-app-holdings-electronic-access-link-text.cy.js | 2 +- ...lk-edit-in-app-holdings-electronic-access-uri.cy.js | 2 +- ...p-holdings-electronic-access-url-relationship.cy.js | 2 +- .../support/fragments/bulk-edit/bulk-edit-actions.js | 10 ++++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js index 215c41dab9..f7657a5339 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js @@ -89,7 +89,7 @@ describe('bulk-edit', () => { BulkEditActions.verifyOptionsDropdown(); BulkEditActions.isSelectActionAbsent(); BulkEditActions.selectOption('Link text'); - let possibleActions = ['Clear field', 'Find', 'Replace with']; + let possibleActions = ['Clear field', 'Find (full field search)', 'Replace with']; BulkEditActions.verifyPossibleActions(possibleActions); BulkEditActions.selectSecondAction('Clear field'); BulkEditActions.addNewBulkEditFilterString(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-uri.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-uri.cy.js index f8e0fde215..c354cf9a58 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-uri.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-uri.cy.js @@ -89,7 +89,7 @@ describe('bulk-edit', () => { BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Electronic access'); BulkEditActions.openInAppStartBulkEditFrom(); BulkEditActions.selectOption('URI'); - const possibleActions = ['Clear field', 'Find', 'Replace with']; + const possibleActions = ['Clear field', 'Find (full field search)', 'Replace with']; BulkEditActions.verifyPossibleActions(possibleActions); BulkEditActions.selectAction('Clear field'); BulkEditActions.addNewBulkEditFilterString(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-url-relationship.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-url-relationship.cy.js index 2a06efd296..353f6515c7 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-url-relationship.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-url-relationship.cy.js @@ -92,7 +92,7 @@ describe('bulk-edit', () => { BulkEditActions.verifyOptionsDropdown(); BulkEditActions.isSelectActionAbsent(); BulkEditActions.selectOption('URL Relationship'); - let possibleActions = ['Clear field', 'Find', 'Replace with']; + let possibleActions = ['Clear field', 'Find (full field search)', 'Replace with']; BulkEditActions.verifyPossibleActions(possibleActions); BulkEditActions.selectSecondAction('Clear field'); BulkEditActions.addNewBulkEditFilterString(); diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index 9e016f7cf1..08608e45a3 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -515,7 +515,7 @@ export default { }, verifyItemAdminstrativeNoteActions(rowIndex = 0) { - const options = ['Add note', 'Remove all', 'Find', 'Change note type']; + const options = ['Add note', 'Remove all', 'Find (full field search)', 'Change note type']; cy.do([ RepeatableFieldItem({ index: rowIndex }) .find(bulkPageSelections.valueType) @@ -578,7 +578,9 @@ export default { findValue(type, rowIndex = 0) { cy.do([ RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose(type), - RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).choose('Find'), + RepeatableFieldItem({ index: rowIndex }) + .find(bulkPageSelections.action) + .choose('Find (full field search)'), ]); }, @@ -620,7 +622,7 @@ export default { 'Remove mark as staff only', 'Add note', 'Remove all', - 'Find', + 'Find (full field search)', 'Change note type', 'Duplicate to', ]; @@ -639,7 +641,7 @@ export default { 'Remove mark as staff only', 'Add note', 'Remove all', - 'Find', + 'Find (full field search)', 'Change note type', ]; cy.do([ From b27b50f1e4112c60f3d28c51d7befb0ac7255e53 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Wed, 17 Apr 2024 17:48:35 +0500 Subject: [PATCH 2/5] FAT-12549 (#3491) --- ...holdings-electronic-access-link-text.cy.js | 1 - ...ldings-electronic-access-public-note.cy.js | 134 ++++++++++++++++++ .../bulk-edit/bulk-edit-search-pane.js | 4 + .../fragments/inventory/holdingsRecordView.js | 5 + 4 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-public-note.cy.js diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js index f7657a5339..4a9d68c454 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-link-text.cy.js @@ -45,7 +45,6 @@ describe('bulk-edit', () => { electronicAccess: [ { linkText: textWithSpecialCharacters, - // relationshipId: electronicAccessRelationshipId.RESOURCE, uri: 'uri.com', }, ], diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-public-note.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-public-note.cy.js new file mode 100644 index 0000000000..d23d80dd02 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-public-note.cy.js @@ -0,0 +1,134 @@ +import permissions from '../../../support/dictionary/permissions'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import ExportFile from '../../../support/fragments/data-export/exportFile'; + +let user; +const item = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; +const publicNote = 'publicNote'; +const newPublicNote = 'new publicNote'; +const holdingUUIDsFileName = `holdingUUIDs_${getRandomPostfix()}.csv`; +const matchedRecordsFileName = `*-Matched-Records-${holdingUUIDsFileName}`; +const previewFileName = `*-Updates-Preview-${holdingUUIDsFileName}`; +const changedRecordsFileName = `*-Changed-Records-${holdingUUIDsFileName}`; + +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.holdingsHRID = holdings[0].hrid; + FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, holdings[0].id); + cy.updateHoldingRecord(holdings[0].id, { + ...holdings[0], + electronicAccess: [ + { + publicNote, + uri: 'uri.com', + }, + ], + }); + }, + ); + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading, + }); + }); + }); + + after('delete test data', () => { + cy.getAdminToken(); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask( + matchedRecordsFileName, + changedRecordsFileName, + previewFileName, + ); + Users.deleteViaApi(user.userId); + }); + + it( + 'C422240 Verify Bulk Edit for Holding populated with "URL public note" in electronic access (firebird)', + { tags: ['criticalPath', 'firebird'] }, + () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); + BulkEditSearchPane.uploadFile(holdingUUIDsFileName); + BulkEditSearchPane.checkForUploading(holdingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditActions.downloadMatchedResults(); + BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Electronic access'); + BulkEditSearchPane.verifySpecificItemsMatched(publicNote); + ExportFile.verifyFileIncludes(matchedRecordsFileName, [publicNote]); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.verifyRowIcons(); + BulkEditActions.verifyOptionsDropdown(); + BulkEditActions.isSelectActionAbsent(); + BulkEditActions.selectOption('URL public note'); + let possibleActions = ['Clear field', 'Find (full field search)', 'Replace with']; + BulkEditActions.verifyPossibleActions(possibleActions); + BulkEditActions.selectSecondAction('Clear field'); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(); + BulkEditActions.verifyOptionAbsentInNewRow('URL public note'); + BulkEditActions.deleteRow(1); + BulkEditActions.selectSecondAction('Replace with'); + BulkEditActions.fillInSecondTextArea(publicNote); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.findValue('URL public note'); + possibleActions = ['Replace with', 'Remove']; + BulkEditActions.verifyPossibleActions(possibleActions); + BulkEditSearchPane.isConfirmButtonDisabled(true); + BulkEditActions.selectSecondAction('Replace with'); + BulkEditSearchPane.isConfirmButtonDisabled(true); + BulkEditActions.fillInFirstTextArea(publicNote); + BulkEditActions.fillInSecondTextArea(newPublicNote); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.selectSecondAction('Remove'); + BulkEditActions.confirmChanges(); + BulkEditSearchPane.verifyInputLabel( + '1 records will be changed if the Commit changes button is clicked. You may choose Download preview to review all changes prior to saving.', + ); + BulkEditSearchPane.verifyElectronicAccessElementByIndex(4, ''); + BulkEditActions.downloadPreview(); + ExportFile.verifyFileIncludes(previewFileName, [';uri.com;;;"']); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyElectronicAccessElementByIndex(4, ''); + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); + ExportFile.verifyFileIncludes(changedRecordsFileName, [';uri.com;;;"']); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.searchByParameter('Holdings HRID', item.holdingsHRID); + InventorySearchAndFilter.selectSearchResultItem(); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.verifyElectronicAccessByElementIndex(4, '-'); + }, + ); + }); +}); 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 f1f8b989c2..e9028c1467 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -1282,4 +1282,8 @@ export default { Checkbox({ disabled: false }).absent(), ]); }, + + verifyElectronicAccessElementByIndex(index, expectedText) { + cy.get('[class^="ElectronicAccess"]').find('td').eq(index).should('contain.text', expectedText); + }, }; diff --git a/cypress/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index 29effdef84..d095b6b2bf 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -209,6 +209,11 @@ export default { verifyElectronicAccess: (uri) => { cy.expect(electronicAccessAccordion.find(HTML(uri)).exists()); }, + verifyElectronicAccessByElementIndex: (index, content) => { + cy.expect( + electronicAccessAccordion.find(MultiColumnListCell({ columnIndex: index, content })).exists(), + ); + }, getHoldingsHrId: () => cy.then(() => holdingHrIdKeyValue.value()), getRecordLastUpdatedDate: () => cy.then(() => { return cy From c5e01cf6a963200ecbf54d6518910a04d663f0c3 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 17 Apr 2024 18:11:30 +0500 Subject: [PATCH 3/5] FAT-12468/C436829 (#3487) * added test C436829 * small change --- ...se-url-before-linking-while-creating.cy.js | 287 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC436829.mrc | 1 + 2 files changed, 288 insertions(+) create mode 100644 cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-before-linking-while-creating.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC436829.mrc diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-before-linking-while-creating.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-before-linking-while-creating.cy.js new file mode 100644 index 0000000000..a27e0d0592 --- /dev/null +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-before-linking-while-creating.cy.js @@ -0,0 +1,287 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; +import Permissions from '../../../../../support/dictionary/permissions'; +import DataImport from '../../../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; +import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities'; +import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; +import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; +import TopMenu from '../../../../../support/fragments/topMenu'; +import Users from '../../../../../support/fragments/users/users'; +import getRandomPostfix from '../../../../../support/utils/stringTools'; +import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; + +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Create new MARC bib', () => { + describe('Manual linking', () => { + let userData = {}; + + const testData = { + tag245: '245', + tag245Content: 'Record for linking: base URL with "http://" protocol before linking', + searchAuthorityQueries: [ + 'C436829 Whiteread, Rachel, 1963-', + 'C436829 Martini, Carlo Maria, 1927-2012. Works. Selections', + 'C436829 St. Louis Art Museum', + 'C436829 Tate Britain (Gallery)', + 'C436829 Action and adventure fiction', + ], + marcAuthIcon: 'Linked to MARC authority', + }; + + const linkedTags = [ + [ + 5, + '100', + '\\', + '\\', + '$a C436829 Whiteread, Rachel, $d 1963-', + '$e artist.', + '$0 http://id.loc.gov/authorities/names/nr94042914', + '', + ], + [6, '240', '\\', '\\', '$a Works. $k Selections', '', '$0 2018019878', ''], + [ + 7, + '655', + '\\', + '\\', + '$a C436829 Action and adventure fiction', + '', + '$0 https://vocabularyserver.com/gsafd/gsafd2014026217', + '$2 lcgft', + ], + [ + 8, + '710', + '\\', + '\\', + '$a C436829 Tate Britain (Gallery)', + '$e organizer, $e host institution.', + '$0 http://linking.com/automated/tests/protocolhttp/os000208089', + '', + ], + [ + 9, + '710', + '\\', + '\\', + '$a C436829 St. Louis Art Museum', + '$e host institution.', + '$0 https://linking.com/automated/tests/protocolhttps/osw790055919', + '', + ], + ]; + + const newMarcAuthoritySources = [ + { + sourceName: `Test auth source file ${getRandomPostfix()}`, + prefix: 'os', + startWithNumber: '1', + isChecked: false, + baseUrl: 'http://linking.com/automated/tests/protocolhttp', + }, + { + sourceName: `Test auth source file ${getRandomPostfix()}`, + prefix: 'osw', + startWithNumber: '1', + isChecked: false, + baseUrl: 'https://linking.com/automated/tests/protocolhttps', + }, + ]; + + const marcFiles = [ + { + marc: 'marcAuthFileForC436829.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 5, + propertyName: 'authority', + }, + ]; + + const newFields = [ + { + rowIndex: 4, + tag: '100', + content: + '$a C436829 Whiteread, Rachel, $e artist. $0 https://id.loc.gov/authorities/names/nr94042914', + }, + { + rowIndex: 5, + tag: '240', + content: '$a C436829 Works. $0 https://notspecifiedsource/2018019878', + }, + { + rowIndex: 6, + tag: '655', + content: + '$a C436829 Adventire $2 lcgft $0 https://vocabularyserver.com/gsafd/gsafd2014026217', + }, + { + rowIndex: 7, + tag: '710', + content: + '$a C436829 Tate Britain (Gallery), $e organizer, $e host institution. $0 https://linking.com/os000208089', + }, + { + rowIndex: 8, + tag: '710', + content: + '$a C436829 St. Louis Art Museum, $e host institution. $0 https://linking.com/automated/tests/protocolhttps/osw790055919', + }, + ]; + + const linkingTagAndValues = [ + { + rowIndex: 5, + value: 'C436829 Whiteread, Rachel, 1963-', + tag: 100, + }, + { + rowIndex: 6, + value: 'C436829 Martini, Carlo Maria 1927-2012. Works. Selections', + tag: 240, + }, + { + rowIndex: 7, + value: 'C436829 Action and adventure fiction', + tag: 655, + }, + { + rowIndex: 8, + value: 'C436829 Tate Britain (Gallery)', + tag: 710, + }, + { + rowIndex: 9, + value: 'C436829 St. Louis Art Museum', + tag: 710, + }, + ]; + + const createdRecordIDs = []; + const createdAuthSources = []; + + before(() => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorCreate.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + userData = createdUserProperties; + + testData.searchAuthorityQueries.forEach((query) => { + MarcAuthorities.getMarcAuthoritiesViaApi({ + limit: 100, + query: `keyword="${query}" and (authRefType==("Authorized" or "Auth/Ref"))`, + }).then((authorities) => { + if (authorities) { + authorities.forEach(({ id }) => { + MarcAuthority.deleteViaAPI(id); + }); + } + }); + }); + + newMarcAuthoritySources.forEach((source) => { + cy.createAuthoritySourceFileUsingAPI( + source.prefix, + source.startWithNumber, + source.sourceName, + source.isChecked, + source.baseUrl, + // TO DO: remove `failOnStatusCode = false` after MODELINKS-210 is done + true, + ).then((sourceId) => { + createdAuthSources.push(sourceId); + }); + }); + + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(userData.username, userData.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Deleting created users, Instances', () => { + cy.getAdminToken(); + Users.deleteViaApi(userData.userId); + for (let i = 0; i < 5; i++) { + MarcAuthority.deleteViaAPI(createdRecordIDs[i]); + } + InventoryInstance.deleteInstanceViaApi(createdRecordIDs[5]); + // TO DO: remove `failOnStatusCode = false` after MODELINKS-210 is done + for (let i = 0; i < 2; i++) { + cy.deleteAuthoritySourceFileViaAPI(createdAuthSources[i], true); + } + }); + + it( + 'C436829 Protocol is displayed in subfield "$0" of manually linked field when field has base URL with "http://" protocol before linking (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + InventoryInstance.newMarcBibRecord(); + QuickMarcEditor.checkPaneheaderContains('Create a new MARC bib record'); + QuickMarcEditor.updateExistingField(testData.tag245, `$a ${testData.tag245Content}`); + QuickMarcEditor.updateLDR06And07Positions(); + newFields.forEach((newField) => { + MarcAuthority.addNewField(newField.rowIndex, newField.tag, newField.content); + }); + 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); + }); + linkedTags.forEach((field) => { + QuickMarcEditor.verifyTagFieldAfterLinking(...field); + }); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.getId().then((id) => { + createdRecordIDs.push(id); + }); + + InventoryInstance.viewSource(); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t100\t \t$a C436829 Whiteread, Rachel, $d 1963- $e artist. $0 http://id.loc.gov/authorities/names/nr94042914 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t240\t \t$a Works. $k Selections $0 2018019878 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t655\t \t$a C436829 Action and adventure fiction $0 https://vocabularyserver.com/gsafd/gsafd2014026217 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t710\t \t$a C436829 Tate Britain (Gallery) $e organizer, $e host institution. $0 http://linking.com/automated/tests/protocolhttp/os000208089 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t710\t \t$a C436829 St. Louis Art Museum $e host institution. $0 https://linking.com/automated/tests/protocolhttps/osw790055919 $9`, + ); + }, + ); + }); + }); + }); +}); diff --git a/cypress/fixtures/marcAuthFileForC436829.mrc b/cypress/fixtures/marcAuthFileForC436829.mrc new file mode 100644 index 0000000000..e3c7a6bf15 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC436829.mrc @@ -0,0 +1 @@ +01300cz a2200253n 4500001000800000005001700008008004100025010001700066035002300083040003900106046002100145100003800166370003400204372002000238373004600258374004600304375001900350377000800369670007600377670009000453670047900543953000901022985001501031126826720181211073550.0941216n| azannaabn n aaa c anr 94042914  a(OCoLC)oca03740903 aMH-FAbengerdacMH-FAdMH-FAdScU f1963-04-202edtf1 aC436829 Whiteread, Rachel,d1963- aIlford (London, England)2naf aSculpture2lcsh aSlade School of Fine Art2nafs1985t1987 aWomen sculptorsaSculptorsaArtists2lcsh aFemales2lcdgt aeng aRachel Whiteread, c1993:bp. 88 (b. 4/20/1963 London) p. 7 (sculptress) aLC database, 12/17/1994b(MLC hdg: Whiteread, Rachel, 1963-; usage: Rachel Whiteread) aThe Tate web site, December 7, 2018:b(Rachel Whiteread, born 1963 ; Rachel Whiteread, CBE (born 20 April 1963) is an English artist who primarily produces sculptures, which typically take the form of casts ; Whiteread was born in 1963 in Ilford. She was briefly at the Cyprus College of Art. From 1985 to 1987 she studied sculpture at Slade School of Art, University College, London, graduating with an MA in 1987)uhttps://www.tate.org.uk/art/artists/rachel-whiteread-2319 axx00 cRLINeLSPC00501cz a2200133n 4500001001100000005001700011008004100028035002300069040002700092100006600119400008900185430003100274670006200305201801987820180507073202.0180410n| azannaabn |a aaa  a(OCoLC)oca11288544 aDLCbengerdacDLCdHU1 aC436829 Martini, Carlo Maria,d1927-2012.tWorks.kSelections1 aC436829 Martini, Carlo Maria,d1927-2012.tGiustizia, etica e politica nella città 0aC436829 Works.kSelections aGiustizia, etica e politica nella città, febbraio 2017.00992cz a2200253n 4500001000800000005001700008008004100025010001800066024006700084035002300151040004500174110003300219368002200252370002700274371005200301410004300353410003500396410005300431510005000484670005900534670012000593952001000713953001500723188470420220726125832.0790122n| azannaabn |a ana  aosw790055919 7 a00000004046667822isni1https://isni.org/isni/0000000404666782 a(OCoLC)oca00239751 aDLCbengerdacDLCdNICdDLCdCMalGdDLC2 aC436829 St. Louis Art Museum aArt museums2lcsh eSaint Louis (Mo.)2naf a1 Fine Arts DrivebSaint LouiscMissourie631101 aC436829 Saint Louis (Mo.).bArt Museum2 aC436829 Saint Louis Art Museum1 aC436829 Saint Louis (Mo.).bSt. Louis Art Museum2 wriPredecessor:aCity Art Museum of St. Louis aBoston. Museum of Fine Arts. The Rathbone years, 1972. aSt. Louis Art Museum WWW site, viewed June 19, 2017b(St. Louis Art Museum, 1 Fine Arts Drive, St. Louis, MO 63110) aRETRO axx00bbe0603367cz a2200289n 4500001000800000005001700008008004100025010001700066035002300083040004500106046001800151110003500169368002200204370002600226510003400252510002600286510002700312510002500339667078400364670005801148670016901206670006401375670006201439670145101501675011002952953001503062513185520160520075503.0000627n| azannaabn |a ana c aos000208089  a(OCoLC)oca05252331 aICAbengerdacICAdUkOxUdICAdDLCdUPB s2000-032edtf2 aC436829 Tate Britain (Gallery) aArt museums2lcsh eLondon (England)2naf2 wriPredecessor:aTate Gallery2 aTate Modern (Gallery)2 aTate Gallery Liverpool2 aTate Gallery St Ives aSummary of Tate web sites, 03-03-01: "The Tate" houses the national collections of British art and of international modern art. Tate Modern, in London's former Bankside Power Station, displays international modern art from 1900 to the present day. Tate Britain, on Millbank, London (formerly the Tate Gallery), is the national gallery of British art from 1500 to the present. Tate Liverpool houses the national collection of modern art in the North of England. Tate St Ives, opened in Cornwall in 1993, also manages the Barbara Hepworth Museum and Sculpture Garden. The National Gallery contains Western European paintings from 1260 to 1900. In 1997 the Tate and National Galleries set the cut-off point between collections at 1900 and exchanged works from the other's time span. aRomantic landscape, c2000:bt.p. verso (Tate Britain) aTate WWW Home page, Jun. 27, 2000:bhome (the original Tate is now Tate Britain) news (Tate Britain at the original Millbank site in London will open Mar. 24, 2000) aRLIN, Jun. 27, 2000b(hdg.: Tate Britain (London, England)) aArtist and empire, 2015:bcolophon (Tate Britain, London) aWikipedia, May 18, 2016b(Tate Britain; Tate Britain (known from 1897 to 1932 as the National Gallery of British Art and from 1932 to 2000 as the Tate Gallery) is an art museum on Millbank in London; it is part of the Tate network of galleries in England, with Tate Modern, Tate Liverpool and Tate St Ives; it is the oldest gallery in the network, having opened in 1897; it houses a substantial collection of the art of the United Kingdom since Tudor times, and in particular has large holdings of the works of J. M. W. Turner, who bequeathed all his own collection to the nation. It is one of the largest museums in the country; the gallery is situated on Millbank, on the site of the former Millbank Prison; construction, undertaken by Higgs and Hill, commenced in 1893, and the gallery opened on 21 July 1897 as the National Gallery of British Art; however, from the start it was commonly known as the Tate Gallery, after its founder Sir Henry Tate, and in 1932 it officially adopted that name; before 2000, the gallery housed and displayed both British and modern collections, but the launch of Tate Modern saw Tate's modern collections move there, while the old Millbank gallery became dedicated to the display of historical and contemporary British art; as a consequence, it was renamed Tate Britain in March 2000; Tate Britain is the national gallery of British art from 1500 to the present day)uhttps://en.wikipedia.org/wiki/Tate_Britain aArt of Bloomsbury, c1999: t.p. verso (Tate Gallery);aTate Modern, 2000: p. 10 (Tate Modern, the gallery) axx00bjk0101382nz a2200241n 4500001000800000005001700008008004100025010002000066035002000086040003000106155004100136455002700177455003000204455003300234455003600267555001500303670049500318670023100813910005301044985000801097985002301105906001201128985891320150514055905.0141201|| anznnbabn |a ana c agsafd2014026217 agsafd2014026217 aIlChALCSbengcDLCflcgft aC436829 Action and adventure fiction aC436829 Action fiction aC436829 Adventure fiction aC436829 Swashbuckler fiction aC436829 Swashbucklers (Fiction) wgaFiction aSaricks, J. Readers' advisory guide to genre fiction, 2009:bp. 17 (novels in the Adventure genre are action-packed, feature a hero on a mission, and are often set in exotic locales during times of war and peace; characteristics of adventure: pacing is generally brisk, as the hero escapes from one dangerous episode to the next; the story line focuses on action, usually a mission; there is always an identifiable hero; detailed settings are important, generally 'elsewhere', i.e. foreign) aGSAFD, 2000b(Adventure fiction. UFs: Adventure stories, Swashbucklers; use for works characterized by an emphasis on physical and often violent action, exotic locales, and dangers, generally with little character development) aProposal saved by tc03 on 04/18/2015 at 09:00:56 aMvI eLiterature project t1515v0 \ No newline at end of file From 7d3a32bcfef4ed227de3ee1504e337f4f37c6f0d Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:47:52 +0500 Subject: [PATCH 4/5] FAT-12386/C423509 (#3493) * Add the test case C423509 * Adjust the test case, add methods * Adjust the test case * Add the test case ID --- ...Auth-record-with-multiple-999-fields.cy.js | 127 ++++++++++++++++++ .../marcAuthority/marcAuthorities.js | 7 + cypress/support/fragments/quickMarcEditor.js | 22 +++ 3 files changed, 156 insertions(+) create mode 100644 cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-multiple-999-fields.cy.js diff --git a/cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-multiple-999-fields.cy.js b/cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-multiple-999-fields.cy.js new file mode 100644 index 0000000000..c927f97d3d --- /dev/null +++ b/cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-multiple-999-fields.cy.js @@ -0,0 +1,127 @@ +import Permissions from '../../../../support/dictionary/permissions'; +import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority'; +import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; +import TopMenu from '../../../../support/fragments/topMenu'; +import Users from '../../../../support/fragments/users/users'; +import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities'; +import ManageAuthorityFiles from '../../../../support/fragments/settings/marc-authority/manageAuthorityFiles'; +import { DEFAULT_FOLIO_AUTHORITY_FILES } from '../../../../support/constants'; + +describe('MARC', () => { + describe('MARC Authority', () => { + describe('Create MARC Authority', () => { + const headerText = 'Create a new MARC authority record'; + const newField010 = { + rowIndex: 3, + tag: '010', + content: '$a n000232', + }; + const newField100 = { + rowIndex: 4, + tag: '100', + content: '$a C423509 999 multiple test', + }; + const newField999 = { + rowIndex: 6, + tag: '999', + content: '$s 999test $i multiple999', + indicator0: 'f', + indicator1: 'f', + }; + const users = {}; + let createdAuthorityId; + + before('Create users, data', () => { + cy.getAdminToken(); + cy.createTempUser([ + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthorityCreate.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordCreate.gui, + ]) + .then((userProperties) => { + users.userProperties = userProperties; + + ManageAuthorityFiles.setAllDefaultFOLIOFilesToActiveViaAPI(); + }) + .then(() => { + cy.login(users.userProperties.username, users.userProperties.password, { + path: TopMenu.marcAuthorities, + waiter: MarcAuthorities.waitLoading, + }); + }); + }); + + after('Delete users, data', () => { + cy.getAdminToken(); + Users.deleteViaApi(users.userProperties.userId); + MarcAuthority.deleteViaAPI(createdAuthorityId); + ManageAuthorityFiles.unsetAllDefaultFOLIOFilesAsActiveViaAPI(); + }); + + it( + 'C423509 Create a new MARC authority record with multiple "999" field (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + // 1 Click on "Actions" button in second pane >> Select "+ New" option + MarcAuthorities.clickNewAuthorityButton(); + QuickMarcEditor.checkPaneheaderContains(headerText); + + // 2 Click on "Authority file look-up" hyperlink + // Click on the "Select authority file" placeholder in "Authority file name" dropdown + // Select any option + // Click on the "Save & close" button in "Select authority file" modal + QuickMarcEditor.clickAuthorityLookUpButton(); + QuickMarcEditor.selectAuthorityFile(DEFAULT_FOLIO_AUTHORITY_FILES.LC_NAME_AUTHORITY_FILE); + QuickMarcEditor.clickSaveAndCloseInModal(); + QuickMarcEditor.checkPaneheaderContains(headerText); + + // 3 Add 2 new fields by clicking on "+" icon and fill them as specified: + // 010 \\ "$a < in accordance to selected authority file>>", ex.: "n000232" + // 100 \\ "$a 999 multiple test" + MarcAuthority.addNewField(newField010.rowIndex, newField010.tag, newField010.content); + MarcAuthority.addNewField(newField100.rowIndex, newField100.tag, newField100.content); + QuickMarcEditor.checkContentByTag(newField010.tag, newField010.content); + QuickMarcEditor.checkContentByTag(newField100.tag, newField100.content); + + // 4 Click on the "+" icon next to any field + QuickMarcEditor.addEmptyFields(5); + + // 5 Fill in the added field with following values (fill in in following sequence): + // 4th box - "$s 999test $i multiple999" + // 3rd box - "f" + // 2nd box - "f" + // 1st box - "999" + QuickMarcEditor.fillInFieldValues( + newField999.rowIndex, + newField999.tag, + newField999.content, + newField999.indicator0, + newField999.indicator1, + ); + QuickMarcEditor.checkContent(newField999.content, newField999.rowIndex); + QuickMarcEditor.verifyAllBoxesInARowAreDisabled(newField999.rowIndex); + + // 6 Click on the "Save & close" button + QuickMarcEditor.pressSaveAndClose(); + MarcAuthority.verifyAfterSaveAndClose(); + QuickMarcEditor.verifyPaneheaderWithContentAbsent(headerText); + MarcAuthorities.verifyViewPaneContentExists(); + MarcAuthority.getId().then((id) => { + createdAuthorityId = id; + + MarcAuthorities.checkFieldAndContentExistence( + newField999.tag, + `${newField999.indicator0} ${newField999.indicator1}`, + ); + MarcAuthorities.checkFieldAndContentExistence(newField999.tag, '$s'); + MarcAuthorities.checkFieldAndContentExistence( + newField999.tag, + `$i ${createdAuthorityId}`, + ); + MarcAuthorities.verifyViewPaneContentAbsent(newField999.content); + }); + }, + ); + }); + }); +}); diff --git a/cypress/support/fragments/marcAuthority/marcAuthorities.js b/cypress/support/fragments/marcAuthority/marcAuthorities.js index 138014a647..f94534f023 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthorities.js +++ b/cypress/support/fragments/marcAuthority/marcAuthorities.js @@ -485,6 +485,13 @@ export default { cy.expect([marcViewSection.exists(), marcViewSectionContent.has({ text: including(value) })]); }, + verifyViewPaneContentAbsent(value) { + cy.expect([ + marcViewSection.exists(), + marcViewSectionContent.find(HTML(including(value))).absent(), + ]); + }, + verifyViewPaneContentExists() { cy.expect(marcViewSection.exists()); }, diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index cc365ea3fc..c947920143 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -495,6 +495,13 @@ export default { ]); }, + fillInFieldValues(rowIndex, tag, content, indicator0, indicator1) { + cy.get(`textarea[name="records[${rowIndex}].content"]`).clear().type(content); + cy.get(`input[name="records[${rowIndex}].indicators[1]"]`).type(indicator1); + cy.get(`input[name="records[${rowIndex}].indicators[0]"]`).type(indicator0); + cy.get(`input[name="records[${rowIndex}].tag"]`).type(tag); + }, + deletePenaltField() { const shouldBeRemovedRowNumber = 16; cy.expect(getRowInteractorByRowNumber(shouldBeRemovedRowNumber).exists()); @@ -2644,4 +2651,19 @@ export default { ); }); }, + + verifyAllBoxesInARowAreDisabled(rowNumber, isDisabled = true) { + cy.expect([ + getRowInteractorByRowNumber(rowNumber).find(TextField('Field')).has({ disabled: isDisabled }), + getRowInteractorByRowNumber(rowNumber) + .find(TextArea({ ariaLabel: 'Subfield' })) + .has({ disabled: isDisabled }), + getRowInteractorByRowNumber(rowNumber) + .find(TextField('Indicator', { name: including('.indicators[0]') })) + .has({ disabled: isDisabled }), + getRowInteractorByRowNumber(rowNumber) + .find(TextField('Indicator', { name: including('.indicators[1]') })) + .has({ disabled: isDisabled }), + ]); + }, }; From f9ac05d57f107b89ff9d7753e7e7c8b2b3d0f2bd Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:26:34 +0500 Subject: [PATCH 5/5] added test C436826 (#3494) --- ...ase-url-with-protocol-before-linking.cy.js | 1 - ...-url-without-protocol-before-linking.cy.js | 1 - ...d-without-$0-subfield-before-linking.cy.js | 261 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC436826.mrc | 1 + cypress/fixtures/marcBibFileForC436826.mrc | 1 + 5 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-without-$0-subfield-before-linking.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC436826.mrc create mode 100644 cypress/fixtures/marcBibFileForC436826.mrc diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-with-protocol-before-linking.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-with-protocol-before-linking.cy.js index 4ace194535..ff7a97fa4a 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-with-protocol-before-linking.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-with-protocol-before-linking.cy.js @@ -216,7 +216,6 @@ describe('MARC', () => { InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.checkPaneheaderContains('Edit MARC record'); - QuickMarcEditor.verifyEnabledLinkHeadingsButton(); QuickMarcEditor.checkValueExist(11, testData.url); QuickMarcEditor.checkValueExist(12, testData.url); QuickMarcEditor.checkValueExist(24, testData.url); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-without-protocol-before-linking.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-without-protocol-before-linking.cy.js index 10bfb69ca4..cffae9f212 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-without-protocol-before-linking.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-with-base-url-without-protocol-before-linking.cy.js @@ -216,7 +216,6 @@ describe('MARC', () => { InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.checkPaneheaderContains('Edit MARC record'); - QuickMarcEditor.verifyEnabledLinkHeadingsButton(); QuickMarcEditor.checkValueAbsent(11, testData.url); QuickMarcEditor.checkValueAbsent(12, testData.url); QuickMarcEditor.checkValueAbsent(24, testData.url); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-without-$0-subfield-before-linking.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-without-$0-subfield-before-linking.cy.js new file mode 100644 index 0000000000..1334f7dcbf --- /dev/null +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/protocol-displayed-in-$0-of-manual-linked-field-without-$0-subfield-before-linking.cy.js @@ -0,0 +1,261 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; +import Permissions from '../../../../../support/dictionary/permissions'; +import DataImport from '../../../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; +import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities'; +import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; +import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; +import TopMenu from '../../../../../support/fragments/topMenu'; +import Users from '../../../../../support/fragments/users/users'; +import getRandomPostfix from '../../../../../support/utils/stringTools'; +import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; + +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + let userData = {}; + + const testData = { + searchAuthorityQueries: [ + 'C436826 Whiteread, Rachel, 1963-', + 'C436826 Martini, Carlo Maria, 1927-2012. Works. Selections', + 'C436826 St. Louis Art Museum', + 'C436826 Tate Britain (Gallery)', + 'C436826 Action and adventure fiction', + ], + subfieldZero: '$0', + marcAuthIcon: 'Linked to MARC authority', + }; + + const linkedTags = [ + [ + 11, + '100', + '1', + '\\', + '$a C436826 Whiteread, Rachel, $d 1963-', + '$e artist.', + '$0 http://id.loc.gov/authorities/names/nr94042914', + '', + ], + [12, '240', '1', '0', '$a Works. $k Selections', '', '$0 2018019878', ''], + [ + 24, + '655', + '\\', + '7', + '$a C436826 Action and adventure fiction', + '', + '$0 https://vocabularyserver.com/gsafd/gsafd2014026217', + '$2 lcgft', + ], + [ + 25, + '710', + '2', + '\\', + '$a C436826 Tate Britain (Gallery)', + '$e organizer, $e host institution.', + '$0 http://linking.com/automated/tests/protocolhttp/os000208089', + '', + ], + [ + 26, + '710', + '2', + '\\', + '$a C436826 St. Louis Art Museum', + '$e host institution.', + '$0 https://linking.com/automated/tests/protocolhttps/osw790055919', + '', + ], + ]; + + const newMarcAuthoritySources = [ + { + sourceName: `Test auth source file ${getRandomPostfix()}`, + prefix: 'os', + startWithNumber: '1', + isChecked: false, + baseUrl: 'http://linking.com/automated/tests/protocolhttp', + }, + { + sourceName: `Test auth source file ${getRandomPostfix()}`, + prefix: 'osw', + startWithNumber: '1', + isChecked: false, + baseUrl: 'https://linking.com/automated/tests/protocolhttps', + }, + ]; + + const marcFiles = [ + { + marc: 'marcBibFileForC436826.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC436826.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 5, + propertyName: 'authority', + }, + ]; + + const linkingTagAndValues = [ + { + rowIndex: 11, + value: 'C436826 Whiteread, Rachel, 1963-', + tag: 100, + }, + { + rowIndex: 12, + value: 'C436826 Martini, Carlo Maria 1927-2012. Works. Selections', + tag: 240, + }, + { + rowIndex: 24, + value: 'C436826 Action and adventure fiction', + tag: 655, + }, + { + rowIndex: 25, + value: 'C436826 Tate Britain (Gallery)', + tag: 710, + }, + { + rowIndex: 26, + value: 'C436826 St. Louis Art Museum', + tag: 710, + }, + ]; + + const createdRecordIDs = []; + const createdAuthSources = []; + + before(() => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + userData = createdUserProperties; + + testData.searchAuthorityQueries.forEach((query) => { + MarcAuthorities.getMarcAuthoritiesViaApi({ + limit: 100, + query: `keyword="${query}" and (authRefType==("Authorized" or "Auth/Ref"))`, + }).then((authorities) => { + if (authorities) { + authorities.forEach(({ id }) => { + MarcAuthority.deleteViaAPI(id); + }); + } + }); + }); + + newMarcAuthoritySources.forEach((source) => { + cy.createAuthoritySourceFileUsingAPI( + source.prefix, + source.startWithNumber, + source.sourceName, + source.isChecked, + source.baseUrl, + // TO DO: remove `failOnStatusCode = false` after MODELINKS-210 is done + true, + ).then((sourceId) => { + createdAuthSources.push(sourceId); + }); + }); + + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(userData.username, userData.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Deleting created users, Instances', () => { + cy.getAdminToken(); + Users.deleteViaApi(userData.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + // TO DO: remove `failOnStatusCode = false` after MODELINKS-210 is done + for (let i = 0; i < 2; i++) { + cy.deleteAuthoritySourceFileViaAPI(createdAuthSources[i], true); + } + }); + + it( + 'C436826 Protocol is displayed in subfield "$0" of manually linked field when field has no subfield "$0" before linking (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.checkPaneheaderContains('Edit MARC record'); + QuickMarcEditor.checkValueAbsent(11, testData.subfieldZero); + QuickMarcEditor.checkValueAbsent(12, testData.subfieldZero); + QuickMarcEditor.checkValueAbsent(24, testData.subfieldZero); + QuickMarcEditor.checkValueAbsent(25, testData.subfieldZero); + QuickMarcEditor.checkValueAbsent(26, testData.subfieldZero); + 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); + }); + + linkedTags.forEach((field) => { + QuickMarcEditor.verifyTagFieldAfterLinking(...field); + }); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + + InventoryInstance.viewSource(); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t100\t1 \t$a C436826 Whiteread, Rachel, $d 1963- $e artist. $0 http://id.loc.gov/authorities/names/nr94042914 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t240\t1 0\t$a Works. $k Selections $0 2018019878 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t655\t 7\t$a C436826 Action and adventure fiction $0 https://vocabularyserver.com/gsafd/gsafd2014026217 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t710\t2 \t$a C436826 Tate Britain (Gallery) $e organizer, $e host institution. $0 http://linking.com/automated/tests/protocolhttp/os000208089 $9`, + ); + InventoryViewSource.contains( + `${testData.marcAuthIcon}\n\t710\t2 \t$a C436826 St. Louis Art Museum $e host institution. $0 https://linking.com/automated/tests/protocolhttps/osw790055919 $9`, + ); + }, + ); + }); + }); + }); +}); diff --git a/cypress/fixtures/marcAuthFileForC436826.mrc b/cypress/fixtures/marcAuthFileForC436826.mrc new file mode 100644 index 0000000000..b6d79711cf --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC436826.mrc @@ -0,0 +1 @@ +01300cz a2200253n 4500001000800000005001700008008004100025010001700066035002300083040003900106046002100145100003800166370003400204372002000238373004600258374004600304375001900350377000800369670007600377670009000453670047900543953000901022985001501031126826720181211073550.0941216n| azannaabn n aaa c anr 94042914  a(OCoLC)oca03740903 aMH-FAbengerdacMH-FAdMH-FAdScU f1963-04-202edtf1 aC436826 Whiteread, Rachel,d1963- aIlford (London, England)2naf aSculpture2lcsh aSlade School of Fine Art2nafs1985t1987 aWomen sculptorsaSculptorsaArtists2lcsh aFemales2lcdgt aeng aRachel Whiteread, c1993:bp. 88 (b. 4/20/1963 London) p. 7 (sculptress) aLC database, 12/17/1994b(MLC hdg: Whiteread, Rachel, 1963-; usage: Rachel Whiteread) aThe Tate web site, December 7, 2018:b(Rachel Whiteread, born 1963 ; Rachel Whiteread, CBE (born 20 April 1963) is an English artist who primarily produces sculptures, which typically take the form of casts ; Whiteread was born in 1963 in Ilford. She was briefly at the Cyprus College of Art. From 1985 to 1987 she studied sculpture at Slade School of Art, University College, London, graduating with an MA in 1987)uhttps://www.tate.org.uk/art/artists/rachel-whiteread-2319 axx00 cRLINeLSPC00501cz a2200133n 4500001001100000005001700011008004100028035002300069040002700092100006600119400008900185430003100274670006200305201801987820180507073202.0180410n| azannaabn |a aaa  a(OCoLC)oca11288544 aDLCbengerdacDLCdHU1 aC436826 Martini, Carlo Maria,d1927-2012.tWorks.kSelections1 aC436826 Martini, Carlo Maria,d1927-2012.tGiustizia, etica e politica nella città 0aC436826 Works.kSelections aGiustizia, etica e politica nella città, febbraio 2017.00992cz a2200253n 4500001000800000005001700008008004100025010001800066024006700084035002300151040004500174110003300219368002200252370002700274371005200301410004300353410003500396410005300431510005000484670005900534670012000593952001000713953001500723188470420220726125832.0790122n| azannaabn |a ana  aosw790055919 7 a00000004046667822isni1https://isni.org/isni/0000000404666782 a(OCoLC)oca00239751 aDLCbengerdacDLCdNICdDLCdCMalGdDLC2 aC436826 St. Louis Art Museum aArt museums2lcsh eSaint Louis (Mo.)2naf a1 Fine Arts DrivebSaint LouiscMissourie631101 aC436826 Saint Louis (Mo.).bArt Museum2 aC436826 Saint Louis Art Museum1 aC436826 Saint Louis (Mo.).bSt. Louis Art Museum2 wriPredecessor:aCity Art Museum of St. Louis aBoston. Museum of Fine Arts. The Rathbone years, 1972. aSt. Louis Art Museum WWW site, viewed June 19, 2017b(St. Louis Art Museum, 1 Fine Arts Drive, St. Louis, MO 63110) aRETRO axx00bbe0603367cz a2200289n 4500001000800000005001700008008004100025010001700066035002300083040004500106046001800151110003500169368002200204370002600226510003400252510002600286510002700312510002500339667078400364670005801148670016901206670006401375670006201439670145101501675011002952953001503062513185520160520075503.0000627n| azannaabn |a ana c aos000208089  a(OCoLC)oca05252331 aICAbengerdacICAdUkOxUdICAdDLCdUPB s2000-032edtf2 aC436826 Tate Britain (Gallery) aArt museums2lcsh eLondon (England)2naf2 wriPredecessor:aTate Gallery2 aTate Modern (Gallery)2 aTate Gallery Liverpool2 aTate Gallery St Ives aSummary of Tate web sites, 03-03-01: "The Tate" houses the national collections of British art and of international modern art. Tate Modern, in London's former Bankside Power Station, displays international modern art from 1900 to the present day. Tate Britain, on Millbank, London (formerly the Tate Gallery), is the national gallery of British art from 1500 to the present. Tate Liverpool houses the national collection of modern art in the North of England. Tate St Ives, opened in Cornwall in 1993, also manages the Barbara Hepworth Museum and Sculpture Garden. The National Gallery contains Western European paintings from 1260 to 1900. In 1997 the Tate and National Galleries set the cut-off point between collections at 1900 and exchanged works from the other's time span. aRomantic landscape, c2000:bt.p. verso (Tate Britain) aTate WWW Home page, Jun. 27, 2000:bhome (the original Tate is now Tate Britain) news (Tate Britain at the original Millbank site in London will open Mar. 24, 2000) aRLIN, Jun. 27, 2000b(hdg.: Tate Britain (London, England)) aArtist and empire, 2015:bcolophon (Tate Britain, London) aWikipedia, May 18, 2016b(Tate Britain; Tate Britain (known from 1897 to 1932 as the National Gallery of British Art and from 1932 to 2000 as the Tate Gallery) is an art museum on Millbank in London; it is part of the Tate network of galleries in England, with Tate Modern, Tate Liverpool and Tate St Ives; it is the oldest gallery in the network, having opened in 1897; it houses a substantial collection of the art of the United Kingdom since Tudor times, and in particular has large holdings of the works of J. M. W. Turner, who bequeathed all his own collection to the nation. It is one of the largest museums in the country; the gallery is situated on Millbank, on the site of the former Millbank Prison; construction, undertaken by Higgs and Hill, commenced in 1893, and the gallery opened on 21 July 1897 as the National Gallery of British Art; however, from the start it was commonly known as the Tate Gallery, after its founder Sir Henry Tate, and in 1932 it officially adopted that name; before 2000, the gallery housed and displayed both British and modern collections, but the launch of Tate Modern saw Tate's modern collections move there, while the old Millbank gallery became dedicated to the display of historical and contemporary British art; as a consequence, it was renamed Tate Britain in March 2000; Tate Britain is the national gallery of British art from 1500 to the present day)uhttps://en.wikipedia.org/wiki/Tate_Britain aArt of Bloomsbury, c1999: t.p. verso (Tate Gallery);aTate Modern, 2000: p. 10 (Tate Modern, the gallery) axx00bjk0101382nz a2200241n 4500001000800000005001700008008004100025010002000066035002000086040003000106155004100136455002700177455003000204455003300234455003600267555001500303670049500318670023100813910005301044985000801097985002301105906001201128985891320150514055905.0141201|| anznnbabn |a ana c agsafd2014026217 agsafd2014026217 aIlChALCSbengcDLCflcgft aC436826 Action and adventure fiction aC436826 Action fiction aC436826 Adventure fiction aC436826 Swashbuckler fiction aC436826 Swashbucklers (Fiction) wgaFiction aSaricks, J. Readers' advisory guide to genre fiction, 2009:bp. 17 (novels in the Adventure genre are action-packed, feature a hero on a mission, and are often set in exotic locales during times of war and peace; characteristics of adventure: pacing is generally brisk, as the hero escapes from one dangerous episode to the next; the story line focuses on action, usually a mission; there is always an identifiable hero; detailed settings are important, generally 'elsewhere', i.e. foreign) aGSAFD, 2000b(Adventure fiction. UFs: Adventure stories, Swashbucklers; use for works characterized by an emphasis on physical and often violent action, exotic locales, and dangers, generally with little character development) aProposal saved by tc03 on 04/18/2015 at 09:00:56 aMvI eLiterature project t1515v0 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC436826.mrc b/cypress/fixtures/marcBibFileForC436826.mrc new file mode 100644 index 0000000000..8136d4c83b --- /dev/null +++ b/cypress/fixtures/marcBibFileForC436826.mrc @@ -0,0 +1 @@ +02239cam a2200373Ii 45000010011000000030006000110050017000170080041000340400028000750190015001030200018001180200015001360350041001510500023001920820015002151000047002302400031002772450158003082640069004662640011005353000053005463360026005993360033006253370028006583380027006865000318007135040067010315050344010986550037014427100067014797100053015467750181015999800085017801004491102OCoLC20180601032826.9170922r20182017gw a bc 001 0deng d aYDXbengerdacYDXdCPL a1036093532 a9783791357355 a3791357352 a(OCoLC)1004491102z(OCoLC)1036093532 4aNB497.W54bA4 201804a730.922231 aC436826 Whiteread, Rachel,d1963-eartist.10aC436826 Works.kSelections10aNo subfield S0 Rachel Whiteread /cedited by Ann Gallagher and Molly Donovan ; co-organised by Tate Britain, and the National Gallery of Art, Washington. 1aMunich ;aLondon ;aNew York :bDelMonico Books/Prestel,c[2018] 4c©2017 a237 pages :billustrations (some color) ;c30 cm atextbtxt2rdacontent astill imagebsti2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aPublished to accompany an exhibition of the same name held at Tate Britain, September 12, 2017-January 21, 2018; 21er Haus, Museum of Contemporary Art, Vienna, March 7-July 29, 2018; National Gallery of Art, Washington, September 16, 2018-January 13, 2019; Saint Louis Art Museum, Missouri, March 17-June 9, 2019. aIncludes bibliographical references (pages 219-222) and index.0 aMaterial culture / Ann Gallagher -- Vies trouvées (found lives) / Molly Donovan -- House / Rachel Whiteread and James Lingwood in conversation with Ann Gallagher -- Art as memorial / Harald Krejci -- Sense and sensibility / Lynn Zelevansky -- Eyes cast / Briony Fer -- The power of things / Linsey Young -- The dream site / Brian Dillon. 7aC436826 Adventire fiction2lcgft2 aC436826 Tate Britain (Gallery),eorganizer,ehost institution.2 aC436826 St. Louis Art Museum,ehost institution.08iReprint of (manifestation):aWhiteread, Rachel, 1963-sWorks. Selections.tRachel Whiteread.dLondon : Tate Publishing, 2017z9781849764643w(DLC) 2017479502w(OCoLC)990681867 a40028236020bART2cGendJRLeYBPg509548h606334i180611lClothm49.95q1j49.95 \ No newline at end of file