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-13330
- Loading branch information
Showing
18 changed files
with
961 additions
and
26 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
104 changes: 104 additions & 0 deletions
104
cypress/e2e/bulk-edit/query/bulk-edit-query-items-view-render-preview.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,104 @@ | ||
import permissions from '../../../support/dictionary/permissions'; | ||
import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import QueryModal, { itemFieldValues } from '../../../support/fragments/bulk-edit/query-modal'; | ||
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
import { ITEM_STATUS_NAMES } from '../../../support/constants'; | ||
import UserEdit from '../../../support/fragments/users/userEdit'; | ||
import Checkout from '../../../support/fragments/checkout/checkout'; | ||
import CheckInActions from '../../../support/fragments/check-in-actions/checkInActions'; | ||
import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; | ||
import ExportFile from '../../../support/fragments/data-export/exportFile'; | ||
import FileManager from '../../../support/utils/fileManager'; | ||
import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; | ||
|
||
let user; | ||
let servicePointId; | ||
const item = { | ||
instanceName: `testBulkEdit_${getRandomPostfix()}`, | ||
barcode: getRandomPostfix(), | ||
}; | ||
const matchedRecordsFileName = '*-Matched-Records-Query-*'; | ||
|
||
describe('Bulk Edit - Query', () => { | ||
before('create test data', () => { | ||
cy.getAdminToken(); | ||
cy.createTempUser([ | ||
permissions.bulkEditView.gui, | ||
permissions.uiInventoryViewCreateEditItems.gui, | ||
permissions.bulkEditQueryView.gui, | ||
]).then((userProperties) => { | ||
user = userProperties; | ||
|
||
InventoryInstances.createInstanceViaApi(item.instanceName, item.barcode); | ||
ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }) | ||
.then((servicePoints) => { | ||
servicePointId = servicePoints[0].id; | ||
}) | ||
.then(() => { | ||
UserEdit.addServicePointViaApi(servicePointId, user.userId, servicePointId); | ||
Checkout.checkoutItemViaApi({ | ||
itemBarcode: item.barcode, | ||
servicePointId, | ||
userBarcode: user.barcode, | ||
}); | ||
}); | ||
cy.login(user.username, user.password, { | ||
path: TopMenu.bulkEditPath, | ||
waiter: BulkEditSearchPane.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('delete test data', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(user.userId); | ||
CheckInActions.checkinItemViaApi({ | ||
itemBarcode: item.barcode, | ||
servicePointId, | ||
checkInDate: new Date().toISOString(), | ||
}); | ||
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.barcode); | ||
FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); | ||
}); | ||
|
||
it( | ||
'C436737 Render preview after query executed (Items - View) (firebird)', | ||
{ tags: ['criticalPath', 'firebird'] }, | ||
() => { | ||
BulkEditSearchPane.openQuerySearch(); | ||
BulkEditSearchPane.checkItemsRadio(); | ||
BulkEditSearchPane.clickBuildQueryButton(); | ||
QueryModal.verify(); | ||
QueryModal.verifyFieldsSortedAlphabetically(); | ||
QueryModal.selectField(itemFieldValues.itemStatus); | ||
QueryModal.verifySelectedField(itemFieldValues.itemStatus); | ||
QueryModal.verifyQueryAreaContent('(item_status )'); | ||
QueryModal.verifyOperatorColumn(); | ||
QueryModal.selectOperator('in'); | ||
QueryModal.verifyQueryAreaContent('(item_status in )'); | ||
QueryModal.verifyValueColumn(); | ||
QueryModal.fillInValueMultiselect(ITEM_STATUS_NAMES.CHECKED_OUT); | ||
QueryModal.fillInValueMultiselect(ITEM_STATUS_NAMES.AGED_TO_LOST); | ||
QueryModal.verifyQueryAreaContent( | ||
`(item_status in ("${ITEM_STATUS_NAMES.CHECKED_OUT}","${ITEM_STATUS_NAMES.AGED_TO_LOST}"))`, | ||
); | ||
QueryModal.testQueryDisabled(false); | ||
QueryModal.runQueryDisabled(); | ||
QueryModal.clickTestQuery(); | ||
QueryModal.verifyPreviewOfRecordsMatched(); | ||
QueryModal.clickRunQuery(); | ||
QueryModal.verifyClosed(); | ||
BulkEditSearchPane.verifySpecificTabHighlighted('Query'); | ||
BulkEditSearchPane.isBuildQueryButtonDisabled(); | ||
BulkEditSearchPane.isHoldingsRadioChecked(false); | ||
BulkEditSearchPane.isInstancesRadioChecked(false); | ||
BulkEditSearchPane.isItemsRadioChecked(true); | ||
BulkEditActions.downloadMatchedResults(); | ||
BulkEditActions.startBulkEditAbsent(); | ||
ExportFile.verifyFileIncludes(matchedRecordsFileName, [item.barcode]); | ||
}, | ||
); | ||
}); |
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
129 changes: 129 additions & 0 deletions
129
cypress/e2e/inventory/search/plug-in-search-marBib-by-lccn-normolized-option.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 InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; | ||
import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; | ||
import NewOrder from '../../../support/fragments/orders/newOrder'; | ||
import OrderLines from '../../../support/fragments/orders/orderLines'; | ||
import Orders from '../../../support/fragments/orders/orders'; | ||
import NewOrganization from '../../../support/fragments/organizations/newOrganization'; | ||
import Organizations from '../../../support/fragments/organizations/organizations'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import DataImport from '../../../support/fragments/data_import/dataImport'; | ||
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; | ||
|
||
describe('Inventory', () => { | ||
describe('Search in Inventory', () => { | ||
const organization = { | ||
...NewOrganization.defaultUiOrganizations, | ||
paymentMethod: 'EFT', | ||
}; | ||
const order = { | ||
...NewOrder.defaultOneTimeOrder, | ||
manualPo: false, | ||
}; | ||
let orderNumber; | ||
let user; | ||
let orderID; | ||
const lccnOption = 'LCCN, normalized'; | ||
|
||
const searchQueries = [ | ||
'n79021425', | ||
' n 79021425 ', | ||
'n 79021425', | ||
'n 79021425', | ||
'n79021425 ', | ||
'n79021425 ', | ||
' n79021425', | ||
' n79021425', | ||
' n 79021425 ', | ||
]; | ||
|
||
const searchResults = [ | ||
'C442799 Test LCCN normalized record 1 (two leading spaces, one trailing space, two internal spaces)', | ||
'C442799 Test LCCN normalized record 2 (one space internal)', | ||
'C442799 Test LCCN normalized record 3 (two spaces internal)', | ||
'C442799 Test LCCN normalized record 4 (one space trailing)', | ||
'C442799 Test LCCN normalized record 5 (two spaces trailing)', | ||
'C442799 Test LCCN normalized record 6 (one space leading)', | ||
'C442799 Test LCCN normalized record 7 (two spaces leading)', | ||
'C442799 Test LCCN normalized record 8 (two spaces everywhere)', | ||
'C442799 Test LCCN normalized record 9 (no spaces)', | ||
]; | ||
|
||
const marcFile = { | ||
marc: 'marcBibFileForC442799.mrc', | ||
fileName: `testMarcFileC442799.${getRandomPostfix()}.mrc`, | ||
jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, | ||
propertyName: 'instance', | ||
}; | ||
|
||
const createdRecordIDs = []; | ||
|
||
before(() => { | ||
cy.getAdminToken(); | ||
|
||
Organizations.createOrganizationViaApi(organization).then((response) => { | ||
organization.id = response; | ||
order.vendor = response; | ||
}); | ||
cy.createOrderApi(order).then((response) => { | ||
orderNumber = response.body.poNumber; | ||
orderID = response.body.id; | ||
}); | ||
DataImport.uploadFileViaApi(marcFile.marc, marcFile.fileName, marcFile.jobProfileToRun).then( | ||
(response) => { | ||
response.forEach((record) => { | ||
createdRecordIDs.push(record[marcFile.propertyName].id); | ||
}); | ||
}, | ||
); | ||
cy.createTempUser([permissions.inventoryAll.gui, permissions.uiOrdersCreate.gui]).then( | ||
(userProperties) => { | ||
user = userProperties; | ||
|
||
cy.login(user.username, user.password, { | ||
path: TopMenu.ordersPath, | ||
waiter: Orders.waitLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
|
||
after(() => { | ||
cy.getAdminToken(); | ||
createdRecordIDs.forEach((id) => { | ||
InventoryInstance.deleteInstanceViaApi(id); | ||
}); | ||
Orders.deleteOrderViaApi(orderID); | ||
Organizations.deleteOrganizationViaApi(organization.id); | ||
Users.deleteViaApi(user.userId); | ||
}); | ||
|
||
it( | ||
'C442799 "Select instance" plug-in | Search for "MARC bibliographic" by "LCCN, normalized" option when "LCCN" (010 $a) has (leading, internal, trailing) spaces. (spitfire)', | ||
{ tags: ['criticalPath', 'spitfire'] }, | ||
() => { | ||
Orders.searchByParameter('PO number', orderNumber); | ||
Orders.selectFromResultsList(orderNumber); | ||
OrderLines.addPOLine(); | ||
OrderLines.clickTitleLookUp(); | ||
InventorySearchAndFilter.instanceTabIsDefault(); | ||
SelectInstanceModal.clickSearchOptionSelect(); | ||
SelectInstanceModal.checkSearchOptionIncluded(lccnOption); | ||
|
||
InventorySearchAndFilter.instanceTabIsDefault(); | ||
searchQueries.forEach((query) => { | ||
SelectInstanceModal.chooseSearchOption(lccnOption); | ||
SelectInstanceModal.searchByName(query); | ||
searchResults.forEach((expectedResult) => { | ||
InventorySearchAndFilter.verifySearchResult(expectedResult); | ||
}); | ||
SelectInstanceModal.clickResetAllButton(); | ||
SelectInstanceModal.checkTableContent(); | ||
}); | ||
}, | ||
); | ||
}); | ||
}); |
Oops, something went wrong.