Skip to content

Commit

Permalink
FAT-15228-C436846 (#4028)
Browse files Browse the repository at this point in the history
* added test

* fixed test

* deleted function

* changed permission
  • Loading branch information
TetianaParanich authored Aug 10, 2024
1 parent 802bdc9 commit 42b1d7c
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Permissions } from '../../../support/dictionary';
import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView';
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance';
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances';
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
import TopMenu from '../../../support/fragments/topMenu';
import Users from '../../../support/fragments/users/users';

describe('Inventory', () => {
describe('Instance', () => {
const testData = {};

before('Create test data and login', () => {
cy.getAdminToken();
InventoryInstance.createInstanceViaApi().then(({ instanceData }) => {
testData.instance = instanceData;

cy.getInstanceById(testData.instance.instanceId).then((body) => {
body.staffSuppress = true;
body.discoverySuppress = true;
cy.updateInstance(body);
});
});

cy.createTempUser([
Permissions.uiInventoryViewCreateEditInstances.gui,
Permissions.uiInventorySetRecordsForDeletion.gui,
Permissions.enableStaffSuppressFacet.gui,
]).then((userProperties) => {
testData.user = userProperties;

cy.login(testData.user.username, testData.user.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
InventorySearchAndFilter.selectYesfilterStaffSuppress();
InventoryInstances.searchByTitle(testData.instance.instanceTitle);
InventoryInstances.selectInstance();
});
});

after('Delete test data', () => {
cy.getAdminToken().then(() => {
Users.deleteViaApi(testData.user.userId);
InventoryInstance.deleteInstanceViaApi(testData.instance.instanceId);
});
});

it(
'C436846 Check "Set record for deletion" option in Actions menu with Instance source FOLIO and marked checkboxes (folijet)',
{ tags: ['extendedPath', 'folijet'] },
() => {
InstanceRecordView.verifyInstancePaneExists();
InstanceRecordView.verifySetRecordForDeletionOptionAbsent();
},
);
});
});
2 changes: 1 addition & 1 deletion cypress/e2e/inventory/item/actions-menu-new-request.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe.skip('Inventory', () => {
InventoryItems.openActions();
InventoryItems.clickNewRequestButton();
NewRequest.waitLoadingNewRequestPage();
NewRequest.checkItemInformationSecton(
NewRequest.checkItemInformationSection(
testData.instanceTitle,
LOCATION_NAMES.MAIN_LIBRARY_UI,
itemStatus,
Expand Down
13 changes: 9 additions & 4 deletions cypress/support/fragments/inventory/instanceRecordView.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,20 @@ export default {
cy.expect(Button({ id: 'move-instance' }).absent());
},

verifyInstanceHeader(header) {
cy.get('#paneHeaderpane-instancedetails')
.find('[class*="paneTitleLabel-"]')
.should('have.text', header);
},

verifySetRecordForDeletionOptionEnabled() {
cy.do(rootSection.find(actionsButton).click());
cy.expect(Button({ id: 'quick-export-trigger' }).has({ disabled: false }));
},

verifyInstanceHeader(header) {
cy.get('#paneHeaderpane-instancedetails')
.find('[class*="paneTitleLabel-"]')
.should('have.text', header);
verifySetRecordForDeletionOptionAbsent() {
cy.do(rootSection.find(actionsButton).click());
cy.expect(Button({ id: 'quick-export-trigger' }).absent());
},

checkMultipleItemNotesWithStaffOnly: (rowIndex, staffOnly, noteType, noteText) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/fragments/requests/newRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export default {
including(`Request has been successfully created for ${username}`),
);
},
checkItemInformationSecton(instanceTitle, location, itemStatus) {
checkItemInformationSection(instanceTitle, location, itemStatus) {
cy.expect([
KeyValue('Title').has({ value: instanceTitle }),
KeyValue('Effective location').has({ value: location }),
Expand Down

0 comments on commit 42b1d7c

Please sign in to comment.