Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/folio-org/stripes-testing
Browse files Browse the repository at this point in the history
…into FAT-10336-C409517
  • Loading branch information
TetianaParanich committed May 23, 2024
2 parents 9168aa5 + 1bf543b commit 86361c3
Show file tree
Hide file tree
Showing 107 changed files with 3,224 additions and 1,990 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
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 ExportFile from '../../../support/fragments/data-export/exportFile';
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances';
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView';
import TopMenu from '../../../support/fragments/topMenu';
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { HOLDING_NOTES } from '../../../support/constants';
import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView';

let user;
const notes = {
actionNote: 'Holding note',
actionNoteStaffOnly: 'Holding note Staff only',
};

const item = {
barcode: getRandomPostfix(),
instanceName: `instance-${getRandomPostfix()}`,
};
const holdingUUIDsFileName = `validHoldingUUIDs_${getRandomPostfix()}.csv`;
const matchedRecordsFileName = `*-Matched-Records-${holdingUUIDsFileName}`;
const previewFileName = `*-Updates-Preview-${holdingUUIDsFileName}`;
const changedRecordsFileName = `*-Changed-Records-${holdingUUIDsFileName}`;

describe('bulk-edit', () => {
describe('in-app approach', () => {
before('create test data', () => {
cy.createTempUser([
permissions.bulkEditView.gui,
permissions.bulkEditEdit.gui,
permissions.inventoryAll.gui,
]).then((userProperties) => {
user = userProperties;
cy.login(user.username, user.password, {
path: TopMenu.bulkEditPath,
waiter: BulkEditSearchPane.waitLoading,
});
item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode);
cy.getHoldings({
limit: 1,
query: `"instanceId"="${item.instanceId}"`,
}).then((holdings) => {
item.holdingHRID = holdings[0].hrid;
item.holdingsUUID = holdings[0].id;
FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, holdings[0].id);
cy.updateHoldingRecord(holdings[0].id, {
...holdings[0],
notes: [
{
holdingsNoteTypeId: HOLDING_NOTES.ACTION_NOTE,
note: notes.actionNote,
staffOnly: false,
},
{
holdingsNoteTypeId: HOLDING_NOTES.ACTION_NOTE,
note: notes.actionNoteStaffOnly,
staffOnly: true,
},
],
});
});
});
});

after('delete test data', () => {
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode);
Users.deleteViaApi(user.userId);
FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`);
FileManager.deleteFileFromDownloadsByMask(
matchedRecordsFileName,
previewFileName,
changedRecordsFileName,
);
});

it(
'C422004 Verify Bulk Edit actions for Holdings notes - preserve the "Staff only" flag when change note type within the group (firebird)',
{ tags: ['criticalPath', 'firebird'] },
() => {
BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Holdings', 'Holdings UUIDs');
BulkEditSearchPane.uploadFile(holdingUUIDsFileName);
BulkEditSearchPane.waitFileUploading();
BulkEditSearchPane.verifyMatchedResults(item.holdingHRID);

BulkEditActions.downloadMatchedResults();
BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Action note', 'Note');
BulkEditActions.openInAppStartBulkEditFrom();
ExportFile.verifyFileIncludes(matchedRecordsFileName, [item.holdingsUUID]);
BulkEditActions.verifyHoldingsOptions();
BulkEditActions.changeNoteType('Action note', 'Note');

BulkEditActions.confirmChanges();
BulkEditActions.verifyChangesInAreYouSureForm('Note', [
`${notes.actionNote} | ${notes.actionNoteStaffOnly} (staff only)`,
]);
BulkEditActions.downloadPreview();
ExportFile.verifyFileIncludes(previewFileName, [
`Note;${notes.actionNote};false|Note;${notes.actionNoteStaffOnly};true,`,
]);
BulkEditActions.commitChanges();
BulkEditSearchPane.waitFileUploading();
BulkEditSearchPane.verifyChangesUnderColumns(
'Note',
`${notes.actionNote} | ${notes.actionNoteStaffOnly} (staff only)`,
);
BulkEditSearchPane.verifyExactChangesUnderColumns('Action note', '');
BulkEditActions.openActions();
BulkEditActions.downloadChangedCSV();
ExportFile.verifyFileIncludes(changedRecordsFileName, [
`Note;${notes.actionNote};false|Note;${notes.actionNoteStaffOnly};true,`,
]);

TopMenuNavigation.navigateToApp('Inventory');
InventorySearchAndFilter.switchToHoldings();
InventorySearchAndFilter.searchHoldingsByHRID(item.holdingHRID);
InventorySearchAndFilter.selectViewHoldings();
HoldingsRecordView.checkHoldingsNoteByRow([notes.actionNote, 'No']);
HoldingsRecordView.checkHoldingsNoteByRow([notes.actionNoteStaffOnly, 'Yes'], 1);
ItemRecordView.verifyTextAbsent('Action note');
},
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView';
import { HOLDING_NOTES } from '../../../support/constants';

let user;
const notes = {
Expand Down Expand Up @@ -51,14 +52,12 @@ describe('bulk-edit', () => {
administrativeNotes: [notes.admin],
notes: [
{
// Action note
holdingsNoteTypeId: 'd6510242-5ec3-42ed-b593-3585d2e48fd6',
holdingsNoteTypeId: HOLDING_NOTES.ACTION_NOTE,
note: notes.action,
staffOnly: false,
},
{
// Electronic bookplate note
holdingsNoteTypeId: '88914775-f677-4759-b57b-1a33b90b24e0',
holdingsNoteTypeId: HOLDING_NOTES.ELECTRONIC_BOOKPLATE_NOTE,
note: notes.elbook,
staffOnly: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView';
import { HOLDING_NOTES } from '../../../support/constants';

let user;

Expand Down Expand Up @@ -53,14 +54,12 @@ describe('bulk-edit', () => {
administrativeNotes: [notes.admin],
notes: [
{
// Binding
holdingsNoteTypeId: 'e19eabab-a85c-4aef-a7b2-33bd9acef24e',
holdingsNoteTypeId: HOLDING_NOTES.BINDING_NOTE,
note: notes.binding,
staffOnly: false,
},
{
// Provenance
holdingsNoteTypeId: 'db9b4787-95f0-4e78-becf-26748ce6bdeb',
holdingsNoteTypeId: HOLDING_NOTES.PROVENANCE_NOTE,
note: notes.provenance,
staffOnly: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES } from '../../../support/constants';

let user;
let noteTypeId;
Expand Down Expand Up @@ -43,7 +44,7 @@ describe('bulk-edit', () => {
const itemData = res;
itemData.notes = [
{
itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e',
itemNoteTypeId: ITEM_NOTES.ACTION_NOTE,
note: actionNote,
staffOnly: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES } from '../../../support/constants';

let user;
const notes = {
Expand Down Expand Up @@ -51,12 +52,12 @@ describe('bulk-edit', () => {

itemData.notes = [
{
itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e',
itemNoteTypeId: ITEM_NOTES.ACTION_NOTE,
note: notes.actionOne,
staffOnly: true,
},
{
itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e',
itemNoteTypeId: ITEM_NOTES.ACTION_NOTE,
note: notes.actionTwo,
staffOnly: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES } from '../../../support/constants';

let user;
const notes = {
Expand Down Expand Up @@ -46,7 +47,7 @@ describe('bulk-edit', () => {

itemData.notes = [
{
itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e',
itemNoteTypeId: ITEM_NOTES.ACTION_NOTE,
note: notes.action,
staffOnly: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES } from '../../../support/constants';

let user;
const notes = {
Expand Down Expand Up @@ -43,26 +44,22 @@ describe('bulk-edit', () => {
const itemData = res;
itemData.notes = [
{
// "Binding" Item note type
itemNoteTypeId: '87c450be-2033-41fb-80ba-dd2409883681',
itemNoteTypeId: ITEM_NOTES.BINDING_NOTE,
note: notes.bindingNote,
staffOnly: true,
},
{
// "Note" Item note type
itemNoteTypeId: '8d0a5eca-25de-4391-81a9-236eeefdd20b',
itemNoteTypeId: ITEM_NOTES.NOTE_NOTE,
note: notes.noteNote,
staffOnly: true,
},
{
// "Copy note" Item note type
itemNoteTypeId: '1dde7141-ec8a-4dae-9825-49ce14c728e7',
itemNoteTypeId: ITEM_NOTES.COPY_NOTE,
note: notes.copyNote,
staffOnly: false,
},
{
// "Electronic bookplate" Item note type
itemNoteTypeId: 'f3ae3823-d096-4c65-8734-0c1efd2ffea8',
itemNoteTypeId: ITEM_NOTES.ELECTRONIC_BOOKPLATE_NOTE,
note: notes.electronicBookplateNote,
staffOnly: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-acti
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView';
import { ITEM_NOTES } from '../../../support/constants';

let user;
const notes = {
Expand Down Expand Up @@ -45,12 +46,12 @@ describe('bulk-edit', () => {

itemData.notes = [
{
itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e',
itemNoteTypeId: ITEM_NOTES.ACTION_NOTE,
note: notes.action,
staffOnly: true,
},
{
itemNoteTypeId: '1dde7141-ec8a-4dae-9825-49ce14c728e7',
itemNoteTypeId: ITEM_NOTES.COPY_NOTE,
note: notes.copy,
staffOnly: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES } from '../../../support/constants';

let user;
const notes = {
Expand Down Expand Up @@ -53,12 +54,12 @@ describe('bulk-edit', () => {

itemData.notes = [
{
itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e',
itemNoteTypeId: ITEM_NOTES.ACTION_NOTE,
note: notes.actionOne,
staffOnly: true,
},
{
itemNoteTypeId: '0e40884c-3523-4c6d-8187-d578e3d2794e',
itemNoteTypeId: ITEM_NOTES.ACTION_NOTE,
note: notes.actionTwo,
staffOnly: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES } from '../../../support/constants';

let user;

Expand Down Expand Up @@ -52,12 +53,12 @@ describe('bulk-edit', () => {

res.notes = [
{
itemNoteTypeId: '1dde7141-ec8a-4dae-9825-49ce14c728e7',
itemNoteTypeId: ITEM_NOTES.COPY_NOTE,
note: notes.copy,
staffOnly: false,
},
{
itemNoteTypeId: 'f3ae3823-d096-4c65-8734-0c1efd2ffea8',
itemNoteTypeId: ITEM_NOTES.ELECTRONIC_BOOKPLATE_NOTE,
note: notes.electronicBookplate,
staffOnly: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES } from '../../../support/constants';

let user;
const notes = {
Expand Down Expand Up @@ -40,26 +41,22 @@ describe('bulk-edit', () => {

itemData.notes = [
{
// "Copy note" Item note type
itemNoteTypeId: '1dde7141-ec8a-4dae-9825-49ce14c728e7',
itemNoteTypeId: ITEM_NOTES.COPY_NOTE,
note: notes.copyNote,
staffOnly: false,
},
{
// "Copy note" Item note type staffOnly
itemNoteTypeId: '1dde7141-ec8a-4dae-9825-49ce14c728e7',
itemNoteTypeId: ITEM_NOTES.COPY_NOTE,
note: notes.copyNoteStaffOnly,
staffOnly: true,
},
{
// "Electronic bookplate" Item note type
itemNoteTypeId: 'f3ae3823-d096-4c65-8734-0c1efd2ffea8',
itemNoteTypeId: ITEM_NOTES.ELECTRONIC_BOOKPLATE_NOTE,
note: notes.electronicBookplateNote,
staffOnly: false,
},
{
// "Electronic bookplate" Item note type staffOnly
itemNoteTypeId: 'f3ae3823-d096-4c65-8734-0c1efd2ffea8',
itemNoteTypeId: ITEM_NOTES.ELECTRONIC_BOOKPLATE_NOTE,
note: notes.electronicBookplateNoteStaffOnly,
staffOnly: true,
},
Expand Down
Loading

0 comments on commit 86361c3

Please sign in to comment.