-
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' into FAT-7708-C1304
- Loading branch information
Showing
4 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
...rc-bibliographic/derive-marc-bib/ldr-validation-rules-with-valid-data-when-deriving.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,109 @@ | ||
import TestTypes from '../../../../support/dictionary/testTypes'; | ||
import DevTeams from '../../../../support/dictionary/devTeams'; | ||
import Permissions from '../../../../support/dictionary/permissions'; | ||
import TopMenu from '../../../../support/fragments/topMenu'; | ||
import DataImport from '../../../../support/fragments/data_import/dataImport'; | ||
import Users from '../../../../support/fragments/users/users'; | ||
import JobProfiles from '../../../../support/fragments/data_import/job_profiles/jobProfiles'; | ||
import Logs from '../../../../support/fragments/data_import/logs/logs'; | ||
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; | ||
import getRandomPostfix from '../../../../support/utils/stringTools'; | ||
import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; | ||
import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; | ||
|
||
describe('MARC -> MARC Bibliographic -> Edit MARC bib', () => { | ||
const testData = { | ||
absent008Fields: ['ELvl', 'Desc'], | ||
}; | ||
const marcFile = { | ||
marc: 'oneMarcBib.mrc', | ||
fileName: `testMarcFileC380398${getRandomPostfix()}.mrc`, | ||
jobProfileToRun: 'Default - Create instance and SRS MARC Bib', | ||
}; | ||
const LDRvalues = [ | ||
// 05 | ||
'01218aam\\a22002773c\\4500', | ||
'01218cam\\a22002773c\\4500', | ||
'01218dam\\a22002773c\\4500', | ||
'01218nam\\a22002773c\\4500', | ||
'01218pam\\a22002773c\\4500', | ||
// 08 | ||
'01218nam a22002773c\\4500', | ||
'01218namaa22002773c\\4500', | ||
'01218nam\\a22002773c\\4500', | ||
// 17 | ||
'01218nam\\a2200277Ac\\4500', | ||
'01218nam\\a2200277vc\\4500', | ||
'01218nam\\a22002778c\\4500', | ||
'01218nam\\a2200277?c\\4500', | ||
// 18 | ||
'01218nam\\a22002773 \\4500', | ||
'01218nam\\a22002773a\\4500', | ||
'01218nam\\a22002773\\\\4500', | ||
'01218nam\\a22002773c\\4500', | ||
'01218nam\\a22002773i\\4500', | ||
'01218nam\\a22002773n\\4500', | ||
'01218nam\\a22002773u\\4500', | ||
// 19 | ||
'01218nam\\a22002773c 4500', | ||
'01218nam\\a22002773ca4500', | ||
'01218nam\\a22002773c\\4500', | ||
'01218nam\\a22002773cb4500', | ||
'01218nam\\a22002773cc4500', | ||
]; | ||
|
||
before('Create user and data', () => { | ||
cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { | ||
DataImport.verifyUploadState(); | ||
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); | ||
JobProfiles.waitLoadingList(); | ||
JobProfiles.search(marcFile.jobProfileToRun); | ||
JobProfiles.runImportFile(); | ||
JobProfiles.waitFileIsImported(marcFile.fileName); | ||
Logs.checkStatusOfJobProfile('Completed'); | ||
Logs.openFileDetails(marcFile.fileName); | ||
Logs.getCreatedItemsID().then((link) => { | ||
testData.instanceID = link.split('/')[5]; | ||
}); | ||
}); | ||
|
||
cy.createTempUser([ | ||
Permissions.inventoryAll.gui, | ||
Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui, | ||
]).then((createdUserProperties) => { | ||
testData.user = createdUserProperties; | ||
|
||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.inventoryPath, | ||
waiter: InventoryInstances.waitContentLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('Deleting test data', () => { | ||
cy.getAdminToken().then(() => { | ||
Users.deleteViaApi(testData.user.userId); | ||
InventoryInstance.deleteInstanceViaApi(testData.instanceID); | ||
}); | ||
}); | ||
|
||
it( | ||
'C380398 Verify "LDR" validation rules with valid data for positions 05, 08, 17, 18, 19 when deriving record (spitfire) (TaaS)', | ||
{ tags: [TestTypes.extendedPath, DevTeams.spitfire] }, | ||
() => { | ||
cy.wrap(LDRvalues).each((LDRvalue) => { | ||
InventoryInstance.searchByTitle(testData.instanceID); | ||
InventoryInstances.selectInstance(); | ||
InventoryInstance.waitLoading(); | ||
InventoryInstance.deriveNewMarcBibRecord(); | ||
QuickMarcEditor.waitLoading(); | ||
QuickMarcEditor.check008FieldsAbsent(...testData.absent008Fields); | ||
QuickMarcEditor.updateExistingField('LDR', LDRvalue); | ||
QuickMarcEditor.checkButtonSaveAndCloseEnable(); | ||
QuickMarcEditor.pressSaveAndClose(); | ||
InventoryInstance.waitInventoryLoading(); | ||
InventoryInstances.resetAllFilters(); | ||
}); | ||
}, | ||
); | ||
}); |
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,77 @@ | ||
import { Permissions } from '../../support/dictionary'; | ||
import { NewOrder, Orders, BasicOrderLine } from '../../support/fragments/orders'; | ||
import { NewOrganization, Organizations } from '../../support/fragments/organizations'; | ||
import TopMenu from '../../support/fragments/topMenu'; | ||
import Users from '../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../support/utils/stringTools'; | ||
|
||
describe('Orders', () => { | ||
const testData = { | ||
renewalNote: `autotest_renewal_note_${getRandomPostfix()}`, | ||
organization: NewOrganization.getDefaultOrganization(), | ||
order: {}, | ||
user: {}, | ||
}; | ||
|
||
before('Create test data', () => { | ||
cy.getAdminToken().then(() => { | ||
Organizations.createOrganizationViaApi(testData.organization).then(() => { | ||
testData.order = NewOrder.getDefaultOngoingOrder({ vendorId: testData.organization.id }); | ||
testData.orderLine = BasicOrderLine.getDefaultOrderLine(); | ||
|
||
Orders.createOrderWithOrderLineViaApi(testData.order, testData.orderLine).then((order) => { | ||
testData.order = order; | ||
|
||
Orders.updateOrderViaApi({ ...testData.order, workflowStatus: 'Open' }); | ||
}); | ||
}); | ||
}); | ||
|
||
cy.createTempUser([Permissions.uiOrdersEdit.gui, Permissions.uiOrdersView.gui]).then( | ||
(userProperties) => { | ||
testData.user = userProperties; | ||
|
||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.ordersPath, | ||
waiter: Orders.waitLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken().then(() => { | ||
Organizations.deleteOrganizationViaApi(testData.organization.id); | ||
Orders.deleteOrderViaApi(testData.order.id); | ||
Users.deleteViaApi(testData.user.userId); | ||
}); | ||
}); | ||
|
||
it( | ||
'C353968 A user can edit "Renewal note" field on POL (thunderjet) (TaaS)', | ||
{ tags: ['extendedPath', 'thunderjet'] }, | ||
() => { | ||
// Click on the record with Order name from precondition | ||
const OrderDetails = Orders.selectOrderByPONumber(testData.order.poNumber); | ||
|
||
// Click on the PO line record in "PO line" accordion | ||
const OrderLineDetails = OrderDetails.openPolDetails(testData.orderLine.titleOrPackage); | ||
OrderLineDetails.checkOngoingOrderInformationSection([{ key: 'Renewal note', value: '' }]); | ||
|
||
// Click "Actions" button, Select "Edit" option | ||
const OrderLineEditForm = OrderLineDetails.openOrderLineEditForm(); | ||
OrderLineEditForm.checkOngoingOrderInformationSection([ | ||
{ label: 'Renewal note', conditions: { value: '' } }, | ||
]); | ||
|
||
// Edit "Renewal note" field and click "Save & close" button | ||
OrderLineEditForm.fillOrderLineFields({ | ||
ongoingOrder: { renewalNote: testData.renewalNote }, | ||
}); | ||
OrderLineEditForm.clickSaveButton(); | ||
OrderLineDetails.checkOngoingOrderInformationSection([ | ||
{ key: 'Renewal note', value: testData.renewalNote }, | ||
]); | ||
}, | ||
); | ||
}); |
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