-
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.
- Loading branch information
1 parent
1c9009e
commit fe93027
Showing
8 changed files
with
211 additions
and
4 deletions.
There are no files selected for viewing
151 changes: 151 additions & 0 deletions
151
...marc-bib-files/importing-order-with-donor-information-using-not-existing-donor-code.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,151 @@ | ||
import { | ||
ACQUISITION_METHOD_NAMES, | ||
APPLICATION_NAMES, | ||
FOLIO_RECORD_TYPE, | ||
JOB_STATUS_NAMES, | ||
ORDER_FORMAT_NAMES_IN_PROFILE, | ||
ORDER_STATUSES, | ||
RECORD_STATUSES, | ||
VENDOR_NAMES, | ||
} from '../../../support/constants'; | ||
import { Permissions } from '../../../support/dictionary'; | ||
import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; | ||
import DataImport from '../../../support/fragments/data_import/dataImport'; | ||
import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; | ||
import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; | ||
import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; | ||
import Logs from '../../../support/fragments/data_import/logs/logs'; | ||
import OrderLines from '../../../support/fragments/orders/orderLines'; | ||
import { NewOrganization, Organizations } from '../../../support/fragments/organizations'; | ||
import { | ||
ActionProfiles as SettingsActionProfiles, | ||
FieldMappingProfiles as SettingsFieldMappingProfiles, | ||
JobProfiles as SettingsJobProfiles, | ||
} from '../../../support/fragments/settings/dataImport'; | ||
import FieldMappingProfiles from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles'; | ||
import SettingsDataImport, { | ||
SETTINGS_TABS, | ||
} from '../../../support/fragments/settings/dataImport/settingsDataImport'; | ||
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
|
||
describe('Data Import', () => { | ||
describe('Importing MARC Bib files', () => { | ||
let user; | ||
const filePath = 'marcBibFileForC554639.mrc'; | ||
const marcFileName = `554639 autotestFileName${getRandomPostfix()}.mrc`; | ||
const organization = NewOrganization.getDefaultOrganization({ | ||
isDonor: true, | ||
isVendor: false, | ||
}); | ||
const donorNames = [organization.name, 'Amazon.com']; | ||
const mappingProfile = { | ||
name: `C554639 Import order with donor field ${getRandomPostfix()}`, | ||
typeValue: FOLIO_RECORD_TYPE.ORDER, | ||
orderStatus: ORDER_STATUSES.OPEN, | ||
approved: true, | ||
vendor: VENDOR_NAMES.GOBI, | ||
title: '245$a', | ||
acquisitionMethod: ACQUISITION_METHOD_NAMES.PURCHASE_AT_VENDOR_SYSTEM, | ||
orderFormat: ORDER_FORMAT_NAMES_IN_PROFILE.PHYSICAL_RESOURCE, | ||
receivingWorkflow: 'Synchronized', | ||
physicalUnitPrice: '"20"', | ||
quantityPhysical: '"1"', | ||
currency: 'USD', | ||
donor: [ | ||
{ value: '865$a', existingStatus: false }, | ||
{ value: organization.name, existingStatus: true }, | ||
{ value: '"88888"', existingStatus: false }, | ||
], | ||
}; | ||
const actionProfile = { | ||
name: `C554639 Import order with donor field ${getRandomPostfix()}`, | ||
typeValue: FOLIO_RECORD_TYPE.ORDER, | ||
}; | ||
const jobProfile = { | ||
...NewJobProfile.defaultJobProfile, | ||
profileName: `C554639 Import order with donor field ${getRandomPostfix()}`, | ||
}; | ||
|
||
before('Create user and login', () => { | ||
cy.getAdminToken(); | ||
Organizations.createOrganizationViaApi(organization); | ||
Organizations.getOrganizationViaApi({ query: `name="${VENDOR_NAMES.AMAZON}"` }).then( | ||
(body) => { | ||
body.isDonor = true; | ||
Organizations.addDonorInfoViaApi(body.id, body); | ||
}, | ||
); | ||
|
||
cy.createTempUser([ | ||
Permissions.settingsDataImportEnabled.gui, | ||
Permissions.moduleDataImportEnabled.gui, | ||
Permissions.inventoryAll.gui, | ||
Permissions.uiOrdersView.gui, | ||
]).then((userProperties) => { | ||
user = userProperties; | ||
|
||
cy.login(userProperties.username, userProperties.password); | ||
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.SETTINGS, APPLICATION_NAMES.DATA_IMPORT); | ||
SettingsDataImport.selectSettingsTab(SETTINGS_TABS.FIELD_MAPPING_PROFILES); | ||
}); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken().then(() => { | ||
Users.deleteViaApi(user.userId); | ||
SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); | ||
SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); | ||
SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); | ||
Organizations.deleteOrganizationViaApi(organization.id); | ||
}); | ||
}); | ||
|
||
it( | ||
'C554639 Importing order with donor information using not existing donor code (folijet)', | ||
{ tags: ['criticalPath', 'folijet', 'C554639'] }, | ||
() => { | ||
// create mapping profile | ||
FieldMappingProfiles.createOrderMappingProfile(mappingProfile); | ||
FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); | ||
|
||
// create action profile | ||
SettingsDataImport.selectSettingsTab(SETTINGS_TABS.ACTION_PROFILES); | ||
ActionProfiles.create(actionProfile, mappingProfile.name); | ||
ActionProfiles.checkActionProfilePresented(actionProfile.name); | ||
|
||
// create job profile | ||
SettingsDataImport.selectSettingsTab(SETTINGS_TABS.JOB_PROFILES); | ||
JobProfiles.createJobProfile(jobProfile); | ||
NewJobProfile.linkActionProfile(actionProfile); | ||
NewJobProfile.saveAndClose(); | ||
JobProfiles.checkJobProfilePresented(jobProfile.profileName); | ||
|
||
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.DATA_IMPORT); | ||
DataImport.verifyUploadState(); | ||
DataImport.uploadFile(filePath, marcFileName); | ||
JobProfiles.waitFileIsUploaded(); | ||
JobProfiles.search(jobProfile.profileName); | ||
JobProfiles.runImportFile(); | ||
Logs.waitFileIsImported(marcFileName); | ||
Logs.checkJobStatus(marcFileName, JOB_STATUS_NAMES.COMPLETED); | ||
Logs.openFileDetails(marcFileName); | ||
[ | ||
FileDetails.columnNameInResultList.instance, | ||
FileDetails.columnNameInResultList.holdings, | ||
FileDetails.columnNameInResultList.item, | ||
].forEach((columnName) => { | ||
FileDetails.checkStatusInColumn(RECORD_STATUSES.DASH, columnName); | ||
}); | ||
FileDetails.checkStatusInColumn( | ||
RECORD_STATUSES.CREATED, | ||
FileDetails.columnNameInResultList.order, | ||
); | ||
FileDetails.openOrder(RECORD_STATUSES.CREATED); | ||
OrderLines.verifyPOLDetailsIsOpened(); | ||
OrderLines.checkDonorInformation(donorNames); | ||
}, | ||
); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
00575cam a22002173 4500001001300000003000600013005001700019008004100036020001500077020001800092035002100110040002900131050002600160082001500186100002300201245001600224260005400240336002600294337002800320865000900348ocn898051021OCoLC20141218085132.5141211s2014 xx 000 0 eng d a1622880730 a9781622880737 a(OCoLC)898051021 aYDXCPbengcYDXCPdOCLCQ 4aPS3611.E764bQ85 201404a813/.62231 aKeriotis, Dimitri.10aQuiet time. aCollege Station :bTexas A & M Univ Press,c2014. atextbtxt2rdacontent aunmediatedbn2rdamedia aAMAZ |
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