From 8a55eee1e9104ee600c7fb5b999b3f6ad1c86cfe Mon Sep 17 00:00:00 2001 From: Sherzod Kenjaev Date: Tue, 13 Feb 2024 19:16:26 +0500 Subject: [PATCH] added test C410744 --- ...th-found-in-marcAuth-app-from-member.cy.js | 237 ++++++++++++++++++ .../marcAuthFileForC410744-Local-M1.mrc | 1 + .../marcAuthFileForC410744-Local-M2.mrc | 1 + .../marcAuthFileForC410744-Shared.mrc | 1 + 4 files changed, 240 insertions(+) create mode 100644 cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC410744-Local-M1.mrc create mode 100644 cypress/fixtures/marcAuthFileForC410744-Local-M2.mrc create mode 100644 cypress/fixtures/marcAuthFileForC410744-Shared.mrc diff --git a/cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js b/cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js new file mode 100644 index 0000000000..28a74a9bcc --- /dev/null +++ b/cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js @@ -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, + ); + }, + ); + }); + }); +}); diff --git a/cypress/fixtures/marcAuthFileForC410744-Local-M1.mrc b/cypress/fixtures/marcAuthFileForC410744-Local-M1.mrc new file mode 100644 index 0000000000..08fa8d0090 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC410744-Local-M1.mrc @@ -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 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileForC410744-Local-M2.mrc b/cypress/fixtures/marcAuthFileForC410744-Local-M2.mrc new file mode 100644 index 0000000000..56e0c9552c --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC410744-Local-M2.mrc @@ -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 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileForC410744-Shared.mrc b/cypress/fixtures/marcAuthFileForC410744-Shared.mrc new file mode 100644 index 0000000000..6534d4bed7 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC410744-Shared.mrc @@ -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 \ No newline at end of file