-
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
- Loading branch information
Showing
17 changed files
with
859 additions
and
10 deletions.
There are no files selected for viewing
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
134 changes: 134 additions & 0 deletions
134
cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-electronic-access-public-note.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,134 @@ | ||
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 HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; | ||
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'; | ||
import FileManager from '../../../support/utils/fileManager'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
import ExportFile from '../../../support/fragments/data-export/exportFile'; | ||
|
||
let user; | ||
const item = { | ||
instanceName: `testBulkEdit_${getRandomPostfix()}`, | ||
itemBarcode: getRandomPostfix(), | ||
}; | ||
const publicNote = 'publicNote'; | ||
const newPublicNote = 'new publicNote'; | ||
const holdingUUIDsFileName = `holdingUUIDs_${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; | ||
|
||
item.instanceId = InventoryInstances.createInstanceViaApi( | ||
item.instanceName, | ||
item.itemBarcode, | ||
); | ||
cy.getHoldings({ limit: 1, query: `"instanceId"="${item.instanceId}"` }).then( | ||
(holdings) => { | ||
item.holdingsHRID = holdings[0].hrid; | ||
FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, holdings[0].id); | ||
cy.updateHoldingRecord(holdings[0].id, { | ||
...holdings[0], | ||
electronicAccess: [ | ||
{ | ||
publicNote, | ||
uri: 'uri.com', | ||
}, | ||
], | ||
}); | ||
}, | ||
); | ||
cy.login(user.username, user.password, { | ||
path: TopMenu.bulkEditPath, | ||
waiter: BulkEditSearchPane.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('delete test data', () => { | ||
cy.getAdminToken(); | ||
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); | ||
FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); | ||
FileManager.deleteFileFromDownloadsByMask( | ||
matchedRecordsFileName, | ||
changedRecordsFileName, | ||
previewFileName, | ||
); | ||
Users.deleteViaApi(user.userId); | ||
}); | ||
|
||
it( | ||
'C422240 Verify Bulk Edit for Holding populated with "URL public note" in electronic access (firebird)', | ||
{ tags: ['criticalPath', 'firebird'] }, | ||
() => { | ||
BulkEditSearchPane.checkHoldingsRadio(); | ||
BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); | ||
BulkEditSearchPane.uploadFile(holdingUUIDsFileName); | ||
BulkEditSearchPane.checkForUploading(holdingUUIDsFileName); | ||
BulkEditSearchPane.waitFileUploading(); | ||
BulkEditActions.downloadMatchedResults(); | ||
BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Electronic access'); | ||
BulkEditSearchPane.verifySpecificItemsMatched(publicNote); | ||
ExportFile.verifyFileIncludes(matchedRecordsFileName, [publicNote]); | ||
BulkEditActions.openInAppStartBulkEditFrom(); | ||
BulkEditActions.verifyRowIcons(); | ||
BulkEditActions.verifyOptionsDropdown(); | ||
BulkEditActions.isSelectActionAbsent(); | ||
BulkEditActions.selectOption('URL public note'); | ||
let possibleActions = ['Clear field', 'Find (full field search)', 'Replace with']; | ||
BulkEditActions.verifyPossibleActions(possibleActions); | ||
BulkEditActions.selectSecondAction('Clear field'); | ||
BulkEditActions.addNewBulkEditFilterString(); | ||
BulkEditActions.verifyNewBulkEditRow(); | ||
BulkEditActions.verifyOptionAbsentInNewRow('URL public note'); | ||
BulkEditActions.deleteRow(1); | ||
BulkEditActions.selectSecondAction('Replace with'); | ||
BulkEditActions.fillInSecondTextArea(publicNote); | ||
BulkEditSearchPane.isConfirmButtonDisabled(false); | ||
BulkEditActions.findValue('URL public note'); | ||
possibleActions = ['Replace with', 'Remove']; | ||
BulkEditActions.verifyPossibleActions(possibleActions); | ||
BulkEditSearchPane.isConfirmButtonDisabled(true); | ||
BulkEditActions.selectSecondAction('Replace with'); | ||
BulkEditSearchPane.isConfirmButtonDisabled(true); | ||
BulkEditActions.fillInFirstTextArea(publicNote); | ||
BulkEditActions.fillInSecondTextArea(newPublicNote); | ||
BulkEditSearchPane.isConfirmButtonDisabled(false); | ||
BulkEditActions.selectSecondAction('Remove'); | ||
BulkEditActions.confirmChanges(); | ||
BulkEditSearchPane.verifyInputLabel( | ||
'1 records will be changed if the Commit changes button is clicked. You may choose Download preview to review all changes prior to saving.', | ||
); | ||
BulkEditSearchPane.verifyElectronicAccessElementByIndex(4, ''); | ||
BulkEditActions.downloadPreview(); | ||
ExportFile.verifyFileIncludes(previewFileName, [';uri.com;;;"']); | ||
BulkEditActions.commitChanges(); | ||
BulkEditSearchPane.waitFileUploading(); | ||
BulkEditSearchPane.verifyElectronicAccessElementByIndex(4, ''); | ||
BulkEditActions.openActions(); | ||
BulkEditActions.downloadChangedCSV(); | ||
ExportFile.verifyFileIncludes(changedRecordsFileName, [';uri.com;;;"']); | ||
|
||
cy.visit(TopMenu.inventoryPath); | ||
InventorySearchAndFilter.switchToHoldings(); | ||
InventorySearchAndFilter.searchByParameter('Holdings HRID', item.holdingsHRID); | ||
InventorySearchAndFilter.selectSearchResultItem(); | ||
InventorySearchAndFilter.selectViewHoldings(); | ||
HoldingsRecordView.verifyElectronicAccessByElementIndex(4, '-'); | ||
}, | ||
); | ||
}); | ||
}); |
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
127 changes: 127 additions & 0 deletions
127
...authority/create-marc-authority/create-new-marcAuth-record-with-multiple-999-fields.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,127 @@ | ||
import Permissions from '../../../../support/dictionary/permissions'; | ||
import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority'; | ||
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; | ||
import TopMenu from '../../../../support/fragments/topMenu'; | ||
import Users from '../../../../support/fragments/users/users'; | ||
import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities'; | ||
import ManageAuthorityFiles from '../../../../support/fragments/settings/marc-authority/manageAuthorityFiles'; | ||
import { DEFAULT_FOLIO_AUTHORITY_FILES } from '../../../../support/constants'; | ||
|
||
describe('MARC', () => { | ||
describe('MARC Authority', () => { | ||
describe('Create MARC Authority', () => { | ||
const headerText = 'Create a new MARC authority record'; | ||
const newField010 = { | ||
rowIndex: 3, | ||
tag: '010', | ||
content: '$a n000232', | ||
}; | ||
const newField100 = { | ||
rowIndex: 4, | ||
tag: '100', | ||
content: '$a C423509 999 multiple test', | ||
}; | ||
const newField999 = { | ||
rowIndex: 6, | ||
tag: '999', | ||
content: '$s 999test $i multiple999', | ||
indicator0: 'f', | ||
indicator1: 'f', | ||
}; | ||
const users = {}; | ||
let createdAuthorityId; | ||
|
||
before('Create users, data', () => { | ||
cy.getAdminToken(); | ||
cy.createTempUser([ | ||
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, | ||
Permissions.uiQuickMarcQuickMarcAuthorityCreate.gui, | ||
Permissions.uiMarcAuthoritiesAuthorityRecordCreate.gui, | ||
]) | ||
.then((userProperties) => { | ||
users.userProperties = userProperties; | ||
|
||
ManageAuthorityFiles.setAllDefaultFOLIOFilesToActiveViaAPI(); | ||
}) | ||
.then(() => { | ||
cy.login(users.userProperties.username, users.userProperties.password, { | ||
path: TopMenu.marcAuthorities, | ||
waiter: MarcAuthorities.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('Delete users, data', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(users.userProperties.userId); | ||
MarcAuthority.deleteViaAPI(createdAuthorityId); | ||
ManageAuthorityFiles.unsetAllDefaultFOLIOFilesAsActiveViaAPI(); | ||
}); | ||
|
||
it( | ||
'C423509 Create a new MARC authority record with multiple "999" field (spitfire)', | ||
{ tags: ['criticalPath', 'spitfire'] }, | ||
() => { | ||
// 1 Click on "Actions" button in second pane >> Select "+ New" option | ||
MarcAuthorities.clickNewAuthorityButton(); | ||
QuickMarcEditor.checkPaneheaderContains(headerText); | ||
|
||
// 2 Click on "Authority file look-up" hyperlink | ||
// Click on the "Select authority file" placeholder in "Authority file name" dropdown | ||
// Select any option | ||
// Click on the "Save & close" button in "Select authority file" modal | ||
QuickMarcEditor.clickAuthorityLookUpButton(); | ||
QuickMarcEditor.selectAuthorityFile(DEFAULT_FOLIO_AUTHORITY_FILES.LC_NAME_AUTHORITY_FILE); | ||
QuickMarcEditor.clickSaveAndCloseInModal(); | ||
QuickMarcEditor.checkPaneheaderContains(headerText); | ||
|
||
// 3 Add 2 new fields by clicking on "+" icon and fill them as specified: | ||
// 010 \\ "$a <<enter a value in format <Prefix><Value> in accordance to selected authority file>>", ex.: "n000232" | ||
// 100 \\ "$a 999 multiple test" | ||
MarcAuthority.addNewField(newField010.rowIndex, newField010.tag, newField010.content); | ||
MarcAuthority.addNewField(newField100.rowIndex, newField100.tag, newField100.content); | ||
QuickMarcEditor.checkContentByTag(newField010.tag, newField010.content); | ||
QuickMarcEditor.checkContentByTag(newField100.tag, newField100.content); | ||
|
||
// 4 Click on the "+" icon next to any field | ||
QuickMarcEditor.addEmptyFields(5); | ||
|
||
// 5 Fill in the added field with following values (fill in in following sequence): | ||
// 4th box - "$s 999test $i multiple999" | ||
// 3rd box - "f" | ||
// 2nd box - "f" | ||
// 1st box - "999" | ||
QuickMarcEditor.fillInFieldValues( | ||
newField999.rowIndex, | ||
newField999.tag, | ||
newField999.content, | ||
newField999.indicator0, | ||
newField999.indicator1, | ||
); | ||
QuickMarcEditor.checkContent(newField999.content, newField999.rowIndex); | ||
QuickMarcEditor.verifyAllBoxesInARowAreDisabled(newField999.rowIndex); | ||
|
||
// 6 Click on the "Save & close" button | ||
QuickMarcEditor.pressSaveAndClose(); | ||
MarcAuthority.verifyAfterSaveAndClose(); | ||
QuickMarcEditor.verifyPaneheaderWithContentAbsent(headerText); | ||
MarcAuthorities.verifyViewPaneContentExists(); | ||
MarcAuthority.getId().then((id) => { | ||
createdAuthorityId = id; | ||
|
||
MarcAuthorities.checkFieldAndContentExistence( | ||
newField999.tag, | ||
`${newField999.indicator0} ${newField999.indicator1}`, | ||
); | ||
MarcAuthorities.checkFieldAndContentExistence(newField999.tag, '$s'); | ||
MarcAuthorities.checkFieldAndContentExistence( | ||
newField999.tag, | ||
`$i ${createdAuthorityId}`, | ||
); | ||
MarcAuthorities.verifyViewPaneContentAbsent(newField999.content); | ||
}); | ||
}, | ||
); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.