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

FAT-10425/C400663-Consortia #3175

Merged
merged 3 commits into from
Feb 8, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('MARC', () => {
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileNameImported);
Logs.waitFileIsImported(marcFile.fileNameImported);
Logs.checkJobStatus(marcFile.fileNameImported, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileNameImported);
for (let i = 0; i < marcFile.numOfRecords; i++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
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';

describe('MARC', () => {
describe('MARC Bibliographic', () => {
describe('Edit MARC bib', () => {
describe('Automated linking', () => {
const testData = {
editSharedRecordText: 'Edit shared MARC record',
linked100Field: [
9,
'100',
'1',
'\\',
'$a Bate, Walter Jackson, $d 1918-1999',
'',
'$0 http://id.loc.gov/authorities/names/n79039769C400663',
'',
],
linked600Field_1: [
18,
'600',
'1',
'0',
'$a Johnson, Samuel, $d 1709-1784',
'$x Criticism and interpretation.',
'$0 http://id.loc.gov/authorities/names/n78095825C400663',
'',
],
linked600Field_2: [
19,
'600',
'1',
'7',
'$a Johnson, Samuel, $d 1709-1784',
'',
'$0 http://id.worldcat.org/fast/fst00029184C400663',
'$2 fast',
],
linked650Field: [
20,
'650',
'\\',
'7',
'$a Criticism and interpretation',
'',
'$0 http://id.worldcat.org/fast/fst01198648C400663',
'$2 fast',
],
};

const linkableFields = [100, 600, 650];

const users = {};

const marcFiles = [
{
marc: 'marcBibFileForC400663.mrc',
fileNameImported: `testMarcFileC410814.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create instance and SRS MARC Bib',
numOfRecords: 1,
},
{
marc: 'marcAuthFileForC400663.mrc',
fileNameImported: `testMarcFileC410814.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
numOfRecords: 4,
},
];

const createdRecordIDs = [];

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

cy.createTempUser([
Permissions.inventoryAll.gui,
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui,
Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui,
])
.then((userProperties) => {
users.userProperties = userProperties;
})
.then(() => {
cy.assignAffiliationToUser(Affiliations.College, users.userProperties.userId);
cy.setTenant(Affiliations.College);
cy.assignPermissionsToExistingUser(users.userProperties.userId, [
Permissions.inventoryAll.gui,
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui,
]);
})
.then(() => {
cy.resetTenant();
cy.loginAsAdmin().then(() => {
marcFiles.forEach((marcFile) => {
cy.visit(TopMenu.dataImportPath);
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported);
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
Logs.waitFileIsImported(marcFile.fileNameImported);
Logs.checkJobStatus(marcFile.fileNameImported, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileNameImported);
for (let i = 0; i < marcFile.numOfRecords; i++) {
Logs.getCreatedItemsID(i).then((link) => {
createdRecordIDs.push(link.split('/')[5]);
});
}
});

linkableFields.forEach((tag) => {
QuickMarcEditor.setRulesForField(tag, true);
});

cy.login(users.userProperties.username, users.userProperties.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
});
});
});

after('Delete users, data', () => {
cy.resetTenant();
cy.getAdminToken();
Users.deleteViaApi(users.userProperties.userId);
createdRecordIDs.forEach((id, index) => {
if (index) MarcAuthority.deleteViaAPI(id);
else InventoryInstance.deleteInstanceViaApi(id);
});
});

it(
'C400663 Automated linking of Shared MARC bib with Shared MARC authority records on Central tenant (consortia) (spitfire)',
{ tags: ['criticalPathECS', 'spitfire'] },
() => {
InventoryInstances.searchByTitle(createdRecordIDs[0]);
InventoryInstances.selectInstance();
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.editMarcBibliographicRecord();
QuickMarcEditor.checkPaneheaderContains(testData.editSharedRecordText);
QuickMarcEditor.clickLinkHeadingsButton();
QuickMarcEditor.checkCallout(
'Field 100, 600, and 650 has been linked to MARC authority record(s).',
);
QuickMarcEditor.verifyDisabledLinkHeadingsButton();
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked100Field);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked600Field_1);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked600Field_2);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked650Field);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkExpectedMARCSource();

ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
InventoryInstances.waitContentLoading();
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college);
InventoryInstances.searchByTitle(createdRecordIDs[0]);
InventoryInstances.selectInstance();
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.editMarcBibliographicRecord();
QuickMarcEditor.checkPaneheaderContains(testData.editSharedRecordText);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked100Field);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked600Field_1);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked600Field_2);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked650Field);
},
);
});
});
});
});
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC400663.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
00429nz a2200145n 4500001001900000003000600019005001700025008004100042016002300083024004500106040002800151150003300179688003500212688003600247fst01198648C400663OCoLC20050301145832.0050301nn anznnbabn || ana d7 afst011986482OCoLC7 ahttp://id.worldcat.org/fast/11986482uri aOCoLCbengcOCoLCffast aCriticism and interpretation aLC (2022) Subject Usage: 3,786 aWC (2022) Subject Usage: 19,35901097cz a2200301n 4500001001900000003000600019005001700025008004100042016003000083024004300113040002800156046002300184053002200207053002800229100003200257374007600289376000900365377000800374400003800382400003600420400003900456400003900495688003300534688003500567700005100602700006400653700007800717fst00029184C400663OCoLC20171208142050.0040924nn anznnbabn || aaa d7 afst00029184C4006632OCoLC7 ahttp://id.worldcat.org/fast/291842uri aOCoLCbengcOCoLCffast f17090918g17841213 0aPA8540.J63cLatin 0aPR3520bPR3538cEnglish1 aJohnson, Samuel,d1709-1784 aPoetsaEssayistsaCriticsaEthicistsaBiographersaLexicographers2lcsh amale aeng0 aAuthor of the Rambler,d1709-17841 aGʹonson, Samyuʼel,d1709-17841 aJonsan, Śāmuʼél,d1709-17841 aRambler, Author of the,d1709-1784 aLC (2022) Subject Usage: 542 aWC (2022) Subject Usage: 9,84110aJohnson, Samuel,d1709-17840(DLC)n 78095825 04aSamuel Johnson0http://en.wikipedia.org/wiki/Samuel_Johnson10aJohnson, Samuel,d1709-17840(viaf)74067250https://viaf.org/viaf/740672501476cz a2200289n 4500001000800000005001700008008004100025010002400066035002300090040005200113046003300165100003700198370007500235373005100310374004900361377000800410400005100418400004600469670007000515670009300585670005900678670005600737670008800793670028000881952001001161953001501171142227220190124073440.0790425n| azannaabn |a aaa  an 79039769C400663  a(OCoLC)oca00273264 aDLCbengerdacDLCdDLCdTxSaTdMH-LdDLCdMoSU f1918-05-23g1999-07-262edtf1 aBate, Walter Jackson,d1918-1999 aMankato (Minn.)bBoston (Mass.)cUnited StatesfCambridge (Mass.)2naf aHarvard University. Department of English2naf aCriticsaBiographersaEnglish teachers2lcsh aeng1 aBate, W. Jacksonq(Walter Jackson),d1918-19991 aBate, W. J.q(Walter Jackson),d1918-1999 aFrom classic to romantic, 1946:btitle page (Walter Jackson Bate) aJohnson, Samuel. The Idler and the Adventurer, 1963:btitle page (W.J. Bate [co-editor]) aJohn Keats, 1964:btitle page (by Walter Jackson Bate) aSamuel Johnson, 1977:btitle page (W. Jackson Bate) aLC in OCLC, December 16, 1997b(hdg.: Bate, Walter Jackson,1918-; usage: W.J. Bate) aWikipedia, viewed January 22, 2019b(Walter Jackson Bate; born May 23, 1918, in Mankato, Minnesota; died July 26, 1999, in Boston; American literary critic and biographer, known for his biographies of Samuel Johnson (1978) and John Keats (1964); taught at Harvard University) aRETRO axx00bvl0901469cz a2200337n 450000100070000000500170000700800410002401000240006503500230008904000690011204600330018105300220021405300280023610000320026437400760029637600090037237700080038140000390038940000380042840000390046640000360050540000280054166700560056966700460062567000540067167001110072567001030083667001670093995200100110695300150111648778420171116073318.0790124n| azannaabn |b aaa  an 78095825C400663  a(OCoLC)oca00230889 aDLCbengerdacDLCdDLCdNNdOCldINS-SFdOCoLCdDLCdOCoLCdInU f1709-09-18g1784-12-132edtf 0aPA8540.J63cLatin 0aPR3520bPR3538cEnglish1 aJohnson, Samuel,d1709-1784 aPoetsaEssayistsaCriticsaEthicistsaBiographersaLexicographers2lcsh amale aeng1 aJonsan, Śāmuʼél,d1709-17840 aAuthor of the Rambler,d1709-17841 aRambler, Author of the,d1709-17841 aGʹonson, Samyuʼel,d1709-17841 aصمويل جونسون aMachine-derived non-Latin script reference project. aNon-Latin script reference not evaluated. aDe La Toore, L. Dr. Sam: Johnson, detector, 1946. aThe life of Mr. Richard Savage, son of the Earl Rivers, 1777:bt.p. (written by the author of the Rambler) aSachs, A. Reḳanut ha-ḥayim, 1978:bt.p. (Samyuʼel Gʹonson [in Hebr.]) p. 10 (Samuel Johnson) aWikipediia, Oct. 18, 2013b(Samuel Johnson; b. Sept. 7 (18), 1709; d. Dec. 13, 1784; poet, essayist, moralist, literary critic, biographer, editor, lexicographer) aRETRO axx00btk02
1 change: 1 addition & 0 deletions cypress/fixtures/marcBibFileForC400663.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01479cam a22002771a 4500003000600000005001700006008004100023010001300064035001800077049000900095040017700104050001700281100009300298245006200391264004800453300003900501336002600540337002800566338002700594504006700621500002000688600017000708600008800878650008900966776014601055OCoLC20220812132347.3721213s1955 nyuc b 001 0 eng  a55009707 a(OCoLC)355413 aWELL aDLCbengcDLCdUKMdMUQdBTCTAdOCLCGdGEBAYdBKLdU5DdOCLCQdOCLCFdDEBBGdOCLCAdWY@dDHAdOCLCQdOCLCOdOCLCQdTYCdOCLCQdUKOBUdUKMGBdOCLCQdOCLCOdOCLCQdUOOdOCLCQ00aPR3533b.B331 aBate, Walter Jackson,d1918-1999.0https://id.loc.gov/authorities/names/n79039769C40066314aThe achievement of Samuel Johnson /cWalter Jackson Bate. 1aNew York :bOxford University Press,c1955. axi, 248 pages :bportrait ;c21 cm atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aBibliographical references included in "Notes" (pages 235-241) aIncludes index.10aJohnson, Samuel,d1709-17840https://id.loc.gov/authorities/names/n78095825C400663xCriticism and interpretation.0https://id.loc.gov/authorities/subjects/sh9900557617aJohnson, Samuel,d1709-1784.2fast0https://id.worldcat.org/fast/fst00029184C400663 7aCriticism and interpretation.2fast0https://id.worldcat.org/fast/fst01198648C40066308iOnline version:aBate, Walter Jackson, 1918-1999.tAchievement of Samuel Johnson.dNew York, Oxford University Press, 1955w(OCoLC)613828979.
Loading