From c44465eb52caa986d66ba22b8a03c91c0a8eb439 Mon Sep 17 00:00:00 2001 From: TatianaOne Date: Sun, 3 Dec 2023 15:10:02 +0200 Subject: [PATCH 1/4] added test --- ...lidation-when-edit-imported-marc-bib.cy.js | 131 ++++++++++++++++++ cypress/fixtures/marcBibFileForC387451.mrc | 1 + 2 files changed, 132 insertions(+) create mode 100644 cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js create mode 100644 cypress/fixtures/marcBibFileForC387451.mrc diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js new file mode 100644 index 0000000000..24fdfa67df --- /dev/null +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js @@ -0,0 +1,131 @@ +import Permissions from '../../../../support/dictionary/permissions'; +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 InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; +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 InventorySteps from '../../../../support/fragments/inventory/inventorySteps'; +import DateTools from '../../../../support/utils/dateTools'; + +describe('MARC -> MARC Bibliographic -> Edit MARC bib', () => { + const testData = { + createdRecordIDs: [], + tag245: '245', + tag245content: + '$aWicked :$bthe life and times of the wicked witch of the West : a novel /$cGregory Maguire ; illustrations by Douglas Smith. TEST', + tag245RowIndex: 12, + tag008: '008', + tag008RowIndex: 3, + tag00: '00', + expected008BoxesSets: [ + 'DtSt', + 'Start date', + 'End date', + 'Ctry', + 'Ills', + 'Audn', + 'Form', + 'Cont', + 'GPub', + 'Conf', + 'Fest', + 'Indx', + 'LitF', + 'Biog', + 'Lang', + 'MRec', + 'Srce', + ], + tag008BoxValues: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + calloutMessage: + 'This record has successfully saved and is in process. Changes may not appear immediately.', + errorCalloutMessage: 'Record cannot be saved without 008 field', + initial008EnteredValue: DateTools.getCurrentDateYYMMDD(), + }; + const marcFile = { + marc: 'marcBibFileForC387451.mrc', + fileName: `testMarcFile${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }; + + before('Creating user and data', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.moduleDataImportEnabled.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; + + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.waitFileIsUploaded(); + JobProfiles.search(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) => { + testData.createdRecordIDs.push(link.split('/')[5]); + }); + } + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Deleting created user and data', () => { + cy.getAdminToken().then(() => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(testData.createdRecordIDs[0]); + }); + }); + + it( + 'C387451 "008" field existence validation when edit imported "MARC bib" (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(testData.createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.checkEditableQuickMarcFormIsOpened(); + QuickMarcEditor.updateExistingFieldContent(testData.tag245RowIndex, testData.tag245content); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkCallout(testData.errorCalloutMessage); + QuickMarcEditor.closeCallout(); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.checkCallout(testData.errorCalloutMessage); + QuickMarcEditor.closeCallout(); + QuickMarcEditor.addNewField(testData.tag008, '', testData.tag008RowIndex); + QuickMarcEditor.check008FieldLabels(testData.expected008BoxesSets); + QuickMarcEditor.updateExistingTagValue(4, testData.tag00); + QuickMarcEditor.verifyTagValue(4, testData.tag00); + QuickMarcEditor.checkContent('', 4); + QuickMarcEditor.checkDeleteButtonExist(4); + QuickMarcEditor.updateExistingTagValue(4, testData.tag008); + QuickMarcEditor.pressSaveAndKeepEditing(testData.calloutMessage); + QuickMarcEditor.checkEditableQuickMarcFormIsOpened(); + QuickMarcEditor.check008FieldContent(); + QuickMarcEditor.updateValuesIn008Boxes(testData.tag008BoxValues); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventorySteps.verifyHiddenFieldValueIn008( + testData.createdRecordIDs[0], + 'Entered', + testData.initial008EnteredValue, + ); + }, + ); +}); diff --git a/cypress/fixtures/marcBibFileForC387451.mrc b/cypress/fixtures/marcBibFileForC387451.mrc new file mode 100644 index 0000000000..2c829b4fc8 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC387451.mrc @@ -0,0 +1 @@ +01717cam a2200361 a 25700010008000000030004000080050017000120200022000290350029000510350014000800350020000940350028001140350028001420400037001701000101002072450128003082500028004362600035004643000029004993360073005283370071006013380069006726500088007416500072008296500060009016550068009616550060010296550071010899030009011609290008011699280084011779270094012612731881ICU20060307202900.0 a0060987103 (pbk.) a(CStRLIN)NYPGR35851444-B ahz2731881 a(OCoLC)35851444 a(NhCcYBP)YBTybp90005871 a(NhCcYBP)YBP40000808366 a*LPU*c*LPU*dOCoLCdNNdCStRLIN1 aMaguire, Gregory.0http://id.loc.gov/authorities/names/n780253161http://viaf.org/viaf/26723061010aWicked :bthe life and times of the wicked witch of the West : a novel /cGregory Maguire ; illustrations by Douglas Smith. a1st HarperPerennial ed. aNew York :bReganBooks,c1996. a406 p. :bill. ;c21 cm. atextbtxt2rdacontent0http://id.loc.gov/vocabulary/contentTypes/txt aunmediatedbn2rdamedia0http://id.loc.gov/vocabulary/mediaTypes/n avolumebnc2rdacarrier0http://id.loc.gov/vocabulary/carriers/nc 0aOz (Imaginary place)vFiction.0http://id.loc.gov/authorities/subjects/sh2010104675 7aOz (Imaginary place)2fast0http://id.worldcat.org/fast/fst01049738 7aWitches.2fast0http://id.worldcat.org/fast/fst01176346 7aFantasy fiction.2fast0http://id.worldcat.org/fast/fst01726607 7aFiction.2fast0http://id.worldcat.org/fast/fst01423787 7aParanormal fiction.2fast0http://id.worldcat.org/fast/fst01921727 aHeVa acat tLibrary of Congress classificationaPS3563.A3535 W5 1996lDLLcDLL-Lawi3242943 tLibrary of Congress classificationaPS3563.A3535 W5 1996lDLLcDLL-Lawb65894424i4967207 \ No newline at end of file From 28bd0e84ba36cd946cb0217a7f2ea798059f9fd9 Mon Sep 17 00:00:00 2001 From: ali-soft-engineer <147161616+ali-soft-engineer@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:04:07 +0500 Subject: [PATCH 2/4] test C375071 (#2562) --- ...linking-bibField651-to-authority-151.cy.js | 158 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC375071.mrc | 1 + cypress/fixtures/marcBibFileForC375071.mrc | 1 + 3 files changed, 160 insertions(+) create mode 100644 cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField651-to-authority-151.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC375071.mrc create mode 100644 cypress/fixtures/marcBibFileForC375071.mrc diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField651-to-authority-151.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField651-to-authority-151.cy.js new file mode 100644 index 0000000000..b2735b7838 --- /dev/null +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField651-to-authority-151.cy.js @@ -0,0 +1,158 @@ +import { Permissions } from '../../../../../support/dictionary'; +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 InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; +import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; +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'; + +describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { + const testData = { + tag651: '651', + authorityMarkedValue: 'C375071 Clear Creek (Tex.)', + subjectValue: 'C375071 Clear Creek (Tex.)--Place in Texas--Form', + authorityIconText: 'Linked to MARC authority', + accordion: 'Subject', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC375071.mrc', + fileName: `testMarcBibFileC375071.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + }, + { + marc: 'marcAuthFileForC375071.mrc', + fileName: `testMarcAuthFileC375071.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C375071 Clear Creek (Tex.) Place in Texas', + }, + ]; + + const createdRecordIDs = []; + const bib651InitialFieldValues = [ + 20, + testData.tag651, + '\\', + '0', + '$a C375071 Creek (Texas) $g Lake $v Form $3 papers', + ]; + const bib651UnlinkedFieldValues = [ + 20, + testData.tag651, + '\\', + '0', + '$a C375071 Clear Creek (Tex.) $g Place in Texas $v Form $0 id.loc.gov/authorities/names/n79041362 $3 papers', + ]; + const bib651LinkedFieldValues = [ + 20, + testData.tag651, + '\\', + '0', + '$a C375071 Clear Creek (Tex.) $g Place in Texas', + '$v Form', + '$0 id.loc.gov/authorities/names/n79041362', + '$3 papers', + ]; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; + + cy.loginAsAdmin().then(() => { + marcFiles.forEach((marcFile) => { + cy.visit(TopMenu.dataImportPath); + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.search(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.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Deleting created user', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it( + 'C375071 Link the "651" of "MARC Bib" field with "151" field of "MARC Authority" record. (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib651InitialFieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag651); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag651); + QuickMarcEditor.verifyTagFieldAfterLinking(...bib651LinkedFieldValues); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.verifyInstanceSubject( + 2, + 0, + `${testData.authorityIconText}${testData.subjectValue}`, + ); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane(testData.accordion); + InventoryInstance.clickViewAuthorityIconDisplayedInInstanceDetailsPane(testData.accordion); + MarcAuthorities.checkDetailViewIncludesText(testData.authorityMarkedValue); + InventoryInstance.goToPreviousPage(); + // Wait for the content to be loaded. + cy.wait(6000); + InventoryInstance.waitLoading(); + InventoryInstance.viewSource(); + InventoryInstance.checkExistanceOfAuthorityIconInMarcViewPane(); + InventoryInstance.clickViewAuthorityIconDisplayedInMarcViewPane(); + MarcAuthorities.checkDetailViewIncludesText(testData.authorityMarkedValue); + InventoryInstance.goToPreviousPage(); + // Wait for the content to be loaded. + cy.wait(6000); + InventoryViewSource.waitLoading(); + InventoryViewSource.close(); + InventoryInstance.waitLoading(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterLinking(...bib651LinkedFieldValues); + QuickMarcEditor.clickUnlinkIconInTagField(bib651UnlinkedFieldValues[0]); + QuickMarcEditor.confirmUnlinkingField(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib651UnlinkedFieldValues); + QuickMarcEditor.verifyIconsAfterUnlinking(bib651UnlinkedFieldValues[0]); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane(testData.accordion); + InventoryInstance.viewSource(); + InventoryInstance.checkAbsenceOfAuthorityIconInMarcViewPane(); + }, + ); +}); diff --git a/cypress/fixtures/marcAuthFileForC375071.mrc b/cypress/fixtures/marcAuthFileForC375071.mrc new file mode 100644 index 0000000000..5d6642e358 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC375071.mrc @@ -0,0 +1 @@ +00696cz a2200193n 4500001000800000005001700008008004100025010001700066034005300083035002300136040002500159043001200184151005300196451003600249670009600285670008900381781002300470953000900493421542120100511071405.0790508n| acannaabn |a ana  an 79041362  dW1001933eW1001933fN0355622gN03556222geonames a(OCoLC)oca00274820 aDLCbengcDLCdOCoLC an-us-tx aC375071 Clear Creek (Tex.)gPlace in Texas8test wnnaaaC375071 Clear Creek, Tex. aC375071 Odell, B. Return to Clear Creek, c1978- (subj.)bt.p. (Clear Creek) p. 22 (in Tex.) aC375071 GeoNames, algorithmically matched, 2009b(ppl; 35°56ʹ22ʺN 100°19ʹ33ʺW) 0zTexaszClear Creek abe84 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC375071.mrc b/cypress/fixtures/marcBibFileForC375071.mrc new file mode 100644 index 0000000000..fe3b5057e0 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC375071.mrc @@ -0,0 +1 @@ +01365nam a22003011a 4500001001000000005001700010006001900027007001500046008004100061003000400102035002800106040001300134110007200147245006900219246006500288260003300353300003200386490001400418500018800432510004800620533013100668650002900799650001800828651004600846710003600892856010800928903002701036in962061620131122092900.0m o d cr un mmmapmmp080123s1941 dcubd o f000 0 eng dICU a(ProQuest)cis2004212586 aUMIcUMI1 aUnited States.bCongress.bHouse.bCommittee on Rivers and Harbors.10aC375071 Clear Creek and Clear Lake, Tex.h[electronic resource].1 aReport on reexamination of Clear Creek and Clear Lake, Texas aWashington :b[s.n.],c1941. a21 p. :bdigital, PDF file.0 aH.doc.319 aRecord is based on bibliographic data in ProQuest U.S. Serial Set Digital Collection (last viewed Jan. 2008). Reuse except for individual research requires license from ProQuest, LLC.3 aProQuest U.S. Serial Set Digital Collection aElectronic resource.b[Bethesda, Md.]:cProQuest,d2004.f(ProQuest U.S. Serial Set Digital Collection : no. 10600 H.doc.319). 0aTopographical surveying. 0aLakeszTexas. 0aC375071 Creek (Texas)gLakevForm3papers1 aUnited States.bWar Department.40uhttp://congressional.proquest.com/congcomp/getdoc?SERIAL-SET-ID=10600+H.doc.319yProQuest Congressional aProQuest US Serial Set \ No newline at end of file From 57cb88fe80d4e86d57ed672bc218a3516bf7376f Mon Sep 17 00:00:00 2001 From: ali-soft-engineer <147161616+ali-soft-engineer@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:07:22 +0500 Subject: [PATCH 3/4] test C375069 (#2563) --- .../linking-bibField630-to-authority130.cy.js | 158 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC375069.mrc | 1 + cypress/fixtures/marcBibFileForC375069.mrc | 1 + 3 files changed, 160 insertions(+) create mode 100644 cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField630-to-authority130.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC375069.mrc create mode 100644 cypress/fixtures/marcBibFileForC375069.mrc diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField630-to-authority130.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField630-to-authority130.cy.js new file mode 100644 index 0000000000..53837c9849 --- /dev/null +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField630-to-authority130.cy.js @@ -0,0 +1,158 @@ +import { Permissions } from '../../../../../support/dictionary'; +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 InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; +import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; +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'; + +describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { + const testData = { + tag630: '630', + authorityMarkedValue: 'C375069 Marvel comics', + subjectValue: 'C375069 Marvel comics ComiCon--Periodicals.--United States', + authorityIconText: 'Linked to MARC authority', + accordion: 'Subject', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC375069.mrc', + fileName: `testMarcBibFileC375071.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + }, + { + marc: 'marcAuthFileForC375069.mrc', + fileName: `testMarcAuthFileC375071.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C375069 Marvel comics ComiCon', + }, + ]; + + const createdRecordIDs = []; + const bib630InitialFieldValues = [ + 23, + testData.tag630, + '0', + '7', + '$a C375069 Marvel comics. $2 fast $0 (OCoLC)fst01373594 $v Periodicals. $z United States $w 830', + ]; + const bib630UnlinkedFieldValues = [ + 23, + testData.tag630, + '0', + '7', + '$a C375069 Marvel comics $t ComiCon $v Periodicals. $z United States $w 830 $0 80026955 $2 fast', + ]; + const bib630LinkedFieldValues = [ + 23, + testData.tag630, + '0', + '7', + '$a C375069 Marvel comics $t ComiCon', + '$v Periodicals. $z United States $w 830', + '$0 80026955', + '$2 fast', + ]; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; + + cy.loginAsAdmin().then(() => { + marcFiles.forEach((marcFile) => { + cy.visit(TopMenu.dataImportPath); + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.search(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.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Deleting created user', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it( + 'C375069 Link the "630" of "MARC Bib" field with "130" field of "MARC Authority" record. (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib630InitialFieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag630); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag630); + QuickMarcEditor.verifyTagFieldAfterLinking(...bib630LinkedFieldValues); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.verifyInstanceSubject( + 2, + 0, + `${testData.authorityIconText}${testData.subjectValue}`, + ); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane(testData.accordion); + InventoryInstance.clickViewAuthorityIconDisplayedInInstanceDetailsPane(testData.accordion); + MarcAuthorities.checkDetailViewIncludesText(testData.authorityMarkedValue); + InventoryInstance.goToPreviousPage(); + // Wait for the content to be loaded. + cy.wait(6000); + InventoryInstance.waitLoading(); + InventoryInstance.viewSource(); + InventoryInstance.checkExistanceOfAuthorityIconInMarcViewPane(); + InventoryInstance.clickViewAuthorityIconDisplayedInMarcViewPane(); + MarcAuthorities.checkDetailViewIncludesText(testData.authorityMarkedValue); + InventoryInstance.goToPreviousPage(); + // Wait for the content to be loaded. + cy.wait(6000); + InventoryViewSource.waitLoading(); + InventoryViewSource.close(); + InventoryInstance.waitLoading(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterLinking(...bib630LinkedFieldValues); + QuickMarcEditor.clickUnlinkIconInTagField(bib630UnlinkedFieldValues[0]); + QuickMarcEditor.confirmUnlinkingField(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib630UnlinkedFieldValues); + QuickMarcEditor.verifyIconsAfterUnlinking(bib630UnlinkedFieldValues[0]); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane(testData.accordion); + InventoryInstance.viewSource(); + InventoryInstance.checkAbsenceOfAuthorityIconInMarcViewPane(); + }, + ); +}); diff --git a/cypress/fixtures/marcAuthFileForC375069.mrc b/cypress/fixtures/marcAuthFileForC375069.mrc new file mode 100644 index 0000000000..4f9b45f064 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC375069.mrc @@ -0,0 +1 @@ +00380cz a2200121n 450000100090000000300040000900800410001300500170005404000180007113000400008967000790012967000500020880026955DLC800331n| acannaab| |n ana ||| 20220816153125.5 aDLCcDLCdDLC 0aC375069 Marvel comicstComiConw630 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/marcBibFileForC375069.mrc b/cypress/fixtures/marcBibFileForC375069.mrc new file mode 100644 index 0000000000..d6bc9b99dd --- /dev/null +++ b/cypress/fixtures/marcBibFileForC375069.mrc @@ -0,0 +1 @@ +01654cas 2200385 a 4500001001500000008004100015005001700056035002400073040007700097035002000174037006900194043001200263050001900275082002000294245007800314260003400392300003800426310001100464336002600475337002800501338002700529500020900556588001000765650005600775650005900831630008700890650005600977651004501033655004001078655004301118655002401161710002501185994001401210948004401224nin00009530413930510c19uu9999nyuar 0 a0eng d20221230151002.4 a(OCoLC)ocm28081689  aTMNbengcTMNdOCLdOCLCQdOSUdOCLCFdOCLCOdOCLCAdOCLCQdOCLCOdOCLCQ a(OCoLC)28081689 bMarvel Comics Group, 387 Park Avenue South, New York, N.Y. 10016 an-us---14aPN6714.M4bM3704a741.5973bM391400aC375069 Marvel comics direct distributors meeting /cMarvel Comics Group. a[New York, N.Y.] :bThe Group avolumes :billustrations ;c28 cm aAnnual atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aA listing of comics to be published for the year. Includes writer, penciler, inker, editor, issues, format, cover price, duration, and page count for each comic as well as a a brief synopsis of the plots.0 a1993. 0aComic books, strips, etc.zUnited StatesvCatalogs. 0aComic books, strips, etc.zUnited StatesvPeriodicals.07aC375069 Marvel comics.2fast0(OCoLC)fst01373594vPeriodicals.zUnited Statesw830 7aComic books, strips, etc.2fast0(OCoLC)fst00869145 7aUnited States.2fast0(OCoLC)fst01204155 7aCatalogs.2fast0(OCoLC)fst01423692 7aPeriodicals.2fast0(OCoLC)fst01411641 7aPeriodicals.2lcgft2 aMarvel Comics Group. aZ0bPAOLF hNO HOLDINGS IN PAOLF - 2 OTHER HOLDINGS \ No newline at end of file From 378dcaafa723c84b14ade87c69ad2e54ff04a04c Mon Sep 17 00:00:00 2001 From: ali-soft-engineer <147161616+ali-soft-engineer@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:11:13 +0500 Subject: [PATCH 4/4] test C375086 (#2564) --- .../linking-bibField811-to-authority111.cy.js | 158 ++++++++++++++++++ cypress/fixtures/marcAuthFileForC375086.mrc | 1 + cypress/fixtures/marcBibFileForC375086.mrc | 1 + 3 files changed, 160 insertions(+) create mode 100644 cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField811-to-authority111.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC375086.mrc create mode 100644 cypress/fixtures/marcBibFileForC375086.mrc diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField811-to-authority111.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField811-to-authority111.cy.js new file mode 100644 index 0000000000..dc13e44af4 --- /dev/null +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField811-to-authority111.cy.js @@ -0,0 +1,158 @@ +import { Permissions } from '../../../../../support/dictionary'; +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 InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; +import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; +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'; + +describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { + const testData = { + tag811: '811', + authorityMarkedValue: 'C375086 Delaware Symposium on Language Studies.', + seriesValue: + 'C375086 Delaware Symposium on Language Studies. 1985 Delaware symposia on language studies 4.', + authorityIconText: 'Linked to MARC authority', + accordion: 'Title data', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC375086.mrc', + fileName: `testMarcBibFileC375071.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + }, + { + marc: 'marcAuthFileForC375086.mrc', + fileName: `testMarcAuthFileC375071.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'C375086 Delaware Symposium on Language Studies.', + }, + ]; + + const createdRecordIDs = []; + const bib811InitialFieldValues = [ + 25, + testData.tag811, + '2', + '\\', + '$a C375086 Symposium on Lang. Studies $v 4. $f 1984', + ]; + const bib811UnlinkedFieldValues = [ + 25, + testData.tag811, + '2', + '\\', + '$a C375086 Delaware Symposium on Language Studies. $f 1985 $t Delaware symposia on language studies $v 4. $0 id.loc.gov/authorities/names/n84745425', + ]; + const bib811LinkedFieldValues = [ + 25, + testData.tag811, + '2', + '\\', + '$a C375086 Delaware Symposium on Language Studies. $f 1985 $t Delaware symposia on language studies', + '$v 4.', + '$0 id.loc.gov/authorities/names/n84745425', + '', + ]; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; + + cy.loginAsAdmin().then(() => { + marcFiles.forEach((marcFile) => { + cy.visit(TopMenu.dataImportPath); + DataImport.verifyUploadState(); + DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.search(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.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Deleting created user', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); + + it( + 'C375086 Link the "811" of "MARC Bib" field with "111" field of "MARC Authority" record. (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib811InitialFieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag811); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag811); + QuickMarcEditor.verifyTagFieldAfterLinking(...bib811LinkedFieldValues); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.verifySeriesStatement( + 0, + `${testData.authorityIconText}${testData.seriesValue}`, + ); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane(testData.accordion); + InventoryInstance.clickViewAuthorityIconDisplayedInInstanceDetailsPane(testData.accordion); + MarcAuthorities.checkDetailViewIncludesText(testData.authorityMarkedValue); + InventoryInstance.goToPreviousPage(); + // Wait for the content to be loaded. + cy.wait(6000); + InventoryInstance.waitLoading(); + InventoryInstance.viewSource(); + InventoryInstance.checkExistanceOfAuthorityIconInMarcViewPane(); + InventoryInstance.clickViewAuthorityIconDisplayedInMarcViewPane(); + MarcAuthorities.checkDetailViewIncludesText(testData.authorityMarkedValue); + InventoryInstance.goToPreviousPage(); + // Wait for the content to be loaded. + cy.wait(6000); + InventoryViewSource.waitLoading(); + InventoryViewSource.close(); + InventoryInstance.waitLoading(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterLinking(...bib811LinkedFieldValues); + QuickMarcEditor.clickUnlinkIconInTagField(bib811UnlinkedFieldValues[0]); + QuickMarcEditor.confirmUnlinkingField(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib811UnlinkedFieldValues); + QuickMarcEditor.verifyIconsAfterUnlinking(bib811UnlinkedFieldValues[0]); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane(testData.accordion); + InventoryInstance.viewSource(); + InventoryInstance.checkAbsenceOfAuthorityIconInMarcViewPane(); + }, + ); +}); diff --git a/cypress/fixtures/marcAuthFileForC375086.mrc b/cypress/fixtures/marcAuthFileForC375086.mrc new file mode 100644 index 0000000000..7fce84912c --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC375086.mrc @@ -0,0 +1 @@ +01194cz a2200265n 450000100070000000500170000700800410002401000170006503500210008204000230010311101080012643000420023441100900027641100640036643000500043064200110048064300360049164400110052764500110053864600110054966700950056067000900065567001680074595300150091359354520120731083754.0840821n| acaaaaaa |a ana  an 84745425  a(DLC)n 84745425 aDLCbengcDLCdDLC2 aC375086 Delaware Symposium on Language Studies.tDelaware symposia on language studiesf1985jtest1ert 0aDelaware symposia on language studies2 aDelaware Symposium on Language Studies.tDelaware symposia on language studies series2 aDelaware Symposium on Language Studies.tDelaware symposium 0aDelaware Symposium series on language studies a45DLC aNorwood, N.J.bAblex Pub. Corp. af5DLC at5DLC as5DLC aTHIS 1XX FIELD CANNOT BE USED UNDER RDA UNTIL THIS RECORD HAS BEEN REVIEWED AND/OR UPDATED aIts (4th : 1982 : University of Delaware). Humans and machines, c1984:bCIP ser. t.p. aLanguages in the international perspective, 1986:bCIP ser. t.p. (Delaware symposia on language studies) data sheet (Delaware Symposium series on language studies) aba25bea16 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC375086.mrc b/cypress/fixtures/marcBibFileForC375086.mrc new file mode 100644 index 0000000000..fa066cd977 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC375086.mrc @@ -0,0 +1 @@ +01422nam a2200325 a 4500001000900000003000400009005001700013008004100030010002200071020001500093035002000108035002000128040002300148041000800171050001900179082001900198111008400217245017000301260004700471300003400518490004700552504004100599650004200640650007100682650007800753650010600831655008600937700002401023811004901047in659473ICU20090311084500.0850311s1985 njua b 10110 eng u a 84020359 //r90 a0893912727 a(ICU)BID8610853 a(OCoLC)11159214 aDLCaDLCcDLCdDLC0 aeng00aP98b.D39 198200a410/.28/542192 aDelaware Symposium on Language Studiesn(4th :d1982 :cUniversity of Delaware)10aC375086 Humans and machines :bproceedings of the 4th Delaware Symposium on Language Studies, October 1982, the University of Delaware /cStephanie Williams, editor.0 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 aC375086 Symposium on Lang. Studiesv4.f1984 \ No newline at end of file