Skip to content

Commit

Permalink
Merge branch 'master' into FAT-9308
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorBohdan committed Dec 4, 2023
2 parents 7616d30 + c5d2fd8 commit 0c321e6
Show file tree
Hide file tree
Showing 25 changed files with 1,009 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import permissions from '../../../support/dictionary/permissions';
import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions';
import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane';
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances';
import TopMenu from '../../../support/fragments/topMenu';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';

let user;
const holdingUUIDsFileName = `holdingUUIDs_${getRandomPostfix()}.csv`;
const item = {
instanceName: `testBulkEdit_${getRandomPostfix()}`,
itemBarcode: getRandomPostfix(),
};

describe('bulk-edit', () => {
describe('in-app approach', () => {
before('create test data', () => {
cy.createTempUser([
permissions.bulkEditEdit.gui,
permissions.inventoryCRUDHoldings.gui,
permissions.inventoryCRUDHoldingsNoteTypes.gui,
]).then((userProperties) => {
user = userProperties;

item.instanceId = InventoryInstances.createInstanceViaApi(
item.instanceName,
item.itemBarcode,
);
cy.getHoldings({
limit: 1,
query: `"instanceId"="${item.instanceId}"`,
}).then((holdings) => {
FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, holdings[0].id);
});
cy.login(user.username, user.password, {
path: TopMenu.bulkEditPath,
waiter: BulkEditSearchPane.waitLoading,
});
});
});

after('delete test data', () => {
cy.getAdminToken();
Users.deleteViaApi(user.userId);
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode);
FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`);
});

it(
'C415368 Verify "Select option" dropdown includes grouped options for Holdings (firebird)',
{ tags: ['smoke', 'firebird'] },
() => {
BulkEditSearchPane.verifyDragNDropHoldingsUUIDsArea();
BulkEditSearchPane.uploadFile(holdingUUIDsFileName);
BulkEditSearchPane.waitFileUploading();

BulkEditActions.openActions();
BulkEditActions.openInAppStartBulkEditFrom();
BulkEditActions.verifyHoldingsOptions();
},
);
});
});
15 changes: 13 additions & 2 deletions cypress/e2e/inventory/search/browse-contributors-back.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Permissions from '../../../support/dictionary/permissions';
import InstanceRecordEdit from '../../../support/fragments/inventory/instanceRecordEdit';
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances';
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance';
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
import BrowseContributors from '../../../support/fragments/inventory/search/browseContributors';
import TopMenu from '../../../support/fragments/topMenu';
Expand Down Expand Up @@ -36,7 +37,17 @@ describe('Inventory -> Contributors Browse', () => {
});

beforeEach(() => {
InventoryInstances.createInstanceViaApi(testData.item.instanceName, testData.item.itemBarcode);
cy.getInstanceTypes({ limit: 2 }).then((instanceTypes) => {
InventoryInstances.createFolioInstanceViaApi({
instance: {
instanceTypeId: instanceTypes[0].id,
title: testData.item.instanceName,
},
}).then((instanceIds) => {
testData.instanceId = instanceIds.instanceId;
});
});

cy.loginAsAdmin({
path: TopMenu.inventoryPath,
waiter: InventorySearchAndFilter.waitLoading,
Expand Down Expand Up @@ -74,7 +85,7 @@ describe('Inventory -> Contributors Browse', () => {

afterEach(() => {
cy.getAdminToken();
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(testData.item.itemBarcode);
InventoryInstance.deleteInstanceViaApi(testData.instanceId);
});

it(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import getRandomPostfix from '../../../support/utils/stringTools';
describe('MARC -> MARC Authority', () => {
const testData = {
marcValue:
'C350932 Beethoven, Ludwig van, 1770-1827. Variations, piano, violin, cello, op. 44, E♭ major',
'C350932 Beethoven, Ludwig van, 1770-1827. 14 variations sur un thème original',
markedValue: 'C350932 Beethoven, Ludwig van,',
searchOption: 'Keyword',
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import getRandomPostfix from '../../../support/utils/stringTools';
import Permissions from '../../../support/dictionary/permissions';
import TopMenu from '../../../support/fragments/topMenu';
import DataImport from '../../../support/fragments/data_import/dataImport';
import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority';
import Users from '../../../support/fragments/users/users';
import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles';
import Logs from '../../../support/fragments/data_import/logs/logs';
import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities';

describe('MARC -> MARC Authority', () => {
const testData = {
authority: {
title: 'Type of heading test',
searchOption: 'Keyword',
all: '*',
},

columnHeaders: [
{ header: 'Authorized/Reference', index: 1 },
{ header: 'Heading/Reference', index: 2 },
{ header: 'Type of heading', index: 3 },
],
};
const marcFiles = [
{
marc: 'marcFileForC353607.mrc',
fileName: `testMarcFile.${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create SRS MARC Authority',
numOfRecords: 19,
},
];

const createdAuthorityIDs = [];

before(() => {
cy.createTempUser([Permissions.uiMarcAuthoritiesAuthorityRecordView.gui]).then(
(createdUserProperties) => {
testData.userProperties = createdUserProperties;
},
);

marcFiles.forEach((marcFile) => {
cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => {
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileName);
Logs.checkStatusOfJobProfile('Completed');
Logs.openFileDetails(marcFile.fileName);
for (let i = 0; i < marcFile.numOfRecords; i++) {
Logs.getCreatedItemsID(i).then((link) => {
createdAuthorityIDs.push(link.split('/')[5]);
});
}

cy.login(testData.userProperties.username, testData.userProperties.password, {
path: TopMenu.marcAuthorities,
waiter: MarcAuthorities.waitLoading,
});
});
});
});

after(() => {
cy.getAdminToken();
createdAuthorityIDs.forEach((id) => {
MarcAuthority.deleteViaAPI(id);
});
Users.deleteViaApi(testData.userProperties.userId);
});

it(
'C353607 The search result list is sorted by clicking on the titles of columns (TaaS) (spitfire)',
{ tags: ['criticalPath', 'spitfire'] },
() => {
MarcAuthorities.checkSearchOptions();
MarcAuthorities.searchBy(testData.authority.searchOption, testData.authority.all);

MarcAuthorities.clickActionsButton();
MarcAuthorities.verifyActionsSortedBy('Relevance');
testData.columnHeaders.forEach(({ header, index }) => {
MarcAuthorities.clickOnColumnHeader(header);
// wait for result list to be sorted
cy.wait(2000);
MarcAuthorities.checkResultListSortedByColumn(index);
MarcAuthorities.clickOnColumnHeader(header);
// wait for result list to be sorted
cy.wait(2000);
MarcAuthorities.checkResultListSortedByColumn(index, false);
MarcAuthorities.verifyActionsSortedBy(header);
});
},
);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import Permissions from '../../../../support/dictionary/permissions';
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 InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance';
import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances';
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor';
import TopMenu from '../../../../support/fragments/topMenu';
import Users from '../../../../support/fragments/users/users';
import getRandomPostfix from '../../../../support/utils/stringTools';
import InventorySteps from '../../../../support/fragments/inventory/inventorySteps';
import DateTools from '../../../../support/utils/dateTools';

describe('MARC -> MARC Bibliographic -> Edit MARC bib', () => {
const testData = {
createdRecordIDs: [],
tag245: '245',
tag245content:
'$aWicked :$bthe life and times of the wicked witch of the West : a novel /$cGregory Maguire ; illustrations by Douglas Smith. TEST',
tag245RowIndex: 12,
tag008: '008',
tag008RowIndex: 3,
tag00: '00',
expected008BoxesSets: [
'DtSt',
'Start date',
'End date',
'Ctry',
'Ills',
'Audn',
'Form',
'Cont',
'GPub',
'Conf',
'Fest',
'Indx',
'LitF',
'Biog',
'Lang',
'MRec',
'Srce',
],
tag008BoxValues: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
calloutMessage:
'This record has successfully saved and is in process. Changes may not appear immediately.',
errorCalloutMessage: 'Record cannot be saved without 008 field',
initial008EnteredValue: DateTools.getCurrentDateYYMMDD(),
};
const marcFile = {
marc: 'marcBibFileForC387451.mrc',
fileName: `testMarcFile${getRandomPostfix()}.mrc`,
jobProfileToRun: 'Default - Create instance and SRS MARC Bib',
numOfRecords: 1,
};

before('Creating user and data', () => {
cy.createTempUser([
Permissions.inventoryAll.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui,
Permissions.moduleDataImportEnabled.gui,
]).then((createdUserProperties) => {
testData.userProperties = createdUserProperties;

cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => {
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileName);
Logs.checkStatusOfJobProfile('Completed');
Logs.openFileDetails(marcFile.fileName);
for (let i = 0; i < marcFile.numOfRecords; i++) {
Logs.getCreatedItemsID(i).then((link) => {
testData.createdRecordIDs.push(link.split('/')[5]);
});
}
});

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

after('Deleting created user and data', () => {
cy.getAdminToken().then(() => {
Users.deleteViaApi(testData.userProperties.userId);
InventoryInstance.deleteInstanceViaApi(testData.createdRecordIDs[0]);
});
});

it(
'C387451 "008" field existence validation when edit imported "MARC bib" (spitfire) (TaaS)',
{ tags: ['extendedPath', 'spitfire'] },
() => {
InventoryInstances.waitContentLoading();
InventoryInstance.searchByTitle(testData.createdRecordIDs[0]);
InventoryInstances.selectInstance();
InventoryInstance.editMarcBibliographicRecord();
QuickMarcEditor.checkEditableQuickMarcFormIsOpened();
QuickMarcEditor.updateExistingFieldContent(testData.tag245RowIndex, testData.tag245content);
QuickMarcEditor.checkButtonsEnabled();
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkCallout(testData.errorCalloutMessage);
QuickMarcEditor.closeCallout();
QuickMarcEditor.clickSaveAndKeepEditingButton();
QuickMarcEditor.checkCallout(testData.errorCalloutMessage);
QuickMarcEditor.closeCallout();
QuickMarcEditor.addNewField(testData.tag008, '', testData.tag008RowIndex);
QuickMarcEditor.check008FieldLabels(testData.expected008BoxesSets);
QuickMarcEditor.updateExistingTagValue(4, testData.tag00);
QuickMarcEditor.verifyTagValue(4, testData.tag00);
QuickMarcEditor.checkContent('', 4);
QuickMarcEditor.checkDeleteButtonExist(4);
QuickMarcEditor.updateExistingTagValue(4, testData.tag008);
QuickMarcEditor.pressSaveAndKeepEditing(testData.calloutMessage);
QuickMarcEditor.checkEditableQuickMarcFormIsOpened();
QuickMarcEditor.check008FieldContent();
QuickMarcEditor.updateValuesIn008Boxes(testData.tag008BoxValues);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventorySteps.verifyHiddenFieldValueIn008(
testData.createdRecordIDs[0],
'Entered',
testData.initial008EnteredValue,
);
},
);
});
Loading

0 comments on commit 0c321e6

Please sign in to comment.