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-10478/C410744-Consortia #3199

Merged
merged 1 commit into from
Feb 13, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
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 ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager';
import { JOB_STATUS_NAMES } from '../../../../../support/constants';
import getRandomPostfix from '../../../../../support/utils/stringTools';
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 MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority';
import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities';

describe('MARC', () => {
describe('MARC Authority', () => {
describe('Search', () => {
const testData = {
marcValueShared: 'C410744 Shared DiCaprio',
marcValueLocalM1: 'C410744 Local Member',
marcValueLocalM2: 'C410744 Local Member 2',
testId: 'C410744',
recordTypesAndValues: {
AUTHORIZED: 'Authorized',
REFERENCE: 'Reference',
AUTHREF: 'Auth/Ref',
authorizedSharedValue: 'C410744 Shared DiCaprio, Leonardo',
authorizedValueM1: 'C410744 Local Member 1 Jackson, Samuel L.',
referenceValueShared: 'C410744 Shared Di Caprio, Leonardo (actor)',
authRefValueShared: 'C410744 Shared Di Caprio, Leonardo (Titanic)',
referenceValueM1: 'C410744 Local Member 1 Jackson, Sam, 1948-',
authRefValueM1: 'C410744 Local Member 1 Jackson, Samuel Leroy 12-21-1948',
},
authoritySearchOption: 'Keyword',
authorityBrowseOption: 'Personal name',
sharedIcon: 'Shared',
};

const users = {};

const marcFiles = [
{
marc: 'marcAuthFileForC410744-Shared.mrc',
fileNameImported: `testMarcFileC410814.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
tenant: 'Central Office',
},
{
marc: 'marcAuthFileForC410744-Local-M1.mrc',
fileNameImported: `testMarcFileC410814.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
tenant: 'University',
},
{
marc: 'marcAuthFileForC410744-Local-M2.mrc',
fileNameImported: `testMarcFileC410814.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
tenant: 'College',
},
];

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.University, users.userProperties.userId);
cy.setTenant(Affiliations.University);
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);
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.fileNameImported);
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileNameImported);
Logs.checkJobStatus(marcFile.fileNameImported, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileNameImported);
Logs.getCreatedItemsID().then((link) => {
createdRecordIDs.push(link.split('/')[5]);
});
});

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

after('Delete users, data', () => {
cy.resetTenant();
cy.getAdminToken();
Users.deleteViaApi(users.userProperties.userId);
MarcAuthority.deleteViaAPI(createdRecordIDs[0]);
cy.setTenant(Affiliations.University);
MarcAuthority.deleteViaAPI(createdRecordIDs[1]);
cy.setTenant(Affiliations.College);
MarcAuthority.deleteViaAPI(createdRecordIDs[2]);
});

it(
'C410744 Shared and Local (for current tenant) "MARC authority" records are found in "MARC authority" app from Member tenant (consortia) (spitfire)',
{ tags: ['criticalPathECS', 'spitfire'] },
() => {
MarcAuthorities.searchBy(testData.authoritySearchOption, testData.marcValueShared);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHORIZED,
`${testData.sharedIcon}${testData.recordTypesAndValues.authorizedSharedValue}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.REFERENCE,
`${testData.sharedIcon}${testData.recordTypesAndValues.referenceValueShared}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHREF,
`${testData.sharedIcon}${testData.recordTypesAndValues.authRefValueShared}`,
);

MarcAuthorities.searchBy(testData.authoritySearchOption, testData.marcValueLocalM1);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHORIZED,
testData.recordTypesAndValues.authorizedValueM1,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.REFERENCE,
testData.recordTypesAndValues.referenceValueM1,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHREF,
testData.recordTypesAndValues.authRefValueM1,
);

MarcAuthorities.searchBy(testData.authoritySearchOption, testData.marcValueLocalM2);
MarcAuthorities.checkNoResultsMessage(
`No results found for "${testData.marcValueLocalM2}". Please check your spelling and filters.`,
);

MarcAuthorities.searchBy(testData.authoritySearchOption, testData.testId);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHORIZED,
`${testData.sharedIcon}${testData.recordTypesAndValues.authorizedSharedValue}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.REFERENCE,
`${testData.sharedIcon}${testData.recordTypesAndValues.referenceValueShared}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHREF,
`${testData.sharedIcon}${testData.recordTypesAndValues.authRefValueShared}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHORIZED,
testData.recordTypesAndValues.authorizedValueM1,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.REFERENCE,
testData.recordTypesAndValues.referenceValueM1,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHREF,
testData.recordTypesAndValues.authRefValueM1,
);

MarcAuthorities.switchToBrowse();
MarcAuthorities.searchByParameter(
testData.authorityBrowseOption,
testData.marcValueShared,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHORIZED,
`${testData.sharedIcon}${testData.recordTypesAndValues.authorizedSharedValue}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.REFERENCE,
`${testData.sharedIcon}${testData.recordTypesAndValues.referenceValueShared}`,
);

MarcAuthorities.searchByParameter(testData.authorityBrowseOption, testData.testId);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHORIZED,
`${testData.sharedIcon}${testData.recordTypesAndValues.authorizedSharedValue}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.REFERENCE,
`${testData.sharedIcon}${testData.recordTypesAndValues.referenceValueShared}`,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.AUTHORIZED,
testData.recordTypesAndValues.authorizedValueM1,
);
MarcAuthorities.checkAfterSearch(
testData.recordTypesAndValues.REFERENCE,
testData.recordTypesAndValues.referenceValueM1,
);
},
);
});
});
});
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC410744-Local-M1.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01610cz a2200337n 4500001000800000005001700008008004100025010001700066035002300083040005900106046002100165100004600186370002700232372009800259374009300357375001700450377000800467378001700475400004800492400002800540400002600568500006000594670006100654670005200715670007500767670007700842670019400919670012901113953001501242985001501257270235620210108070133.0960516n| azannaabn |a aaa c ano 96025567  a(OCoLC)oca04079825 aICIUbengerdacICIUdMoSpS-AVdIAhCCSdInIBdUPBdScU f1948-12-212edtf1 aC410744 Local Member 1 Jackson, Samuel L. aWashington (D.C.)2naf aActingaMotion pictures--Production and directionaTelevision--Production and direction2lcsh aActorsaMotion picture producers and directorsaTelevision producers and directors2lcsh aMales2lcdgt aeng qSamuel Leroy1 aC410744 Local Member 1 Jackson, Sam,d1948-1 aJackson, Samuel,d1948-1 aJackson, Samuel Leroy1 aC410744 Local Member 1 Jackson, Samuel Leroy 12-21-1948 aPulp fiction, 1996:bopening credits (Samuel L. Jackson) aLC in OCLC, 5/16/96b(hdg.: Jackson, Samuel L.) aSamuel L. Jackson, c2000:bp. 17 (Samuel Leroy Jackson; b. 12-21-1948) aUnbreakable [VR] 2001, c2000:bopening credits, cast (Samuel L. Jackson) aInternet movie database, Jan. 31, 2002:b(Samuel L. Jackson; b. Samuel Leroy Jackson, Dec. 21, 1948, Washington, D.C.; sometimes credited as Samuel Jackson, Sam Jackson; actor, 1970s-2000s) aIMDb, January 7, 2020:b(Samuel L. Jackson, actor, producer ; b. December 21, 1948 in Washington, District of Columbia, USA) axx00blg09 cOCLCeLSPC
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC410744-Local-M2.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01123cz a2200289n 450000100070000000500170000700800410002401000140006503500230007904000500010205300160015210000530016840000350022140000710025640000410032740000360036840000370040440000360044166700560047766700460053366700150057950000670059467000540066167000930071595200100080895300150081897125520131101085901.0800331n| azannaabn |b aaa  a80036674  a(OCoLC)oca00418812 aDLCbengerdacDLCdDLCdMdUdNjPdOCoLCdDLC 0aPS3521.E7351 aC410744 Local Member 2 Kerouac, Jack,d1922-19691 wnnaaKerouac, John,d1922-19691 aC410744 Local Member 2 Kérouac, Jean Louis Lebris de,d1922-19691 aChia-lo-kʻo, Chieh-kʻo,d1922-19691 aKeruak, Dz︠h︡ek,d1922-19691 aḲeruʼaḳ, G'eḳ,d1922-19691 aקרואק, ג׳ק,d1922־1969 aMachine-derived non-Latin script reference project. aNon-Latin script reference not evaluated. aSubstitute aC410744 Local Member 2 His The town and the city, 1959, c1950. aHis Malyĭ Pik, 1982:bt.p. (Dz︠h︡ek Keruak) aha-Ḥatranim, 1997:bt.p. (G'eḳ Ḳeruʼaḳ) p. facing t.p. (Jack Kerouac [in rom.]) aRETRO axx00bxk10
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC410744-Shared.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01266cz 2200289n 4500001000800000005001700008008004100025010001700066035002300083040004600106046002100152100003800173370004100211372006000252374005700312375001700369377000800386400002700394400004700421500004900468670006500517670007500582670010700657670012200764670007500886953001500961358430820190116074415.0940103n| azannaabn |a aaa  an 94000330  a(OCoLC)oca03522314 aDLCbengerdacDLCdIWhNdDLCdOCoLCdScU f1974-11-112edtf1 aC410744 Shared DiCaprio, Leonardo aHollywood (Los Angeles, Calif.)2naf aActingaMotion pictures--Production and direction2lcsh aActorsaMotion picture producers and directors2lcsh aMales2lcdgt aeng1 wnneaDiCaprio, Leonard1 aC410744 Shared Di Caprio, Leonardo (actor)1 aC410744 Shared Di Caprio, Leonardo (Titanic) aThis boy's life [MP] 1993:bcredits (cast, Leonard DiCaprio) aWhat's eating Gilbert Grape? 1994, c1993:bcredits (Leonardo DiCaprio) aHalliwell's filmgoer's & video viewer's comp., 11th ed.b(DiCaprio, Leonardo; b. 1974; American actor) aIMDb, June 6, 2003b(Leonardo DiCaprio; b. Nov. 11, 1974, Hollywood, Calif.; sometime credited as Leonardo Di Caprio) aIMDb, January 4 ,2019:b(Leonardo DiCaprio; actor, producer, director) aqu25bta30