-
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
a446cca
commit 4f12e88
Showing
1 changed file
with
131 additions
and
0 deletions.
There are no files selected for viewing
131 changes: 131 additions & 0 deletions
131
...e2e/data-import/log-details/support-from-discovery-true-in-json-after-create-import.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,131 @@ | ||
import { | ||
APPLICATION_NAMES, | ||
FOLIO_RECORD_TYPE, | ||
JOB_STATUS_NAMES, | ||
RECORD_STATUSES, | ||
} 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 JsonScreenView from '../../../support/fragments/data_import/logs/jsonScreenView'; | ||
import Logs from '../../../support/fragments/data_import/logs/logs'; | ||
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; | ||
import { | ||
ActionProfiles as SettingsActionProfiles, | ||
FieldMappingProfiles as SettingsFieldMappingProfiles, | ||
JobProfiles as SettingsJobProfiles, | ||
} from '../../../support/fragments/settings/dataImport'; | ||
import FieldMappingProfileView from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfileView'; | ||
import FieldMappingProfiles from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles'; | ||
import NewFieldMappingProfile from '../../../support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile'; | ||
import SettingsDataImport, { | ||
SETTINGS_TABS, | ||
} from '../../../support/fragments/settings/dataImport/settingsDataImport'; | ||
import SettingsMenu from '../../../support/fragments/settingsMenu'; | ||
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
|
||
describe('Data Import', () => { | ||
describe('Log details', () => { | ||
let user; | ||
let instanceHrid; | ||
const filePath = 'oneMarcBib.mrc'; | ||
const marcFileName = `C594482 autotestFile${getRandomPostfix()}.mrc`; | ||
const mappingProfile = { | ||
typeValue: FOLIO_RECORD_TYPE.INSTANCE, | ||
name: `C594482 instance mapping profile ${getRandomPostfix()}`, | ||
suppressFromDiscavery: 'Mark for all affected records', | ||
}; | ||
const actionProfile = { | ||
typeValue: FOLIO_RECORD_TYPE.INSTANCE, | ||
name: `C594482 instance action profile ${getRandomPostfix()}`, | ||
}; | ||
const jobProfile = { | ||
...NewJobProfile.defaultJobProfile, | ||
profileName: `C594482 job profile ${getRandomPostfix()}`, | ||
}; | ||
const instanceTitle = | ||
'Anglo-Saxon manuscripts in microfiche facsimile Volume 25 Corpus Christi College, Cambridge II, MSS 12, 144, 162, 178, 188, 198, 265, 285, 322, 326, 449 microform A. N. Doane (editor and director), Matthew T. Hussey (associate editor), Phillip Pulsiano (founding editor)'; | ||
|
||
before('Create test user and login', () => { | ||
cy.createTempUser([ | ||
Permissions.settingsDataImportEnabled.gui, | ||
Permissions.moduleDataImportEnabled.gui, | ||
]).then((userProperties) => { | ||
user = userProperties; | ||
|
||
cy.login(user.username, user.password, { | ||
path: SettingsMenu.mappingProfilePath, | ||
waiter: FieldMappingProfiles.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken().then(() => { | ||
SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); | ||
SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); | ||
SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); | ||
}); | ||
Users.deleteViaApi(user.userId); | ||
cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }).then( | ||
(instance) => { | ||
InventoryInstance.deleteInstanceViaApi(instance.id); | ||
}, | ||
); | ||
}); | ||
|
||
it( | ||
'C594482 Suppress from discovery = TRUE in JSON after create import (folijet)', | ||
{ tags: ['criticalPath', 'folijet', 'C594482'] }, | ||
() => { | ||
// create mapping profiles | ||
FieldMappingProfiles.openNewMappingProfileForm(); | ||
NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); | ||
NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.suppressFromDiscavery); | ||
NewFieldMappingProfile.save(); | ||
FieldMappingProfileView.closeViewMode(mappingProfile.name); | ||
|
||
// create action profiles | ||
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); | ||
|
||
// upload a marc file for creating of the new instance, holding and item | ||
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.srsMarc, | ||
FileDetails.columnNameInResultList.instance, | ||
].forEach((columnName) => { | ||
FileDetails.checkStatusInColumn(RECORD_STATUSES.CREATED, columnName); | ||
}); | ||
FileDetails.openJsonScreen(instanceTitle); | ||
JsonScreenView.verifyJsonScreenIsOpened(); | ||
JsonScreenView.openMarcSrsTab(); | ||
JsonScreenView.verifyContentInTab('"suppressDiscovery": true'); | ||
JsonScreenView.getInstanceHrid().then((initialInstanceHrId) => { | ||
instanceHrid = initialInstanceHrId; | ||
}); | ||
}, | ||
); | ||
}); | ||
}); |