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-10432-C402767-Consortia #2954

Merged
merged 3 commits into from
Jan 3, 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
Expand Up @@ -111,7 +111,7 @@ describe('MARC -> MARC Bibliographic -> Create new MARC bib -> Consortia', () =>
});
InventoryInstance.searchByTitle(testData.fieldContents.tag245Content, false);
InventoryInstance.verifyNoResultFoundMessage(
`No results found for "${testData.fieldContents.tag245Content}". Please check your spelling and filters.`
`No results found for "${testData.fieldContents.tag245Content}". Please check your spelling and filters.`,
);
},
);
Expand Down
156 changes: 156 additions & 0 deletions cypress/e2e/consortia/derive-from-shared-marc-bib-in-central.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
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 TestTypes from '../../support/dictionary/testTypes';
import DevTeams from '../../support/dictionary/devTeams';
import InventoryInstance from '../../support/fragments/inventory/inventoryInstance';
import InventoryViewSource from '../../support/fragments/inventory/inventoryViewSource';
import QuickMarcEditor from '../../support/fragments/quickMarcEditor';
import ConsortiumManager from '../../support/fragments/settings/consortium-manager/consortium-manager';
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 getRandomPostfix from '../../support/utils/stringTools';

describe('MARC -> MARC Bibliographic -> Derive MARC bib -> Consortia', () => {
const testData = {
tag245: '245',
tag245DerivedContent: '$a C402767 Variations (derived record) / $c Ludwig Van Beethoven.',
tag245EditedContent:
'$a C402767 Variations (derived and edited record) / $c Ludwig Van Beethoven.',
instanceTitle: 'C402767 Variations / Ludwig Van Beethoven.',
instanceDerivedTitle: 'C402767 Variations (derived record) / Ludwig Van Beethoven.',
instanceEditedTitle: 'C402767 Variations (derived and edited record) / Ludwig Van Beethoven.',
deriveSharedPaneheaderText: 'Derive a new shared MARC bib record',
sourceViewSharedText: 'Shared MARC bibliographic record',
};

const marcFile = {
marc: 'marcBibFileC402767.mrc',
fileNameImported: `testMarcFileC402767.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create instance and SRS MARC Bib',
};

const users = {};

const createdInstanceIDs = [];

before('Create user, data', () => {
cy.getAdminToken();
cy.createTempUser([
Permissions.uiInventoryViewInstances.gui,
Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui,
])
.then((userProperties) => {
users.userProperties = userProperties;

cy.assignAffiliationToUser(Affiliations.College, users.userProperties.userId);
cy.setTenant(Affiliations.College);
cy.assignPermissionsToExistingUser(users.userProperties.userId, [
Permissions.uiInventoryViewInstances.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui,
]);
})
.then(() => {
cy.resetTenant();
cy.loginAsAdmin().then(() => {
cy.visit(TopMenu.dataImportPath);
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported);
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileNameImported);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileNameImported);
Logs.getCreatedItemsID().then((link) => {
createdInstanceIDs.push(link.split('/')[5]);
});
});

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

after('Delete user, data', () => {
cy.resetTenant();
cy.getAdminToken();
Users.deleteViaApi(users.userProperties.userId);
createdInstanceIDs.forEach((instanceID) => {
InventoryInstance.deleteInstanceViaApi(instanceID);
});
});

it(
'C402767 Derive new Shared MARC bib record from Shared Instance in Central tenant (consortia) (spitfire)',
{ tags: [TestTypes.criticalPath, DevTeams.spitfire] },
() => {
cy.visit(`${TopMenu.inventoryPath}/view/${createdInstanceIDs[0]}`);
InventoryInstance.waitLoading();
InventoryInstance.checkPresentedText(testData.instanceTitle);

InventoryInstance.deriveNewMarcBib();
QuickMarcEditor.checkPaneheaderContains(testData.deriveSharedPaneheaderText);
QuickMarcEditor.updateExistingField(testData.tag245, testData.tag245DerivedContent);
QuickMarcEditor.checkContentByTag(testData.tag245, testData.tag245DerivedContent);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndCloseDerive();
InventoryInstance.checkSharedTextInDetailView();
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.checkPresentedText(testData.instanceDerivedTitle);
InventoryInstance.verifyLastUpdatedSource(
users.userProperties.firstName,
users.userProperties.lastName,
);
InventoryInstance.verifyLastUpdatedDate();
InventoryInstance.verifyRecordCreatedSource(
users.userProperties.firstName,
users.userProperties.lastName,
);
InventoryInstance.getId().then((id) => {
createdInstanceIDs.push(id);

InventoryInstance.editMarcBibliographicRecord();
QuickMarcEditor.checkContentByTag(testData.tag245, testData.tag245DerivedContent);
QuickMarcEditor.updateExistingField(testData.tag245, testData.tag245EditedContent);
QuickMarcEditor.checkContentByTag(testData.tag245, testData.tag245EditedContent);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkSharedTextInDetailView();
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.checkPresentedText(testData.instanceEditedTitle);

ConsortiumManager.switchActiveAffiliation(tenantNames.college);
InventoryInstances.waitContentLoading();
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college);

InventoryInstance.searchByTitle(createdInstanceIDs[1]);
InventoryInstances.selectInstance();
InventoryInstance.checkPresentedText(testData.instanceEditedTitle);
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.verifyLastUpdatedSource(
users.userProperties.firstName,
users.userProperties.lastName,
);
InventoryInstance.verifyLastUpdatedDate();
InventoryInstance.verifyRecordCreatedSource(
users.userProperties.firstName,
users.userProperties.lastName,
);

InventoryInstance.viewSource();
InventoryViewSource.contains(testData.tag245EditedContent);
InventoryViewSource.contains(testData.sourceViewSharedText);
});
},
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const testUser = {
email: 'test@folio.org',
},
patronGroup: 'undergrad (Undergraduate Student)',
userType: 'Staff' // select staff
userType: 'Staff', // select staff
};
const newUsername = getTestEntityValue('username');

Expand All @@ -43,7 +43,8 @@ describe('Users (Consortia)', () => {
Users.deleteViaApi(user.userId);
});

it('C418647 Creating new patron user with empty "Username" field (thunderjet) (consortia)',
it(
'C418647 Creating new patron user with empty "Username" field (thunderjet) (consortia)',
{ tags: [testTypes.criticalPath, devTeams.thunderjet] },
() => {
Users.createViaUiIncomplete(testUser).then((id) => {
Expand All @@ -63,5 +64,6 @@ describe('Users (Consortia)', () => {
UserEdit.saveEditedUser();
Users.verifyUserTypeOnUserDetailsPane('staff');
Users.verifyUsernameOnUserDetailsPane(newUsername);
});
},
);
});
1 change: 1 addition & 0 deletions cypress/fixtures/marcBibFileC402767.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
03576cjm 2200733 i 4500001001500000008004100015007001500056005001700071035002400088040009000112024001700202028002000219028002300239033003300262035002200295041002300317042000800340050002200348082001900370100005000389240003600439245004800475264003200523264001200555300003800567306001100605336003700616337002300653338003100676344001900707344001900726344001200745347002200757347001300779370004600792386003000838386002600868386003300894386002900927511002600956518006500982546012101047505041101168650001701579650002301596650002301619650002301642650004201665650004901707655004901756655003001805655003201835700008701867700010101954700010102055700012002156700012602276700011602402700010702518700010402625938005402729994001402783948004502797nin00009530351200724p20202020enkvrnn efi n zxx csd fu|gnn|m|eu20221219103441.0 a(OCoLC)on1182808100 aTDFbengerdacTDFdOCLCQdOCLCOdTEFdOCLCFdUIUdCLOdOCLCOdWAUdOCLCQdOCLCOdOCL10a03457128346302a68346bHyperion02aCDA68346bHyperion20a20200127a20200130b6299cB3 a(OCoLC)11828081000 genggfreggermeng apcc 4aM27.B44bV37 202004a786.2/18252231 aBeethoven, Ludwig van,d1770-1827,ecomposer.10aVariations,mpiano.kSelections10aC402767 Variations /cLudwig Van Beethoven. 1aLondon :bHyperion,c[2020] 4c℗2020 a1 audio disc (79:43) ;c4 3/4 in. a011943 aperformed musicbprm2rdacontent aaudiobs2rdamedia aaudio discbsd2rdacarrier adigital2rdatr boptical2rdarm c1.4 m/s aaudio file2rdaft bCD audio iPlace of capture:fBerliln (Germany)2naf iComposer:aGermans2lcdgt iComposer:aMen2lcdgt iPerformer:aCanadians2lcdgt iPerformer:aWomen2lcdgt0 aAngela Hewitt, piano. oRecordedd2020 January 27-30pJesus-Christus-Kirche, Berlin. aProgram notes by Angela Hewitt in English, with French and German translations (15 pages : illustrations) on insert.0 a32 variations on an original theme in C minor (13:00) -- 6 variations on an original theme in F major, op. 34 (14:27) -- 15 variations and a fugue on an original theme 'Eroica', op. 35 (24:54) -- 9 variations on the aria 'Quant'è più bello' (6:30) -- 6 variations on the duet 'Nel cor più non mi sento' (5:51) -- 7 variations on 'God save the King' (9:27) -- 5 variations on 'Rule, Britannia' (5:31). 0aPiano music. 0aVariations (Piano) 6aPiano, Musique de. 6aVariations (Piano) 7aPiano music2fast0(OCoLC)fst01063403 7aVariations (Piano)2fast0(OCoLC)fst01164335 7aVariations (Music)2fast0(OCoLC)fst01726509 7aVariations (Music)2lcgft 7aVariations (Musique)2rvmgf1 aHewitt, Angela,d1958-einstrumentalist,ewriter of supplementary textual content.12iContainer of (work):aBeethoven, Ludwig van,d1770-1827.tVariations,mpiano,nWoO 80,rC minor.12iContainer of (work):aBeethoven, Ludwig van,d1770-1827.tVariations,mpiano,nop. 34,rF major.12iContainer of (work):aBeethoven, Ludwig van,d1770-1827.tVariationen mit einer Fuge,mpiano,nop. 35,rE♭ major.12iContainer of (work):aBeethoven, Ludwig van,d1770-1827.tVariazioni della thema Quant' è più bello l'amor contadino.12iContainer of (work):aBeethoven, Ludwig van,d1770-1827.tVariazioni sopra il duetto Nel cor più no mi sento.12iContainer of (work):aBeethoven, Ludwig van,d1770-1827.tVariations sur le thême God save the King.12iContainer of (work):aBeethoven, Ludwig van,d1770-1827.tVariations sur le thême Rule Britannia. aTheodore Front Musical LiteraturebTFRTnTF499010 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 37 OTHER HOLDINGS
1 change: 1 addition & 0 deletions cypress/fixtures/marcBibFileC402769.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
02358cam a2200349 i 4500001001600000008004100016005001700057010001700074020003700091020002700128024001200155040002800167042000800195050002700203082001600230100003700246245004900283250002700332264003200359300002300391336002600414337002800440338002700468500008400495520113700579655003101716655003101747655001901778906004501797925004201842955012401884mgin00017412112210305s2021 nyu 000 1 eng 20221108152823.5 a 2021010625 a9781538717318q(trade paperback) z9781538717301q(ebook) a24722-1 aDLCbengerdacDLCdDLC apcc00aPR9619.4.L48bR59 202100a823/.922231 aLester, Natasha,d1973-eauthor.14aC402769 The Riviera house /cNatasha Lester. aFirst Forever edition. 1aNew York :bForever,c2021. a463 pages ;c21 cm atextbtxt2rdacontent aunmediatedbn2rdamedia avolumebnc2rdacarrier aIncludes Club Car reading group discussion questions and guide (pages 457-463). a"Paris, 1939: The Nazis think Éliane can't understand German. They're wrong. They think she's merely cataloging the art collection in The Louvre while they steal national treasures for their private collections. They have no idea she's carefully decoding their notes to ensure every painting can be recovered after the war. But Éliane is playing a very dangerous game. Does she dare trust the man she once loved, or will he only betray her once again? She can't know for sure...until a visit to a stunning home on the Riviera dramatically changes the course of her life. Present Day: Seventy years after the end of WWII, Remy heads to a home she's mysteriously inherited on the French Riviera, wanting to forget the tragedy that has left her life in shambles and taken away those she loved most. But when she discovers a painting known to have been stolen decades ago, she begins to question everything she ever knew about her heritage. Maybe the Riviera house holds more secrets than she's ready to deal with. Or maybe, to find the answers she needs, she'll have to learn to open her heart once again"--cProvided by publisher. 7aHistorical fiction.2gsafd 7aHistorical fiction.2lcgft 7aNovels.2lcgft a7bcbccorignewd1eecipf20gy-gencatlg0 aacquireb1 shelf copyxpolicy default bxk12 2021-03-05ixk12 2021-03-05 (telework) to CIPaxn18 2021-10-18 1 copy rec'd., to CIP ver.fxk18 2022-07-20 to LOAN
15 changes: 15 additions & 0 deletions cypress/support/fragments/inventory/inventoryInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const itemBarcodeField = TextField({ name: 'barcode' });
const itemStatusKeyValue = KeyValue('Item status');
const viewHoldingsButtonByID = (holdingsID) => Section({ id: holdingsID }).find(viewHoldingsButton);
const marcAuthorityAppIcon = Link({ href: including('/marc-authorities/authorities/') });
const detailsViewPaneheader = PaneHeader({ id: 'paneHeaderpane-instancedetails' });

const messages = {
itemMovedSuccessfully: '1 item has been successfully moved.',
Expand All @@ -163,6 +164,9 @@ const validOCLC = {
},
};

const sharedTextInDetailView = 'Shared instance • ';
const localTextInDetailView = 'Local instance • ';

const pressAddHoldingsButton = () => {
cy.do(addHoldingButton.click());
HoldingsRecordEdit.waitLoading();
Expand Down Expand Up @@ -1210,6 +1214,17 @@ export default {
.should('include.text', `${userLastName}, ${userFirsttName}`);
},

verifyRecordCreatedSource: (userFirsttName, userLastName) => {
cy.get('div[data-test-created-by="true"]')
.find('a')
.should('include.text', `${userLastName}, ${userFirsttName}`);
},

checkSharedTextInDetailView(isShared = true) {
const expectedText = isShared ? sharedTextInDetailView : localTextInDetailView;
cy.expect(detailsViewPaneheader.has({ title: including(expectedText) }));
},

verifyContributorAbsent: (text) => {
cy.expect(section.find(Button(including('Contributor'))).exists());
cy.expect(
Expand Down
35 changes: 16 additions & 19 deletions cypress/support/fragments/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,29 +102,26 @@ export default {
},

createViaUiIncomplete: (userData) => {
return cy
.do([
Dropdown('Actions').find(Button()).click(),
Button({ id: 'clickable-newuser' }).click(),
TextField({ id: 'adduser_lastname' }).fillIn(userData.personal.lastName),
TextField({ id: 'adduser_middlename' }).fillIn(userData.personal.middleName),
TextField({ id: 'adduser_firstname' }).fillIn(userData.personal.firstName),
TextField({ id: 'adduser_preferredname' }).fillIn(userData.personal.preferredFirstName),
Select({ id: 'adduser_group' }).choose(userData.patronGroup),
Select({ id: 'type' }).choose(userData.userType),
TextField({ name: 'barcode' }).fillIn(userData.barcode),
TextField({ id: 'adduser_email' }).fillIn(userData.personal.email),
TextField({ id: 'adduser_username' }).fillIn(userData.username),
Button({ id: 'clickable-save' }).click(),
Dropdown('Actions').absent(),
]);
return cy.do([
Dropdown('Actions').find(Button()).click(),
Button({ id: 'clickable-newuser' }).click(),
TextField({ id: 'adduser_lastname' }).fillIn(userData.personal.lastName),
TextField({ id: 'adduser_middlename' }).fillIn(userData.personal.middleName),
TextField({ id: 'adduser_firstname' }).fillIn(userData.personal.firstName),
TextField({ id: 'adduser_preferredname' }).fillIn(userData.personal.preferredFirstName),
Select({ id: 'adduser_group' }).choose(userData.patronGroup),
Select({ id: 'type' }).choose(userData.userType),
TextField({ name: 'barcode' }).fillIn(userData.barcode),
TextField({ id: 'adduser_email' }).fillIn(userData.personal.email),
TextField({ id: 'adduser_username' }).fillIn(userData.username),
Button({ id: 'clickable-save' }).click(),
Dropdown('Actions').absent(),
]);
},

verifyUsernameMandatory(mandatory = true) {
if (mandatory) {
cy.expect(
TextField('Username*').exists(),
);
cy.expect(TextField('Username*').exists());
} else {
cy.expect(TextField('Username').exists());
}
Expand Down