-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/folio-org/stripes-testing …
…into FAT-12480-C430257
- Loading branch information
Showing
136 changed files
with
4,172 additions
and
2,101 deletions.
There are no files selected for viewing
129 changes: 129 additions & 0 deletions
129
cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-change-note-type-within.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.