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-13497
  • Loading branch information
bohdanihor committed May 23, 2024
2 parents 0b27fe6 + c795547 commit da9fa05
Show file tree
Hide file tree
Showing 370 changed files with 14,418 additions and 7,802 deletions.
10 changes: 10 additions & 0 deletions DockerfileCypress
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG NODE_VERSION='18.16.0'
ARG YARN_VERSION='1.22.19'
ARG CHROME_VERSION='124.0.6367.60-1'
ARG CYPRESS_VERSION='12.0.0'

FROM cypress/factory

COPY . /opt/app
WORKDIR /opt/app
RUN npm install --save-dev cypress
7 changes: 4 additions & 3 deletions cypress/e2e/bulk-edit/bulk-edit-landing-page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import BulkEditSearchPane, {
holdingsIdentifiers,
} from '../../support/fragments/bulk-edit/bulk-edit-search-pane';
import Users from '../../support/fragments/users/users';
import BulkEditLogs from '../../support/fragments/bulk-edit/bulk-edit-logs';

let user;

Expand Down Expand Up @@ -49,7 +50,7 @@ describe('bulk-edit', () => {
BulkEditSearchPane.verifySpecificTabHighlighted('Identifier');

// verify panes
BulkEditSearchPane.verifyRecordTypesSortedAlphabetically(false);
BulkEditSearchPane.verifyRecordTypesSortedAlphabetically();
BulkEditSearchPane.verifyPanesBeforeImport();
BulkEditSearchPane.verifyBulkEditPaneItems();
BulkEditSearchPane.verifySetCriteriaPaneItems();
Expand Down Expand Up @@ -83,8 +84,8 @@ describe('bulk-edit', () => {
BulkEditSearchPane.openLogsSearch();
BulkEditSearchPane.verifySetCriteriaPaneSpecificTabs('Identifier', 'Logs', 'Query');
BulkEditSearchPane.verifySpecificTabHighlighted('Logs');
BulkEditSearchPane.verifyLogsPane();
BulkEditSearchPane.verifyRecordTypesSortedAlphabetically();
BulkEditLogs.verifyLogsPane();
BulkEditLogs.verifyRecordTypesSortedAlphabetically();
},
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-acti
import Users from '../../../support/fragments/users/users';
import ExportFile from '../../../support/fragments/data-export/exportFile';
import DateTools from '../../../support/utils/dateTools';
import BulkEditLogs from '../../../support/fragments/bulk-edit/bulk-edit-logs';

let user;
let updatedDate;
Expand Down Expand Up @@ -122,25 +123,25 @@ describe('bulk-edit', () => {
);

BulkEditSearchPane.openLogsSearch();
BulkEditSearchPane.verifyLogsPane();
BulkEditSearchPane.checkUsersCheckbox();
BulkEditLogs.verifyLogsPane();
BulkEditLogs.checkUsersCheckbox();

BulkEditSearchPane.clickActionsRunBy(user.username);
BulkEditSearchPane.verifyLogsRowActionWhenCompleted();
BulkEditSearchPane.downloadFileUsedToTrigger();
BulkEditLogs.clickActionsRunBy(user.username);
BulkEditLogs.verifyLogsRowActionWhenCompleted();
BulkEditLogs.downloadFileUsedToTrigger();
ExportFile.verifyFileIncludes(userUUIDsFileName, [user.userId]);

BulkEditSearchPane.downloadFileWithMatchingRecords();
BulkEditLogs.downloadFileWithMatchingRecords();
ExportFile.verifyFileIncludes(matchedRecordsFileName, ['Date of birth', userColumns]);

BulkEditSearchPane.downloadFileWithProposedChanges();
BulkEditLogs.downloadFileWithProposedChanges();
ExportFile.verifyFileIncludes(previewOfProposedChangesFileName, [
'Date of birth',
userColumns,
newName,
]);

BulkEditSearchPane.downloadFileWithUpdatedRecords();
BulkEditLogs.downloadFileWithUpdatedRecords();
ExportFile.verifyFileIncludes(updatedRecordsFileName, [
'Date Of Birth',
userColumns,
Expand Down
17 changes: 9 additions & 8 deletions cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-address-type.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Users from '../../../support/fragments/users/users';
import UsersSearchPane from '../../../support/fragments/users/usersSearchPane';
import UserEdit from '../../../support/fragments/users/userEdit';
import ExportFile from '../../../support/fragments/data-export/exportFile';
import BulkEditLogs from '../../../support/fragments/bulk-edit/bulk-edit-logs';

let user;
let addressTypeId;
Expand Down Expand Up @@ -101,21 +102,21 @@ describe('bulk-edit', () => {
BulkEditActions.downloadMatchedRecordsAbsent();

BulkEditSearchPane.openLogsSearch();
BulkEditSearchPane.verifyLogsPane();
BulkEditSearchPane.checkUsersCheckbox();
BulkEditSearchPane.clickActionsRunBy(user.username);
BulkEditSearchPane.verifyLogsRowActionWhenCompleted();
BulkEditLogs.verifyLogsPane();
BulkEditLogs.checkUsersCheckbox();
BulkEditLogs.clickActionsRunBy(user.username);
BulkEditLogs.verifyLogsRowActionWhenCompleted();

BulkEditSearchPane.downloadFileUsedToTrigger();
BulkEditLogs.downloadFileUsedToTrigger();
ExportFile.verifyFileIncludes(userBarcodesFileName, [user.barcode]);

BulkEditSearchPane.downloadFileWithMatchingRecords();
BulkEditLogs.downloadFileWithMatchingRecords();
ExportFile.verifyFileIncludes(matchedRecordsFileName, [user.barcode]);

BulkEditSearchPane.downloadFileWithProposedChanges();
BulkEditLogs.downloadFileWithProposedChanges();
ExportFile.verifyFileIncludes(previewOfProposedChangesFileName, [newFirstName]);

BulkEditSearchPane.downloadFileWithUpdatedRecords();
BulkEditLogs.downloadFileWithUpdatedRecords();
ExportFile.verifyFileIncludes(updatedRecordsFileName, [newFirstName]);

cy.visit(TopMenu.usersPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions';
import Users from '../../../support/fragments/users/users';
import BulkEditLogs from '../../../support/fragments/bulk-edit/bulk-edit-logs';

let user;
const userBarcodesFileName = `userBarcodes_${getRandomPostfix()}.csv`;
Expand Down Expand Up @@ -65,10 +66,10 @@ describe('bulk-edit', () => {
BulkEditActions.verifyDownloadChangedRecordsAbsent();

BulkEditSearchPane.openLogsSearch();
BulkEditSearchPane.verifyLogsPane();
BulkEditSearchPane.checkUsersCheckbox();
BulkEditSearchPane.clickActionsRunBy(user.username);
BulkEditSearchPane.verifyLogsRowActionWhenNoChangesApplied();
BulkEditLogs.verifyLogsPane();
BulkEditLogs.checkUsersCheckbox();
BulkEditLogs.clickActionsRunBy(user.username);
BulkEditLogs.verifyLogsRowActionWhenNoChangesApplied();
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-s
import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions';
import getRandomPostfix from '../../../support/utils/stringTools';
import FileManager from '../../../support/utils/fileManager';
import BulkEditLogs from '../../../support/fragments/bulk-edit/bulk-edit-logs';

let user;
const invalidUserUUID = `invalidUserUUID_${uuid()}`;
Expand Down Expand Up @@ -94,7 +95,7 @@ describe('bulk-edit', () => {
// BulkEditSearchPane.verifyNonMatchedResults(invalidUserUUID);

BulkEditSearchPane.openLogsSearch();
BulkEditSearchPane.verifyLogsPane();
BulkEditLogs.verifyLogsPane();
BulkEditSearchPane.openIdentifierSearch();
// BulkEditSearchPane.verifyErrorLabel(userUUIDsFileName, 1, 1);
BulkEditSearchPane.verifyMatchedResults(user.username);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('bulk-edit', () => {
BulkEditActions.selectOption('URI');
const possibleActions = ['Clear field', 'Find (full field search)', 'Replace with'];
BulkEditActions.verifyPossibleActions(possibleActions);
BulkEditActions.selectAction('Clear field');
BulkEditActions.selectSecondAction('Clear field');
BulkEditActions.addNewBulkEditFilterString();
BulkEditActions.verifyNewBulkEditRow();
BulkEditActions.verifyOptionAbsentInNewRow('URI');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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';
import { LOCATION_IDS } from '../../../support/constants';

let user;
const holdingHRIDsFileName = `holdingHRIDs-${getRandomPostfix()}.csv`;
Expand Down Expand Up @@ -39,8 +40,7 @@ describe('bulk-edit', () => {
item.holdingHRID = holdings[0].hrid;
cy.updateHoldingRecord(holdings[0].id, {
...holdings[0],
// Popular Reading Collection
temporaryLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87',
temporaryLocationId: LOCATION_IDS.POPULAR_READING_COLLECTION,
sourceId: null,
});
FileManager.createFile(`cypress/fixtures/${holdingHRIDsFileName}`, holdings[0].hrid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import { LOCATION_IDS } from '../../../support/constants';

let user;
const validHoldingHRIDsFileName = `validHoldingHRIDs_${getRandomPostfix()}.csv`;
Expand Down Expand Up @@ -58,8 +59,7 @@ describe('bulk-edit', () => {
item.holdingHRID = holdings[0].hrid;
cy.updateHoldingRecord(holdings[0].id, {
...holdings[0],
// Popular Reading Collection
permanentLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87',
permanentLocationId: LOCATION_IDS.POPULAR_READING_COLLECTION,
// Updating holdings with special characters
callNumber: 'number;special&characters',
callNumberPrefix: 'number-prefix;special&characters',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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';
import { LOCATION_IDS } from '../../../support/constants';

let user;
let holdingHRID;
Expand Down Expand Up @@ -38,8 +39,7 @@ describe('bulk-edit', () => {
holdingHRID = holdings[0].hrid;
cy.updateHoldingRecord(holdings[0].id, {
...holdings[0],
// Popular Reading Collection
permanentLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87',
permanentLocationId: LOCATION_IDS.POPULAR_READING_COLLECTION,
});
FileManager.createFile(`cypress/fixtures/${validHoldingUUIDsFileName}`, holdings[0].id);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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';
import { LOCATION_IDS } from '../../../support/constants';

let user;
const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`;
Expand Down Expand Up @@ -53,9 +54,8 @@ describe('bulk-edit', () => {
}).then((holdings) => {
cy.updateHoldingRecord(holdings[0].id, {
...holdings[0],
// Popular Reading Collection location
permanentLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87',
temporaryLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87',
permanentLocationId: LOCATION_IDS.POPULAR_READING_COLLECTION,
temporaryLocationId: LOCATION_IDS.POPULAR_READING_COLLECTION,
});
});
cy.login(user.username, user.password, {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
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';
import ExportFile from '../../../support/fragments/data-export/exportFile';
import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints';
import Locations from '../../../support/fragments/settings/tenant/location-setup/locations';
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance';
import SelectInstanceModal from '../../../support/fragments/requests/selectInstanceModal';

let user;
const testData = {};
const instanceUUIDsFileName = `instanceUUIDs-${getRandomPostfix()}.csv`;
const matchedRecordsFileName = `*-Matched-Records-${instanceUUIDsFileName}`;
const previewFileName = `*-Updates-Preview-${instanceUUIDsFileName}`;
const changedRecordsFileName = `*-Changed-Records-${instanceUUIDsFileName}`;
const folioItem = {
instanceName: `testBulkEdit_${getRandomPostfix()}`,
itemBarcode: `folioItem${getRandomPostfix()}`,
};
const userServicePoint = ServicePoints.getDefaultServicePoint();
const marcInstances = InventoryInstances.generateFolioInstances();

describe('bulk-edit', () => {
describe('in-app approach', () => {
before('create test data', () => {
cy.createTempUser([
permissions.inventoryAll.gui,
permissions.enableStaffSuppressFacet.gui,
permissions.bulkEditView.gui,
permissions.bulkEditEdit.gui,
]).then((userProperties) => {
user = userProperties;
ServicePoints.createViaApi(userServicePoint);
testData.defaultLocation = Locations.getDefaultLocation({
servicePointId: userServicePoint.id,
}).location;
Locations.createViaApi(testData.defaultLocation).then((location) => {
InventoryInstances.createMarcInstancesViaApi({
marcInstances,
location,
});
});
folioItem.instanceId = InventoryInstances.createInstanceViaApi(
folioItem.instanceName,
folioItem.itemBarcode,
);
[marcInstances[0].instanceId, folioItem.instanceId].forEach((instanceId) => {
cy.getInstanceById(instanceId).then((body) => {
body.staffSuppress = true;
cy.updateInstance(body);
});
});
FileManager.createFile(
`cypress/fixtures/${instanceUUIDsFileName}`,
`${marcInstances[0].instanceId}\n${folioItem.instanceId}`,
);
cy.login(user.username, user.password, {
path: TopMenu.bulkEditPath,
waiter: BulkEditSearchPane.waitLoading,
});
});
});

after('delete test data', () => {
cy.getAdminToken();
Users.deleteViaApi(user.userId);
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(folioItem.itemBarcode);
InventoryInstances.deleteInstanceViaApi({
instance: marcInstances[0],
servicePoint: userServicePoint,
});
FileManager.deleteFile(`cypress/fixtures/${instanceUUIDsFileName}`);
FileManager.deleteFileFromDownloadsByMask(
matchedRecordsFileName,
previewFileName,
changedRecordsFileName,
);
});

it(
'C423980 Verify "Staff suppress" (Set false) option in Bulk Editing - Instances (firebird)',
{ tags: ['criticalPath', 'firebird'] },
() => {
BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Instance', 'Instance UUIDs');
BulkEditSearchPane.uploadFile(instanceUUIDsFileName);
BulkEditSearchPane.checkForUploading(instanceUUIDsFileName);
BulkEditSearchPane.waitFileUploading();

BulkEditActions.downloadMatchedResults();
BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Instance UUID');
BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Staff suppress');
BulkEditSearchPane.verifyResultColumTitles('Staff suppress');
ExportFile.verifyFileIncludes(matchedRecordsFileName, [
`${folioItem.instanceId},false,true,`,
`${marcInstances[0].instanceId},false,true,`,
]);
BulkEditActions.openInAppStartBulkEditFrom();
BulkEditActions.verifyModifyLandingPageBeforeModifying();
const possibleActions = ['Staff suppress', 'Suppress from discovery'];
BulkEditActions.verifyPossibleActions(possibleActions);
BulkEditActions.selectOption('Staff suppress');
BulkEditSearchPane.verifyInputLabel('Staff suppress');
BulkEditActions.selectSecondAction('Set false');
BulkEditActions.verifyCheckboxAbsent();
BulkEditSearchPane.isConfirmButtonDisabled(false);
BulkEditActions.confirmChanges();
BulkEditSearchPane.verifyInputLabel(
'2 records will be changed if the Commit changes button is clicked. You may choose Download preview to review all changes prior to saving.',
);
BulkEditActions.verifyAreYouSureForm(2, folioItem.instanceId);
BulkEditActions.verifyAreYouSureForm(2, marcInstances[0].instanceId);
BulkEditActions.downloadPreview();
ExportFile.verifyFileIncludes(previewFileName, [
`${folioItem.instanceId},false,false,`,
`${marcInstances[0].instanceId},false,false,`,
]);
BulkEditActions.commitChanges();
BulkEditActions.verifySuccessBanner(2);
BulkEditSearchPane.verifyLocationChanges(2, 'false');
BulkEditSearchPane.verifyChangedResults(folioItem.instanceId, marcInstances[0].instanceId);
BulkEditActions.openActions();
BulkEditActions.downloadChangedCSV();
ExportFile.verifyFileIncludes(changedRecordsFileName, [
`${folioItem.instanceId},false,false,`,
`${marcInstances[0].instanceId},false,false,`,
]);

[folioItem.instanceName, marcInstances[0].instanceTitle].forEach((title) => {
cy.visit(TopMenu.inventoryPath);
SelectInstanceModal.filterByStaffSuppress('No');
InventorySearchAndFilter.searchInstanceByTitle(title);
InventoryInstances.selectInstance();
InventoryInstance.waitLoading();
InventoryInstance.verifyNoStaffSuppress();
});
},
);
});
});
Loading

0 comments on commit da9fa05

Please sign in to comment.