Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed tests #3128

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
404 changes: 0 additions & 404 deletions cypress/downloads/order-export-2023-12-13-04_30.csv

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('data-import', () => {

it(
'C17017 Check that field protection settings work properly during data import (folijet)',
{ tags: ['criticalPath', 'folijet', 'parallel'] },
{ tags: ['criticalPath', 'folijet'] },
() => {
// create mapping profile
cy.visit(SettingsMenu.mappingProfilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ describe('data-import', () => {
]).then((userProperties) => {
firstUser = userProperties;

cy.login(userProperties.username, userProperties.password, {
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
});
// Log list should contain at least 30-35 import jobs, run by different users, and using different import profiles
for (let i = 0; i < 25; i++) {
const fileName = `oneMarcBib.mrc${getRandomPostfix()}`;

DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName);
}

const fileName = `C358136 fileName${getRandomPostfix()}.mrc`;
cy.login(firstUser.username, firstUser.password);
DataImport.verifyUploadState();
DataImport.waitLoading();
DataImport.uploadFile('oneMarcBib.mrc', fileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.search('Default - Create instance and SRS MARC Bib');
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(fileName);
cy.logout();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('data-import', () => {

it(
'C350591 Match on VRN and update related Instance, Holdings, Item (folijet)',
{ tags: ['smoke', 'folijet', 'parallel'] },
{ tags: ['smoke', 'folijet'] },
() => {
// create order with POL
Orders.createOrderWithOrderLineViaApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ describe('data-import', () => {

after('delete test data', () => {
cy.getAdminToken().then(() => {
JobProfiles.deleteJobProfile(jobProfile.profileName);
MatchProfiles.deleteMatchProfile(matchProfile.profileName);
ActionProfiles.deleteActionProfile(actionProfile.name);
FieldMappingProfileView.deleteViaApi(mappingProfile.name);
// delete created files in fixtures
FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`);
FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`);
cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }).then(
(instance) => {
InventoryInstance.deleteInstanceViaApi(instance.id);
Expand All @@ -116,7 +109,14 @@ describe('data-import', () => {
}).then((instance) => {
InventoryInstance.deleteInstanceViaApi(instance.id);
});
JobProfiles.deleteJobProfile(jobProfile.profileName);
MatchProfiles.deleteMatchProfile(matchProfile.profileName);
ActionProfiles.deleteActionProfile(actionProfile.name);
FieldMappingProfileView.deleteViaApi(mappingProfile.name);
});
// delete created files in fixtures
FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`);
FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`);
});

it(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ describe('data-import', () => {
callNumberSuffix: 'TestSuf',
};
const filePathForCreate = 'marcFileForC401727.mrc';
const marcFileNameForCreate = `C401727 autotestFileName ${getRandomPostfix()}`;
const marcFileNameForUpdate = `C401727 autotestFileName ${getRandomPostfix()}`;
const editedMarcFileName = `C401727 editedAutotestFileName ${getRandomPostfix()}`;
const marcFileNameForCreate = `C401727 autotestFileName${getRandomPostfix()}.mrc`;
const marcFileNameForUpdate = `C401727 autotestFileName${getRandomPostfix()}.mrc`;
const editedMarcFileName = `C401727 editedAutotestFileName${getRandomPostfix()}.mrc`;
const holdingsMappingProfile = {
typeValue: FOLIO_RECORD_TYPE.HOLDINGS,
name: `C401727 Create simple Holdings ${getRandomPostfix()}}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ describe('data-import', () => {
InstanceRecordView.viewSource();
InstanceRecordView.verifySrsMarcRecord();
[
{ field: '010', fieldData: '$a 58020553' },
{ field: '022', fieldData: '$a 0022-0469' },
{ field: '035', fieldData: '$a (OCoLC)1604275' },
{ field: '035', fieldData: '$a (CStRLIN)NYCX1604275S' },
{ field: '035', fieldData: '$a (NIC)notisABP6388' },
{ field: '035', fieldData: '$a 366832' },
{ field: '040', fieldData: '$d CtY $d MBTI $d CtY $d MBTI $d NIC $d CStRLIN $d NIC' },
{ field: '050', fieldData: '$a BR140 $b .J6' },
{ field: '010', fieldData: 'a 58020553' },
{ field: '022', fieldData: 'a 0022-0469' },
{ field: '035', fieldData: 'a (OCoLC)1604275' },
{ field: '035', fieldData: 'a (CStRLIN)NYCX1604275S' },
{ field: '035', fieldData: 'a (NIC)notisABP6388' },
{ field: '035', fieldData: 'a 366832' },
{ field: '040', fieldData: 'd CtY d MBTI d CtY d MBTI d NIC d CStRLIN d NIC' },
{ field: '050', fieldData: 'a BR140 b .J6' },
].forEach((data) => {
InventoryViewSource.verifyFieldInMARCBibSource(data.field, data.fieldData);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('data-import', () => {
InstanceRecordView.verifySrsMarcRecord();
InventoryViewSource.verifyFieldInMARCBibSource(
'336',
'$a performed music $b prm $2 rdacontent',
'a performed music b prm 2 rdacontent',
);
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('data-import', () => {
InstanceRecordView.viewSource();
InventoryViewSource.verifyFieldInMARCBibSource(
'650',
'$a English literature $y 18th century.',
'a English literature y 18th century.',
);
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ describe('data-import', () => {
JobProfiles.search(jobProfileToRun);
JobProfiles.selectJobProfile();
JobProfiles.runImportFile();
cy.wait(120000);
JobProfiles.waitFileIsImported(smallFileName);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,18 @@ describe('data-import', () => {
'C11087 Instance field mapping: Confirm the "suppress" checkboxes when creating (folijet) (TaaS)',
{ tags: ['extendedPath', 'folijet'] },
() => {
const marcFileName = `C11087 autotestFile_${getRandomPostfix()}.mrc`;
const marcFileName = `C11087 autotestFile${getRandomPostfix()}.mrc`;

// upload a marc file
cy.visit(TopMenu.dataImportPath);
// TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691
DataImport.verifyUploadState();
DataImport.uploadFile(filePathToUpload, marcFileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.search(jobProfile.profileName);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFileName);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
Logs.waitFileIsImported(marcFileName);
Logs.checkJobStatus(marcFileName, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFileName);
FileDetails.verifyLogDetailsPageIsOpened(marcFileName);
FileDetails.openJsonScreen(instanceTitle);
Expand Down Expand Up @@ -133,9 +134,9 @@ describe('data-import', () => {
'C11088 Instance field mapping: Confirm the "suppress" checkboxes when updating (folijet) (TaaS)',
{ tags: ['extendedPath', 'folijet'] },
() => {
const marcFileName = `C11088 autotestFile_${getRandomPostfix()}.mrc`;
const editedFileName = `C11088 editedAutotestFile_${getRandomPostfix()}.mrc`;
const fileNameForUpdate = `C11088 autotestFile_${getRandomPostfix()}.mrc`;
const marcFileName = `C11088 autotestFile${getRandomPostfix()}.mrc`;
const editedFileName = `C11088 editedAutotestFile${getRandomPostfix()}.mrc`;
const fileNameForUpdate = `C11088 autotestFile${getRandomPostfix()}.mrc`;
const mappingProfileUpdate = {
name: `C11088 autotest update MappingProf${getRandomPostfix()}`,
typeValue: FOLIO_RECORD_TYPE.INSTANCE,
Expand Down Expand Up @@ -170,10 +171,11 @@ describe('data-import', () => {
// TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691
DataImport.verifyUploadState();
DataImport.uploadFile(filePathToUpload, marcFileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.search(jobProfile.profileName);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFileName);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
Logs.waitFileIsImported(marcFileName);
Logs.checkJobStatus(marcFileName, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFileName);
FileDetails.openInstanceInInventory(RECORD_STATUSES.CREATED);
InstanceRecordView.verifyInstancePaneExists();
Expand Down Expand Up @@ -223,9 +225,10 @@ describe('data-import', () => {
// TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691
DataImport.verifyUploadState();
DataImport.uploadFile(editedFileName, fileNameForUpdate);
JobProfiles.waitFileIsUploaded();
JobProfiles.search(jobProfileUpdate.profileName);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(fileNameForUpdate);
Logs.waitFileIsImported(fileNameForUpdate);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(fileNameForUpdate);
FileDetails.openJsonScreen(instanceTitle);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('data-import', () => {

it(
'C368005 Verify the mapping for item record notes and check in/out notes from MARC field (folijet)',
{ tags: ['criticalPath', 'folijet', 'parallel'] },
{ tags: ['criticalPath', 'folijet'] },
() => {
// create Field mapping profiles
FieldMappingProfiles.openNewMappingProfileForm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,25 +114,25 @@ describe('data-import', () => {

after('delete test data', () => {
cy.getAdminToken().then(() => {
// delete profiles
JobProfiles.deleteJobProfile(jobProfile.profileName);
MatchProfiles.deleteMatchProfile(matchProfile.profileName);
ActionProfiles.deleteActionProfile(actionProfile.name);
FieldMappingProfileView.deleteViaApi(mappingProfile.name);
Users.deleteViaApi(userId);
InventorySearchAndFilter.getInstancesByIdentifierViaApi(resourceIdentifiers[0].value).then(
(instances) => {
instances.forEach(({ id }) => {
InventoryInstance.deleteInstanceViaApi(id);
});
},
);
// delete profiles
JobProfiles.deleteJobProfile(jobProfile.profileName);
MatchProfiles.deleteMatchProfile(matchProfile.profileName);
ActionProfiles.deleteActionProfile(actionProfile.name);
FieldMappingProfileView.deleteViaApi(mappingProfile.name);
Users.deleteViaApi(userId);
});
});

it(
'C347830 Match on Instance identifier match meets both the Identifier type and Data requirements Scenario 3 (folijet)',
{ tags: ['criticalPath', 'folijet', 'parallel'] },
{ tags: ['criticalPath', 'folijet'] },
() => {
DataImport.editMarcFile(
filePathForCreateInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('data-import', () => {
];

before('login', () => {
cy.loginAsAdmin();
cy.getAdminToken();
InventorySearchAndFilter.getInstancesByIdentifierViaApi(oclcNumber.value).then(
(instances) => {
if (instances) {
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('data-import', () => {

it(
'C11109 Update an instance based on an OCLC number match (folijet)',
{ tags: ['criticalPath', 'folijet', 'parallel'] },
{ tags: ['criticalPath', 'folijet'] },
() => {
// create mapping profile for creating instance
cy.visit(SettingsMenu.mappingProfilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('data-import', () => {

it(
'C358138 Matching on newly-created 035 does not work (regression) (folijet)',
{ tags: ['criticalPath', 'folijet', 'parallel'] },
{ tags: ['criticalPath', 'folijet'] },
() => {
// TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691
DataImport.verifyUploadState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('data-import', () => {

it(
'C358968 Check that protected fields in incoming records are not deleted during import: Scenario 1 (folijet)',
{ tags: ['criticalPath', 'folijet', 'parallel'] },
{ tags: ['criticalPath', 'folijet'] },
() => {
cy.visit(SettingsMenu.marcFieldProtectionPath);
MarcFieldProtection.verifyListOfExistingSettingsIsDisplayed();
Expand Down