Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdanihor committed Apr 16, 2024
2 parents b5b5f56 + 4d39546 commit 9168dee
Show file tree
Hide file tree
Showing 21 changed files with 457 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-s
import UsersSearchPane from '../../../support/fragments/users/usersSearchPane';
import UserEdit from '../../../support/fragments/users/userEdit';
import UsersCard from '../../../support/fragments/users/usersCard';
import QueryModal from '../../../support/fragments/bulk-edit/query-modal';

let user;

Expand Down Expand Up @@ -33,7 +34,7 @@ describe('bulk-edit', () => {
});

it(
'C413369 Verify Query tab permissions (In app items) (firebird)',
'C376991 Verify Query tab permissions (In app items) (firebird)',
{ tags: ['criticalPath', 'firebird'] },
() => {
BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier');
Expand Down Expand Up @@ -63,6 +64,15 @@ describe('bulk-edit', () => {
});
BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Query');
BulkEditSearchPane.verifySetCriteriaPaneSpecificTabsHidden('Logs');
BulkEditSearchPane.openQuerySearch();
BulkEditSearchPane.isHoldingsRadioChecked(false);
BulkEditSearchPane.isInstancesRadioChecked(false);
BulkEditSearchPane.isItemsRadioChecked(false);
BulkEditSearchPane.verifyUsersRadioAbsent();
BulkEditSearchPane.verifyInputLabel(
'Select a record type and then click the Build query button.',
);
QueryModal.buildQueryButtonDisabled();
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('Data Import', () => {
cy.expect(beforeFilteringCells).to.not.deep.equal(afterFilteringByJobProfileCells);
LogsViewAll.checkByReverseChronologicalOrder();
LogsViewAll.resetAllFilters(false);
cy.wait(3000);
LogsViewAll.getAllLogsColumnsResults(jobProfileColumn).then(
(afterResetFilteringCells) => {
LogsViewAll.checkByReverseChronologicalOrder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('eHoldings', () => {
const today = moment().utc().format('M/D/YYYY');
describe('Title+Package', () => {
const testData = {
title: 'Fish Biology',
title: 'Biology of Fishes',
titleId: '',
titleName: '',
titlePackages: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ describe('Inventory', () => {
// uncheck first, since this checkbox can be checked by default
HridHandling.uncheckRemoveLeadingZeroesIfCheckedAndSave();
HridHandling.checkRemoveLeadingZeroesAndSave();

let date = DateTools.getFormattedDateWithTime(new Date(), { withSpace: true });
// wait, because next steps can be failed without it
cy.wait(5000);
HridHandling.verifyValueInRecordDetailsSection(testData.user.username);
HridHandling.verifyValueInRecordDetailsSection(date);
HridHandling.uncheckRemoveLeadingZeroesAndSave();

date = DateTools.getFormattedDateWithTime(new Date(), { withSpace: true });
HridHandling.verifyValueInRecordDetailsSection(testData.user.username);
HridHandling.verifyValueInRecordDetailsSection(date);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import moment from 'moment';
import Permissions from '../../../../support/dictionary/permissions';
import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority';
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor';
import TopMenu from '../../../../support/fragments/topMenu';
import Users from '../../../../support/fragments/users/users';
import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities';
import ManageAuthorityFiles from '../../../../support/fragments/settings/marc-authority/manageAuthorityFiles';
import { DEFAULT_FOLIO_AUTHORITY_FILES } from '../../../../support/constants';

describe('MARC', () => {
describe('MARC Authority', () => {
describe('Create MARC Authority', () => {
const todayDate = moment(new Date()).format('YYYYMMDD');
const headerText = 'Create a new MARC authority record';
const tag999 = '999';
const newField010 = {
rowIndex: 4,
tag: '010',
content: '$a n000232',
};
const newField100 = {
rowIndex: 5,
tag: '100',
content: '$a 005 and 999 auto-generated test',
};
const users = {};
let createdAuthorityId;

before('Create users, data', () => {
cy.getAdminToken();
cy.createTempUser([
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Permissions.uiQuickMarcQuickMarcAuthorityCreate.gui,
Permissions.uiMarcAuthoritiesAuthorityRecordCreate.gui,
])
.then((userProperties) => {
users.userProperties = userProperties;

ManageAuthorityFiles.setAllDefaultFOLIOFilesToActiveViaAPI();
})
.then(() => {
cy.login(users.userProperties.username, users.userProperties.password, {
path: TopMenu.marcAuthorities,
waiter: MarcAuthorities.waitLoading,
});
});
});

after('Delete users, data', () => {
cy.getAdminToken();
Users.deleteViaApi(users.userProperties.userId);
MarcAuthority.deleteViaAPI(createdAuthorityId);
ManageAuthorityFiles.unsetAllDefaultFOLIOFilesAsActiveViaAPI();
});

it(
'C423500 Verify that 005 and 999 fields are system generated after saving (spitfire)',
{ tags: ['criticalPath', 'spitfire'] },
() => {
// 1 Click on "Actions" button in second pane >> Select "+ New" option
MarcAuthorities.clickNewAuthorityButton();
QuickMarcEditor.checkPaneheaderContains(headerText);
QuickMarcEditor.verifyAuthorityLookUpButton();

// 2 Click on "Authority file look-up" hyperlink
// Click on the "Select authority file" placeholder in "Authority file name" dropdown
// Select any option
// Click on the "Save & close" button in "Select authority file" modal
QuickMarcEditor.clickAuthorityLookUpButton();
QuickMarcEditor.selectAuthorityFile(DEFAULT_FOLIO_AUTHORITY_FILES.LC_NAME_AUTHORITY_FILE);
QuickMarcEditor.clickSaveAndCloseInModal();
QuickMarcEditor.checkPaneheaderContains(headerText);

// 3 Add 2 new fields by clicking on "+" icon and fill them as specified:
// 010 \\ "$a <<enter a value in format <Prefix><Value> in accordance to selected authority file>>", ex.: "n000232"
// 100 \\ "$a 005 and 999 auto-generated test"
MarcAuthority.addNewField(newField010.rowIndex, newField010.tag, newField010.content);
MarcAuthority.addNewField(newField100.rowIndex, newField100.tag, newField100.content);
QuickMarcEditor.checkContentByTag(newField010.tag, newField010.content);
QuickMarcEditor.checkContentByTag(newField100.tag, newField100.content);

// 4 Click on the "Save & close" button
QuickMarcEditor.pressSaveAndClose();
MarcAuthority.verifyAfterSaveAndClose();
QuickMarcEditor.verifyPaneheaderWithContentAbsent(headerText);
MarcAuthorities.verifyViewPaneContentExists();
MarcAuthority.getId().then((id) => {
createdAuthorityId = id;

MarcAuthorities.checkFieldAndContentExistence('005', todayDate);
MarcAuthorities.checkFieldAndContentExistence(tag999, 'f f');
MarcAuthorities.checkFieldAndContentExistence(tag999, '$s');
MarcAuthorities.checkFieldAndContentExistence(tag999, `$i ${createdAuthorityId}`);
});
},
);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ describe('MARC', () => {
searchOption: 'Keyword',
marcAuthIcon: 'Linked to MARC authority',
authorityType: 'Auth/Ref',
searchAuthorityQueries: ['Poetry', 'Chin, Staceyann, 1972-'],
searchAuthorityQueries: ['C374148 Feminist poetry', 'C374148 Chin, Staceyann, 1972-'],
recordsLinkingData: [
{
linkingBibFieldTag: '650',
authorityTitle: 'Feminist poetry',
authorityTitle: 'C374148 Feminist poetry',
authorityLinkedFieldTag: '150',
authorityFieldValue: 'Feminist poetry',
authorityFieldValue: 'C374148 Feminist poetry',
},
{
linkingBibFieldTag: '100',
authorityTitle: 'Chin, Staceyann, 1972-',
authorityTitle: 'C374148 Chin, Staceyann, 1972-',
authorityLinkedFieldTag: '100',
authorityFieldValue: '$a Chin, Staceyann, $d 1972-',
authorityFieldValue: '$a C374148 Chin, Staceyann, $d 1972-',
},
],
linked100FieldValues: [
11,
'100',
'1',
'\\',
'$a Chin, Staceyann, $d 1972-',
'$a C374148 Chin, Staceyann, $d 1972-',
'$e Author $e Narrator',
'$0 http://id.loc.gov/authorities/names/n2008052404',
'$1 http://viaf.org/viaf/24074052',
Expand All @@ -49,10 +49,10 @@ describe('MARC', () => {
'650',
'\\',
'0',
'$a Feminist poetry $0 http://id.loc.gov/authorities/subjects/sh85047755',
'$a C374148 Feminist poetry $0 http://id.loc.gov/authorities/subjects/sh85047755',
],
deleteModalMessage:
'Are you sure you want to permanently delete the authority record: Poetry ? If you proceed with deletion, then 1 linked bibliographic record will retain authorized value and will become uncontrolled.',
'Are you sure you want to permanently delete the authority record: C374148 Poetry ? If you proceed with deletion, then 1 linked bibliographic record will retain authorized value and will become uncontrolled.',
};

const marcFiles = [
Expand All @@ -74,7 +74,7 @@ describe('MARC', () => {
fileName: `testMarcFileC374148.${getRandomPostfix()}.mrc`,
jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY,
propertyName: 'authority',
authorutyTitle: 'Poetry',
authorutyTitle: 'C374148 Poetry',
},
];

Expand All @@ -93,16 +93,16 @@ describe('MARC', () => {
});
}
});
});

marcFiles.forEach((marcFile) => {
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
marcFile.jobProfileToRun,
).then((response) => {
response.forEach((record) => {
createdRecordIDs.push(record[marcFile.propertyName].id);
});
marcFiles.forEach((marcFile) => {
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
marcFile.jobProfileToRun,
).then((response) => {
response.forEach((record) => {
createdRecordIDs.push(record[marcFile.propertyName].id);
});
});
});
Expand Down
Loading

0 comments on commit 9168dee

Please sign in to comment.