Skip to content

Commit

Permalink
added test C410775 (#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherzod-Kenjaev committed Feb 19, 2024
1 parent ee52d57 commit cb64b1d
Show file tree
Hide file tree
Showing 6 changed files with 290 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
import Permissions from '../../../../../support/dictionary/permissions';
import Affiliations, { tenantNames } from '../../../../../support/dictionary/affiliations';
import Users from '../../../../../support/fragments/users/users';
import TopMenu from '../../../../../support/fragments/topMenu';
import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances';
import getRandomPostfix from '../../../../../support/utils/stringTools';
import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance';
import DataImport from '../../../../../support/fragments/data_import/dataImport';
import { JOB_STATUS_NAMES } from '../../../../../support/constants';
import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles';
import Logs from '../../../../../support/fragments/data_import/logs/logs';
import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor';
import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager';
import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority';
import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities';
import InventoryHoldings from '../../../../../support/fragments/inventory/holdings/inventoryHoldings';
import ServicePoints from '../../../../../support/fragments/settings/tenant/servicePoints/servicePoints';
import Locations from '../../../../../support/fragments/settings/tenant/location-setup/locations';
import MarcAuthorityBrowse from '../../../../../support/fragments/marcAuthority/MarcAuthorityBrowse';

describe('MARC', () => {
describe('MARC Authority', () => {
describe('Edit linked Authority record', () => {
const testData = {
authoritySearchOption: 'Keyword',
sharedMarcAuthValue: 'Gálvez Shared C410775',
marcAuthFileM1: 'Lentz Local C410775',
marcAuthFileM2: 'Gálvez Local C410775',
collegeHoldings: [],
tag245: '245',
tag245DerivedContent:
'$a C410775 Murder in Mérida, 1792 : derived record $b violence, factions, and the law / $c Mark W. Lentz.',
instanceTitle:
'C410775 Murder in Mérida, 1792 : violence, factions, and the law / Mark W. Lentz.',
instanceEditedTitle:
'C410775 Murder in Mérida, 1792 : derived record violence, factions, and the law / Mark W. Lentz.',
deriveLocalPaneheaderText: 'Derive a new local MARC bib record',
contributor: 'Contributor',
subject: 'Subject',
linkAuthorityIcon: 'Linked to MARC authority',
};

const users = {};

const createdRecordIDs = [];

const marcFiles = [
{
marc: 'marcBibFileForC410775.mrc',
fileName: `testMarcFile.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create instance and SRS MARC Bib',
tenant: 'Central Office',
},
{
marc: 'marcAuthFileForC410775-Shared.mrc',
fileName: `testMarcFile.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
tenant: 'Central Office',
},
{
marc: 'marcAuthFileForC410775-Local-M1.mrc',
fileName: `testMarcFile.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
tenant: 'University',
},
{
marc: 'marcAuthFileForC410775-Local-M2.mrc',
fileName: `testMarcFile.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
tenant: 'College',
},
];

const linkableFields = [600, 700, 710];

const linked600Field = [
29,
'600',
'1',
'0',
'$a Gálvez Shared C410775',
'$x Assassination.',
'$0 http://id.loc.gov/authorities/names/n20114107752',
'',
];

const linked700Field = [
38,
'700',
'\\',
'\\',
'$a Lentz Local C410775',
'',
'$0 http://id.loc.gov/authorities/names/n20114107753',
'',
];

const notLinked710Field = [39, '710', '\\', '\\', '$a Gálvez710 $0 n20114107754'];

before('Create users, data', () => {
cy.getAdminToken();

cy.createTempUser([
Permissions.inventoryAll.gui,
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui,
])
.then((userProperties) => {
users.userProperties = userProperties;
})
.then(() => {
cy.assignAffiliationToUser(Affiliations.University, users.userProperties.userId);
cy.assignAffiliationToUser(Affiliations.College, users.userProperties.userId);
cy.setTenant(Affiliations.University);
cy.assignPermissionsToExistingUser(users.userProperties.userId, [
Permissions.inventoryAll.gui,
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui,
Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui,
]);
})
.then(() => {
cy.setTenant(Affiliations.College);
cy.assignPermissionsToExistingUser(users.userProperties.userId, [
Permissions.inventoryAll.gui,
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui,
]);
})
.then(() => {
cy.resetTenant();
cy.loginAsAdmin().then(() => {
marcFiles.forEach((marcFile) => {
cy.visit(TopMenu.dataImportPath);
if (marcFile.tenant === 'University') {
ConsortiumManager.switchActiveAffiliation(
tenantNames.central,
tenantNames.university,
);
} else if (marcFile.tenant === 'College') {
ConsortiumManager.switchActiveAffiliation(
tenantNames.university,
tenantNames.college,
);
}
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName);
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileName);
Logs.checkJobStatus(marcFile.fileName, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileName);
Logs.getCreatedItemsID().then((link) => {
createdRecordIDs.push(link.split('/')[5]);
});
});

linkableFields.forEach((tag) => {
QuickMarcEditor.setRulesForField(tag, true);
});
});
})
.then(() => {
// adding Holdings in College for shared Instance
cy.setTenant(Affiliations.University);
const collegeLocationData = Locations.getDefaultLocation({
servicePointId: ServicePoints.getDefaultServicePoint().id,
}).location;
Locations.createViaApi(collegeLocationData).then((location) => {
testData.collegeLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: createdRecordIDs[0],
permanentLocationId: testData.collegeLocation.id,
}).then((holding) => {
testData.collegeHoldings.push(holding);
});
});

cy.login(users.userProperties.username, users.userProperties.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
}).then(() => {
ConsortiumManager.switchActiveAffiliation(
tenantNames.central,
tenantNames.university,
);
InventoryInstances.waitContentLoading();
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university);
});
});
});

after('Delete users, data', () => {
cy.resetTenant();
cy.getAdminToken();
Users.deleteViaApi(users.userProperties.userId);
InventoryInstance.deleteInstanceViaApi(createdRecordIDs[0]);
MarcAuthority.deleteViaAPI(createdRecordIDs[1]);
cy.setTenant(Affiliations.College);
MarcAuthority.deleteViaAPI(createdRecordIDs[3]);
cy.setTenant(Affiliations.University);
MarcAuthority.deleteViaAPI(createdRecordIDs[2]);
testData.collegeHoldings.forEach((holding) => {
InventoryHoldings.deleteHoldingRecordViaApi(holding.id);
});
Locations.deleteViaApi(testData.collegeLocation);
InventoryInstance.deleteInstanceViaApi(createdRecordIDs[4]);
});

it(
'C410775 Derive new Local MARC bib record from shadow Instance with "MARC" source and link it in Member tenant (consortia) (spitfire)',
{ tags: ['criticalPathECS', 'spitfire'] },
() => {
InventoryInstances.searchByTitle('c573889c-4ac4-432f-86ad-9de618296919');
InventoryInstance.checkPresentedText(testData.instanceTitle);
InventoryInstance.checkSharedTextInDetailView();
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.deriveNewMarcBib();
QuickMarcEditor.checkPaneheaderContains(testData.deriveLocalPaneheaderText);
QuickMarcEditor.updateExistingField(testData.tag245, testData.tag245DerivedContent);
QuickMarcEditor.checkContentByTag(testData.tag245, testData.tag245DerivedContent);
InventoryInstance.verifyAndClickLinkIcon(linked600Field[1]);
InventoryInstance.verifySelectMarcAuthorityModal();
MarcAuthorityBrowse.checkSearchOptions();
MarcAuthorities.checkRow(`Shared${testData.sharedMarcAuthValue}`);
MarcAuthorities.selectTitle(`Shared\n${testData.sharedMarcAuthValue}`);
InventoryInstance.clickLinkButton();
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linked600Field[1], linked600Field[0]);
QuickMarcEditor.verifyTagFieldAfterLinking(...linked600Field);
QuickMarcEditor.clickLinkHeadingsButton();
QuickMarcEditor.checkCallout('Field 700 has been linked to MARC authority record(s).');
QuickMarcEditor.checkCallout(
'Field 710 must be set manually by selecting the link icon.',
);
QuickMarcEditor.verifyEnabledLinkHeadingsButton();
QuickMarcEditor.verifyTagFieldAfterLinking(...linked700Field);
QuickMarcEditor.verifyTagFieldAfterUnlinking(...notLinked710Field);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndCloseDerive();
InventoryInstance.checkPresentedText(testData.instanceEditedTitle);
InventoryInstance.checkSharedTextInDetailView(false);
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.getId().then((id) => {
createdRecordIDs.push(id);
});
InventoryInstance.verifyRecordAndMarcAuthIcon(
testData.contributor,
`${testData.linkAuthorityIcon}\n${testData.marcAuthFileM1}`,
);
InventoryInstance.verifyRecordAndMarcAuthIcon(
testData.subject,
`${testData.linkAuthorityIcon}\n${testData.sharedMarcAuthValue}`,
);
InventoryInstance.verifyRecordAndMarcAuthIconAbsence(
testData.contributor,
`${testData.linkAuthorityIcon}\n${testData.marcAuthFileM2}`,
);

InventoryInstance.deriveNewMarcBib();
QuickMarcEditor.checkPaneheaderContains(testData.deriveLocalPaneheaderText);
ConsortiumManager.switchActiveAffiliation(tenantNames.university, tenantNames.college);
InventoryInstances.waitContentLoading();

cy.visit(TopMenu.marcAuthorities);
MarcAuthorities.searchBy(testData.authoritySearchOption, testData.marcAuthFileM2);
MarcAuthorities.verifyEmptyNumberOfTitlesForRowWithValue(testData.marcAuthFileM2);

ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.central);
MarcAuthorities.searchBy(testData.authoritySearchOption, testData.sharedMarcAuthValue);
MarcAuthorities.verifyEmptyNumberOfTitlesForRowWithValue(
`Shared${testData.sharedMarcAuthValue}`,
);
},
);
});
});
});
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC410775-Local-M1.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
00533cz a2200145n 4500001000800000005001700008008004100025010001700066035002300083040003300106046002100139100002400160670007600184670012700260870998020201031070045.0110721n| azannaabn |n aaa  an20114107753 a(OCoLC)oca08921677 aDLCbengcDLCerdadDLCdMvI f1977-10-112edtf1 aLentz Local C410775 aCity indians in Spain's American empire, c2012:bECIP t.p. (Mark Lentz) aMurder in Mérida, 1792, 2018 :bpre-publication galley title page (Mark W. Lentz) data from publisher (b. Oct. 11, 1977)
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC410775-Local-M2.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
00913cz a2200169n 45000010009000000050017000090080041000260100017000670400028000840460025001121000027001373700042001644000035002066700106002416700308003476700088006551071198120180403112730.0180402n| azannaabn |a aaa  an20114107754 aDLCbengerdacDLCdDLC f1739g179206222edtf1 aGálvez Local C410775 aEcija (Spain)bMérida (Mexico)2naf1 aGálvez, Lucas de,d1739-1792 aMurder in Mérida, 1792, 2018:bECIP Prologue (Lucas de Gálvez, Lucas de Gálvez y Montes de Oca) aWikipedia, viewed April 2, 2018b(entry under: Lucas de Gálvez; Lucas de Gálvez y Montes de Oca, born in Écija, province of Seville, Spain, in 1739 . He was governor, intendant and captain general of Yucatan from 1789 to 1792. He was assassinated on June 22, 1792, at 53 years of age in Mérida) aLC database, April 3, 2018b(old cat heading: Galvez y Montes de Oca, Lucas, -1792)
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC410775-Shared.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
00914cz a2200169n 45000010009000000050017000090080041000260100017000670400028000840460025001121000028001373700042001654000035002076700106002426700308003486700088006561071198120180403112730.0180402n| azannaabn |a aaa  an20114107752 aDLCbengerdacDLCdDLC f1739g179206222edtf1 aGálvez Shared C410775 aEcija (Spain)bMérida (Mexico)2naf1 aGálvez, Lucas de,d1739-1792 aMurder in Mérida, 1792, 2018:bECIP Prologue (Lucas de Gálvez, Lucas de Gálvez y Montes de Oca) aWikipedia, viewed April 2, 2018b(entry under: Lucas de Gálvez; Lucas de Gálvez y Montes de Oca, born in Écija, province of Seville, Spain, in 1739 . He was governor, intendant and captain general of Yucatan from 1789 to 1792. He was assassinated on June 22, 1792, at 53 years of age in Mérida) aLC database, April 3, 2018b(old cat heading: Galvez y Montes de Oca, Lucas, -1792)
1 change: 1 addition & 0 deletions cypress/fixtures/marcBibFileForC410775.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
03518cam a2200529 i 45000010011000000030006000110050017000170080041000340100017000750400054000920200030001460200015001760200027001910200015002180350022002330420008002550430012002630500021002750820016002960840023003121000027003352450090003622500019004522640057004713000052005283360026005803370028006063380027006344900020006615050449006815201027011305200099021575040067022566000067023236510055023906510065024456500045025106500025025556500029025806510036026096480020026456550019026657000027026847100030027117760162027419800085029031031041933OCoLC20180524122107.0180223s2018 nmu b 001 0 eng  a 2017049081 aDLCbengerdacDLCdOCLCOdBDXdOCLCQdOCLCFdIQU a9780826359605q(hardback) a0826359604 a9780826359612q(paper) a0826359612 a(OCoLC)1031041933 apcc an-mx---00aF1376b.L46 201800a972/.65223 aHIS0250002bisacsh1 aLentz, Mark.,eauthor.10aC410775 Murder in Mérida, 1792 :bviolence, factions, and the law /cMark W. Lentz. aFirst edition. 1aAlbuqerque :bUniversity of New Mexico Press,c2018. axvi, 312 pages :billustrations, maps ;c23 cm. atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier0 aDialogos series0 aA Province at risk -- The intendant's enemies: Chronicle of an assassination foretold -- The suspects of 1792: Prosecuting the powerless -- Neither free nor family: Criados and slaves in Spanish households -- Into the countryside: Outsiders, intermediaries, and the Maya world -- A stratified cah, united by language: Cabildos, church auxiliaries, and Indios Hidalgos -- Divided at the top: Politics of the personal -- A strange turn of events. a"During the summer of 1792, a man wearing the rough garb of a vaquero stepped out of the night shadows of Mérida, Yucatan, and murdered the province's top royal official, don Lucas de Galvez. This book recounts the mystery of the Galvez murder and its resolution, an event that captured contemporaries imaginations throughout the Hispanic world and caused consternation on the part of authorities in both Mexico and Madrid. In this work Lentz further provides a readable introduction to the Bourbon Reforms as well as new insights on late colonial Yucatecan society through the vast depictions of the cross-section of Yucatecan people questioned during the decade it took to uncover the assassin's identity. These suspects and witnesses, from all walks of life, reveal the interconnected layers found in colonial Yucatecan society and the social networks of Mérida's urban underclass as well as their unexpected ties to the creole elites and rural Mayas that have previously been unexplored."--cProvided by publisher. a"Yucatan; Bourbon Reforms; creoles; underclass; trial; independence"--cProvided by publisher. aIncludes bibliographical references (pages 289-304) and index.10aGálvez y Montes de Oca, Lucas de,d1739-1792xAssassination. 0aYucatán (Mexico : State)xHistoryy18th century. 0aYucatán (Mexico : State)xSocial conditionsy18th century. 7aHISTORYzLatin AmericaxMexico.2bisacsh 7aAssassination.2fast 7aSocial conditions.2fast 7aMexicozYucatán (State)2fast 7a1700-17992fast 7aHistory.2fast aLentz7000n20114107753 aGálvez7100n2011410775408iOnline version:aLentz, Mark.tMurder in Mérida, 1792.bFirst edition.dAlbuqerque : University of New Mexico Press, 2018z9780826359629w(DLC) 2018016955 a40028235808bHLA2cGendJRLeYBPg509530h606315i180611lPaperm29.95q1j29.95
8 changes: 8 additions & 0 deletions cypress/support/fragments/inventory/inventoryInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,14 @@ export default {
);
},

verifyRecordAndMarcAuthIconAbsence(accordion, expectedText) {
cy.expect(
Accordion(accordion)
.find(HTML(including(expectedText)))
.absent(),
);
},

checkExistanceOfAuthorityIconInInstanceDetailPane(accordion) {
cy.expect(Accordion(accordion).find(Link()).exists());
},
Expand Down

0 comments on commit cb64b1d

Please sign in to comment.