-
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
70 changed files
with
5,353 additions
and
3,934 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
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
145 changes: 145 additions & 0 deletions
145
...ing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-creating.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,145 @@ | ||
import { | ||
ACCEPTED_DATA_TYPE_NAMES, | ||
FOLIO_RECORD_TYPE, | ||
JOB_STATUS_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 JsonScreenView from '../../../support/fragments/data_import/logs/jsonScreenView'; | ||
import Logs from '../../../support/fragments/data_import/logs/logs'; | ||
import InstanceRecordEdit from '../../../support/fragments/inventory/instanceRecordEdit'; | ||
import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; | ||
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; | ||
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; | ||
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 SettingsMenu from '../../../support/fragments/settingsMenu'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
|
||
describe('Data Import', () => { | ||
describe('Importing MARC Bib files', () => { | ||
let user; | ||
let instanceHrid; | ||
const checked = true; | ||
const instanceTitle = | ||
"101 things I wish I'd known when I started using hypnosis / Dabney Ewin."; | ||
const filePathToUpload = 'marcBibFileForC11087.mrc'; | ||
const marcFileName = `C11087 autotestFile${getRandomPostfix()}.mrc`; | ||
const mappingProfile = { | ||
name: `C11087 autotestMappingProfile_${getRandomPostfix()}`, | ||
typeValue: FOLIO_RECORD_TYPE.INSTANCE, | ||
suppressFromDiscavery: 'Mark for all affected records', | ||
staffSuppress: 'Unmark for all affected records', | ||
previouslyHeld: 'Keep the existing value for all affected records', | ||
}; | ||
const actionProfile = { | ||
name: `C11087 autotestActionProfile_${getRandomPostfix()}`, | ||
typeValue: FOLIO_RECORD_TYPE.INSTANCE, | ||
}; | ||
const jobProfile = { | ||
profileName: `C11087 autotestJobProfile_${getRandomPostfix()}`, | ||
acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, | ||
}; | ||
|
||
before('Create test data', () => { | ||
cy.loginAsAdmin({ | ||
path: SettingsMenu.mappingProfilePath, | ||
waiter: FieldMappingProfiles.waitLoading, | ||
}); | ||
// create profiles | ||
FieldMappingProfiles.openNewMappingProfileForm(); | ||
NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); | ||
NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); | ||
NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.suppressFromDiscavery); | ||
NewFieldMappingProfile.addPreviouslyHeld(mappingProfile.previouslyHeld); | ||
NewFieldMappingProfile.save(); | ||
FieldMappingProfileView.closeViewMode(mappingProfile.name); | ||
FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); | ||
|
||
cy.visit(SettingsMenu.actionProfilePath); | ||
ActionProfiles.create(actionProfile, mappingProfile.name); | ||
ActionProfiles.checkActionProfilePresented(actionProfile.name); | ||
|
||
cy.visit(SettingsMenu.jobProfilePath); | ||
JobProfiles.createJobProfile(jobProfile); | ||
NewJobProfile.linkActionProfile(actionProfile); | ||
NewJobProfile.saveAndClose(); | ||
JobProfiles.checkJobProfilePresented(jobProfile.profileName); | ||
|
||
cy.createTempUser([ | ||
Permissions.moduleDataImportEnabled.gui, | ||
Permissions.settingsDataImportEnabled.gui, | ||
Permissions.inventoryAll.gui, | ||
Permissions.enableStaffSuppressFacet.gui, | ||
]).then((userProperties) => { | ||
user = userProperties; | ||
|
||
cy.login(user.username, user.password, { | ||
path: TopMenu.dataImportPath, | ||
waiter: DataImport.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken().then(() => { | ||
Users.deleteViaApi(user.userId); | ||
SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); | ||
SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); | ||
SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); | ||
cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }).then( | ||
(instance) => { | ||
InventoryInstance.deleteInstanceViaApi(instance.id); | ||
}, | ||
); | ||
}); | ||
}); | ||
|
||
it( | ||
'C11087 Instance field mapping: Confirm the "suppress" checkboxes when creating (folijet) (TaaS)', | ||
{ tags: ['extendedPath', 'folijet'] }, | ||
() => { | ||
// upload a marc file | ||
DataImport.verifyUploadState(); | ||
DataImport.uploadFile(filePathToUpload, marcFileName); | ||
JobProfiles.waitFileIsUploaded(); | ||
JobProfiles.search(jobProfile.profileName); | ||
JobProfiles.runImportFile(); | ||
Logs.waitFileIsImported(marcFileName); | ||
Logs.checkJobStatus(marcFileName, JOB_STATUS_NAMES.COMPLETED); | ||
Logs.openFileDetails(marcFileName); | ||
FileDetails.verifyLogDetailsPageIsOpened(marcFileName); | ||
FileDetails.openJsonScreen(instanceTitle); | ||
JsonScreenView.verifyJsonScreenIsOpened(); | ||
JsonScreenView.openMarcSrsTab(); | ||
JsonScreenView.getInstanceHrid().then((initialInstanceHrId) => { | ||
instanceHrid = initialInstanceHrId; | ||
|
||
cy.visit(TopMenu.inventoryPath); | ||
InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); | ||
InstanceRecordView.verifyInstancePaneExists(); | ||
InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); | ||
InstanceRecordView.verifyNotMarkAsStaffSuppressed(); | ||
InstanceRecordView.verifyNotMarkAsPreviouslyHeld(); | ||
InstanceRecordView.edit(); | ||
InstanceRecordEdit.waitLoading(); | ||
InstanceRecordEdit.verifyDiscoverySuppressCheckbox(checked); | ||
InstanceRecordEdit.verifyStaffSuppressCheckbox(); | ||
InstanceRecordEdit.verifyPreviouslyHeldCheckbox(); | ||
}); | ||
}, | ||
); | ||
}); | ||
}); |
Oops, something went wrong.