Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C375088 Link the "830" of "MARC Bib" field with "130" field of "MARC Authority" record. (spitfire) (TaaS) #2565

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import getRandomPostfix from '../../../support/utils/stringTools';
describe('MARC -> MARC Authority', () => {
const testData = {
marcValue:
'C350932 Beethoven, Ludwig van, 1770-1827. Variations, piano, violin, cello, op. 44, E♭ major',
'C350932 Beethoven, Ludwig van, 1770-1827. 14 variations sur un thème original',
markedValue: 'C350932 Beethoven, Ludwig van,',
searchOption: 'Keyword',
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
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 = {
tag830: '830',
authorityMarkedValue: 'C375088 Cambridge tracts in mathematics and mathematical physics',
seriesValue: 'C375088 Cambridge tracts in mathematics and mathematical physics english no. 19.',
authorityIconText: 'Linked to MARC authority',
accordion: 'Title data',
};

const marcFiles = [
{
marc: 'marcBibFileForC375088.mrc',
fileName: `testMarcBibFileC375071.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create instance and SRS MARC Bib',
},
{
marc: 'marcAuthFileForC375088.mrc',
fileName: `testMarcAuthFileC375071.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
authorityHeading: 'C375088 Cambridge tracts in mathematics and mathematical physics',
},
];

const createdRecordIDs = [];
const bib830InitialFieldValues = [
21,
testData.tag830,
'\\',
'0',
'$a C375088 Cambridge tracts in mathematics $v no. 19. $t Mathematics $s #1',
];
const bib830UnlinkedFieldValues = [
21,
testData.tag830,
'\\',
'0',
'$a C375088 Cambridge tracts in mathematics and mathematical physics $l english $v no. 19. $0 id.loc.gov/authorities/names/n84801249',
];
const bib830LinkedFieldValues = [
21,
testData.tag830,
'\\',
'0',
'$a C375088 Cambridge tracts in mathematics and mathematical physics $l english',
'$v no. 19.',
'$0 id.loc.gov/authorities/names/n84801249',
'',
];

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(
'C375088 Link the "830" 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(...bib830InitialFieldValues);
InventoryInstance.verifyAndClickLinkIcon(testData.tag830);
MarcAuthorities.switchToSearch();
InventoryInstance.verifySelectMarcAuthorityModal();
InventoryInstance.searchResults(marcFiles[1].authorityHeading);
MarcAuthorities.clickLinkButton();
QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag830);
QuickMarcEditor.verifyTagFieldAfterLinking(...bib830LinkedFieldValues);
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(...bib830LinkedFieldValues);
QuickMarcEditor.clickUnlinkIconInTagField(bib830UnlinkedFieldValues[0]);
QuickMarcEditor.confirmUnlinkingField();
QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib830UnlinkedFieldValues);
QuickMarcEditor.verifyIconsAfterUnlinking(bib830UnlinkedFieldValues[0]);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkAbsenceOfAuthorityIconInInstanceDetailPane(testData.accordion);
InventoryInstance.viewSource();
InventoryInstance.checkAbsenceOfAuthorityIconInMarcViewPane();
},
);
});
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC375088.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
00981cz a2200241n 4500001000800000005001700008008004100025010003100066035002300097040003500120130009600155530003900251642002100290643003900311643002700350644001600377645001600393646001600409670008500425670006900510675014500579953001500724152434420081205072222.0840510n| acaaaaaan |a ana c an 84801249 zn 84801960  a(OCoLC)oca01092018 aICUbengcICUdDLCdICUdOCoLC 0aC375088 Cambridge tracts in mathematics and mathematical physicsvno. 19.lenglishzEngland 0wbaCambridge tracts in mathematics ano. 365DLC5ICU aCambridge [Eng.]bUniversity Press aLondonbCambridge U.P. af5DLC5ICU at5DLC5ICU as5DLC5ICU aLCCN 63-2549: Cramér, H. Random variables and probability distributions, 1962. aLC data base, 8-12-88 Wasan, M.T. Stochastic approximation, 1969 aLC data base 8/26/85 Mahler, K. Introduction to p-adic numbers and their functions, 1973: (ser. stmt.: Cambridge tracts in mathematics ; 64) abz51bbz51
1 change: 1 addition & 0 deletions cypress/fixtures/marcBibFileForC375088.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01294cam a2200337 4500001001000000003000400010005001700014008004100031010001900072035002100091040001700112041000800129050001500137100005900152245007300211260004900284300003700333440007000370504004100440530008300481650001600564650002400580650006400604650007100668830007000739856009400809903001500903903000900918035001900927903001000946in1070103ICU20021022111100.0900712s1916 enka b 00010 eng u a16022168 //r90 a(ICU)BID13072663 aDLC/ICUcICU0 aeng00aQA192b.M21 aC375088 Macaulay, F. S.q(Francis Sowerby),d1862-193714aC375088 The algebraic theory of modular systems /cby F.S. Macaulay.0 aCambridge [Eng.] :bUniversity Press,c1916. axiv, 112 p. :bdiagrs. ;c22 cm. 0aCambridge tracts in mathematics and mathematical physics.vno. 19 a"List of references": p. [xiii]-xiv. aAlso available on the Internet from the Cornell historic math book collection. 0aElimination 0aForms (Mathematics) 7aElimination.2fast0http://id.worldcat.org/fast/fst00908107 7aForms (Mathematics)2fast0http://id.worldcat.org/fast/fst00932975 0aC375088 Cambridge tracts in mathematicsvno. 19.tMathematicss#141uhttp://cdl.library.cornell.edu/Hunter/hunter.pl?handle=cornell.library.math/05190001&id=9 aRECON/MARC aSMON a(OCoLC)5624967 aHathi