Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorBohdan committed Sep 16, 2024
2 parents d6a0ce2 + 746ca86 commit d627632
Show file tree
Hide file tree
Showing 70 changed files with 5,353 additions and 3,934 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ describe('bulk-edit', () => {
InventorySearchAndFilter.switchToItem();
InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode);
ItemRecordView.waitLoading();
ItemRecordView.verifyPermanentLocation('-');
ItemRecordView.verifyTemporaryLocation('-');
ItemRecordView.verifyPermanentLocation('No value set-');
ItemRecordView.verifyTemporaryLocation('No value set-');
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ describe('bulk-edit', () => {
]);

BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin);
// TODO: uncomment after MODBULKOPS-204
// BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkOutNote);
// BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkOutNote);
BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkInNote);
BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkInNote);
BulkEditSearchPane.verifyExactChangesUnderColumns('Note', `${notes.noteNote} (staff only)`);
BulkEditSearchPane.verifyExactChangesUnderColumns('Status', 'Available');
BulkEditSearchPane.verifyExactChangesUnderColumns('Permanent loan type', 'Reading room');
Expand All @@ -148,8 +147,8 @@ describe('bulk-edit', () => {
BulkEditActions.commitChanges();
BulkEditSearchPane.waitFileUploading();
BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin);
// BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkOutNote);
// BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkOutNote);
BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkInNote);
BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkInNote);
BulkEditSearchPane.verifyExactChangesUnderColumns('Note', `${notes.noteNote} (staff only)`);
BulkEditSearchPane.verifyExactChangesUnderColumns('Status', 'Available');
BulkEditSearchPane.verifyExactChangesUnderColumns('Permanent loan type', 'Reading room');
Expand All @@ -174,9 +173,9 @@ describe('bulk-edit', () => {
ItemRecordView.checkItemNote(notes.noteNote);
ItemRecordView.verifyItemStatus('Available');
ItemRecordView.verifyPermanentLoanType('Reading room');
ItemRecordView.verifyTemporaryLoanType('-');
ItemRecordView.verifyTemporaryLoanType('No value set-');
ItemRecordView.verifyPermanentLocation('Online');
ItemRecordView.verifyTemporaryLocation('-');
ItemRecordView.verifyTemporaryLocation('No value set-');
},
);
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('bulk-edit', () => {

// try to upload empty file
BulkEditSearchPane.uploadFile('empty.csv');
InteractorsTools.checkCalloutMessage('Fail to upload file', calloutTypes.error);
InteractorsTools.checkCalloutMessage('The uploaded file is empty.', calloutTypes.error);
InteractorsTools.closeCalloutMessage();

const invalidFileWarning = 'Invalid file';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import {
ACCEPTED_DATA_TYPE_NAMES,
FOLIO_RECORD_TYPE,
JOB_STATUS_NAMES,
} from '../../../support/constants';
import { Permissions } from '../../../support/dictionary';
import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles';
import DataImport from '../../../support/fragments/data_import/dataImport';
import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles';
import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile';
import FileDetails from '../../../support/fragments/data_import/logs/fileDetails';
import JsonScreenView from '../../../support/fragments/data_import/logs/jsonScreenView';
import Logs from '../../../support/fragments/data_import/logs/logs';
import InstanceRecordEdit from '../../../support/fragments/inventory/instanceRecordEdit';
import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView';
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance';
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
import {
ActionProfiles as SettingsActionProfiles,
FieldMappingProfiles as SettingsFieldMappingProfiles,
JobProfiles as SettingsJobProfiles,
} from '../../../support/fragments/settings/dataImport';
import FieldMappingProfileView from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfileView';
import FieldMappingProfiles from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles';
import NewFieldMappingProfile from '../../../support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile';
import SettingsMenu from '../../../support/fragments/settingsMenu';
import TopMenu from '../../../support/fragments/topMenu';
import Users from '../../../support/fragments/users/users';
import getRandomPostfix from '../../../support/utils/stringTools';

describe('Data Import', () => {
describe('Importing MARC Bib files', () => {
let user;
let instanceHrid;
const checked = true;
const instanceTitle =
"101 things I wish I'd known when I started using hypnosis / Dabney Ewin.";
const filePathToUpload = 'marcBibFileForC11087.mrc';
const marcFileName = `C11087 autotestFile${getRandomPostfix()}.mrc`;
const mappingProfile = {
name: `C11087 autotestMappingProfile_${getRandomPostfix()}`,
typeValue: FOLIO_RECORD_TYPE.INSTANCE,
suppressFromDiscavery: 'Mark for all affected records',
staffSuppress: 'Unmark for all affected records',
previouslyHeld: 'Keep the existing value for all affected records',
};
const actionProfile = {
name: `C11087 autotestActionProfile_${getRandomPostfix()}`,
typeValue: FOLIO_RECORD_TYPE.INSTANCE,
};
const jobProfile = {
profileName: `C11087 autotestJobProfile_${getRandomPostfix()}`,
acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC,
};

before('Create test data', () => {
cy.loginAsAdmin({
path: SettingsMenu.mappingProfilePath,
waiter: FieldMappingProfiles.waitLoading,
});
// create profiles
FieldMappingProfiles.openNewMappingProfileForm();
NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile);
NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress);
NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.suppressFromDiscavery);
NewFieldMappingProfile.addPreviouslyHeld(mappingProfile.previouslyHeld);
NewFieldMappingProfile.save();
FieldMappingProfileView.closeViewMode(mappingProfile.name);
FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name);

cy.visit(SettingsMenu.actionProfilePath);
ActionProfiles.create(actionProfile, mappingProfile.name);
ActionProfiles.checkActionProfilePresented(actionProfile.name);

cy.visit(SettingsMenu.jobProfilePath);
JobProfiles.createJobProfile(jobProfile);
NewJobProfile.linkActionProfile(actionProfile);
NewJobProfile.saveAndClose();
JobProfiles.checkJobProfilePresented(jobProfile.profileName);

cy.createTempUser([
Permissions.moduleDataImportEnabled.gui,
Permissions.settingsDataImportEnabled.gui,
Permissions.inventoryAll.gui,
Permissions.enableStaffSuppressFacet.gui,
]).then((userProperties) => {
user = userProperties;

cy.login(user.username, user.password, {
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
});
});
});

after('Delete test data', () => {
cy.getAdminToken().then(() => {
Users.deleteViaApi(user.userId);
SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName);
SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name);
SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name);
cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }).then(
(instance) => {
InventoryInstance.deleteInstanceViaApi(instance.id);
},
);
});
});

it(
'C11087 Instance field mapping: Confirm the "suppress" checkboxes when creating (folijet) (TaaS)',
{ tags: ['extendedPath', 'folijet'] },
() => {
// upload a marc file
DataImport.verifyUploadState();
DataImport.uploadFile(filePathToUpload, marcFileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.search(jobProfile.profileName);
JobProfiles.runImportFile();
Logs.waitFileIsImported(marcFileName);
Logs.checkJobStatus(marcFileName, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFileName);
FileDetails.verifyLogDetailsPageIsOpened(marcFileName);
FileDetails.openJsonScreen(instanceTitle);
JsonScreenView.verifyJsonScreenIsOpened();
JsonScreenView.openMarcSrsTab();
JsonScreenView.getInstanceHrid().then((initialInstanceHrId) => {
instanceHrid = initialInstanceHrId;

cy.visit(TopMenu.inventoryPath);
InventorySearchAndFilter.searchInstanceByHRID(instanceHrid);
InstanceRecordView.verifyInstancePaneExists();
InstanceRecordView.verifyMarkAsSuppressedFromDiscovery();
InstanceRecordView.verifyNotMarkAsStaffSuppressed();
InstanceRecordView.verifyNotMarkAsPreviouslyHeld();
InstanceRecordView.edit();
InstanceRecordEdit.waitLoading();
InstanceRecordEdit.verifyDiscoverySuppressCheckbox(checked);
InstanceRecordEdit.verifyStaffSuppressCheckbox();
InstanceRecordEdit.verifyPreviouslyHeldCheckbox();
});
},
);
});
});
Loading

0 comments on commit d627632

Please sign in to comment.