From f5c155daa0b9901bef076032823c92cc5059d8ab Mon Sep 17 00:00:00 2001 From: Ostap_Voitsekhovskyi Date: Thu, 20 Jul 2023 15:34:41 +0300 Subject: [PATCH 01/55] added logic to retry failed tests --- cypress.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cypress.config.js b/cypress.config.js index 9ff4c4b2bf..cdfb928e5c 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -7,6 +7,10 @@ const fs = require('fs'); const allureWriter = require('@shelex/cypress-allure-plugin/writer'); module.exports = defineConfig({ + retries: { + runMode: 1, + openMode: 1, + }, viewportWidth: 1920, viewportHeight: 1080, video: false, From a19ebd02b4e1021608bb0a1fb5571a7a167e0e37 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:31:53 +0300 Subject: [PATCH 02/55] Fat 7010 c397383 (#1414) * added test * added test * moved profiles for creating to preconditions --- ...instance-using-marc-to-marc-submatch.cy.js | 391 +++++++++++------- .../data_import/job_profiles/newJobProfile.js | 24 ++ .../match_profiles/newMatchProfile.js | 5 +- .../fragments/inventory/instanceRecordView.js | 9 - 4 files changed, 267 insertions(+), 162 deletions(-) diff --git a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js index e9c799ee8a..a47b2349e4 100644 --- a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js +++ b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js @@ -30,6 +30,7 @@ import FileManager from '../../../support/utils/fileManager'; import Users from '../../../support/fragments/users/users'; import InstanceStatusTypes from '../../../support/fragments/settings/inventory/instances/instanceStatusTypes/instanceStatusTypes'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; describe('ui-data-import', () => { const testData = { @@ -40,6 +41,34 @@ describe('ui-data-import', () => { }; let user; const instanceHrids = []; + // profiles for create + const collectionOfMappingAndActionProfilesForCreate = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `Create ER Instance ${getRandomPostfix()}`, + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `Create ER Instance ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `Create ER Holdings ${getRandomPostfix()}`, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, + relationship: 'Resource', + uri: '856$u', + linkText: '856$y', + materialsSpecified: '856$3', + urlPublicNote: '856$z' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `Create ER Holdings ${getRandomPostfix()}` } + } + ]; + const jobProfileForCreate = { + ...NewJobProfile.defaultJobProfile, + profileName: `Create ER Instance and Holdings ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; before('create test data and login', () => { cy.createTempUser([ @@ -66,13 +95,54 @@ describe('ui-data-import', () => { .then((initialInstanceStatusType) => { testData.instanceStatusTypeId = initialInstanceStatusType.body.id; }); - cy.login(user.username, user.password); + cy.login(user.username, user.password, { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + + // create Field mapping profiles for creating + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.instanceStatusTerm); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.holdingsType); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); + NewFieldMappingProfile.addElectronicAccess( + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.relationship, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.uri, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.linkText, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.materialsSpecified, + collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.urlPublicNote + ); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); + + // create action profiles for creating + collectionOfMappingAndActionProfilesForCreate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create job profile for creating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForCreate); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[0].actionProfile.name); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[1].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); }); }); after('delete test data', () => { MarcFieldProtection.deleteMarcFieldProtectionViaApi(testData.protectedFieldId); InstanceStatusTypes.deleteViaApi(testData.instanceStatusTypeId); + JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); + collectionOfMappingAndActionProfilesForCreate.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); Users.deleteViaApi(user.userId); instanceHrids.forEach(hrid => { cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }) @@ -81,18 +151,6 @@ describe('ui-data-import', () => { InventoryInstance.deleteInstanceViaApi(instance.id); }); }); - - // // delete profiles - // MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); - // MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); - // collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - // ActionProfiles.deleteActionProfile(profile.actionProfile.name); - // FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - // }); - // collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { - // ActionProfiles.deleteActionProfile(profile.actionProfile.name); - // FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - // }); }); it('C397983 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 2 matches (folijet)', @@ -103,34 +161,6 @@ describe('ui-data-import', () => { const editedMarcFileNameForUpdate = `C397983 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; const uniq001Field = Helper.getRandomBarcode(); const newUri = 'http://jbjjhhjj:3000/Test2'; - // profiles for create - const collectionOfMappingAndActionProfilesForCreate = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397983 Create ER Instance ${getRandomPostfix()}`, - instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397983 Create ER Instance ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397983 Create ER Holdings ${getRandomPostfix()}`, - holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - relationship: 'Resource', - uri: '856$u', - linkText: '856$y', - materialsSpecified: '856$3', - urlPublicNote: '856$z' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397983 Create ER Holdings ${getRandomPostfix()}` } - } - ]; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C397983 Create ER Instance and Holdings ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; // profiles for update const collectionOfMappingAndActionProfilesForUpdate = [ { @@ -172,43 +202,6 @@ describe('ui-data-import', () => { // change file for creating uniq 035 field DataImport.editMarcFile(testData.fileName, editedMarcFileNameForCreate, ['9000098'], [uniq001Field]); - // create Field mapping profiles for creating - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.instanceStatusTerm); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); - - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); - NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.holdingsType); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); - NewFieldMappingProfile.addElectronicAccess( - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.relationship, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.uri, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.linkText, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.materialsSpecified, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.urlPublicNote - ); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); - - // create action profiles for creating - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); - - // create job profile for creating - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForCreate); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[0].actionProfile.name); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[1].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); @@ -285,13 +278,8 @@ describe('ui-data-import', () => { // delete profiles JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[1].matchProfile.profileName); MatchProfiles.deleteMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - ActionProfiles.deleteActionProfile(profile.actionProfile.name); - FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); - }); collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); @@ -309,34 +297,6 @@ describe('ui-data-import', () => { const editedMarcFileNameForUpdate = `C397984 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; const uniq001Field = Helper.getRandomBarcode(); const newUri = 'http://jbjjhhjj:3000/Test'; - // profiles for create - const collectionOfMappingAndActionProfilesForCreate = [ - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397984 Create ER Instance ${getRandomPostfix()}`, - instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C397984 Create ER Instance ${getRandomPostfix()}` } - }, - { - mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397984 Create ER Holdings ${getRandomPostfix()}`, - holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, - permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - relationship: 'Resource', - uri: '856$u', - linkText: '856$y', - materialsSpecified: '856$3', - urlPublicNote: '856$z' }, - actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C397984 Create ER Holdings ${getRandomPostfix()}` } - } - ]; - const jobProfileForCreate = { - ...NewJobProfile.defaultJobProfile, - profileName: `C397984 Create ER Instance and Holdings ${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC - }; // profiles for update const collectionOfMappingAndActionProfilesForUpdate = [ { @@ -369,43 +329,6 @@ describe('ui-data-import', () => { // change file for creating uniq 035 field DataImport.editMarcFile(testData.fileName, editedMarcFileNameForCreate, ['9000098'], [uniq001Field]); - // create Field mapping profiles for creating - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.instanceStatusTerm); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[0].mappingProfile.name); - - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile); - NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.holdingsType); - NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.permanentLocation); - NewFieldMappingProfile.addElectronicAccess( - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.relationship, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.uri, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.linkText, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.materialsSpecified, - collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.urlPublicNote - ); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForCreate[1].mappingProfile.name); - - // create action profiles for creating - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); - ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); - }); - - // create job profile for creating - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(jobProfileForCreate); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[0].actionProfile.name); - NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfilesForCreate[1].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileForCreate.profileName); - cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); @@ -430,7 +353,6 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillMappingProfileForUpdatesMarc(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); NewFieldMappingProfile.markFieldForProtection(testData.protectedField); - FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); @@ -480,12 +402,179 @@ describe('ui-data-import', () => { // delete profiles JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); - JobProfiles.deleteJobProfile(jobProfileForCreate.profileName); MatchProfiles.deleteMatchProfile(matchProfile.profileName); - collectionOfMappingAndActionProfilesForCreate.forEach(profile => { + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); + // delete created files + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForCreate}`); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileNameForUpdate}`); + }); + + it('C397383 Verify the ability to import Holdings and Instance using marc-to-marc submatch: 3 matches (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + const fileNameForCreate = `C397383 autotestFileForCreate.${getRandomPostfix()}.mrc`; + const fileNameForUpdate = `C397383 autotestFileForUpdate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForCreate = `C397383 editedAutotestFileForCreate.${getRandomPostfix()}.mrc`; + const editedMarcFileNameForUpdate = `C397383 editedAutotestFileForUpdate.${getRandomPostfix()}.mrc`; + const uniq001Field = Helper.getRandomBarcode(); + const newUri = 'http://jbjjhhjj:3000/Test3'; + // profiles for update + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C397383 Override 856 protection ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C397383 Update srs override 856 protection ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C397383 Update ER holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, + permanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C397383 Update ER Holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const collectionOfMatchProfiles = [ + { + matchProfile: { profileName: `C397383 035$a to 035$a match ${getRandomPostfix()}`, + incomingRecordFields: { + field: '035', + subfield: 'a' + }, + existingRecordFields: { + field: '035', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } + }, + { + matchProfile: { profileName: `C397383 Instance status submatch - Electronic Resource ${getRandomPostfix()}`, + incomingStaticValue: 'Electronic Resource', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.instanceStatusTerm } + }, + { + matchProfile: { profileName: `C397383 Holdings type electronic ${getRandomPostfix()}`, + incomingStaticValue: 'Electronic', + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + existingRecordOption: NewMatchProfile.optionsList.holdingsType } + } + ]; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C397383 035$a to 035$a match with instance status and holdings type submatch ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + // change file for creating uniq 035 field + DataImport.editMarcFile(testData.fileName, editedMarcFileNameForCreate, ['9000098'], [uniq001Field]); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + + // change file for changing content of 856 field + DataImport.editMarcFile(testData.fileName, editedMarcFileNameForUpdate, ['9000098', 'http://jbjjhhjj:3000/'], + [uniq001Field, newUri]); + + // create Field mapping profiles for updating + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillMappingProfileForUpdatesMarc(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.markFieldForProtection(testData.protectedField); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.holdingsType); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + + // create action profiles for updating + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[2].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[2].matchProfile.profileName); + MatchProfiles.createMatchProfileWithStaticValue(collectionOfMatchProfiles[1].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[1].matchProfile.profileName); + MatchProfiles.createMatchProfile(collectionOfMatchProfiles[0].matchProfile); + MatchProfiles.checkMatchProfilePresented(collectionOfMatchProfiles[0].matchProfile.profileName); + + // create job profile for updating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.openNewJobProfileForm(); + NewJobProfile.fillJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchProfile(collectionOfMatchProfiles[0].matchProfile.profileName); + NewJobProfile.linkMatchProfileForMatches(collectionOfMatchProfiles[1].matchProfile.profileName); + NewJobProfile.linkMatchAndTwoActionProfilesForSubMatches( + collectionOfMatchProfiles[2].matchProfile.profileName, + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, + collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name + ); + NewJobProfile.saveAndClose(); + JobProfiles.waitLoadingList(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForUpdate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.openInstanceInInventory('Updated'); + InventoryInstance.getAssignedHRID() + .then(hrId => { + instanceHrids.push(hrId); + }); + InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); + InventoryViewSource.close(); + InstanceRecordView.openHoldingView(); + HoldingsRecordView.checkPermanentLocation(LOCATION_NAMES.ONLINE_UI); + + // delete profiles + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + collectionOfMatchProfiles.forEach(profile => { + MatchProfiles.deleteMatchProfile(profile.matchProfile.profileName); + }); collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); diff --git a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js index d6ac6e276e..57bf186872 100644 --- a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js +++ b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js @@ -41,6 +41,14 @@ function linkMatchProfileForMatches(matchProfileName, forMatchesOrder = 0) { cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); } +function linkMatchProfileForSubMatches(matchProfileName, forMatchesOrder = 0) { + cy.get('[id*="type-selector-dropdown-ROOT-MATCH"]').eq(forMatchesOrder).click(); + cy.do(matchButton.click()); + ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); + ModalSelectProfile.selectProfile(matchProfileName); + cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); +} + function linkActionProfileForMatches(actionProfileName, forMatchesOrder = 0) { cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); @@ -49,11 +57,21 @@ function linkActionProfileForMatches(actionProfileName, forMatchesOrder = 0) { cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); } +function linkActionProfileForSubMatches(actionProfileName, forMatchesOrder = 0) { + cy.get('[id*="type-selector-dropdown-ROOT-MATCH-MATCH"]').eq(forMatchesOrder).click(); + cy.do(actionsButton.click()); + ModalSelectProfile.searchProfileByName(actionProfileName); + ModalSelectProfile.selectProfile(actionProfileName); + cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); +} + export default { getDefaultJobProfile, linkActionProfileByName, linkMatchProfileForMatches, linkActionProfileForMatches, + linkMatchProfileForSubMatches, + linkActionProfileForSubMatches, defaultJobProfile, fillJobProfile: (specialJobProfile = defaultJobProfile) => { @@ -97,6 +115,12 @@ export default { cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); }, + linkMatchAndTwoActionProfilesForSubMatches(matchProfileName, firstActionProfileName, secondActionProfileName) { + linkMatchProfileForSubMatches(matchProfileName); + linkActionProfileForSubMatches(firstActionProfileName); + linkActionProfileForSubMatches(secondActionProfileName); + }, + linkMatchAndActionProfiles(matchProfileName, actionProfileName, forMatchesOrder = 0) { // link match profile to job profile cy.get('[id="type-selector-dropdown-linker-root"]').click(); diff --git a/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js b/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js index 3db7006e6c..43b3a81a8c 100644 --- a/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js +++ b/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js @@ -27,7 +27,8 @@ const optionsList = { systemControlNumber: 'Identifier: System control number', status: 'Loan and availability: Status', barcode: 'Admin data: Barcode', - instanceStatusTerm: 'Admin data: Instance status term' + instanceStatusTerm: 'Admin data: Instance status term', + holdingsType: 'Admin data: Holdings type' }; function fillExistingRecordFields(value = '', selector) { @@ -105,7 +106,7 @@ function selectExistingRecordField(existingRecordOption) { cy.do(criterionValueTypeList .find(SelectionOption(existingRecordOption)).click()); // TODO wait until option will be selected - cy.wait(5000); + cy.wait(1500); } function fillOnlyComparePartOfTheValue(value) { diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index 8f71b6e18c..3f0638b93b 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -140,15 +140,6 @@ export default { .absent()); }, - verifyElectronicAccess:(uriValue) => { - cy.expect(electronicAccessAccordion - .find(MultiColumnListCell({ row: 0, columnIndex: 1, content: uriValue })) - .exists()); - cy.expect(electronicAccessAccordion - .find(MultiColumnListCell({ row: 1, columnIndex: 1 })) - .absent()); - }, - openHoldingView: () => { cy.do(Button('View holdings').click()); cy.expect(Button('Actions').exists()); From 70a069aa0da8743a7dfe8ad3786f8b991b4aa3f6 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Wed, 26 Jul 2023 13:28:04 +0500 Subject: [PATCH 03/55] FAT-6998 (#1412) --- .../csv/bulk-edit-csv-invalid-date.cy.js | 8 +- .../csv/bulk-edit-csv-users-ids-error.cy.js | 2 +- ...ulk-edit-csv-users-ids-label-cleanup.cy.js | 2 +- ...bulk-edit-in-app-suppressed-holdings.cy.js | 82 +++++++++++++++++++ .../bulk-edit-in-app-suppressed-items.cy.js | 2 +- ...ulk-edit-in-app-user-uuids-with-null.cy.js | 2 +- ...lk-edit-logs-in-app-suppressed-items.cy.js | 9 +- ...-edit-csv-export-manager-permissions.cy.js | 2 +- .../bulk-edit-csv-permissions.cy.js | 2 +- ...pping-profile-holdings-source-record.cy.js | 2 + .../fragments/bulk-edit/bulk-edit-actions.js | 16 ++-- .../bulk-edit/bulk-edit-search-pane.js | 4 - 12 files changed, 105 insertions(+), 28 deletions(-) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings.cy.js diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js index b074814e39..7955114d79 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-invalid-date.cy.js @@ -8,13 +8,11 @@ import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-s import Users from '../../../support/fragments/users/users'; import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; import DateTools from '../../../support/utils/dateTools'; -import BulkEditFiles from '../../../support/fragments/bulk-edit/bulk-edit-files'; let user; const userBarcodesFileName = `userBarcodes_${getRandomPostfix()}.csv`; const matchedRecordsFileName = `*Matched-Records-${userBarcodesFileName}`; const editedFileName = `edited-records-${getRandomPostfix()}.csv`; -const errorsInChangedRecordsFileName = `*-Errors-${editedFileName}`; describe('bulk-edit', () => { describe('csv approach', () => { @@ -37,10 +35,10 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); FileManager.deleteFile(`cypress/fixtures/${userBarcodesFileName}`); FileManager.deleteFile(`cypress/fixtures/${editedFileName}`); - FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName, errorsInChangedRecordsFileName); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); }); - it('C388498 Negative: Verify CSV updating records with invalid date (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { + it('C388498 Negative: Verify Local updating records with invalid date (firebird)', { tags: [testTypes.extendedPath, devTeams.firebird] }, () => { BulkEditSearchPane.selectRecordIdentifier('User Barcodes'); BulkEditSearchPane.uploadFile(userBarcodesFileName); @@ -60,8 +58,6 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyErrorLabelAfterChanges(editedFileName, 0, 1); BulkEditSearchPane.verifyReasonForError('Field "createdDate"'); BulkEditActions.openActions(); - BulkEditActions.downloadErrors(); - BulkEditFiles.verifyMatchedResultFileContent(errorsInChangedRecordsFileName, [user.barcode], 'firstElement', false); }); }); }); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js index 34ee144f98..32e8d8bbf9 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js @@ -31,7 +31,7 @@ describe('bulk-edit', () => { Users.deleteViaApi(user.userId); }); - it('C350928 Verify error accordion during matching (CSV approach) (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C350928 Verify error accordion during matching (Local approach) (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js index 21e3331fe5..3af3a48100 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-label-cleanup.cy.js @@ -39,7 +39,7 @@ describe('bulk-edit', () => { cy.visit(TopMenu.bulkEditPath); }); - it('C356817 Verify Matched records label cleanup -- CSV approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C356817 Verify Matched records label cleanup -- Local approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); BulkEditSearchPane.uploadFile(userUUIDsFileName); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings.cy.js new file mode 100644 index 0000000000..1641985556 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings.cy.js @@ -0,0 +1,82 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import TopMenu from '../../../support/fragments/topMenu'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import Users from '../../../support/fragments/users/users'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; + +let user; +const holdingUUIDsFileName = `holdingUUIDs_${getRandomPostfix()}.csv`; +const item = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + + const instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getHoldings({ query: `"instanceId"="${instanceId}"` }).then(holdings => { + FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, holdings[0].id); + }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); + }); + + it('C398010 Verify "Suppress from discovery" (Set true) option in Bulk Editing Holdings (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings UUIDs'); + BulkEditSearchPane.uploadFile(holdingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + + const suppressFromDiscovery = true; + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.checkMarkAsSuppressedFromDiscovery(); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsPresent(); + }); + }); +}); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js index 32df25059a..21dd728ea6 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-items.cy.js @@ -58,7 +58,7 @@ describe('bulk-edit', () => { BulkEditActions.downloadMatchedResults(); BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.editSuppressFromDiscovery('Set true'); + BulkEditActions.editItemsSuppressFromDiscovery(true); BulkEditActions.confirmChanges(); BulkEditActions.downloadPreview(); BulkEditActions.commitChanges(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js index 53bac517ca..1bb662eb6b 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-user-uuids-with-null.cy.js @@ -21,7 +21,7 @@ describe('bulk-edit', () => { permissions.bulkEditUpdateRecords.gui, permissions.uiUsersView.gui, permissions.uiUserEdit.gui, - ]) + ], 'staff') .then(userProperties => { user = userProperties; FileManager.createFile(`cypress/fixtures/${userUUIDsFileName}`, user.userId); diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js index 79d40d7f05..b71466c45d 100644 --- a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-items.cy.js @@ -62,15 +62,10 @@ describe('Bulk Edit - Logs', () => { BulkEditSearchPane.uploadFile(validItemBarcodesFileName); BulkEditSearchPane.waitFileUploading(); - BulkEditActions.openActions(); - BulkEditActions.clickSuppressedFromDiscoveryCheckbox(); - BulkEditSearchPane.verifyResultColumTitles('Suppressed from discovery'); - BulkEditSearchPane.verifyResultColumnValue('true'); - BulkEditActions.openActions(); BulkEditActions.downloadMatchedResults(); BulkEditActions.openInAppStartBulkEditFrom(); - BulkEditActions.editSuppressFromDiscovery('Set false'); + BulkEditActions.editItemsSuppressFromDiscovery(false); BulkEditActions.addNewBulkEditFilterString(); BulkEditActions.fillPermanentLoanType('Selected', 1); BulkEditActions.confirmChanges(); @@ -78,6 +73,8 @@ describe('Bulk Edit - Logs', () => { BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', false); BulkEditActions.downloadChangedCSV(); BulkEditSearchPane.openLogsSearch(); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js index d8c9029afb..5f1b590cfd 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-export-manager-permissions.cy.js @@ -47,7 +47,7 @@ describe('Permissions Bulk Edit', () => { FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName); }); - it('C353969 Export manager -- Verify that user can view data in Export Manager based on permissions (CSV approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + it('C353969 Export manager -- Verify that user can view data in Export Manager based on permissions (Local approach) (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { ExportManagerSearchPane.waitLoading(); ExportManagerSearchPane.searchByBulkEdit(); ExportManagerSearchPane.selectJob(user.username); diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js index 26f5a34f4b..4456bc85c1 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-csv-permissions.cy.js @@ -37,7 +37,7 @@ describe('bulk-edit', () => { }); // TODO: think about dragging file without dropping - it('C353537 Verify label to the Drag and drop area -- CSV approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + it('C353537 Verify label to the Drag and drop area -- Local approach (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { cy.login(userWithCsvPermissions.username, userWithCsvPermissions.password); cy.visit(TopMenu.bulkEditPath); diff --git a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js index cda8d184a1..8f16914ad0 100644 --- a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js +++ b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js @@ -44,11 +44,13 @@ describe('Mapping profile - setup', () => { ExportNewFieldMappingProfile.createNewFieldMappingProfile(fieldMappingProfileName, ['Source record storage (entire record)', 'Holdings', 'Item']); ModalSelectTransformations.verifyCheckboxDisabled('Instance'); ModalSelectTransformations.uncheckItemRecordTypeChechbox(); + ModalSelectTransformations.searchItemTransformationsByName('Holdings - ID'); ModalSelectTransformations.clickNthCheckbox(); ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', '$a'); ModalSelectTransformations.uncheckHoldingsRecordTypeChechbox(); ModalSelectTransformations.checkItemRecordTypeChechbox(); + ModalSelectTransformations.searchItemTransformationsByName('Item - ID'); ModalSelectTransformations.clickNthCheckbox(); ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', '$a'); diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index d4fcfa020a..80cd99978a 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -93,10 +93,6 @@ export default { cy.expect(Button('Download errors (CSV)').exists()); }, - clickSuppressedFromDiscoveryCheckbox() { - cy.do(Checkbox('Suppressed from discovery').click()); - }, - verifyActionAfterChangingRecords() { cy.do(actionsBtn.click()); cy.expect([ @@ -232,11 +228,19 @@ export default { ]); }, - editSuppressFromDiscovery(value, rowIndex = 0) { + editItemsSuppressFromDiscovery(value, rowIndex = 0) { + cy.do([ + RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Suppress from discovery'), + RepeatableFieldItem({ index: rowIndex }).find(Select({ content: including('Set') })).choose(`Set ${value}`), + ]); + }, + + editHoldingsSuppressFromDiscovery(value, rowIndex = 0) { cy.do([ RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Suppress from discovery'), - RepeatableFieldItem({ index: rowIndex }).find(Select({ content: including('Set') })).choose(value), + RepeatableFieldItem({ index: rowIndex }).find(Select({ content: including('Set') })).choose(`Set ${value}`), ]); + if (value) cy.expect(Checkbox('Apply to items records').has({ checked: true })); }, verifyNoMatchingOptionsForLocationFilter() { diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js index b77820bba6..7c9e543b71 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -725,10 +725,6 @@ export default { cy.expect(resultsAccordion.find(MultiColumnListHeader(title)).exists()); }, - verifyResultColumnValue(value) { - cy.expect(MultiColumnListCell(value).exists()); - }, - verifyResultColumTitlesDoNotInclude(title) { cy.expect(resultsAccordion.find(MultiColumnListHeader(title)).absent()); }, From da5c63a4cc0d7ddb48e6359e0b475f19169b73a9 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 26 Jul 2023 15:49:17 +0500 Subject: [PATCH 04/55] FAT-4941/C375271 (#1411) * added test C375271 * some fixes --- cypress/e2e/eholdings/eholdings-titles.cy.js | 3 + .../marc-authority/marc-authority-sort.cy.js | 3 + ...650-field-using-number-of-title-link.cy.js | 110 ++++++++++++++++++ cypress/e2e/quickmark/holding-quickmark.cy.js | 3 + cypress/fixtures/marcAuthFileForC375271.mrc | 1 + cypress/fixtures/marcBibFileForC375271.mrc | 1 + 6 files changed, 121 insertions(+) create mode 100644 cypress/e2e/marc-authority/open-marc-bib-650-field-using-number-of-title-link.cy.js create mode 100644 cypress/fixtures/marcAuthFileForC375271.mrc create mode 100644 cypress/fixtures/marcBibFileForC375271.mrc diff --git a/cypress/e2e/eholdings/eholdings-titles.cy.js b/cypress/e2e/eholdings/eholdings-titles.cy.js index 4451e08672..c4540e2467 100644 --- a/cypress/e2e/eholdings/eholdings-titles.cy.js +++ b/cypress/e2e/eholdings/eholdings-titles.cy.js @@ -17,6 +17,9 @@ import permissions from '../../support/dictionary/permissions'; import users from '../../support/fragments/users/users'; import devTeams from '../../support/dictionary/devTeams'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('eHoldings titles management', () => { let userId; diff --git a/cypress/e2e/marc-authority/marc-authority-sort.cy.js b/cypress/e2e/marc-authority/marc-authority-sort.cy.js index 61a90bc8cd..6e1f404b0a 100644 --- a/cypress/e2e/marc-authority/marc-authority-sort.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-sort.cy.js @@ -11,6 +11,9 @@ import Logs from '../../support/fragments/data_import/logs/logs'; import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('MARC Authority Sort', () => { const testData = { authority: { diff --git a/cypress/e2e/marc-authority/open-marc-bib-650-field-using-number-of-title-link.cy.js b/cypress/e2e/marc-authority/open-marc-bib-650-field-using-number-of-title-link.cy.js new file mode 100644 index 0000000000..0435319539 --- /dev/null +++ b/cypress/e2e/marc-authority/open-marc-bib-650-field-using-number-of-title-link.cy.js @@ -0,0 +1,110 @@ +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 Users from '../../support/fragments/users/users'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import DataImport from '../../support/fragments/data_import/dataImport'; +import Logs from '../../support/fragments/data_import/logs/logs'; +import JobProfiles from '../../support/fragments/data_import/job_profiles/jobProfiles'; +import getRandomPostfix from '../../support/utils/stringTools'; +import MarcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +import MarcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import QuickMarcEditor from '../../support/fragments/quickMarcEditor'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; + +describe('MARC -> MARC Authority', () => { + const testData = { + tag: '650', + marcValue: 'Speaking Oratory debating', + rowIndex: 15, + searchOption: 'Keyword', + instanceTitle: 'Abraham Lincoln, by Lillian Hertz. Prize essay in Alexander Hamilton junior high school P.S. 186, June 24, 1927.', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC375271.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }, + { + marc: 'marcAuthFileForC375271.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + numOfRecords: 1, + } + ]; + + const createdAuthorityIDs = []; + + before('Creating user', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFile(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(marcFile.fileName); + for (let i = 0; i < marcFile.numOfRecords; i++) { + Logs.getCreatedItemsID(i).then(link => { + createdAuthorityIDs.push(link.split('/')[5]); + }); + } + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.clickLinkIconInTagField(testData.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(testData.marcValue); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex(testData.tag, testData.rowIndex); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }) + + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); + }); + }); + + after('Deleting created user', () => { + Users.deleteViaApi(testData.userProperties.userId); + InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); + createdAuthorityIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + }); + + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + for (let i = 0; i < 2; i++) { + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + } + }); + + it('C375271 "Number of titles" link in "MARC authority" app opens linked "MARC bib" record with controlled "650" field (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchByParameter(testData.searchOption, testData.marcValue); + MarcAuthorities.checkRow(testData.marcValue); + MarcAuthorities.verifyNumberOfTitles(4, '1'); + MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); + InventorySearchAndFilter.verifySearchResult(testData.instanceTitle); + InventoryInstance.checkPresentedText(testData.instanceTitle); + }); +}); diff --git a/cypress/e2e/quickmark/holding-quickmark.cy.js b/cypress/e2e/quickmark/holding-quickmark.cy.js index b5d6df5009..79033dd538 100644 --- a/cypress/e2e/quickmark/holding-quickmark.cy.js +++ b/cypress/e2e/quickmark/holding-quickmark.cy.js @@ -16,6 +16,9 @@ import JobProfiles from '../../support/fragments/data_import/job_profiles/jobPro import Logs from '../../support/fragments/data_import/logs/logs'; import getRandomPostfix from '../../support/utils/stringTools'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('MARC -> MARC Holdings', () => { const testData = {}; const fileName = `testMarcFile.${getRandomPostfix()}.mrc`; diff --git a/cypress/fixtures/marcAuthFileForC375271.mrc b/cypress/fixtures/marcAuthFileForC375271.mrc new file mode 100644 index 0000000000..6b0ea0bf64 --- /dev/null +++ b/cypress/fixtures/marcAuthFileForC375271.mrc @@ -0,0 +1 @@ +01068cz a2200337n 4500001000800000005001700008008004100025010001700066035002100083035001500104040001800119053001900137150004300156360006000199450001800259450002800277450001300305550003000318550001600348550003300364550002500397550001400422550001400436550002700450550002600477550002000503680014200523681003200665906001800697953001500715474525120120327095430.0860211i| anannbabn |a ana  ash 85095299  a(DLC)sh 85095299 a(DLC)91936 aDLCcDLCdDLC 0aPN4001bPN4355 aSpeaking Oratorybdebating1test01111 isubdivisionaOratoryiunder names of individual persons aArgumentation wnneaOratory, Primitive aSpeaking wgaLanguage and languages wgaRhetoric wgaSpeeches, addresses, etc. aDebates and debating aElocution aEloquence aLectures and lecturing aPersuasion (Rhetoric) aPublic speaking iHere are entered works on the rhetorical aspects of speeches. Works on speaking effectively in public are entered underaPublic speaking. iNote underaPublic speaking t9350ute03v0 axx00bta28 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileForC375271.mrc b/cypress/fixtures/marcBibFileForC375271.mrc new file mode 100644 index 0000000000..e4a2e20233 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC375271.mrc @@ -0,0 +1 @@ +00757nam a2200217 4500001001000000003000400010005001700014008004100031035002100072035001900093040001300112041000800125100002800133245011800161260002700279300001900306600005900325600008000384650006000464903001500524in2340312ICU19951122000000.0950906s1927 xxu 000 0 eng d a(ICU)BID21137833 a(OCoLC)9192518 aICUcICU0 aeng1 aHertz, Lillian,d1913?-10aAbraham Lincoln,cby Lillian Hertz. Prize essay in Alexander Hamilton junior high school P.S. 186, June 24, 1927. a[United States,c1927] a[4] p.c18 cm.10aLincoln, Abraham,d1809-1865xAddresses, sermons, etc.17aLincoln, Abraham,d1809-18652fast0http://id.worldcat.org/fast/fst00030184 7aOratory.2fast0http://id.worldcat.org/fast/fst01047214 aOCLC/RECON \ No newline at end of file From 75ce98352dd45db718c3f5c4b2019d1f7739450b Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Wed, 26 Jul 2023 15:55:01 +0500 Subject: [PATCH 05/55] FAT-7001/C387434 (#1379) * added C387434 --- ...s-by-fee-fine-type-charge-and-action.cy.js | 3 + .../overdue-fine-renewed-triggers.cy.js | 6 +- .../overdue-fine-returned-triggers.cy.js | 5 ++ ...scovery-display-name-as-notice-token.cy.js | 78 +++++++++++++++++++ .../item-aged-to-lost-triggers.cy.js | 5 ++ ...ickup-hold-shelf-expiration-triggers.cy.js | 9 ++- ...page-request-cancel-request-triggers.cy.js | 4 + .../recieve-notice-triggers.cy.js | 4 + .../circulation/newNoticePolicyTemplate.js | 25 ++++-- .../circulation/notice-policy-template.js | 12 ++- 10 files changed, 143 insertions(+), 8 deletions(-) create mode 100644 cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js diff --git a/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js b/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js index 940d599e92..fa49d8b8b1 100644 --- a/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js +++ b/cypress/e2e/fee-fine/manual-fee-fine-notices-by-fee-fine-type-charge-and-action.cy.js @@ -43,6 +43,7 @@ describe('Overdue fine', () => { category: noticeCategory, subject: `${noticeName}_${getRandomPostfix()}`, body: '{{item.title}}', + previewText: 'The Wines of Italy', }; }; const noticeTemplates = { @@ -184,11 +185,13 @@ describe('Overdue fine', () => { }; NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.manualFeeFineCharge); + delete noticeTemplates.manualFeeFineCharge.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.manualFeeFineCharge, category: 'FeeFineCharge', }); NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.manualFeeFineAction); + delete noticeTemplates.manualFeeFineAction.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.manualFeeFineAction, category: 'FeeFineAction', diff --git a/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js b/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js index 42314665f0..729c6ed149 100644 --- a/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js +++ b/cypress/e2e/fee-fine/overdue-fine-renewed-triggers.cy.js @@ -1,4 +1,5 @@ import uuid from 'uuid'; +import moment from 'moment'; import TestTypes from '../../support/dictionary/testTypes'; import devTeams from '../../support/dictionary/devTeams'; import permissions from '../../support/dictionary/permissions'; @@ -36,7 +37,6 @@ import LoanDetails from '../../support/fragments/users/userDefaultObjects/loanDe import NewFeeFine from '../../support/fragments/users/newFeeFine'; import { ITEM_STATUS_NAMES } from '../../support/constants'; - describe('Overdue fine', () => { let addedCirculationRule; const patronGroup = { @@ -62,6 +62,7 @@ describe('Overdue fine', () => { category: 'Automated fee/fine charge', subject: `Autotest_${getRandomPostfix()}_${noticeName}`, body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -322,16 +323,19 @@ describe('Overdue fine', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.returnedUponAt); + delete noticeTemplates.returnedUponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedUponAt, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterOnce); + delete noticeTemplates.returnedAfterOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterOnce, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterRecurring); + delete noticeTemplates.returnedAfterRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterRecurring, category: 'AutomatedFeeFineCharge', diff --git a/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js b/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js index 9d0908ca0f..e831d977fd 100644 --- a/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js +++ b/cypress/e2e/fee-fine/overdue-fine-returned-triggers.cy.js @@ -1,4 +1,5 @@ import uuid from 'uuid'; +import moment from 'moment'; import TestTypes from '../../support/dictionary/testTypes'; import devTeams from '../../support/dictionary/devTeams'; import permissions from '../../support/dictionary/permissions'; @@ -59,6 +60,7 @@ describe('Overdue fine', () => { category: 'Automated fee/fine charge', subject: `Autotest_${getRandomPostfix()}_${noticeName}`, body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -302,16 +304,19 @@ describe('Overdue fine', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.returnedUponAt); + delete noticeTemplates.returnedUponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedUponAt, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterOnce); + delete noticeTemplates.returnedAfterOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterOnce, category: 'AutomatedFeeFineCharge', }); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.returnedAfterRecurring); + delete noticeTemplates.returnedAfterRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving({ ...noticeTemplates.returnedAfterRecurring, category: 'AutomatedFeeFineCharge', diff --git a/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js b/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js new file mode 100644 index 0000000000..c47c1a41fa --- /dev/null +++ b/cypress/e2e/recieve-notice/add-discovery-display-name-as-notice-token.cy.js @@ -0,0 +1,78 @@ +import uuid from 'uuid'; +import devTeams from '../../support/dictionary/devTeams'; +import permissions from '../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../support/utils/stringTools'; +import SettingsMenu from '../../support/fragments/settingsMenu'; +import TestTypes from '../../support/dictionary/testTypes'; +import Users from '../../support/fragments/users/users'; +import PatronGroups from '../../support/fragments/settings/users/patronGroups'; +import NewNoticePolicyTemplate from '../../support/fragments/circulation/newNoticePolicyTemplate'; +import NoticePolicyTemplate from '../../support/fragments/circulation/notice-policy-template'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; +import UserEdit from '../../support/fragments/users/userEdit'; + +describe('Patron Notices', () => { + let userData; + const patronGroup = { + name: getTestEntityValue('groupNoticePolicy'), + }; + const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotestReceiveNotice', uuid()), + }; + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.createViaApi(testData.userServicePoint); + testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); + Location.createViaApi(testData.defaultLocation); + NoticePolicyTemplate.createViaApi('Loan').then((noticeTemplateResp) => { + testData.noticeTemplateBody = noticeTemplateResp.body; + }); + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser([permissions.uiCirculationSettingsNoticeTemplates.gui], patronGroup.name).then( + (userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi( + testData.userServicePoint.id, + userData.userId, + testData.userServicePoint.id + ); + cy.login(userData.username, userData.password, { + path: SettingsMenu.circulationPatronNoticeTemplatesPath, + waiter: NewNoticePolicyTemplate.waitLoading, + }); + } + ); + }); + }); + + after('Deleting created entities', () => { + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + NoticePolicyTemplate.deleteViaApi(testData.noticeTemplateBody.id); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + Location.deleteViaApiIncludingInstitutionCampusLibrary( + testData.defaultLocation.institutionId, + testData.defaultLocation.campusId, + testData.defaultLocation.libraryId, + testData.defaultLocation.id + ); + }); + + it( + 'C387434 Add "Discovery display name" as notice token in Settings', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + NewNoticePolicyTemplate.editTemplate(testData.noticeTemplateBody.name); + NewNoticePolicyTemplate.clearBody(); + NewNoticePolicyTemplate.addToken('item.effectiveLocationDiscoveryDisplayName'); + NewNoticePolicyTemplate.saveAndClose(); + NewNoticePolicyTemplate.waitLoading(); + NoticePolicyTemplate.checkPreview('Main Library'); + } + ); +}); diff --git a/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js b/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js index b4c9e8e90d..a735726976 100644 --- a/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js +++ b/cypress/e2e/recieve-notice/item-aged-to-lost-triggers.cy.js @@ -1,3 +1,4 @@ +import moment from 'moment'; import uuid from 'uuid'; import TestTypes from '../../support/dictionary/testTypes'; import { ITEM_STATUS_NAMES } from '../../support/constants'; @@ -51,6 +52,7 @@ describe('Loan notice triggers', () => { category: 'Loan', subject: getTestEntityValue(noticeName), body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -290,10 +292,13 @@ describe('Loan notice triggers', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.uponAt); + delete noticeTemplates.uponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.uponAt); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.afterOnce); + delete noticeTemplates.afterOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.afterOnce); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.afterRecurring); + delete noticeTemplates.afterRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.afterRecurring); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); diff --git a/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js b/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js index 7baa9a4079..999a2725aa 100644 --- a/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js +++ b/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js @@ -1,4 +1,4 @@ -// This test is failing due to the CIRCSTORE-412 bug. +import moment from 'moment'; import uuid from 'uuid'; import TestTypes from '../../support/dictionary/testTypes'; import { REQUEST_TYPES } from '../../support/constants'; @@ -57,6 +57,7 @@ describe('Request notice triggers', () => { category: 'Request', subject: getTestEntityValue(noticeName), body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -304,16 +305,22 @@ describe('Request notice triggers', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.itemRecaled); + delete noticeTemplates.itemRecaled.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.itemRecaled); NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.recallRequest); + delete noticeTemplates.recallRequest.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.recallRequest); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.awaitingPickUp); + delete noticeTemplates.awaitingPickUp.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.awaitingPickUp); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.holdShelfBeforeOnce); + delete noticeTemplates.holdShelfBeforeOnce.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfBeforeOnce); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.holdShelfBeforeRecurring); + delete noticeTemplates.holdShelfBeforeRecurring.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfBeforeRecurring); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.holdShelfUponAt); + delete noticeTemplates.holdShelfUponAt.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfUponAt); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); diff --git a/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js b/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js index 8c7663a4f9..7df368df8d 100644 --- a/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js +++ b/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js @@ -1,4 +1,5 @@ import uuid from 'uuid'; +import moment from 'moment'; import { ITEM_STATUS_NAMES, REQUEST_TYPES } from '../../support/constants'; import TestTypes from '../../support/dictionary/testTypes'; import devTeams from '../../support/dictionary/devTeams'; @@ -44,6 +45,7 @@ describe('Request notice triggers', () => { category: 'Request', subject: getTestEntityValue(noticeName), body: 'Test email body {{item.title}} {{loan.dueDateTime}}', + previewText: `Test email body The Wines of Italy ${moment().format('ll')}`, }; }; const noticeTemplates = { @@ -189,8 +191,10 @@ describe('Request notice triggers', () => { { tags: [TestTypes.criticalPath, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.pageRequest); + delete noticeTemplates.pageRequest.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.pageRequest); NewNoticePolicyTemplate.duplicatePatronNoticeTemplate(noticeTemplates.cancelRequest); + delete noticeTemplates.cancelRequest.previewText; NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.cancelRequest); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); diff --git a/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js b/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js index 4b176cd9e7..1a2f9b1186 100644 --- a/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js +++ b/cypress/e2e/recieve-notice/recieve-notice-triggers.cy.js @@ -35,6 +35,7 @@ describe('Triggers: Check Out, Loan due date change, Check in', () => { description: 'Created by autotest team', body: 'Test_email_body', category: 'Loan', + previewText: 'Test_email_body' }; const checkOutTemplate = { ...defaultTemplate }; checkOutTemplate.name += ' Check out'; @@ -247,10 +248,13 @@ describe('Triggers: Check Out, Loan due date change, Check in', () => { { tags: [TestTypes.smoke, devTeams.volaris] }, () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(checkOutTemplate); + delete checkOutTemplate.previewText; NewNoticePolicyTemplate.checkAfterSaving(checkOutTemplate); NewNoticePolicyTemplate.createPatronNoticeTemplate(loanDueDateChangeTemplate); + delete loanDueDateChangeTemplate.previewText; NewNoticePolicyTemplate.checkAfterSaving(loanDueDateChangeTemplate); NewNoticePolicyTemplate.createPatronNoticeTemplate(checkInTemplate); + delete checkInTemplate.previewText; NewNoticePolicyTemplate.checkAfterSaving(checkInTemplate); cy.visit(SettingsMenu.circulationPatronNoticePoliciesPath); diff --git a/cypress/support/fragments/circulation/newNoticePolicyTemplate.js b/cypress/support/fragments/circulation/newNoticePolicyTemplate.js index e57246f6ce..430d1e855d 100644 --- a/cypress/support/fragments/circulation/newNoticePolicyTemplate.js +++ b/cypress/support/fragments/circulation/newNoticePolicyTemplate.js @@ -1,6 +1,6 @@ /* eslint-disable cypress/no-unnecessary-waiting */ import getRandomPostfix from '../../utils/stringTools'; -import { Button, TextField, TextArea, KeyValue, Checkbox, Link, Heading, Select, Pane, Modal, PaneContent } from '../../../../interactors'; +import { Button, TextField, TextArea, KeyValue, Checkbox, Link, Heading, Select, Pane, Modal, PaneContent, NavListItem, RichEditor, including } from '../../../../interactors'; import richTextEditor from '../../../../interactors/rich-text-editor'; import { NOTICE_CATEGORIES } from './notice-policy'; import { actionsButtons } from './newNoticePolicy'; @@ -56,9 +56,12 @@ export default { cy.do(Select({ name: 'category' }).choose(category)); }, - checkPreview: () => { + checkPreview: (previewText) => { cy.do(PaneContent({ id: 'patron-notice-template-pane-content' }).find(Button('Preview')).click()); - cy.expect(Modal('Preview of patron notice template').exists()); + cy.expect([ + Modal(including('Preview of patron notice template')).exists(), + Modal({ content: including(previewText) }).exists(), + ]); cy.do(Button('Close').click()); }, @@ -79,6 +82,10 @@ export default { return cy.wrap(noticePolicyTemplateToken); }, + clearBody() { + cy.do(RichEditor().fillIn('')); + }, + saveAndClose() { return cy.do([saveButton.has({ disabled: false }), saveButton.click(), @@ -147,6 +154,14 @@ export default { ]); }, + editTemplate(name) { + cy.do([ + NavListItem(name).click(), + actionsButton.click(), + actionsButtons.edit.click(), + ]); + }, + typeTemplateName: (noticePolicytemplateName) => { cy.do(nameField.fillIn(noticePolicytemplateName)); }, @@ -161,7 +176,7 @@ export default { this.addToken('item.title'); this.create(template, false); this.chooseCategory(template.category); - this.checkPreview(); + this.checkPreview(template.previewText); this.saveAndClose(); this.waitLoading(); }, @@ -170,7 +185,7 @@ export default { this.duplicateTemplate(); this.typeTemplateName(template.name); this.typeTemplateSubject(template.subject); - this.checkPreview(); + this.checkPreview(template.previewText); this.saveAndClose(); this.waitLoading(); }, diff --git a/cypress/support/fragments/circulation/notice-policy-template.js b/cypress/support/fragments/circulation/notice-policy-template.js index 6255671438..e7d5bc36b4 100644 --- a/cypress/support/fragments/circulation/notice-policy-template.js +++ b/cypress/support/fragments/circulation/notice-policy-template.js @@ -1,5 +1,7 @@ import uuid from 'uuid'; import getRandomPostfix from '../../utils/stringTools'; +import { Button, Modal, including } from '../../../../interactors'; + const defaultNoticeTemplateBody = { active: true, @@ -10,7 +12,7 @@ const defaultNoticeTemplateBody = { }, body: '
Email body {{item.title}}
', header: 'Email subject: Loan', - name: `Template_name_${getRandomPostfix}`, + name: `Template_name_${getRandomPostfix()}`, outputFormats: ['text/html'], 0: 'text/html', templateResolver: 'mustache', @@ -18,6 +20,14 @@ const defaultNoticeTemplateBody = { export default { defaultNoticeTemplateBody, + checkPreview: (previewText) => { + cy.do(Button('Preview').click()); + cy.expect([ + Modal(including('Preview of patron notice template')).exists(), + Modal({ content: including(previewText) }).exists(), + ]); + cy.do(Button('Close').click()); + }, createViaApi(noticeTemplateCategory) { return cy.okapiRequest({ method: 'POST', path: 'templates', From cfcbae251b9e434dd1d78a703fd482fba508be5e Mon Sep 17 00:00:00 2001 From: nayimovag Date: Wed, 26 Jul 2023 19:32:11 +0500 Subject: [PATCH 06/55] FAT-6999 (#1418) --- ...dit-in-app-suppressed-holdings-false.cy.js | 98 +++++++++++++++++++ ...dit-in-app-suppressed-holdings-true.cy.js} | 0 ...bulk-edit-export-manager-permissions.cy.js | 3 + .../bulk-edit-user-permissions.cy.js | 3 + .../fragments/bulk-edit/bulk-edit-actions.js | 2 +- .../fragments/inventory/holdingsRecordView.js | 3 + 6 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js rename cypress/e2e/bulk-edit/in-app/{bulk-edit-in-app-suppressed-holdings.cy.js => bulk-edit-in-app-suppressed-holdings-true.cy.js} (100%) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js new file mode 100644 index 0000000000..66b4dcc0e1 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-false.cy.js @@ -0,0 +1,98 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import TopMenu from '../../../support/fragments/topMenu'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import Users from '../../../support/fragments/users/users'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; +import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; + +let user; +const holdingHRIDsFileName = `holdingHRIDs_${getRandomPostfix()}.csv`; +const barcode = getRandomPostfix(); +const inventoryEntity = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + barcode, + secondBarcode: `secondBarcode_${barcode}`, +}; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + + inventoryEntity.instanceId = InventoryInstances.createInstanceViaApi(inventoryEntity.instanceName, inventoryEntity.barcode); + cy.getHoldings({ query: `"instanceId"="${inventoryEntity.instanceId}"` }).then(holdings => { + inventoryEntity.holdingHRID = holdings[0].hrid; + FileManager.createFile(`cypress/fixtures/${holdingHRIDsFileName}`, inventoryEntity.holdingHRID); + }); + + cy.getItems({ query: `"barcode"=="${inventoryEntity.barcode}"` }).then(inventoryItem => { + inventoryItem.discoverySuppress = true; + ItemActions.editItemViaApi(inventoryItem); + }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(inventoryEntity.barcode); + FileManager.deleteFile(`cypress/fixtures/${holdingHRIDsFileName}`); + }); + + it('C399061 Verify "Suppress from discovery" (Set false) option in Bulk Editing Holdings (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Holdings HRIDs'); + BulkEditSearchPane.uploadFile(holdingHRIDsFileName); + BulkEditSearchPane.waitFileUploading(); + + const suppressFromDiscovery = false; + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', inventoryEntity.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.checkMarkAsSuppressedFromDiscoveryAbsent(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', inventoryEntity.barcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsPresent(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', inventoryEntity.secondBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsAbsent(); + }); + }); +}); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-true.cy.js similarity index 100% rename from cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings.cy.js rename to cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-suppressed-holdings-true.cy.js diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js index da38c16c59..8257bd39a7 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-export-manager-permissions.cy.js @@ -10,6 +10,9 @@ import FileManager from '../../../support/utils/fileManager'; import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; import UserEdit from '../../../support/fragments/users/userEdit'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + let user; const userUUIDsFileName = `userUUIDs_${getRandomPostfix()}.csv`; diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js index 3118cf12a8..561f00b6a8 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js @@ -7,6 +7,9 @@ import UsersCard from '../../../support/fragments/users/usersCard'; import devTeams from '../../../support/dictionary/devTeams'; import users from '../../../support/fragments/users/users'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + let userWthViewEditPermissions; describe('bulk-edit', () => { diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index 80cd99978a..5e6265e76f 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -240,7 +240,7 @@ export default { RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Suppress from discovery'), RepeatableFieldItem({ index: rowIndex }).find(Select({ content: including('Set') })).choose(`Set ${value}`), ]); - if (value) cy.expect(Checkbox('Apply to items records').has({ checked: true })); + cy.expect(Checkbox('Apply to items records').has({ checked: value })); }, verifyNoMatchingOptionsForLocationFilter() { diff --git a/cypress/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index 147f88dea7..130af789e5 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -138,6 +138,9 @@ export default { checkMarkAsSuppressedFromDiscovery:() => cy.expect(root .find(HTML(including('Warning: Holdings is marked suppressed from discovery'))) .exists()), + checkMarkAsSuppressedFromDiscoveryAbsent: () => cy.expect(root + .find(HTML(including('Warning: Holdings is marked suppressed from discovery'))) + .absent()), checkElectronicAccess:(relationshipValue, uriValue) => { cy.expect(electronicAccessAccordion .find(MultiColumnListCell({ row: 0, columnIndex: 0, content: relationshipValue })) From 2c105d8e5ccd9afafd1805416b2431963725ce0e Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Wed, 26 Jul 2023 20:40:22 +0300 Subject: [PATCH 07/55] FAT-7141-C375256 (#1413) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7141: test implemented * FAT-7141: method updated * FAT-7141: minor method update --- .../search/search-in-inventory-linked.cy.js | 160 ++++++++++++++++++ cypress/fixtures/marcAuthFileC375256_1.mrc | 1 + cypress/fixtures/marcAuthFileC375256_2.mrc | 1 + cypress/fixtures/marcBibFileC375256.mrc | 1 + .../inventory/inventorySearchAndFilter.js | 8 + 5 files changed, 171 insertions(+) create mode 100644 cypress/e2e/inventory/search/search-in-inventory-linked.cy.js create mode 100644 cypress/fixtures/marcAuthFileC375256_1.mrc create mode 100644 cypress/fixtures/marcAuthFileC375256_2.mrc create mode 100644 cypress/fixtures/marcBibFileC375256.mrc diff --git a/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js new file mode 100644 index 0000000000..ba93a81df6 --- /dev/null +++ b/cypress/e2e/inventory/search/search-in-inventory-linked.cy.js @@ -0,0 +1,160 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +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 InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import { JOB_STATUS_NAMES } from '../../../support/constants'; +import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority'; +import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; + +describe('Search in Inventory', () => { + const testData = { + tag130: '130', + tag240: '240', + tag010: '010', + querySearchOption: 'Query search', + searchQueries: { + allRecords: 'alternativeTitles.alternativeTitle = "bible"', + secondLinkedRecord: 'alternativeTitles.alternativeTitle = "Hosanna Bible"', + bothLinkedRecords: 'alternativeTitles.alternativeTitle = "Hosanna Bible" OR alternativeTitles.alternativeTitle = "Bible. Polish."', + linkedAndFirstNotLinkedRecords: 'alternativeTitles.alternativeTitle = "Hosanna Bible" OR alternativeTitles.alternativeTitle = "Bible. Polish." OR alternativeTitles.alternativeTitle = "Bible1"' + }, + searchResults: { + firstLinkedRecord: 'Prayer Bible (Test record with 130 linked field).', + secondLinkedRecord: 'Prayer Bible (Test record with 240 linked field).', + firstNotLinkedRecord: 'Prayer Bible (Test record without linked field: 246).', + secondNotLinkedRecord: 'Prayer Bible (Test record without linked field: 270).', + } + }; + + const marcFiles = [ + { + marc: 'marcBibFileC375256.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numberOfRecords: 4 + }, + { + marc: 'marcAuthFileC375256_1.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Bible. Polish. Biblia Płocka C375256', + authority010FieldValue: 'n92085235375256', + numberOfRecords: 1 + }, + { + marc: 'marcAuthFileC375256_2.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Abraham, Angela, C375256 Hosanna Bible', + authority010FieldValue: 'n99036055375256', + numberOfRecords: 1 + }, + ]; + + const createdRecordIDs = []; + + before('Importing data, linking Bib fields', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + ]).then(createdUserProperties => { + testData.userProperties = createdUserProperties; + marcFiles.forEach(marcFile => { + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFile(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFile.fileName); + for (let i = 0; i < marcFile.numberOfRecords; i++) { + Logs.getCreatedItemsID(i).then(link => { + createdRecordIDs.push(link.split('/')[5]); + }); + } + }); + }); + // linking fields in MARC Bib records + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.waitContentLoading(); + InventoryInstance.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag130); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[1].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag130); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + InventoryInstance.searchByTitle(createdRecordIDs[1]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag240); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.searchResults(marcFiles[2].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[2].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag240); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + }); + + after('Deleting user, records', () => { + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index > marcFiles[0].numberOfRecords - 1) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + for (let i = 0; i < marcFiles.length; i++) { + DataImport.selectLog(i); + } + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + }); + + it('C375256 Query search | Search by "Alternative title" field of linked "MARC Bib" records (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.allRecords); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstNotLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondNotLinkedRecord); + InventorySearchAndFilter.checkRowsCount(4); + + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.secondLinkedRecord); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.checkRowsCount(1); + + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.bothLinkedRecords); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.checkRowsCount(2); + + InventorySearchAndFilter.selectSearchOptions(testData.querySearchOption, testData.searchQueries.linkedAndFirstNotLinkedRecords); + InventorySearchAndFilter.clickSearch(); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.secondLinkedRecord); + InventorySearchAndFilter.verifySearchResult(testData.searchResults.firstNotLinkedRecord); + InventorySearchAndFilter.checkRowsCount(3); + }); +}); diff --git a/cypress/fixtures/marcAuthFileC375256_1.mrc b/cypress/fixtures/marcAuthFileC375256_1.mrc new file mode 100644 index 0000000000..9620834267 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC375256_1.mrc @@ -0,0 +1 @@ +00598cz a2200169n 450000100070000000500170000700800410002401000200006503500210008504000180010613000450012443000190016943000190018867001800020767500320038795300090041976691219920825111123.7920825n| acannaab |a ana  an92085235375256 a(DLC)n 92085235 aDLCcDLCdDLC 0aBible.lPolish.sBiblia PłockadC375256 0aBiblia Płocka 0aPłocka Biblia aKnapiński, R. Iluminacje romańskiej Biblii Płockiej, 1992:bt.p. (Biblii Płockiej) p. 315 (Early Romanesque Polish handwriting, Biblia Płocka, 2nd quarter of XII cent.) aEnc. Pow. PWNaUltima Thule asd14 \ No newline at end of file diff --git a/cypress/fixtures/marcAuthFileC375256_2.mrc b/cypress/fixtures/marcAuthFileC375256_2.mrc new file mode 100644 index 0000000000..0549b63845 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC375256_2.mrc @@ -0,0 +1 @@ +00406nz a2200145n 450000100070000000500170000700800410002401000200006503500210008504000180010610000450012440000500016967000320021995300090025192724919990513143117.3990513n| acannaabn |a aaa  an99036055375256 a(DLC)n 99036055 aDLCbengcDLC10aAbraham, Angela,dC375256tHosanna Bible10aAbraham, Angela,d1958-tJesus loves me Bible aJesus loves me Bible, 1999. ash21 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC375256.mrc b/cypress/fixtures/marcBibFileC375256.mrc new file mode 100644 index 0000000000..6a14ad141f --- /dev/null +++ b/cypress/fixtures/marcBibFileC375256.mrc @@ -0,0 +1 @@ +03800cam 2200601 i 4500001002100000008004100021006001900062007001500081005001700096035002400113040007600137019001500213020003600228020003300264020001500297020001800312035004100330050001000371082001800381130005100399245005400450246002100504250002300525264004900548264001100597300003900608336002600647337002600673338003600699588002600735500004600761500006500807500002200872520036700894505060101261505038901862520020902251630002002460630003402480630002202514630003702536655002202573655005302595710003202648776012902680856010702809856010802916938004503024938002903069938004103098994001403139948004503153nin00009530419375256190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aHoly BiblelEnglish.sEnglish Standard.f2016.10aPrayer Bible (Test record with 130 linked field).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS03769cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375240002600393245005400419246002100473250002300494264004900517264001100566300003900577336002600616337002600642338003600668588002600704500004600730500006500776500002200841520036700863505060101230505038901831520020902220630002002429630003402449630002202483630003702505655002202542655005302564710003202617776012902649856010702778856010802885938004502993938002903038938004103067994001403108948004503122nin00009530419190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aHoly Bible of England10aPrayer Bible (Test record with 240 linked field).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS03759cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375246001200393245005800405246002100463250002300484264004900507264001100556300003900567336002600606337002600632338003600658588002600694500004600720500006500766500002200831520036700853505060101220505038901821520020902210630002002419630003402439630002202473630003702495655002202532655005302554710003202607776012902639856010702768856010802875938004502983938002903028938004103057994001403098948004503112nin00009530419190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aBible 110aPrayer Bible (Test record without linked field: 246).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS03759cam 2200601 i 4500001001500000008004100015006001900056007001500075005001700090035002400107040007600131019001500207020003600222020003300258020001500291020001800306035004100324050001000365082001800375247001200393245005800405246002100463250002300484264004900507264001100556300003900567336002600606337002600632338003600658588002600694500004600720500006500766500002200831520036700853505060101220505038901821520020902210630002002419630003402439630002202473630003702495655002202532655005302554710003202607776012902639856010702768856010802875938004502983938002903028938004103057994001403098948004503112nin00009530419190504s2019 ilu o 001 0 eng dm o d cr |n|---|||||20230104103759.3 a(OCoLC)on1100023846 aEBLCPbengerdaepncEBLCPdMERUCdOCLCQdYDXdOCLCQdN$TdOCLCQdOCLCO a1099567160 a9781433568381q(electronic bk.) a1433568381q(electronic bk.) z1433564513 z9781433564512 a(OCoLC)1100023846z(OCoLC)1099567160 4aBS19504a220.5/2082230 aBible 210aPrayer Bible (Test record without linked field: 270).14aESV Prayer Bible a[Indexed edition]. 1aWheaton, Illinois :bCrossway Books,c[2019] 4c©2018 a1 online resource (xx, 1896 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier0 aPrint version record. a"ESV text edition 2016"--Title page verso a"Version: esvprb.v3.no-nav.2019.03.a.epub"--Title page verso aIncludes indexes. aThe ESV Prayer Bible was created to help readers reflect on God's Word through prayer. With over four hundred historical prayers linked to specific passages throughout the biblical text, this Bible edition shows God's people how to pray using Scripture as their guide alongside Augustine, John Calvin, George Whitefield, and other Christians from church history.0 aIntro; How to Use the Prayer Bible, ePub Edition; Table of Contents; Title Page; Copyright Information; Introduction to the ESV Prayer Bible; User's Guide; Preface to the English Standard Version; Explanation of ESV Features; Genesis; Exodus; Leviticus; Numbers; Deuteronomy; Joshua; Judges; Ruth; 1 Samuel; 2 Samuel; 1 Kings; 2 Kings; 1 Chronicles; 2 Chronicles; Ezra; Nehemiah; Esther; Job; Psalms; Proverbs; Ecclesiastes; Song of Solomon; Isaiah; Jeremiah; Lamentations; Ezekiel; Daniel; Hosea; Joel; Amos; Obadiah; Jonah; Micah; Nahum; Habakkuk; Zephaniah; Haggai; Zechariah; Malachi; Matthew8 aMarkLuke; John; Acts; Romans; 1 Corinthians; 2 Corinthians; Galatians; Ephesians; Philippians; Colossians; 1 Thessalonians; 2 Thessalonians; 1 Timothy; 2 Timothy; Titus; Philemon; Hebrews; James; 1 Peter; 2 Peter; 1 John; 2 John; 3 John; Jude; Revelation; Table of Weights and Measures; Author Index; Prayer Index; Comprehensive Index of Prayer in the Bible; Concordance; Reading Plan aThe ESV Prayer Bible, with 400+ historical prayers linked to key passages throughout the Bible text, demonstrates how to pursue a deeper communion with God by combining personal Bible reading with prayer.00aBiblexPrayers.00aBiblexPrayers and devotions.06aBiblevPrières.07aBible.2fast0(OCoLC)fst01356024 4aElectronic books. 7aPrayers and devotions.2fast0(OCoLC)fst014239092 aCrossway Books,epublisher.08iPrint version:tPrayer Bible.b[Indexed edition].dWheaton, Illinois : Crossway Books, [2019]z143356453Xw(OCoLC)1065901905403EBSCOhostuhttps://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=2179607403ProQuest Ebook Centraluhttps://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=5760767 aProQuest Ebook CentralbEBLBnEBL5760767 aEBSCOhostbEBSCn2179607 aYBP Library ServicesbYANKn16192509 aZ0bPAOLF hNO HOLDINGS IN PAOLF - 43 OTHER HOLDINGS \ No newline at end of file diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index b0c8d4119f..55adc5eced 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -57,6 +57,7 @@ const editInstanceButton = Button('Edit instance'); const inventorySearchResultsPane = Section({ id: 'browse-inventory-results-pane' }); const nextButton = Button({ id: 'browse-results-list-callNumbers-next-paging-button' }); const previousButton = Button({ id: 'browse-results-list-callNumbers-prev-paging-button' }); +const instancesList = paneResultsSection.find(MultiColumnList({ id: 'list-inventory' })); const searchInstanceByHRID = (id) => { cy.do([ @@ -581,5 +582,12 @@ export default { cy.wait(1000); holdingsPermanentLocationAccordion.find(TextField()).click(); cy.do(holdingsPermanentLocationAccordion.find(Checkbox(location)).click()); + }, + + checkRowsCount:(expectedRowsCount) => { + cy.expect([ + instancesList.find(MultiColumnListRow({ index: expectedRowsCount - 1 })).exists(), + instancesList.find(MultiColumnListRow({ index: expectedRowsCount })).absent() + ]); } }; From 6c565113c2730396b653b8f7338bdb8249ab1c44 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:04:47 +0500 Subject: [PATCH 08/55] FAT-7099/Fix e2e autotests (#1417) * fixed bugs * fixed C350615 --- .../recieve-notice/page-request-cancel-request-triggers.cy.js | 3 ++- cypress/e2e/settings/users/owners.cy.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js b/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js index 7df368df8d..086b68d927 100644 --- a/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js +++ b/cypress/e2e/recieve-notice/page-request-cancel-request-triggers.cy.js @@ -237,11 +237,12 @@ describe('Request notice triggers', () => { NewRequest.waitLoadingNewRequestPage(); NewRequest.enterItemInfo(itemData.barcode); NewRequest.verifyItemInformation([itemData.barcode, itemData.title]); - NewRequest.verifyRequestInformation(ITEM_STATUS_NAMES.AVAILABLE); NewRequest.enterRequesterInfo({ requesterBarcode: userData.barcode, pickupServicePoint: testData.userServicePoint.name, }); + NewRequest.verifyRequestInformation(ITEM_STATUS_NAMES.AVAILABLE); + NewRequest.chooseRequestType(REQUEST_TYPES.PAGE); // needed to prevent from error "Cannot create a request without Instance ID" // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(3000); diff --git a/cypress/e2e/settings/users/owners.cy.js b/cypress/e2e/settings/users/owners.cy.js index fdcd4c5dea..112b4f8f45 100644 --- a/cypress/e2e/settings/users/owners.cy.js +++ b/cypress/e2e/settings/users/owners.cy.js @@ -8,6 +8,9 @@ import Features from '../../../support/dictionary/features'; import users from '../../../support/fragments/users/users'; import ServicePoint from '../../../support/fragments/servicePoint/servicePoint'; +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + describe('ui-users-settings: Owners', () => { describe('Owner creation', () => { const servicePoints = []; From a9e453c43d487a36fb1089ca17a899721537761b Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:22:55 +0500 Subject: [PATCH 09/55] FAT-6883/C388508 (#1416) * added C388508 * fixed bug * fixed bug --- .../add-staff-slip-tokens-in-settings.cy.js | 140 ++++++++++++++++-- .../support/fragments/requests/newRequest.js | 21 ++- 2 files changed, 147 insertions(+), 14 deletions(-) diff --git a/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js b/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js index 47e6634aa0..f92b46c3e5 100644 --- a/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js +++ b/cypress/e2e/staff-slips/add-staff-slip-tokens-in-settings.cy.js @@ -1,38 +1,133 @@ +import uuid from 'uuid'; import devTeams from '../../support/dictionary/devTeams'; import permissions from '../../support/dictionary/permissions'; import { getTestEntityValue } from '../../support/utils/stringTools'; +import { + FULFILMENT_PREFERENCES, + REQUEST_LEVELS, + REQUEST_TYPES, + ITEM_STATUS_NAMES, +} from '../../support/constants'; +import generateItemBarcode from '../../support/utils/generateItemBarcode'; +import TopMenu from '../../support/fragments/topMenu'; import SettingsMenu from '../../support/fragments/settingsMenu'; import TestTypes from '../../support/dictionary/testTypes'; import EditStaffClips from '../../support/fragments/circulation/editStaffClips'; import Users from '../../support/fragments/users/users'; import PatronGroups from '../../support/fragments/settings/users/patronGroups'; +import Requests from '../../support/fragments/requests/requests'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import UserEdit from '../../support/fragments/users/userEdit'; +import NewRequest from '../../support/fragments/requests/newRequest'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; describe('Staff slips', () => { let userData; const patronGroup = { name: getTestEntityValue('groupStaffSlips'), }; + const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotestTLR', uuid()), + itemBarcode: generateItemBarcode(), + }; + const instanceData = { + title: getTestEntityValue('InstanceStaffSlips'), + }; before('Preconditions', () => { - cy.getAdminToken().then(() => { - PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { - patronGroup.id = patronGroupResponse; - }); - cy.createTempUser([permissions.uiCirculationCreateEditRemoveStaffSlips.gui], patronGroup.name).then( - (userProperties) => { + cy.getAdminToken() + .then(() => { + ServicePoints.createViaApi(testData.userServicePoint); + testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); + Location.createViaApi(testData.defaultLocation); + cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { + testData.instanceTypeId = instanceTypes[0].id; + }); + cy.getHoldingTypes({ limit: 1 }).then((holdingTypes) => { + testData.holdingTypeId = holdingTypes[0].id; + }); + cy.getLoanTypes({ limit: 1 }).then((loanTypes) => { + testData.loanTypeId = loanTypes[0].id; + }); + cy.getMaterialTypes({ limit: 1 }).then((materialTypes) => { + testData.materialTypeId = materialTypes.id; + }); + }) + .then(() => { + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId: testData.instanceTypeId, + title: instanceData.title, + }, + holdings: [ + { + holdingsTypeId: testData.holdingTypeId, + permanentLocationId: testData.defaultLocation.id, + }, + ], + items: [ + { + barcode: testData.itemBarcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: testData.loanTypeId }, + materialType: { id: testData.materialTypeId }, + }, + ], + }).then((specialInstanceIds) => { + instanceData.instanceId = specialInstanceIds.instanceId; + instanceData.holdingId = specialInstanceIds.holdingIds[0].id; + instanceData.itemId = specialInstanceIds.holdingIds[0].itemIds[0]; + }); + }) + .then(() => { + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser( + [permissions.uiCirculationCreateEditRemoveStaffSlips.gui, permissions.requestsAll.gui], + patronGroup.name + ).then((userProperties) => { userData = userProperties; + UserEdit.addServicePointViaApi( + testData.userServicePoint.id, + userData.userId, + testData.userServicePoint.id + ); + }); + }) + .then(() => { + Requests.createNewRequestViaApi({ + fulfillmentPreference: FULFILMENT_PREFERENCES.HOLD_SHELF, + holdingsRecordId: testData.holdingTypeId, + instanceId: instanceData.instanceId, + item: { barcode: testData.itemBarcode }, + itemId: instanceData.itemId, + pickupServicePointId: testData.userServicePoint.id, + requestDate: new Date(), + requestExpirationDate: new Date(new Date().getTime() + 86400000), + requestLevel: REQUEST_LEVELS.ITEM, + requestType: REQUEST_TYPES.PAGE, + requesterId: userData.userId, + }).then((request) => { + testData.requestsId = request.body.id; cy.login(userData.username, userData.password); - } - ); - }); - }); - - afterEach('Clear template', () => { - EditStaffClips.editAndClearTransit(); + }); + }); }); after('Deleting created entities', () => { + Requests.deleteRequestViaApi(testData.requestsId); + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); + ServicePoints.deleteViaApi(testData.userServicePoint.id); Users.deleteViaApi(userData.userId); PatronGroups.deleteViaApi(patronGroup.id); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(testData.itemBarcode); + Location.deleteViaApiIncludingInstitutionCampusLibrary( + testData.defaultLocation.institutionId, + testData.defaultLocation.campusId, + testData.defaultLocation.libraryId, + testData.defaultLocation.id + ); }); it( @@ -45,6 +140,7 @@ describe('Staff slips', () => { EditStaffClips.saveAndClose(); EditStaffClips.checkAfterUpdate('Transit'); EditStaffClips.checkPreview('Transit', 'Undergraduate'); + EditStaffClips.editAndClearTransit(); } ); @@ -58,6 +154,24 @@ describe('Staff slips', () => { EditStaffClips.saveAndClose(); EditStaffClips.checkAfterUpdate('Transit'); EditStaffClips.checkPreview('Transit', 'Library Technical Services; IT Operations'); + EditStaffClips.editAndClearTransit(); + } + ); + + it( + 'C388508 Verify that token "currentDateTime" is populated in the pick slip', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.circulationStaffSlipsPath); + EditStaffClips.editPickslip(); + EditStaffClips.addToken(['staffSlip.currentDateTime']); + EditStaffClips.saveAndClose(); + EditStaffClips.checkAfterUpdate('Pick slip'); + cy.visit(TopMenu.requestsPath); + NewRequest.printPickSlips(); + cy.visit(SettingsMenu.circulationStaffSlipsPath); + EditStaffClips.editPickslip(); + EditStaffClips.clearStaffClips(); } ); }); diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index f33903122e..db552fddda 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -1,6 +1,19 @@ /* eslint-disable cypress/no-unnecessary-waiting */ -import { Button, TextField, Pane, Select, HTML, including, Checkbox, Section, Accordion, TextArea, MultiColumnListCell } from '../../../../interactors'; +import { + Button, + TextField, + Pane, + Select, + HTML, + including, + Checkbox, + Section, + Accordion, + TextArea, + MultiColumnListCell, +} from '../../../../interactors'; import { ITEM_STATUS_NAMES, REQUEST_TYPES } from '../../constants'; +import InteractorsTools from '../../utils/interactorsTools'; import SelectUser from './selectUser'; const actionsButton = Button('Actions'); @@ -29,9 +42,15 @@ function openNewRequestPane() { ]); } +function printPickSlips() { + cy.do([actionsButton.click(), Button({ id: 'printPickSlipsBtn' }).click()]); + InteractorsTools.checkCalloutMessage('Print options loading in progress. It might take a few seconds, please be patient.'); +} + export default { addRequester, openNewRequestPane, + printPickSlips, fillRequiredFields(newRequest) { if ('instanceHRID' in newRequest) { From e432d519c2b82608387a6620b0e4e44b0159e700 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:11:47 +0300 Subject: [PATCH 10/55] Implementing of FAT-7006 (#1401) * Implementing of FAT-7006 * Implementing of FAT-7006 * Implementing of FAT-7006 * Implementing of FAT-7006 --- .../funds/filter-transer-from-in-fund.cy.js | 95 +++++++++++++++++++ .../support/fragments/finance/funds/funds.js | 27 +++++- 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/finance/funds/filter-transer-from-in-fund.cy.js diff --git a/cypress/e2e/finance/funds/filter-transer-from-in-fund.cy.js b/cypress/e2e/finance/funds/filter-transer-from-in-fund.cy.js new file mode 100644 index 0000000000..298f8451c4 --- /dev/null +++ b/cypress/e2e/finance/funds/filter-transer-from-in-fund.cy.js @@ -0,0 +1,95 @@ +import permissions from '../../../support/dictionary/permissions'; +import testType from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import FiscalYears from '../../../support/fragments/finance/fiscalYears/fiscalYears'; +import TopMenu from '../../../support/fragments/topMenu'; +import Ledgers from '../../../support/fragments/finance/ledgers/ledgers'; +import Users from '../../../support/fragments/users/users'; +import Funds from '../../../support/fragments/finance/funds/funds'; +import FinanceHelp from '../../../support/fragments/finance/financeHelper'; + +describe('ui-finance: Funds', () => { + const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const firstFund = { ...Funds.defaultUiFund }; + const secondFund = { + name: `autotest_fund2_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: `2${getRandomPostfix()}`, + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + const thirdFund = { + name: `autotest_fund3_${getRandomPostfix()}`, + code: `3${getRandomPostfix()}`, + externalAccountNo: `32${getRandomPostfix()}`, + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + + const allocatedQuantity = '1000'; + let user; + + before(() => { + cy.getAdminToken(); + // create first Fiscal Year and prepere 2 Funds for Rollover + FiscalYears.createViaApi(firstFiscalYear) + .then(firstFiscalYearResponse => { + firstFiscalYear.id = firstFiscalYearResponse.id; + defaultLedger.fiscalYearOneId = firstFiscalYear.id; + Ledgers.createViaApi(defaultLedger) + .then(ledgerResponse => { + defaultLedger.id = ledgerResponse.id; + firstFund.ledgerId = defaultLedger.id; + secondFund.ledgerId = defaultLedger.id; + + Funds.createViaApi(firstFund) + .then(fundResponse => { + firstFund.id = fundResponse.fund.id; + + cy.loginAsAdmin({ path:TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(firstFund.name); + Funds.selectFund(firstFund.name); + Funds.addBudget(allocatedQuantity); + }); + + Funds.createViaApi(secondFund) + .then(secondFundResponse => { + secondFund.id = secondFundResponse.fund.id; + }); + }); + }); + + cy.createTempUser([ + permissions.uiFinanceViewEditCreateFundAndBudget.gui, + permissions.uiFinanceViewLedger.gui, + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.fundPath, waiter: Funds.waitLoading }); + }); + }); + + after(() => { + cy.loginAsAdmin({ path:TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(firstFund.name); + Funds.selectFund(firstFund.name); + Funds.selectBudgetDetails(); + Funds.deleteBudgetViaActions(); + Funds.checkIsBudgetDeleted(); + + Funds.deleteFundViaApi(firstFund.id); + Funds.deleteFundViaApi(secondFund.id); + + Ledgers.deleteledgerViaApi(defaultLedger.id); + + FiscalYears.deleteFiscalYearViaApi(firstFiscalYear.id); + + Users.deleteViaApi(user.userId); + }); + + it('C380708 Filter in "Transfer from" and "Transfer to" fields works correctly when creating a new fund (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + Funds.cancelCreatingFundWithTransfers(thirdFund, defaultLedger.name, firstFund, secondFund); + }); +}); diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 456b00d873..b30eed62e4 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -56,6 +56,7 @@ const fundingInformationMCList = MultiColumnList({ ariaRowCount: 7 }); const FinancialActivityAndOveragesMCList = MultiColumnList({ ariaRowCount: 5 }); const resetButton = Button({ id: 'reset-funds-filters' }); const addTransferModal = Modal({ id: 'add-transfer-modal' }); +const closeWithoutSavingButton = Button('Close without saving'); export default { @@ -102,6 +103,30 @@ export default { this.waitForFundDetailsLoading(); }, + cancelCreatingFundWithTransfers(defaultFund, defaultLedger, firstFund, secondFund) { + cy.do([ + newButton.click(), + nameField.fillIn(defaultFund.name), + codeField.fillIn(defaultFund.code), + ledgerSelection.open(), + SelectionList().select(defaultLedger), + ]); + // TO DO: change xpath to interactors when it would be possible + cy.get('[data-test-col-transfer-from="true"]').click(); + cy.get('[data-test-col-transfer-from="true"] ul[role="listbox"]') + .contains(firstFund.name) + .click(); + cy.get('[data-test-col-transfer-to="true"]').click(); + cy.get('[data-test-col-transfer-to="true"] ul[role="listbox"]') + .contains(secondFund.name) + .click(); + cy.do([ + cancelButton.click(), + closeWithoutSavingButton.click() + ]); + this.waitLoading(); + }, + createFundForWarningMessage(fund) { cy.do([ newButton.click(), @@ -149,7 +174,7 @@ export default { Button('Agreements').click(), Button('Keep editing').click, cancelButton.click(), - Button('Close without saving').click() + closeWithoutSavingButton.click() ]); }, From 7aca34058d20aff4ebd7d234e2f763a675ce0719 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Thu, 27 Jul 2023 18:03:53 +0500 Subject: [PATCH 11/55] FAT-1417 (#1420) --- .../remote-storage/configurations.cy.js | 22 ++++++++--- .../remote-storage-configuration.js | 38 +++++++++++++++---- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/cypress/e2e/settings/remote-storage/configurations.cy.js b/cypress/e2e/settings/remote-storage/configurations.cy.js index 6e6b58fbec..302256c572 100644 --- a/cypress/e2e/settings/remote-storage/configurations.cy.js +++ b/cypress/e2e/settings/remote-storage/configurations.cy.js @@ -7,7 +7,10 @@ import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; let user; -const name = `AutotestConfigurationName${getRandomPostfix()}`; + +const dematicEMS = RemoteStorageHelper.configurations.DematicEMS; +const caiaSoft = RemoteStorageHelper.configurations.CaiaSoft; +const dematicStagingDirector = RemoteStorageHelper.configurations.DematicStagingDirector; describe('remote-storage-configuration', () => { before('create test data', () => { @@ -18,14 +21,11 @@ describe('remote-storage-configuration', () => { }); after('delete test data', () => { - RemoteStorageHelper.deleteRemoteStorage(name); Users.deleteViaApi(user.userId); }); it('C343219 Check “Accession tables” page without configurations with CaiaSoft provider (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { - const dematicEMS = RemoteStorageHelper.configurations.DematicEMS; - const caiaSoft = RemoteStorageHelper.configurations.CaiaSoft; - const dematicStagingDirector = RemoteStorageHelper.configurations.DematicStagingDirector; + const name = `AutotestConfigurationName${getRandomPostfix()}`; dematicEMS.create(name); RemoteStorageHelper.verifyCreatedConfiguration(name, dematicEMS); @@ -39,5 +39,17 @@ describe('remote-storage-configuration', () => { RemoteStorageHelper.closeWithSaving(); RemoteStorageHelper.verifyEditedConfiguration(name, { provider: `${dematicStagingDirector.title} (TCP/IP)` }); RemoteStorageHelper.verifyDataSynchronizationSettingsAccordion(true); + + RemoteStorageHelper.deleteRemoteStorage(name); + }); + + it('C343287 Data synchronization settings field must be undefined for any provider except Dematic StagingDirector (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + const name = `AutotestConfigurationName${getRandomPostfix()}`; + + RemoteStorageHelper.verifyProviderDataSynchronizationSettings(); + dematicStagingDirector.create(name); + RemoteStorageHelper.verifyCreatedConfiguration(name, dematicStagingDirector); + + RemoteStorageHelper.deleteRemoteStorage(name); }); }); diff --git a/cypress/support/fragments/settings/remote-storage/remote-storage-configuration.js b/cypress/support/fragments/settings/remote-storage/remote-storage-configuration.js index 6231b57015..08cef702fd 100644 --- a/cypress/support/fragments/settings/remote-storage/remote-storage-configuration.js +++ b/cypress/support/fragments/settings/remote-storage/remote-storage-configuration.js @@ -16,10 +16,13 @@ const successfulCreateCalloutMessage = 'Remote storage configuration was success const successfulChangeCalloutMessage = 'Remote storage configuration was successfully changed.'; const successfulDeleteCalloutMessage = 'Remote storage configuration was successfully deleted.'; const configurationPane = Pane({ title: 'Configurations' }); -const verifyDataSynchronizationSettingsAccordion = Accordion('Data synchronization settings'); +const dataSynchronizationSettingsAccordion = Accordion('Data synchronization settings'); const saveAndCloseBtn = Button('Save & close'); const saveBtn = Button('Save'); const actionsBtn = Button('Actions'); +const xButton = Button({ icon: 'times' }); +const newButton = Button('+ New'); +const generalInformationAccordion = Accordion({ label: 'General information' }); const configurationFields = { nameInput: TextField({ name: 'name' }), urlInput: TextField({ name: 'url' }), @@ -30,9 +33,9 @@ const configurationFields = { function fillGeneralInfo(fileName, providerName) { return cy.do([ - Button('+ New').click(), - TextField({ name: 'name' }).fillIn(fileName), - Accordion({ label: 'General information' }).find(Select()).choose(including(providerName)), + newButton.click(), + configurationFields.nameInput.fillIn(fileName), + generalInformationAccordion.find(Select()).choose(including(providerName)), ]); } @@ -57,7 +60,7 @@ const configurations = { title: 'Dematic StagingDirector', create(name) { fillGeneralInfo(name, this.title); - cy.do(TextField({ name: 'accessionDelay' }).fillIn('1')); + cy.do(configurationFields.timingInput.fillIn('1')); saveAndCloseForm(); } }, @@ -142,7 +145,14 @@ export default { closeWithoutSaving() { return cy.do([ Modal().find(Button('Cancel')).click(), - Pane({ title: including('Edit ') }).find(Button({ icon: 'times' })).click() + Pane({ title: including('Edit ') }).find(xButton).click() + ]); + }, + + closeCreateConfigurationWithoutSaving() { + return cy.do([ + Pane('Create configuration').find(xButton).click(), + Modal('Are you sure?').find(Button('Close without saving')).click(), ]); }, @@ -163,7 +173,19 @@ export default { }, verifyDataSynchronizationSettingsAccordion(exists) { - if (exists) cy.expect(verifyDataSynchronizationSettingsAccordion.exists()); - else cy.expect(verifyDataSynchronizationSettingsAccordion.absent()) + if (exists) cy.expect(dataSynchronizationSettingsAccordion.exists()); + else cy.expect(dataSynchronizationSettingsAccordion.absent()) + }, + + verifyProviderDataSynchronizationSettings() { + cy.do(newButton.click()); + Object.keys(configurations).forEach(key => { + cy.do([ + generalInformationAccordion.find(Select()).choose(including(configurations[key].title)) + ]); + if (configurations[key].title === 'Dematic StagingDirector') this.verifyDataSynchronizationSettingsAccordion(true); + else this.verifyDataSynchronizationSettingsAccordion(false); + }); + this.closeCreateConfigurationWithoutSaving(); }, }; From 3eca1c410dde85ce804c5ced9afd44cab2d66cad Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Fri, 28 Jul 2023 10:34:45 +0300 Subject: [PATCH 12/55] Implementing of FAT-1331 (#1421) * Implementing of FAT-1331 * Implementing of FAT-1331 * Implementing of FAT-1331 * Implementing of FAT-1331 * Implementing of FAT-1331 --- .../approve-invoice-with-payment-credit.cy.js | 139 ++++++++++++++++++ .../support/fragments/finance/funds/funds.js | 17 +++ .../support/fragments/invoices/invoices.js | 50 +++++-- 3 files changed, 193 insertions(+), 13 deletions(-) create mode 100644 cypress/e2e/invoices/approve-invoice-with-payment-credit.cy.js diff --git a/cypress/e2e/invoices/approve-invoice-with-payment-credit.cy.js b/cypress/e2e/invoices/approve-invoice-with-payment-credit.cy.js new file mode 100644 index 0000000000..b7db05f974 --- /dev/null +++ b/cypress/e2e/invoices/approve-invoice-with-payment-credit.cy.js @@ -0,0 +1,139 @@ +import permissions from '../../support/dictionary/permissions'; +import testType from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; +import TopMenu from '../../support/fragments/topMenu'; +import NewInvoice from '../../support/fragments/invoices/newInvoice'; +import Invoices from '../../support/fragments/invoices/invoices'; +import Funds from '../../support/fragments/finance/funds/funds'; +import Organizations from '../../support/fragments/organizations/organizations'; +import Users from '../../support/fragments/users/users'; +import NewOrder from '../../support/fragments/orders/newOrder'; +import Orders from '../../support/fragments/orders/orders'; +import OrderLines from '../../support/fragments/orders/orderLines'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; +import FiscalYears from '../../support/fragments/finance/fiscalYears/fiscalYears'; +import Ledgers from '../../support/fragments/finance/ledgers/ledgers'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import NewLocation from '../../support/fragments/settings/tenant/locations/newLocation'; +import FinanceHelp from '../../support/fragments/finance/financeHelper'; + +describe('ui-invoices: Cancelling approved invoices', () => { + const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; + + const defaultLedger = { ...Ledgers.defaultUiLedger }; + const defaultFund = { ...Funds.defaultUiFund }; + const secondOrder = { ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true, + reEncumber: true }; + const firstOrder = { + approved: true, + reEncumber: true, + }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const allocatedQuantity = '100'; + let user; + let firstOrderNumber; + let servicePointId; + let location; + + before(() => { + cy.getAdminToken(); + FiscalYears.createViaApi(firstFiscalYear) + .then(firstFiscalYearResponse => { + firstFiscalYear.id = firstFiscalYearResponse.id; + defaultLedger.fiscalYearOneId = firstFiscalYear.id; + Ledgers.createViaApi(defaultLedger) + .then(ledgerResponse => { + defaultLedger.id = ledgerResponse.id; + defaultFund.ledgerId = defaultLedger.id; + + Funds.createViaApi(defaultFund) + .then(fundResponse => { + defaultFund.id = fundResponse.fund.id; + + cy.loginAsAdmin({ path:TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.addBudget(allocatedQuantity); + }); + }); + }); + ServicePoints.getViaApi() + .then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) + .then(res => { + location = res; + }); + }); + Organizations.createOrganizationViaApi(organization) + .then(responseOrganizations => { + organization.id = responseOrganizations; + invoice.accountingCode = organization.erpCode; + firstOrder.orderType = 'One-time'; + }); + secondOrder.vendor = organization.name; + firstOrder.vendor = organization.name; + cy.visit(TopMenu.ordersPath); + Orders.createOrderForRollover(secondOrder).then(firstOrderResponse => { + secondOrder.id = firstOrderResponse.id; + firstOrderNumber = firstOrderResponse.poNumber; + Orders.checkCreatedOrder(secondOrder); + OrderLines.addPOLine(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 5); + OrderLines.rolloverPOLineInfoforPhysicalMaterialWithFund(defaultFund, '20', '1', '20', location.institutionId); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + }); + + cy.createTempUser([ + permissions.uiFinanceViewEditCreateFundAndBudget.gui, + permissions.uiInvoicesApproveInvoices.gui, + permissions.uiInvoicesPayInvoices.gui, + permissions.viewEditCreateInvoiceInvoiceLine.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { path:TopMenu.invoicesPath, waiter: Invoices.waitLoading }); + }); + }); + after(() => { + Organizations.deleteOrganizationViaApi(organization.id); + Users.deleteViaApi(user.userId); + }); + + it('C347897 Approve invoice with both payment and credit (thunderjet)', { tags: [testType.criticalPath, devTeams.thunderjet] }, () => { + cy.visit(TopMenu.invoicesPath); + Invoices.createRolloverInvoice(invoice, organization.name); + Invoices.createInvoiceLinePOLLookUWithSubTotal(firstOrderNumber, '10'); + Invoices.createInvoiceLinePOLLookUWithSubTotal(firstOrderNumber, '-10'); + Invoices.createInvoiceLinePOLLookUWithSubTotal(firstOrderNumber, '10'); + Invoices.approveInvoice(); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.selectBudgetDetails(); + Funds.checkFinancialActivityAndOverages('$10.00', '$10.00', '$0.00', '$20.00'); + Funds.viewTransactions(); + Funds.checkOrderInTransactionList(defaultFund.code, '($10.00)'); + Funds.checkInvoiceInTransactionList(2, 'Pending payment', '($10.00)', 'Invoice'); + Funds.checkInvoiceInTransactionList(3, 'Pending payment', '$10.00', 'Invoice'); + Funds.checkInvoiceInTransactionList(4, 'Pending payment', '($10.00)', 'Invoice'); + cy.visit(TopMenu.invoicesPath); + Invoices.searchByNumber(invoice.invoiceNumber); + Invoices.selectInvoice(invoice.invoiceNumber); + Invoices.payInvoice(); + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(defaultFund.name); + Funds.selectFund(defaultFund.name); + Funds.selectBudgetDetails(); + Funds.checkFinancialActivityAndOverages('$10.00', '$0.00', '$10.00', '$20.00'); + Funds.viewTransactions(); + Funds.checkInvoiceInTransactionList(2, 'Payment', '($10.00)', 'Invoice'); + Funds.checkInvoiceInTransactionList(3, 'Credit', '$10.00', 'Invoice'); + Funds.checkInvoiceInTransactionList(4, 'Payment', '($10.00)', 'Invoice'); + }); +}); diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index b30eed62e4..952646f352 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -274,6 +274,23 @@ export default { ]); }, + checkInvoiceInTransactionList: (indexnumber, type, amount, source) => { + cy.expect([ + transactionList + .find(MultiColumnListRow({ index: indexnumber })) + .find(MultiColumnListCell({ columnIndex: 1 })) + .has({ content: type }), + transactionList + .find(MultiColumnListRow({ index: indexnumber })) + .find(MultiColumnListCell({ columnIndex: 2 })) + .has({ content: `${amount}` }), + transactionList + .find(MultiColumnListRow({ index: indexnumber })) + .find(MultiColumnListCell({ columnIndex: 5 })) + .has({ content: source }) + ]); + }, + increaseAllocation: () => { cy.do([ diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index b5b332e6db..4b7ef48c3f 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -50,6 +50,10 @@ const fundCodeFilterSection = Section({ id: 'fundCode' }); const fiscalYearFilterSection = Section({ id: 'fiscalYearId' }); const invoiceDateFilterSection = Section({ id: 'invoiceDate' }); const approvalDateFilterSection = Section({ id: 'approvalDate' }); +const newBlankLineButton = Button('New blank line'); +const polLookUpButton = Button('POL look-up'); +const selectOrderLinesModal = Modal('Select order lines'); +const fundInInvoiceSection = Section({ id: 'invoiceLineForm-fundDistribution' }); export default { @@ -179,7 +183,7 @@ export default { createInvoiceLine: (invoiceLine) => { cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); - cy.do(Button('New blank line').click()); + cy.do(newBlankLineButton.click()); // TODO: update using interactors once we will be able to pass negative value into text field cy.xpath('//*[@id="subTotal"]').type(invoiceLine.subTotal); cy.do([ @@ -192,10 +196,10 @@ export default { createInvoiceLinePOLLookUp: (orderNumber) => { cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); - cy.do(Button('New blank line').click()); + cy.do(newBlankLineButton.click()); cy.do([ - Button('POL look-up').click(), - Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(orderNumber), + polLookUpButton.click(), + selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(orderNumber), searchButton.click() ]); Helper.selectFromResultsList(); @@ -203,11 +207,31 @@ export default { InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); }, + createInvoiceLinePOLLookUWithSubTotal: (orderNumber, total) => { + cy.do([ + Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), + newBlankLineButton.click() + ]); + cy.do([ + polLookUpButton.click(), + selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(orderNumber), + searchButton.click() + ]); + Helper.selectFromResultsList(); + cy.get('input[name="subTotal"]').clear().type(total); + cy.do([ + fundInInvoiceSection.find(Button('%')).click(), + saveAndClose.click(), + ]); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + cy.wait(4000); + }, + addLineFromPol: (orderNumber) => { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), Button('Add line from POL').click(), - Modal('Select order lines').find(SearchField()).fillIn(orderNumber), + selectOrderLinesModal.find(SearchField()).fillIn(orderNumber), MultiColumnListRow({ index: rowNumber = 0 }).click() ]); }, @@ -217,10 +241,10 @@ export default { Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), Button('Add line from POL').click() ]); - cy.expect(Modal('Select order lines').exists()); + cy.expect(selectOrderLinesModal.exists()); cy.do([ - Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(orderNumber), - Modal('Select order lines').find(searchButton).click(), + selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(orderNumber), + selectOrderLinesModal.find(searchButton).click(), Checkbox({ ariaLabel: `record ${rowNumber} checkbox` }).clickInput(), Button('Save').click() ]); @@ -259,7 +283,7 @@ export default { deleteFundInInvoiceLine: () => { cy.do([ - Section({ id: 'invoiceLineForm-fundDistribution' }).find(Button({ icon: 'trash' })).click(), + fundInInvoiceSection.find(Button({ icon: 'trash' })).click(), saveAndClose.click() ]); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); @@ -340,15 +364,15 @@ export default { Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), Button('Add line from POL').click() ]); - cy.expect(Modal('Select order lines').exists()); + cy.expect(selectOrderLinesModal.exists()); }, checkSearchPolPlugin: (searchParamsMap, titleOrPackage) => { for (const [key, value] of searchParamsMap.entries()) { cy.do([ - Modal('Select order lines').find(SearchField({ id: searhInputId })).selectIndex(key), - Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(value), - Modal('Select order lines').find(searchButton).click() + selectOrderLinesModal.find(SearchField({ id: searhInputId })).selectIndex(key), + selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(value), + selectOrderLinesModal.find(searchButton).click() ]); // verify that first row in the result list contains related order line title cy.expect(MultiColumnList({ id: 'list-plugin-find-records' }) From 64fa1df579e1bae7f5aee6b37f8f614c2849812a Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Fri, 28 Jul 2023 12:53:37 +0300 Subject: [PATCH 13/55] FAT-7007-C400649 (#1423) * added test * added checks * changed method * changed checks --- ...lationship-between-url-and-link-test.cy.js | 181 ++++++++++++++++++ ...instance-using-marc-to-marc-submatch.cy.js | 3 + cypress/fixtures/marcFileForC400649.mrc | 1 + .../fragments/inventory/instanceRecordView.js | 25 ++- 4 files changed, 202 insertions(+), 8 deletions(-) create mode 100644 cypress/e2e/data-import/importing-marc-bib-files/mapping-for-the-856-field-maintains-relationship-between-url-and-link-test.cy.js create mode 100644 cypress/fixtures/marcFileForC400649.mrc diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-the-856-field-maintains-relationship-between-url-and-link-test.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-the-856-field-maintains-relationship-between-url-and-link-test.cy.js new file mode 100644 index 0000000000..bfa3a15b16 --- /dev/null +++ b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-the-856-field-maintains-relationship-between-url-and-link-test.cy.js @@ -0,0 +1,181 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import { INSTANCE_STATUS_TERM_NAMES, + HOLDINGS_TYPE_NAMES, + LOCATION_NAMES, + FOLIO_RECORD_TYPE, + ACCEPTED_DATA_TYPE_NAMES, + JOB_STATUS_NAMES } from '../../../support/constants'; +import NewInstanceStatusType from '../../../support/fragments/settings/inventory/instances/instanceStatusTypes/newInstanceStatusType'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import Users from '../../../support/fragments/users/users'; +import InstanceStatusTypes from '../../../support/fragments/settings/inventory/instances/instanceStatusTypes/instanceStatusTypes'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; + +describe('ui-data-import', () => { + let user; + let instanceHrid; + const testData = { + protectedFieldId: null, + filePath: 'marcFileForC400649.mrc', + fileName: `C400649 autotestFile_${getRandomPostfix()}` + }; + const firstField = { + fieldNimberInFile: 0, + url: 'https://muse.jhu.edu/book/67428', + linkText: 'Project Muse' + }; + const secondField = { + fieldNimberInFile: 1, + url: 'https://muse.jhu.edu/book/74528', + linkText: 'Project Muse' + }; + const thirdField = { + fieldNimberInFile: 2, + url: 'https://www.jstor.org/stable/10.2307/j.ctv26d9pv', + linkText: 'JSTOR' + }; + const forthField = { + fieldNimberInFile: 3, + url: 'https://www.jstor.org/stable/10.2307/j.ctvcwp01n', + linkText: 'JSTOR' + }; + const collectionOfMappingAndActionProfiles = [ + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C400649 Create ER Instance ${getRandomPostfix()}`, + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.ELECTRONIC_RESOURCE }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C400649 Create ER Instance ${getRandomPostfix()}` } + }, + { + mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C400649 Create ER Holdings ${getRandomPostfix()}`, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, + relationship: 'Resource', + uri: '856$u', + linkText: '856$y', + materialsSpecified: '856$3', + urlPublicNote: '856$z' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C400649 Create ER Holdings ${getRandomPostfix()}` } + } + ]; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C400649 Create ER Instance and Holdings ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + + NewInstanceStatusType.createViaApi() + .then((initialInstanceStatusType) => { + testData.instanceStatusTypeId = initialInstanceStatusType.body.id; + }); + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + InstanceStatusTypes.deleteViaApi(testData.instanceStatusTypeId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + collectionOfMappingAndActionProfiles.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + Users.deleteViaApi(user.userId); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C400649 Verify that mapping for the 856 field maintains relationship between URL and link text (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create Field mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(collectionOfMappingAndActionProfiles[0].mappingProfile.instanceStatusTerm); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfiles[1].mappingProfile.holdingsType); + NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.permanentLocation); + NewFieldMappingProfile.addElectronicAccess( + collectionOfMappingAndActionProfiles[1].mappingProfile.relationship, + collectionOfMappingAndActionProfiles[1].mappingProfile.uri, + collectionOfMappingAndActionProfiles[1].mappingProfile.linkText, + collectionOfMappingAndActionProfiles[1].mappingProfile.materialsSpecified, + collectionOfMappingAndActionProfiles[1].mappingProfile.urlPublicNote + ); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + + // create action profiles + collectionOfMappingAndActionProfiles.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkActionProfileByName(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + DataImport.uploadFile(testData.filePath, testData.fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(testData.fileName); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(testData.fileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(hrId => { instanceHrid = hrId; }); + [firstField, secondField, thirdField, forthField].forEach(field => { + InstanceRecordView.verifyElectronicAccess(field.url, field.linkText, field.fieldNimberInFile); + }); + InstanceRecordView.viewSource(); + [firstField, secondField, thirdField, forthField].forEach(field => { + InventoryViewSource.verifyFieldInMARCBibSource('856', field.url); + InventoryViewSource.contains(field.linkText); + }); + }); +}); diff --git a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js index a47b2349e4..715ec2ddbc 100644 --- a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js +++ b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js @@ -273,6 +273,7 @@ describe('ui-data-import', () => { instanceHrids.push(hrId); }); InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); InstanceRecordView.viewSource(); InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); @@ -397,6 +398,7 @@ describe('ui-data-import', () => { instanceHrids.push(hrId); }); InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); InstanceRecordView.viewSource(); InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); @@ -564,6 +566,7 @@ describe('ui-data-import', () => { instanceHrids.push(hrId); }); InstanceRecordView.verifyElectronicAccess(newUri); + InstanceRecordView.verifyElectronicAccessAbsent(1); InstanceRecordView.viewSource(); InventoryViewSource.verifyFieldInMARCBibSource(testData.protectedField, newUri); InventoryViewSource.close(); diff --git a/cypress/fixtures/marcFileForC400649.mrc b/cypress/fixtures/marcFileForC400649.mrc new file mode 100644 index 0000000000..762a0e2e01 --- /dev/null +++ b/cypress/fixtures/marcFileForC400649.mrc @@ -0,0 +1 @@ +05077cam a2200769 i 4500006001900000007001500019007001500034008004100049005001700090010001700107040013000124019012200254020003600376020003300412020001500445020001800460035021300478037002700691042001300718043003000731050002100761049000900782111015900791245013500950250002201085264004901107300003401156336002601190337002601216338003601242490008501278504004101363505071401404506005402118533008402172538023702256583008502493588002502578650004302603651004902646651005202695650004302747650005102790650005702841650004802898650005702946651003903003651003603042650005303078651005603131651006203187655002203249655006503271655003903336655002203375700009503397710007203492776024703564830013403811856005003945856005003995856006004045856006004105950004904165950003804214951005504252m o d cr bn||||||abpcr bn||||||ada100317s1981 mx ob 100 0 eng c20230310182223.3 a 83138637  aOCLCEbengerdaepncOCLCEdOCLCQdOCLCOdOCLCQdOCLCFdOCLdOCLCQdCOOdVT2dJSTORdIYUdGZMdUPMdAUMdU9XdUABdNOCdOCLCO a606272588a1056778856a1061083900a1091325862a1115069902a1154285075a1155075406a1181901831a1181903791a1228540641 a9786076284384q(electronic bk.) a6076284382q(electronic bk.) z9681201078 z9789681201074 a(OCoLC)tst557659379z(OCoLC)606272588z(OCoLC)1056778856z(OCoLC)1061083900z(OCoLC)1091325862z(OCoLC)1115069902z(OCoLC)1154285075z(OCoLC)1155075406z(OCoLC)1181901831z(OCoLC)1181903791z(OCoLC)1228540641 a22573/ctvcxggb5bJSTOR apccadlr aa------an------as------ 4aJC375b.I57 1976 aMAIN2 aInternational Congress of Human Sciences in Asia and North African(30th :d1976 :cMexico City, Mexico)0http://id.loc.gov/authorities/names/no202009168710aKingship in Asia and early America :bXXX International Congress of Human Sciences in Asia and North Africa /ceditor, A.L. Basham aPrimera edición 1aMéxico, D.F. :bColegio de México,c1981 a1 online resource (256 pages) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier1 a30th International Congress of Human Sciences in Asia and North Africa. Seminars aIncludes bibliographical references.0 aSacral and not-so-sacral kingship in the ancient Near East / John van Seters -- Kingship in Islam: an historical analysis / S.A.A. Rizvi -- Aspects of the nature and functions of Vedic kingship / James A. Santucci -- Ideas of kingship in Hinduism and Buddhism / A.L.Barsham -- The socio-economic bases of "Oriental despotism" in early India / R.S. Sharma -- Some aspects of kingship in ancient Java / S. Supomo -- Ideologies and traditions of monarchy and government in Imperial China / Hok-lam Chan -- Monarchy and government: traditions and ideologies in pre-modern Japan / Joseph M. Kitagawa -- Kingship in ancient Mexico / Pedro Carrasco -- The Inka and political power in the Andes / Franklin Pease, G.Y. 3Use copyfRestrictions unspecified5MiAaHDL2star aElectronic reproduction.b[S.l.] :cHathiTrust Digital Library,d2010.5MiAaHDL aMaster and use copy. Digital master created according to Benchmark for Faithful Digital Reproductions of Monographs and Serials, Version 1. Digital Library Federation, December 2002.uhttp://purl.oclc.org/DLF/benchrepro02125MiAaHDL1 adigitizedc2010hHathiTrust Digital Librarylcommitted to preserve5MiAaHDL2pda0 aPrint version record 0aKings and rulers, AncientvCongresses. 0aAsiaxKings and rulersxHistoryvCongresses. 0aAmericaxKings and rulersxHistoryvCongresses. 6aRois et souverains anciensxCongrès. 6aRois et souverainszAsiexHistoirexCongrès. 6aRois et souverainszAmériquexHistoirexCongrès. 7aKings and rulers.2fast0(OCoLC)fst00987694 7aKings and rulers, Ancient.2fast0(OCoLC)fst00987739 7aAmerica.2fast0(OCoLC)fst01239786 7aAsia.2fast0(OCoLC)fst01240495 7aRois et souverainsxTitulaturesxCongrès.2ram 7aAsiexRois et souverainsxHistoirexCongrès.2ram 7aAmériquexRois et souverainsxHistoirexCongrès.2ram 4aElectronic books. 7aConference papers and proceedings.2fast0(OCoLC)fst01423772 7aHistory.2fast0(OCoLC)fst01411628 0aElectronic books.1 aBasham, A. L.q(Arthur Llewellyn),eeditor.0http://id.loc.gov/authorities/names/n500184002 aColegio de México.0http://id.loc.gov/authorities/names/n7914279708iPrint version:aInternational Congress of Human Sciences in Asia and North Africa (30th : 1976 : Mexico City, Mexico).tKingship in Asia and early America.b1a ed.dMéxico, D.F. : Colegio de México, 1981w(DLC) 83138637w(OCoLC)10099013 0a30th International Congress of Human Sciences in Asia and North Africa.pSeminars.0http://id.loc.gov/authorities/names/n8370347040uhttps://muse.jhu.edu/book/67428yProject Muse40uhttps://muse.jhu.edu/book/74528yProject Muse40uhttps://www.jstor.org/stable/10.2307/j.ctv26d9pvyJSTOR40uhttps://www.jstor.org/stable/10.2307/j.ctvcwp01nyJSTOR aProject MusebProject Muse Open Access Books aJSTORbBooks at JSTOR Open Access aAdditional title added to collection Muse.oaebooks \ No newline at end of file diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index 3f0638b93b..9d2d85eca3 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -94,6 +94,21 @@ const verifyInstanceRecordViewOpened = () => { cy.expect(Pane({ id:'pane-instancedetails' }).exists()); }; +const verifyElectronicAccess = (uriValue, linkText = '', rowNumber = 0) => { + cy.expect(electronicAccessAccordion + .find(MultiColumnListCell({ row: rowNumber, columnIndex: 1, content: uriValue })) + .exists()); + cy.expect(electronicAccessAccordion + .find(MultiColumnListCell({ row: rowNumber, columnIndex: 2, content: linkText })) + .exists()); +}; + +const verifyElectronicAccessAbsent = (rowNumber = 0) => { + cy.expect(electronicAccessAccordion + .find(MultiColumnListCell({ row: rowNumber, columnIndex: 1 })) + .absent()); +}; + const waitLoading = () => cy.expect(actionsButton.exists()); export default { @@ -116,6 +131,8 @@ export default { verifyNatureOfContent, verifyInstanceSource, verifyInstanceRecordViewOpened, + verifyElectronicAccess, + verifyElectronicAccessAbsent, verifyHotlinkToPOL:(number) => { cy.expect(Accordion('Acquisition').find(MultiColumnListCell({ row: 0, content: number })).exists()); cy.expect(Accordion('Acquisition').find(Link({ href: including('/orders/lines/view') })).exists()); @@ -131,14 +148,6 @@ export default { cy.expect(Callout({ textContent: including(`Record ${number} created. Results may take a few moments to become visible in Inventory`) }) .exists()); }, - verifyElectronicAccess:(uriValue) => { - cy.expect(electronicAccessAccordion - .find(MultiColumnListCell({ row: 0, columnIndex: 1, content: uriValue })) - .exists()); - cy.expect(electronicAccessAccordion - .find(MultiColumnListCell({ row: 1, columnIndex: 1 })) - .absent()); - }, openHoldingView: () => { cy.do(Button('View holdings').click()); From 7ee5c1bc23c37e47b4ee50b8791b22b85b303982 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Fri, 28 Jul 2023 21:35:18 +0300 Subject: [PATCH 14/55] FAT-7200 (#1419) * fixed tests * added reload * fixed C17018, C6707, C3506 * deleted retries * changed all methods getting instance hrid via api * added cy.reload in all tests with import --- .../delete-all-logs-from-landing-page.cy.js | 1 + ...mport-file-for-create-invoice-record.cy.js | 1 + .../e2e/edi-import-large-invoice-file.cy.js | 1 + .../e2e/field-protection-overrides.cy.js | 135 +++++++------- .../e2e/field-protection-settings.cy.js | 38 ++-- ...r-and-delete-import-logs-on-view-all.cy.js | 1 + .../e2e/match-on-holdings-856-u.cy.js | 2 + .../match-on-instance-identifier-scen1.cy.js | 2 + .../match-on-instance-identifier-scen2.cy.js | 2 + .../match-on-pol-and-update-instance.cy.js | 2 + .../e2e/match-on-pol-and-update-items.cy.js | 1 + .../e2e/match-on-vrn-and-update-items.cy.js | 1 + .../mrc-import-file-for-create-items.cy.js | 1 + ...mport-file-for-modify-marcBib-record.cy.js | 24 +-- .../mrc-import-file-for-update-items.cy.js | 25 +-- .../e2e/mrc-import-with-matching-001.cy.js | 93 +++++----- .../e2e/mrc-import-with-matching-999ff.cy.js | 119 ++++++------- .../e2e/data-import/e2e/view-all-filter.cy.js | 2 + cypress/e2e/data-import/e2e/view-all.cy.js | 1 + ...ndling-for-new-and-update-srs-record.cy.js | 164 +++++++++--------- ...on-and-field-mapping-create-instance.cy.js | 25 +-- ...when-job-profile-not-create-instance.cy.js | 1 + ...-not-processed-for-invalid-marc-bibs.cy.js | 1 + ...it-file-and-reimport-to-update-items.cy.js | 2 + .../field-protection-modification.cy.js | 26 +-- ...import-a-bunch-of-marc-files-at-once.cy.js | 6 +- ...stopping-running-job-and-deleting-it.cy.js | 2 + ...import-of-orders-with-pending-status.cy.js | 1 + ...lectronic-resource-with-no-inventory.cy.js | 1 + ...-orders-other-with-instance-holdings.cy.js | 1 + ...source-with-instances-holdings-items.cy.js | 1 + ...orting-ebook-orders-with-open-status.cy.js | 1 + .../item-update-via-match-by-status.cy.js | 2 + ...d-check-in-out-notes-from-marc-field.cy.js | 1 + ...-update-select-fields-works-properly.cy.js | 1 + .../match-on-instance-identifier-scen3.cy.js | 2 + .../match-on-instance-identifier-scen4.cy.js | 2 + .../match-on-location.cy.js | 2 + .../match-on-oclc-and-update-instance.cy.js | 126 +++++++------- ...g-on-newly-created-035-does-not-work.cy.js | 24 +-- ...-pe-mix-with-instance-holdings-items.cy.js | 1 + ...rc-import-with-999-field-and-without.cy.js | 1 + ...tches-under-actions-in-a-job-profile.cy.js | 2 + ...n-incoming-records-not-deleted-scen1.cy.js | 11 +- ...record-import-with-running-large-job.cy.js | 1 + ...or-marc-indicators-in-match-profiles.cy.js | 3 + .../test-remove-field-mapping-option.cy.js | 4 +- ...e-holdings-via-static-value-submatch.cy.js | 2 + .../updates-should-add-035-field.cy.js | 2 + ...aking-incorrect-records-into-account.cy.js | 3 + ...-records-do-or-do-not-have-999-field.cy.js | 1 + ...-discarded-error-actions-for-invoice.cy.js | 1 + ...instance-using-marc-to-marc-submatch.cy.js | 6 + ...t-summary-table-for-creating-actions.cy.js | 1 + ...t-summury-table-for-updating-actions.cy.js | 6 +- ...orting-of-orders-with-pending-status.cy.js | 1 + ...s-for-created-imported-order-records.cy.js | 1 + ...y-records-created-after-not-matching.cy.js | 1 + ...not-exceed-number-of-records-in-file.cy.js | 2 + ...ile-only-involves-holdings-and-items.cy.js | 4 + .../user-cannot-delete-import-logs.cy.js | 13 +- ...-limited-permissions-can-import-file.cy.js | 12 +- .../fund-and-expense-class-mappings.cy.js | 4 + ...-after-editing-marc-bib-in-quickMarc.cy.js | 1 + ...ields-after-editing-marc-bib-outside.cy.js | 2 + ...catalogue-new-ordered-recieved-title.cy.js | 4 + .../marking/mark-item-as-missing.cy.js | 23 +++ .../marking/mark-item-as-withdrawn.cy.js | 22 +++ .../fragments/data_import/dataImport.js | 2 +- .../newFieldMappingProfile.js | 14 +- .../fragments/inventory/markItemAsMissing.js | 2 +- 71 files changed, 585 insertions(+), 412 deletions(-) diff --git a/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js b/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js index 0c609b08a7..3f894d5b10 100644 --- a/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js +++ b/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js @@ -41,6 +41,7 @@ describe('ui-data-import', () => { fileNameToUpload = `C358137autotestFile.${getRandomPostfix()}.mrc`; // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.waitLoading(); DataImport.uploadFile(filePath, fileNameToUpload); JobProfiles.searchJobProfileForImport(jobProfileToRun); diff --git a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js index a9b11614fa..474b7612fb 100644 --- a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js @@ -93,6 +93,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('ediFileForC343338.edi', fileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.selectJobProfile(); diff --git a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js index b4e60d87cf..4881eda291 100644 --- a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js @@ -75,6 +75,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('ediFileForC347615.edi', fileName); DataImport.waitFileIsUploaded(); JobProfiles.searchJobProfileForImport(jobProfile.profileName); diff --git a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js index 86b5e6ad2b..f1f4e40c09 100644 --- a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js @@ -245,6 +245,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC17018-BeforeOverride.mrc', fileNameForCreatingInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -256,72 +257,74 @@ describe('ui-data-import', () => { }); FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); FileDetails.checkInstanceQuantityInSummaryTable('1', 0); - - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - DataImport.editMarcFile(fileForEditRev1, editedFileNameRev1, [instanceHridFromFile], [instanceHrid]); - DataImport.editMarcFile(fileForEditRev2, editedFileNameRev2, [instanceHridFromFile], [instanceHrid]); - - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedFileNameRev1, fileNameForProtect); - JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForProtect); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForProtect); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); - FileDetails.checkInstanceQuantityInSummaryTable('1', 1); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyAdministrativeNote(administrativeNote); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 2); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 1); - InstanceRecordView.verifyInstanceNote(instanceNote); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - resourceIdentifiers.forEach(element => { - InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.firstField, element.value); - }); - InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, instanceNote); - - // upload a marc file - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedFileNameRev2, fileNameForOverride); - JobProfiles.searchJobProfileForImport(jobProfileForOverride.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameForOverride); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameForOverride); - [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { - FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); - FileDetails.checkInstanceQuantityInSummaryTable('1', 1); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyAdministrativeNote(administrativeNote); - InstanceRecordView.verifyAdministrativeNote(updatedAdministativeNote); - resourceIdentifiers.forEach(element => { - InventoryInstance.verifyResourceIdentifierAbsent(element.value); - }); - InstanceRecordView.verifyInstanceNote(updatedInstanceNote); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - InventoryViewSource.notContains(`${protectedFields.firstField}\t`); - InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, updatedInstanceNote); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + DataImport.editMarcFile(fileForEditRev1, editedFileNameRev1, [instanceHridFromFile], [instanceHrid]); + DataImport.editMarcFile(fileForEditRev2, editedFileNameRev2, [instanceHridFromFile], [instanceHrid]); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadFile(editedFileNameRev1, fileNameForProtect); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForProtect); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForProtect); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); + FileDetails.checkInstanceQuantityInSummaryTable('1', 1); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyAdministrativeNote(administrativeNote); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 2); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[2].type, resourceIdentifiers[2].value, 1); + InstanceRecordView.verifyInstanceNote(instanceNote); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + resourceIdentifiers.forEach(element => { + InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.firstField, element.value); + }); + InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, instanceNote); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadFile(editedFileNameRev2, fileNameForOverride); + JobProfiles.searchJobProfileForImport(jobProfileForOverride.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameForOverride); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameForOverride); + [FileDetails.columnNameInResultList.srsMarc, FileDetails.columnNameInResultList.instance].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.updated, columnName); }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 1); + FileDetails.checkInstanceQuantityInSummaryTable('1', 1); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyAdministrativeNote(administrativeNote); + InstanceRecordView.verifyAdministrativeNote(updatedAdministativeNote); + resourceIdentifiers.forEach(element => { + InventoryInstance.verifyResourceIdentifierAbsent(element.value); + }); + InstanceRecordView.verifyInstanceNote(updatedInstanceNote); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + InventoryViewSource.notContains(`${protectedFields.firstField}\t`); + InventoryViewSource.verifyFieldInMARCBibSource(protectedFields.secondField, updatedInstanceNote); + }); }); }); diff --git a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js index ff84ef8ef3..b0992a76e3 100644 --- a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js @@ -17,7 +17,6 @@ import Logs from '../../../support/fragments/data_import/logs/logs'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import MarcFieldProtection from '../../../support/fragments/settings/dataImport/marcFieldProtection'; -import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; @@ -156,6 +155,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC17017.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -167,24 +167,23 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); Logs.clickOnHotLink(0, 3, 'Created'); - InstanceRecordView.viewSource(); - InstanceRecordView.verifySrsMarcRecord(); - InventoryViewSource.verifyFieldInMARCBibSource('500', dataForField500); - InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[0], dataForField507); - InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[1], dataForField920); - - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - // change file using order number - DataImport.editMarcFile( - 'marcFileForC17017.mrc', - editedMarcFileName, - [dataFromField001, dataForField500, dataForField507, dataForField920], - [instanceHrid, updateDataForField500, updateDataForField507, updateDataForField920] - ); - }); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + InstanceRecordView.viewSource(); + InstanceRecordView.verifySrsMarcRecord(); + InventoryViewSource.verifyFieldInMARCBibSource('500', dataForField500); + InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[0], dataForField507); + InventoryViewSource.verifyFieldInMARCBibSource(marcFieldProtected[1], dataForField920); + + + // change file using order number + DataImport.editMarcFile( + 'marcFileForC17017.mrc', + editedMarcFileName, + [dataFromField001, dataForField500, dataForField507, dataForField920], + [instanceHrid, updateDataForField500, updateDataForField507, updateDataForField920] + ); + }); // create mapping profile for update cy.visit(SettingsMenu.mappingProfilePath); @@ -209,6 +208,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js b/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js index af3b47aa0d..0836c20767 100644 --- a/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js +++ b/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js @@ -63,6 +63,7 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcAuthority.mrc', nameMarcFileForCreate); // need to wait until file will be uploaded in loop cy.wait(8000); diff --git a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js index bfd4a468a3..f353d52928 100644 --- a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js @@ -155,6 +155,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC17025.mrc', nameForCreateMarcFile); JobProfiles.searchJobProfileForImport(createInstanceAndEHoldingsJobProfile.profileName); JobProfiles.runImportFile(); @@ -171,6 +172,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC17025.mrc', nameForUpdateCreateMarcFile); JobProfiles.searchJobProfileForImport(updateEHoldingsJobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js index 90219409b7..98eb34b89a 100644 --- a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js @@ -104,6 +104,7 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForMatchOnIdentifierForCreate.mrc', fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -143,6 +144,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForMatchOnIdentifierForUpdate_1.mrc', fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js index c8dd6c360f..7782df3552 100644 --- a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js @@ -107,6 +107,7 @@ describe('ui-data-import', () => { it('C347829 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 2 (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -145,6 +146,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForUpdateInstance, fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js b/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js index e3de64c647..e930bd3bdf 100644 --- a/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js @@ -227,6 +227,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC350944.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -256,6 +257,7 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js index 311b592f75..2223e7409a 100644 --- a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js @@ -343,6 +343,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.checkIsLandingPageOpened(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); diff --git a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js index 8db4555e7f..26f6364dc2 100644 --- a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js @@ -240,6 +240,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.checkIsLandingPageOpened(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfilesData.name); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js index 497d8958e4..07fc3a6c7e 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js @@ -130,6 +130,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', fileName); JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js index 1e92cfb489..21bc92f20a 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js @@ -89,6 +89,7 @@ describe('ui-data-import', () => { it('C345423 Verify the possibility to modify MARC Bibliographic record (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // upload a marc file for creating of the new instance, holding and item DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -101,18 +102,18 @@ describe('ui-data-import', () => { FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); }); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHRID = hrId[0]; + // open Instance to get hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - }); + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + }); // download exported marc file cy.visit(TopMenu.dataExportPath); ExportFile.uploadFile(nameForCSVFile); @@ -148,6 +149,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(nameMarcFileForUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js index 700d25c97a..2904c82102 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js @@ -385,6 +385,7 @@ describe('ui-data-import', () => { it('C343335 MARC file upload with the update of instance, holding, and items (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // upload a marc file for creating of the new instance, holding and item DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); @@ -400,17 +401,18 @@ describe('ui-data-import', () => { FileDetails.checkItemsQuantityInSummaryTable(0, '1'); FileDetails.checkItemsQuantityInSummaryTable(1, '0'); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHRID = hrId[0]; - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHRID = initialInstanceHrId; + + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + }); cy.visit(SettingsMenu.exportMappingProfilePath); ExportFieldMappingProfiles.createMappingProfile(exportMappingProfile); @@ -458,6 +460,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(nameMarcFileForImportUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js index 29b1ca07a7..b7808ee101 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js @@ -17,6 +17,7 @@ import FileDetails from '../../../support/fragments/data_import/logs/fileDetails import permissions from '../../../support/dictionary/permissions'; import Users from '../../../support/fragments/users/users'; import DevTeams from '../../../support/dictionary/devTeams'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; describe('ui-data-import', () => { let user = {}; @@ -82,6 +83,7 @@ describe('ui-data-import', () => { it('C17044: MARC-MARC matching for 001 field (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // upload a marc file for export DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -90,57 +92,60 @@ describe('ui-data-import', () => { Logs.openFileDetails(nameForMarcFile); FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - cy.visit(TopMenu.dataExportPath); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + const instanceHRID = initialInstanceHrId; - // download exported marc file - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithDefaultJobProfile(nameForCSVFile); - ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + cy.visit(TopMenu.dataExportPath); - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); + // download exported marc file + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithDefaultJobProfile(nameForCSVFile); + ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfile(mappingProfile); + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); - // create Action profile and link it to Field mapping profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfile(mappingProfile); - // create Job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); + // create Action profile and link it to Field mapping profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); - // upload the exported marc file with 001 field - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(nameForExportedMarcFile); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForExportedMarcFile); - Logs.openFileDetails(nameForExportedMarcFile); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); + // upload the exported marc file with 001 field + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadExportedFile(nameForExportedMarcFile); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForExportedMarcFile); + Logs.openFileDetails(nameForExportedMarcFile); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - // ensure the fields created in Field mapping profile exists in inventory - InventorySearchAndFilter.checkInstanceDetails(); - }); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + + // ensure the fields created in Field mapping profile exists in inventory + InventorySearchAndFilter.checkInstanceDetails(); + }); }); }); diff --git a/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js b/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js index ee356f2525..9e25bd5a3f 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js @@ -14,6 +14,7 @@ import SettingsMenu from '../../../support/fragments/settingsMenu'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import TopMenu from '../../../support/fragments/topMenu'; import DevTeams from '../../../support/dictionary/devTeams'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import { LOCATION_NAMES, FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { @@ -108,6 +109,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); JobProfiles.searchJobProfileForImport(jobProfileForExport.profileName); JobProfiles.runImportFile(); @@ -115,64 +117,63 @@ describe('ui-data-import', () => { Logs.openFileDetails(nameForMarcFile); FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.instance); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - // download .csv file - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(hrId[0]); - InventorySearchAndFilter.saveUUIDs(); - ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - cy.visit(TopMenu.dataExportPath); - - // download exported marc file - ExportFile.uploadFile(nameForCSVFile); - ExportFile.exportWithDefaultJobProfile(nameForCSVFile); - ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); - - cy.log('#####End Of Export#####'); - - // create Match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - - // create Field mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.createMappingProfile(mappingProfile); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - - // create Action profile and link it to Field mapping profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); - - // create Job profile - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - - // upload the exported marc file with 999.f.f.s fields - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadExportedFile(nameForExportedMarcFile); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameForExportedMarcFile); - Logs.openFileDetails(nameForExportedMarcFile); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(id => { - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(id[0]); - - // ensure the fields created in Field mapping profile exists in inventory - InventorySearchAndFilter.checkInstanceDetails(); - }); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + const instanceHRID = initialInstanceHrId; + + // download .csv file + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + InventorySearchAndFilter.saveUUIDs(); + ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*'); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + cy.visit(TopMenu.dataExportPath); + + // download exported marc file + ExportFile.uploadFile(nameForCSVFile); + ExportFile.exportWithDefaultJobProfile(nameForCSVFile); + ExportFile.downloadExportedMarcFile(nameForExportedMarcFile); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + + cy.log('#####End Of Export#####'); + + // create Match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + + // create Field mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.createMappingProfile(mappingProfile); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create Action profile and link it to Field mapping profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload the exported marc file with 999.f.f.s fields + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadExportedFile(nameForExportedMarcFile); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameForExportedMarcFile); + Logs.openFileDetails(nameForExportedMarcFile); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); + + // ensure the fields created in Field mapping profile exists in inventory + InventorySearchAndFilter.checkInstanceDetails(); + }); }); }); diff --git a/cypress/e2e/data-import/e2e/view-all-filter.cy.js b/cypress/e2e/data-import/e2e/view-all-filter.cy.js index cacc592add..eb9fcd669c 100644 --- a/cypress/e2e/data-import/e2e/view-all-filter.cy.js +++ b/cypress/e2e/data-import/e2e/view-all-filter.cy.js @@ -34,12 +34,14 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // Upload files // runs with errors cy.uploadFileWithDefaultJobProfile(fileNameForFailedImport); cy.reload(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // runs successfully cy.uploadFileWithDefaultJobProfile(fileNameForSuccessfulImport); diff --git a/cypress/e2e/data-import/e2e/view-all.cy.js b/cypress/e2e/data-import/e2e/view-all.cy.js index 7f0da2fc25..1f9cc4a7d5 100644 --- a/cypress/e2e/data-import/e2e/view-all.cy.js +++ b/cypress/e2e/data-import/e2e/view-all.cy.js @@ -22,6 +22,7 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // remove generated test file from fixtures after uploading cy.uploadFileWithDefaultJobProfile(uniqueFileName); FileManager.deleteFile(`cypress/fixtures/${uniqueFileName}`); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js index 9da4eaf056..d23be5dc3e 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js @@ -80,17 +80,18 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileName); Logs.openFileDetails(fileName); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHridForReimport = hrId[0]; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHridForReimport = initialInstanceHrId; + }); }); }); @@ -118,6 +119,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFilrForC17039.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -131,82 +133,83 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - // check fields are absent in the view source - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); - InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 1); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); - InventoryViewSource.notContains('003\t'); - InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); - - InventoryViewSource.extructDataFrom999Field() - .then(uuid => { - // change file using uuid for 999 field - DataImport.editMarcFile( - 'marcFilrForC17039With999Field.mrc', - editedMarcFileName, - ['srsUuid', 'instanceUuid'], - [uuid[0], uuid[1]] - ); - }); - - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithExistingPart(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create mapping profiles - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(instanceStatusTerm); - NewFieldMappingProfile.fillCatalogedDate(catalogedDate); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); - - // create job profile for update - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - - // upload a marc file for updating already created instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile(editedMarcFileName, fileNameAfterUpload); - JobProfiles.searchJobProfileForImport(jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(fileNameAfterUpload); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(fileNameAfterUpload); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); - FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + // check fields are absent in the view source + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[0].type, resourceIdentifiers[0].value, 0); + InventoryInstance.verifyResourceIdentifier(resourceIdentifiers[1].type, resourceIdentifiers[1].value, 1); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); + InventoryViewSource.notContains('003\t'); + InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); - // check instance is updated - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InventoryInstance.checkIsInstanceUpdated(); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); - InventoryViewSource.notContains('003\t'); - InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); - }); + InventoryViewSource.extructDataFrom999Field() + .then(uuid => { + // change file using uuid for 999 field + DataImport.editMarcFile( + 'marcFilrForC17039With999Field.mrc', + editedMarcFileName, + ['srsUuid', 'instanceUuid'], + [uuid[0], uuid[1]] + ); + }); + + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithExistingPart(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create mapping profiles + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(instanceStatusTerm); + NewFieldMappingProfile.fillCatalogedDate(catalogedDate); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + // create job profile for update + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles(jobProfile, actionProfile.name, matchProfile.profileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file for updating already created instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadFile(editedMarcFileName, fileNameAfterUpload); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileNameAfterUpload); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameAfterUpload); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + + // check instance is updated + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InventoryInstance.checkIsInstanceUpdated(); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + InventoryViewSource.verifyFieldInMARCBibSource('001\t', instanceHrid); + InventoryViewSource.notContains('003\t'); + InventoryViewSource.verifyFieldInMARCBibSource('035\t', '(ICU)1299036'); + }); // export instance cy.visit(TopMenu.inventoryPath); @@ -226,6 +229,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(exportedFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js index 3992ccc7de..90b94d533d 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js @@ -90,6 +90,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -104,18 +105,18 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); - InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); - InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); - InstanceRecordView.verifyNatureOfContent(mappingProfile.natureOfContent); - }); + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); + InstanceRecordView.verifyCatalogedDate(mappingProfile.catalogedDateUI); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatus); + InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); + InstanceRecordView.verifyNatureOfContent(mappingProfile.natureOfContent); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js index fcc2c2cacc..aee43e8300 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js @@ -182,6 +182,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(exportedFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js index e4ec0aaf79..94d726231e 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js @@ -40,6 +40,7 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC350750.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js index 5572cbf7b8..87b3b5f45b 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js @@ -226,6 +226,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('mrcFileForC11123.mrc', marcFileForCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -324,6 +325,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, nameMarcFileForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js index 4a04071698..ba6622b1e5 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js @@ -127,6 +127,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC350678.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -139,18 +140,19 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); FileDetails.checkInstanceQuantityInSummaryTable('1', 0); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - // check fields are absent in the view source - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - // verify table data in marc bibliographic source - InventoryInstance.viewSource(); - fieldsForDelete.forEach(fieldNumber => { - InventoryViewSource.notContains(`${fieldNumber}\t`); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + // check fields are absent in the view source + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + // verify table data in marc bibliographic source + InventoryInstance.viewSource(); + fieldsForDelete.forEach(fieldNumber => { + InventoryViewSource.notContains(`${fieldNumber}\t`); }); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js index 06fe84bc34..05e8d1da31 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js @@ -34,9 +34,9 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadBunchOfFiles(filePathForUpload, upload.quantityOfFiles, upload.fileName); - // TODO wait until the file will be uploaded - cy.wait(8000); + DataImport.waitFileIsUploaded(); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(upload.fileName); @@ -45,6 +45,8 @@ describe('ui-data-import', () => { LogsViewAll.viewAllIsOpened(); LogsViewAll.selectOption('Keyword (ID, File name)'); LogsViewAll.searchWithTerm(upload.fileName); + // TODO need to wait until files are filtered + cy.wait(2000); LogsViewAll.verifyQuantityOfLogs(upload.quantityOfFiles); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js index 17b5294b62..fc86e6dc02 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js @@ -41,6 +41,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneThousandMarcBib.mrc', bigFileName); // TODO wait until file will be uploaded cy.wait(5000); @@ -60,6 +61,7 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', smallFileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.selectJobProfile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js index 2343d8443b..955d6b7e01 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js @@ -159,6 +159,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js index 183450ab74..a24d4e0fe9 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js @@ -96,6 +96,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js index f6f9205153..97ed736da5 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js @@ -134,6 +134,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js index f672d80d4c..c6f79c79bc 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js @@ -156,6 +156,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js index 4fab9edb5b..b7ba5dab6d 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js @@ -118,6 +118,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC375989.mrc', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js index 970e486b5b..ee28f01fac 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js @@ -236,6 +236,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC357552.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(createJobProfile.profileName); JobProfiles.runImportFile(); @@ -290,6 +291,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(nameMarcFileForUpdate); JobProfiles.searchJobProfileForImport(updateJobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js index 1f476a2350..380987cdda 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js @@ -153,6 +153,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC368005.mrc', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js index 5381bf3f6c..fa8ba6ace8 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js @@ -143,6 +143,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js index a072a00193..388ca3e93b 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js @@ -124,6 +124,7 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -163,6 +164,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForUpdateInstance, fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js index f04eeaa8c3..9ac01a2440 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js @@ -131,6 +131,7 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -172,6 +173,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js index 54b92d6e3a..e02e8d1a89 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js @@ -234,6 +234,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC17027.mrc', marcFileForCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -343,6 +344,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, fileNameAfterUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js index be84221ffc..078e693af4 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js @@ -144,6 +144,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[0].jobProfile.profileName); JobProfiles.runImportFile(); @@ -158,67 +159,68 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyCatalogedDate(itemsForCreateInstance.catalogedDateUi); - InstanceRecordView.verifyInstanceStatusTerm(itemsForCreateInstance.statusTerm); - InstanceRecordView.verifyStatisticalCode(itemsForCreateInstance.statisticalCodeUI); - InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); - - // create mapping profile for updating instance - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(itemsForUpdateInstance.statusTerm); - NewFieldMappingProfile.addStatisticalCode(itemsForUpdateInstance.statisticalCode, 8); - FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); - - // create action profile for updating instance - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(collectionOfMappingAndActionProfiles[1].actionProfile, collectionOfMappingAndActionProfiles[1].mappingProfile.name); - ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfiles[1].actionProfile.name); - - // craete match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfile(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create job profile for updating instance - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfile(collectionOfJobProfiles[1].jobProfile); - NewJobProfile.linkMatchProfile(matchProfile.profileName); - NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); - NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(collectionOfJobProfiles[1].jobProfile.profileName); - - // upload a marc file for updating instance - cy.visit(TopMenu.dataImportPath); - // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 - DataImport.verifyUploadState(); - DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForUpdate); - JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[1].jobProfile.profileName); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(nameMarcFileForUpdate); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(nameMarcFileForUpdate); - FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); - FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); - FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); - FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); - InstanceRecordView.verifyInstanceStatusTerm(itemsForUpdateInstance.statusTerm); - InstanceRecordView.verifyStatisticalCode(itemsForUpdateInstance.statisticalCodeUI); - InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyCatalogedDate(itemsForCreateInstance.catalogedDateUi); + InstanceRecordView.verifyInstanceStatusTerm(itemsForCreateInstance.statusTerm); + InstanceRecordView.verifyStatisticalCode(itemsForCreateInstance.statisticalCodeUI); + InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); + + // create mapping profile for updating instance + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(itemsForUpdateInstance.statusTerm); + NewFieldMappingProfile.addStatisticalCode(itemsForUpdateInstance.statisticalCode, 8); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfiles[1].mappingProfile.name); + + // create action profile for updating instance + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(collectionOfMappingAndActionProfiles[1].actionProfile, collectionOfMappingAndActionProfiles[1].mappingProfile.name); + ActionProfiles.checkActionProfilePresented(collectionOfMappingAndActionProfiles[1].actionProfile.name); + + // craete match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create job profile for updating instance + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(collectionOfJobProfiles[1].jobProfile); + NewJobProfile.linkMatchProfile(matchProfile.profileName); + NewJobProfile.linkActionProfileForMatches(collectionOfMappingAndActionProfiles[1].actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(collectionOfJobProfiles[1].jobProfile.profileName); + + // upload a marc file for updating instance + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForUpdate); + JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[1].jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(nameMarcFileForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(nameMarcFileForUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.created, FileDetails.columnNameInResultList.srsMarc); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.instance); + FileDetails.checkSrsRecordQuantityInSummaryTable(quantityOfItems); + FileDetails.checkInstanceQuantityInSummaryTable(quantityOfItems, 1); + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyMarkAsSuppressedFromDiscoveryAndSuppressed(); + InstanceRecordView.verifyInstanceStatusTerm(itemsForUpdateInstance.statusTerm); + InstanceRecordView.verifyStatisticalCode(itemsForUpdateInstance.statisticalCodeUI); + InventoryInstance.verifyResourceIdentifier(oclcNumber.type, oclcNumber.value, 2); + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js index 80fee8693b..99f74bab04 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js @@ -121,6 +121,7 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // upload a marc file for creating of the new instance DataImport.uploadFile('marcFileForC358138.mrc', fileForCreateFirstName); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -135,11 +136,11 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API for delete instance - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - firstInstanceHrid = hrId[0]; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + firstInstanceHrid = initialInstanceHrId; + }); FileDetails.openInstanceInInventory('Created'); InventoryInstance.verifyResourceIdentifier(resourceIdentifierForFirstInstance.type, resourceIdentifierForFirstInstance.value, 2); @@ -175,6 +176,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC358138_rev.mrc', fileForUpdateFirstName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -198,6 +200,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC358138_with_035.mrc', fileForCreateSecondName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -211,11 +214,11 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API for delete instance - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - secondInstanceHrid = hrId[0]; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + secondInstanceHrid = initialInstanceHrId; + }); FileDetails.openInstanceInInventory('Created'); InventoryInstance.verifyResourceIdentifier(resourceIdentifierForSecondInstance.type, resourceIdentifierForSecondInstance.value, 3); @@ -227,6 +230,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC358138_with_035_rev.mrc', fileForUpdateSecondName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js index 86b57fe0ee..7367aaabe1 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js @@ -152,6 +152,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js index 0468af30f8..c37cf908da 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js @@ -40,6 +40,7 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC359012.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js index 991b9f27f9..15a9be9878 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js @@ -169,6 +169,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathToUpload, marcFileNameForCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -279,6 +280,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(exportedFileName); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js index d52a285bfe..b5131b7a93 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js @@ -49,6 +49,7 @@ describe('ui-data-import', () => { Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC358968.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -62,11 +63,11 @@ describe('ui-data-import', () => { FileDetails.checkSrsRecordQuantityInSummaryTable('1'); FileDetails.checkInstanceQuantityInSummaryTable('1'); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId; - }); + // open Instance for getting hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); }); }); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js index c522e41493..212b4deadf 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js @@ -66,6 +66,7 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneThousandMarcBib.mrc', fileName); // wait until file will be uploaded cy.wait(10000); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js index 989ff41c1a..17186979dc 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js @@ -184,6 +184,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -247,6 +248,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileNameForFirstUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithFail.profileName); JobProfiles.runImportFile(); @@ -264,6 +266,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileNameForSecondUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithSucceed.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js index 6614f2bc86..34d366178e 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js @@ -207,6 +207,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(marcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -280,7 +281,7 @@ describe('ui-data-import', () => { cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); + NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 1); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); @@ -288,6 +289,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js index 34f453190f..2fc82b84bb 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js @@ -195,6 +195,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -274,6 +275,7 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js index 86e5df30dc..b56778d38a 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js @@ -87,6 +87,7 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); // upload the first .mrc file DataImport.uploadFile('marcFileForC358998ForCreate_1.mrc', firstMarcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -146,6 +147,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(firstMarcFileNameForUpdate, firstFileNameAfterUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js index 46ea866a6c..03f533d5a6 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js @@ -133,6 +133,7 @@ describe('ui-data-import', () => { // upload a marc file // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathToUpload, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -156,6 +157,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathToUpload, fileNameForMatch); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -193,6 +195,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathToUpload, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js b/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js index 3a56dc7a49..053cf97934 100644 --- a/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js @@ -57,6 +57,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport('Default - Create Holdings and SRS MARC Holdings'); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js b/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js index bd1675e09b..2d6ebcf618 100644 --- a/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js +++ b/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js @@ -90,6 +90,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('ediFileForC357018.edi', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js index 715ec2ddbc..09e8a8b983 100644 --- a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js +++ b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js @@ -205,6 +205,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -260,6 +261,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); @@ -333,6 +335,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -382,6 +385,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); @@ -482,6 +486,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -549,6 +554,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js index b6e957fc73..5790082fda 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js @@ -136,6 +136,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameMarcFile); JobProfiles.searchJobProfileForImport(jobProfileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js index 40ae7e5568..69c805159a 100644 --- a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js @@ -357,6 +357,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -443,14 +444,15 @@ describe('ui-data-import', () => { cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfMappingAndActionProfiles[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 1); + NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 2); NewJobProfile.saveAndClose(); // upload the exported marc file cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(nameMarcFileForImportUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js b/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js index b24416ad87..f75b4e81ba 100644 --- a/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js +++ b/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js @@ -135,6 +135,7 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js b/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js index 697e3f4266..a572fa8192 100644 --- a/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js +++ b/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js @@ -129,6 +129,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js index 30967fb84b..50d96abebe 100644 --- a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js +++ b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js @@ -178,6 +178,7 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC378901.mrc', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js b/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js index 58804c2097..375e15732f 100644 --- a/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js +++ b/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js @@ -159,6 +159,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC367966_BeforeOverride.mrc', marcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -185,6 +186,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js index 80cc489395..c4d6e517be 100644 --- a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js +++ b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js @@ -218,6 +218,7 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreateFirstRecord); JobProfiles.searchJobProfileForImport(firstTestData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -246,6 +247,7 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreateSecondRecord); JobProfiles.searchJobProfileForImport(secondTestData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -405,6 +407,7 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(marcFileNameForUpdateFirstRecord); JobProfiles.searchJobProfileForImport(jobProfileWithMatch.profileName); JobProfiles.runImportFile(); @@ -445,6 +448,7 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadExportedFile(marcFileNameForUpdateSecondRecord); JobProfiles.searchJobProfileForImport(jobProfileWithoutMatch.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js b/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js index f3d2ad72db..fededa6593 100644 --- a/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js +++ b/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js @@ -6,7 +6,7 @@ import Helper from '../../../support/fragments/finance/financeHelper'; import DataImport from '../../../support/fragments/data_import/dataImport'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../../support/fragments/data_import/logs/logs'; -import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Users from '../../../support/fragments/users/users'; @@ -40,13 +40,20 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(fileName); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - // get Instance HRID through API for delete instance - InventorySearchAndFilter.getInstanceHRID().then(hrId => { instanceHrid = hrId[0]; }); + Logs.openFileDetails(fileName); + // open Instance to get hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); + cy.go('back'); + Logs.verifyCheckboxForMarkingLogsAbsent(); Logs.actionsButtonClick(); Logs.verifyDeleteSelectedLogsButtonAbsent(); diff --git a/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js b/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js index b6d309839b..b62af029a6 100644 --- a/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js +++ b/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js @@ -21,7 +21,6 @@ import DataImport from '../../../support/fragments/data_import/dataImport'; import Logs from '../../../support/fragments/data_import/logs/logs'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; -import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; describe('ui-data-import', () => { @@ -143,6 +142,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameMarcFile); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -158,10 +158,10 @@ describe('ui-data-import', () => { }); FileDetails.checkItemQuantityInSummaryTable(quantityOfItems); - // get Instance HRID through API - InventorySearchAndFilter.getInstanceHRID() - .then(hrId => { - instanceHrid = hrId[0]; - }); + // open Instance to get hrid + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { + instanceHrid = initialInstanceHrId; + }); }); }); diff --git a/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js b/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js index 8c362b3bde..38266e56bc 100644 --- a/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js +++ b/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js @@ -150,6 +150,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, firstMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -187,6 +188,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, secondMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -216,6 +218,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, thirdMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -255,6 +258,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(filePathForCreateOrder, forthMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js index db64fc4292..926818f68d 100644 --- a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js +++ b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js @@ -201,6 +201,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile(editedMarcFileName, nameMarcFileForUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js index c00cd91fc2..d0f319c3fa 100644 --- a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js +++ b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js @@ -156,6 +156,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.uploadFile('marcFileForC356830.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -190,6 +191,7 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); + cy.reload(); DataImport.checkIsLandingPageOpened(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); diff --git a/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js b/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js index 8e338cf500..d06e0cb4fa 100644 --- a/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js +++ b/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js @@ -163,6 +163,8 @@ describe('orders: Receive piece from Order', () => { InventorySearchAndFilter.instanceTabIsDefault(); InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); + // TODO need to wait until result is displayed + cy.wait(1500); InventoryInstances.selectInstance(); InventoryInstances.verifyInstanceDetailsView(); InventoryInstance.openHoldings(effectiveLocation.name); @@ -179,6 +181,8 @@ describe('orders: Receive piece from Order', () => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); + // TODO need to wait until result is displayed + cy.wait(1500); InventoryInstances.selectInstance(); InventoryInstances.verifyInstanceDetailsView(); InventoryInstance.openHoldings(effectiveLocation.name); diff --git a/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js b/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js index 9ca468e612..83b0071df3 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js @@ -10,6 +10,7 @@ import ServicePoints from '../../../support/fragments/settings/tenant/servicePoi import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; +import CirculationRules from '../../../support/fragments/circulation/circulation-rules'; describe('ui-inventory: Mark an item as Missing', () => { let user = {}; @@ -19,6 +20,24 @@ describe('ui-inventory: Mark an item as Missing', () => { const createdRequestsIds = []; let createdItems = []; let materialType = ''; + let addedCirculationRule; + let originalCirculationRules; + + before(() => { + let materialBookId; + cy.getAdminToken(); + cy.getMaterialTypes({ query: 'name="video recording"' }).then(type => { + materialBookId = type.id; + }); + CirculationRules.getViaApi().then((circulationRule) => { + originalCirculationRules = circulationRule.rulesAsText; + const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); + const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n} l ${ruleProps.l}`; + addedCirculationRule = ` \nm ${materialBookId}: ${defaultProps}`; + cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); + }); + }); + beforeEach(() => { cy.getAdminToken() .then(() => { @@ -60,6 +79,10 @@ describe('ui-inventory: Mark an item as Missing', () => { }); }); + after(() => { + CirculationRules.deleteRuleViaApi(addedCirculationRule); + }); + afterEach(() => { createdItems.forEach(item => { cy.deleteItemViaApi(item.itemId); diff --git a/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js b/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js index 62f18f1d70..33de4bc57d 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js @@ -10,6 +10,7 @@ import ServicePoints from '../../../support/fragments/settings/tenant/servicePoi import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import DevTeams from '../../../support/dictionary/devTeams'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; +import CirculationRules from '../../../support/fragments/circulation/circulation-rules'; describe('ui-inventory: Mark items as withdrawn', () => { let user = {}; @@ -19,6 +20,23 @@ describe('ui-inventory: Mark items as withdrawn', () => { const createdRequestsIds = []; let createdItems = []; let materialType = ''; + let addedCirculationRule; + let originalCirculationRules; + + before(() => { + let materialBookId; + cy.getAdminToken(); + cy.getMaterialTypes({ query: 'name="video recording"' }).then(type => { + materialBookId = type.id; + }); + CirculationRules.getViaApi().then((circulationRule) => { + originalCirculationRules = circulationRule.rulesAsText; + const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); + const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n} l ${ruleProps.l}`; + addedCirculationRule = ` \nm ${materialBookId}: ${defaultProps}`; + cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); + }); + }); beforeEach(() => { cy.getAdminToken() @@ -62,6 +80,10 @@ describe('ui-inventory: Mark items as withdrawn', () => { }); }); + after(() => { + CirculationRules.deleteRuleViaApi(addedCirculationRule); + }); + afterEach(() => { createdItems.forEach(item => { cy.deleteItemViaApi(item.itemId); diff --git a/cypress/support/fragments/data_import/dataImport.js b/cypress/support/fragments/data_import/dataImport.js index aafdce1713..12bacfac69 100644 --- a/cypress/support/fragments/data_import/dataImport.js +++ b/cypress/support/fragments/data_import/dataImport.js @@ -397,6 +397,6 @@ export default { waitFileIsUploaded:() => { // TODO need to wait until big file is uploaded - cy.wait(5000); + cy.wait(10000); } }; diff --git a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js index 00de392363..ee061c4bd2 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js +++ b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js @@ -490,7 +490,10 @@ export default { addName:(name) => cy.do(nameField.fillIn(name)), addIncomingRecordType:(type) => cy.do(incomingRecordTypeField.choose(type)), addFolioRecordType:(folioType) => cy.do(existingRecordType.choose(folioType)), - saveProfile:() => cy.do(saveButton.click()), + saveProfile:() => { + cy.wait(1000); + cy.do(saveButton.click()); + }, fillTemporaryLocation:(location) => cy.do(TextField('Temporary').fillIn(location)), fillDigitizationPolicy:(policy) => cy.do(TextField('Digitization policy').fillIn(policy)), fillCallNumber:(number) => cy.do(TextField('Call number').fillIn(number)), @@ -775,10 +778,11 @@ export default { }, fillModificationSectionWithDelete:(action, fieldNumber, number) => { - cy.do([ - Select({ name:`profile.mappingDetails.marcMappingDetails[${number}].action` }).choose(action), - TextField({ name:`profile.mappingDetails.marcMappingDetails[${number}].field.field` }).fillIn(fieldNumber) - ]); + cy.do(Select({ name:`profile.mappingDetails.marcMappingDetails[${number}].action` }).choose(action)); + cy.do(TextField({ name:`profile.mappingDetails.marcMappingDetails[${number}].field.field` }).fillIn(fieldNumber)); + cy.expect(TextField({ name:`profile.mappingDetails.marcMappingDetails[${number}].field.field` }) + .has({ value: fieldNumber })); + cy.wait(1500); }, addNewFieldInModificationSection:() => { diff --git a/cypress/support/fragments/inventory/markItemAsMissing.js b/cypress/support/fragments/inventory/markItemAsMissing.js index ffda852897..f0e299fdc2 100644 --- a/cypress/support/fragments/inventory/markItemAsMissing.js +++ b/cypress/support/fragments/inventory/markItemAsMissing.js @@ -73,7 +73,7 @@ export default { }; return cy.wrap(Promise.resolve(true)).then(() => { - cy.getMaterialTypes({ limit: 1 }).then(materialType => { + cy.getMaterialTypes({ query: 'name="video recording"' }).then(materialType => { instanceRecordData.materialTypeId = materialType.id; materialTypeValue = materialType.name; }); From 2137a473cc96844d75691b3b9d0b7708c388b243 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Mon, 31 Jul 2023 19:42:29 +0300 Subject: [PATCH 15/55] FAT-7201-C374159 (#1428) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7201: test implemented --- .../marc-authority-edit-linked.cy.js | 91 ++++++++++++++++--- cypress/fixtures/marcAuthFileC374159.mrc | 1 + cypress/fixtures/marcBibFileC374159.mrc | 1 + cypress/support/fragments/quickMarcEditor.js | 13 +++ 4 files changed, 91 insertions(+), 15 deletions(-) create mode 100644 cypress/fixtures/marcAuthFileC374159.mrc create mode 100644 cypress/fixtures/marcBibFileC374159.mrc diff --git a/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js index c575d49446..8531b1c5e1 100644 --- a/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js +++ b/cypress/e2e/marc-authority/marc-authority-edit-linked.cy.js @@ -18,9 +18,16 @@ describe('MARC Authority -> Edit linked Authority record', () => { tag001: '001', tag010: '010', tag100: '100', + tag155: '155', + tag655: '655', tag700: '700', subfieldZValue: 'n12345', - updatedSubfieldZValue: 'n12345678910' + updatedSubfieldZValue: 'n12345678910', + updated155FieldValue: 'Drama C374159 cinema', + updated010FieldValue: 'gf20140262973741590', + autoUpdateUserName: 'Automated linking update', + subjectAccordion: 'Subject', + authorityIconText: 'Linked to MARC authority' }; const marcFiles = [ @@ -30,12 +37,26 @@ describe('MARC Authority -> Edit linked Authority record', () => { jobProfileToRun: 'Default - Create instance and SRS MARC Bib', instanceTitle: 'The coronation of Queen Elizabeth II C376596' }, + { + marc: 'marcBibFileC374159.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + instanceTitle: 'Titanic / written and directed by James Cameron. C374159' + }, { marc: 'marcAuthFileC376596.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: 'Default - Create SRS MARC Authority', authorityHeading: 'Elizabeth C376596', authority010FieldValue: 'n80126296376596', + }, + { + marc: 'marcAuthFileC374159.mrc', + fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create SRS MARC Authority', + authorityHeading: 'Drama C374159', + authority010FieldValue: 'gf2014026297374159', + authority555FieldValue: 'Literature C374159' } ]; @@ -75,22 +96,38 @@ describe('MARC Authority -> Edit linked Authority record', () => { MarcAuthorities.switchToSearch(); InventoryInstance.verifySelectMarcAuthorityModal(); InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(marcFiles[1].authorityHeading); - MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[1].authority010FieldValue}`); + InventoryInstance.searchResults(marcFiles[2].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[2].authority010FieldValue}`); InventoryInstance.clickLinkButton(); QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag700); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); + InventoryInstance.searchByTitle(createdRecordIDs[1]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag655); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(marcFiles[3].authorityHeading); + MarcAuthorities.checkFieldAndContentExistence(testData.tag010, `‡a ${marcFiles[3].authority010FieldValue}`); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag655); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); }); }); + beforeEach('Login', () => { + cy.login(testData.userProperties.username, testData.userProperties.password, { path: TopMenu.marcAuthorities, waiter: MarcAuthorities.waitLoading }); + }); + after('Deleting user, data', () => { Users.deleteViaApi(testData.userProperties.userId); createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); + if (index > 1) MarcAuthority.deleteViaAPI(id); else InventoryInstance.deleteInstanceViaApi(id); }); cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); @@ -101,31 +138,55 @@ describe('MARC Authority -> Edit linked Authority record', () => { DataImport.confirmDeleteImportLogs(); }); - it('C376596 Add/Edit/Delete "$z" subfield in "010" field of linked "MARC authority" record when "010" = "$0" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire], retries: 1 }, () => { - MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); - MarcAuthorities.selectTitle(marcFiles[1].authorityHeading); + it('C376596 Add/Edit/Delete "$z" subfield in "010" field of linked "MARC authority" record when "010" = "$0" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[2].authorityHeading); + MarcAuthorities.selectTitle(marcFiles[2].authorityHeading); MarcAuthority.edit(); - QuickMarcEditor.checkContent(`$a ${marcFiles[1].authority010FieldValue}`, 4); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue} $z ${testData.subfieldZValue}`); + QuickMarcEditor.checkContent(`$a ${marcFiles[2].authority010FieldValue}`, 4); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue} $z ${testData.subfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue} $z ${testData.updatedSubfieldZValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[1].authority010FieldValue}`); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${marcFiles[2].authority010FieldValue}`); QuickMarcEditor.checkButtonsEnabled(); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyAndDismissRecordUpdatedCallout(); - MarcAuthorities.searchBy('Keyword', marcFiles[1].authorityHeading); + MarcAuthorities.searchBy('Keyword', marcFiles[2].authorityHeading); MarcAuthorities.verifyNumberOfTitles(4, '1'); MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.verifyTagFieldAfterLinking(60, testData.tag700, '0', '\\', - `$a ${marcFiles[1].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[1].authority010FieldValue}`, ''); + `$a ${marcFiles[2].authorityHeading}`, '', `$0 id.loc.gov/authorities/names/${marcFiles[2].authority010FieldValue}`, ''); + }); + + it('C374159 Edit values in "1XX" and "010" fields of linked "MARC Authority" record when "$0" = "010 $a" (spitfire)', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + MarcAuthorities.searchBy('Keyword', marcFiles[3].authority555FieldValue); + MarcAuthorities.selectTitle(marcFiles[3].authority555FieldValue); + MarcAuthority.edit(); + QuickMarcEditor.updateExistingField(testData.tag155, `$a ${testData.updated155FieldValue}`); + QuickMarcEditor.checkButtonsEnabled(); + QuickMarcEditor.updateExistingField(testData.tag010, `$a ${testData.updated010FieldValue}`); + QuickMarcEditor.saveAndCloseUpdatedLinkedBibField(); + QuickMarcEditor.confirmUpdateLinkedBibs(1); + MarcAuthorities.searchBy('Keyword', testData.updated155FieldValue); + MarcAuthorities.checkResultList([testData.updated155FieldValue]); + MarcAuthorities.verifyNumberOfTitles(4, '1'); + MarcAuthorities.clickOnNumberOfTitlesLink(4, '1'); + + InventoryInstance.checkInstanceTitle(marcFiles[1].instanceTitle); + InventoryInstance.verifyRecordStatus(testData.autoUpdateUserName); + InventoryInstance.verifyInstanceSubject(11, 0, `${testData.authorityIconText}${testData.updated155FieldValue}`); + InventoryInstance.checkExistanceOfAuthorityIconInInstanceDetailPane(testData.subjectAccordion); + + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.checkPaneheaderContains(`Source: ${testData.autoUpdateUserName}`); + QuickMarcEditor.verifyTagFieldAfterLinking(52, '655', '\\', '7', `$a ${testData.updated155FieldValue}`, '', `$0 id.loc.gov/authorities/genreForms/${testData.updated010FieldValue}`, '$2 fast'); }); }); diff --git a/cypress/fixtures/marcAuthFileC374159.mrc b/cypress/fixtures/marcAuthFileC374159.mrc new file mode 100644 index 0000000000..fc869d1c04 --- /dev/null +++ b/cypress/fixtures/marcAuthFileC374159.mrc @@ -0,0 +1 @@ +02799cz a2200421n 4500001000800000005001700008008004100025010002300066035001700089040003500106155001800141455001100159455002200170455001000192455001600202455001900218455001600237455001800253455002500271455002100296555002600317670005800343670030600401670035900707670022301066670021501289670039601504670015101900670006702051670005902118670004102177910005102218910005302269985000802322985002302330906001202353906001202365985899020210911060015.0141201|| anznnbabn |a ana | agf2014026297374159 agf2014026297 aIlChALCSbengcDLCflcgftdDLC aDrama C374159 aDramas wnneaFilmed plays aPlays aPlayscripts aScripts, Stage aStage plays aStage scripts wnneaTelevised plays aTheatrical works wgaLiterature C374159 aLCSH, Oct. 22, 2014b(Drama. UF Plays. BT Literature) aAbrams, M. A glossary of literary terms, c1999b(Drama. The form of composition designed for performance in the theater, in which actors take the roles of the characters, perform the indicated action, and utter the written dialogue. (The common alternative name for a dramatic composition is a play.)) aQuinn, E. A dictionary of literary and thematic terms, c1999b(drama: In its broadest sense, any work in which actors assume roles before an audience, either in a theater or on radio or television. Drama is a major literary genre, frequently subdivided into the categories of tragedy, comedy, and tragicomedy; play: A composition written to be performed) aThe American heritage dictionary of the English language, ©2000, updated 2009, via WWW, Mar. 11, 2014b(theatrical, noun 1. Stage performances or a stage performance, especially by amateurs. Often used in the plural.) aOxford dictionaries website, July 11, 2014b(play, noun 3. A dramatic work for the stage or to be broadcast. Synonyms: drama, theatrical work; screenplay, comedy, tragedy; production, performance, show, sketch) aMerriam-Webster online, July 11, 2014b(play noun 2. a written work in which the story is told through speech and action that is intended to be acted out on stage. Synonyms: drama, dramatization. Related Words: interlude, playlet; comedy, comedy drama, docudrama, dramedy, melodrama, monodrama, musical, musical comedy, psychodrama, tragedy, tragicomedy; magnum opus, opus, work; adaptation) aWynston, G.P. Adapting stage drama for radio : techniques of preparing stage scripts for Canadian Broadcasting Corporation radio production, 1976. aVickers, S. Drama scripts for people with special needs, 2005. aHirsch, M.E. Chinese shadow theater playscripts, 1998. aChayefsky, P. The stage plays, 1995. aRecord saved by td14 on 09/10/2021 at 10:08:18 aProposal saved by tc03 on 01/08/2019 at 15:51:22 aMvI eLiterature project t1515v0 t1812v0 \ No newline at end of file diff --git a/cypress/fixtures/marcBibFileC374159.mrc b/cypress/fixtures/marcBibFileC374159.mrc new file mode 100644 index 0000000000..4a5acc4e4b --- /dev/null +++ b/cypress/fixtures/marcBibFileC374159.mrc @@ -0,0 +1 @@ +03127cgm a2200733 i 4500001001400000008004100014007001000055005001700065035002400082040006000106024001700166028004600183035002200229037004600251041003300297043001200330050002200342082001800364245006200382250003700444264006100481300005700542336005000599337002300649338003000672344001900702344001900721344002100740344002200761344001100783344001200794347002200806347001200828347002000840380002700860538015100887546007001038500002701108511006201135500005301197500001701250521010001267520023601367610003201603650004501635650003601680650002701716650003101743610005001774650005501824650005001879650004201929650004601971651005202017655003702069700005802106700003202164700002702196700002502223700003302248710005302281994001402334948004502348in00000000001210223s2021 cau194 vleng dvd csaizq20221124071431.3 a(OCoLC)on1238102243 aTEFMTbengerdacTEFMTdTEFdOCLCOdOCLCFdOCLCQdOCLCO1 a03242935510242a59215486000bParamount Home Entertainment a(OCoLC)1238102243 bMidwest Tapenhttp://www.midwesttapes.com1 aengafreaspajengjfreheng aln----- 4aPN1997b.T58 202104a791.43/7222300aTitanic /cwritten and directed by James Cameron. C374159 a[English/French/Spanish version] 1aLos Angeles, CA :bParamount Home Entertainment,c[2021] a2 videodiscs (194 min.) :bsound, color ;c4 3/4 in. atwo-dimensional moving imagebtdi2rdacontent avideobv2rdamedia avideodiscbvd2rdacarrier adigital2rdatr boptical2rdarm gsurround2rdacpc h2.0 Dolby digital h5.1 EX h6.1 DTS avideo file2rdaft bBlu-ray eregion A2rdare aMotion pictures2lcgft aBlu-ray, wide screen; 5.1 surround EX, 6.1 DTS surround (English), 2.0 Dolby digital surround (English, French, Spanish); requires Blu-ray player. aEnglish, French or Spanish dialogue; English or French subtitles. aTitle from sell sheet.1 aLeonardo DiCaprio, Kate Winslet, Billy Zane, Kathy Bates. aOriginally released as a motion picture in 1997. aWide screen.8 aRating: PG-13; for disaster related peril, and violence, nudity, sensuality and brief language. aTitanic is an extraordinary retelling of the doomed voyage that follows the destinies of the Titanic's victims and survivors as their stories of passion, betrayal, and hope unfold amidst the tragic events of the ship's final hours.20aTitanic (Steamship)vDrama. 0aShipwreckszNorth Atlantic OceanvDrama. 0aMan-woman relationshipsvDrama. 0aSocial classesvDrama. 0aShipwreck survivalvDrama.27aTitanic (Steamship)2fast0(OCoLC)fst00522117 7aMan-woman relationships.2fast0(OCoLC)fst01007080 7aShipwreck survival.2fast0(OCoLC)fst01761960 7aShipwrecks.2fast0(OCoLC)fst01116638 7aSocial classes.2fast0(OCoLC)fst01122346 7aNorth Atlantic Ocean.2fast0(OCoLC)fst01242477 7aDrama.2fast0(OCoLC)fst014238791 aCameron, James,d1954-escreenwriter,efilm director.1 aDiCaprio, Leonardo,eactor.1 aWinslet, Kate,eactor.1 aZane, Billy,eactor.1 aBates, Kathy,d1948-eactor.2 aParamount Home Entertainment (Firm),epublisher. aZ0bPAOLF hNO HOLDINGS IN PAOLF - 24 OTHER HOLDINGS \ No newline at end of file diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 9eed294316..5f86e0d355 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -713,5 +713,18 @@ export default { cy.expect(calloutUpdatedRecord.exists()); cy.do(calloutUpdatedRecord.dismiss()); cy.expect(calloutUpdatedRecord.absent()); + }, + + confirmUpdateLinkedBibs(linkedRecordsNumber) { + cy.do(saveButton.click()); + cy.expect([ + Callout(`Record has been updated. ${linkedRecordsNumber} linked bibliographic record(s) updates have begun.`).exists(), + rootSection.absent(), + viewMarcSection.exists() + ]); + }, + + checkPaneheaderContains(text) { + cy.expect(PaneHeader({ text: (including(text)) }).exists()); } }; From 08f01e1051dfb2201b58b73e5bf3b53b803081e4 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:24:47 +0300 Subject: [PATCH 16/55] Fat 7008 c401727 (#1429) * added test * added after block --- .../e2e/match-on-holdings-856-u.cy.js | 2 +- .../mrc-import-file-for-update-items.cy.js | 2 +- ...-for-holdings-proceed-without-errors.cy.js | 273 ++++++++++++++++++ ...instance-using-marc-to-marc-submatch.cy.js | 2 +- ...t-summury-table-for-updating-actions.cy.js | 2 +- ...y-records-created-after-not-matching.cy.js | 2 +- cypress/fixtures/marcFileForC401727.mrc | 1 + .../newFieldMappingProfile.js | 6 +- .../fragments/inventory/holdingsRecordView.js | 12 +- 9 files changed, 294 insertions(+), 8 deletions(-) create mode 100644 cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js create mode 100644 cypress/fixtures/marcFileForC401727.mrc diff --git a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js index f353d52928..3b08eb1235 100644 --- a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js @@ -105,7 +105,7 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(profile); NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); - NewFieldMappingProfile.addElectronicAccess('Resource', '856$u', '856$z'); + NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u', '856$z'); FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); }; diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js index 2904c82102..abf0d56970 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js @@ -366,7 +366,7 @@ describe('ui-data-import', () => { NewFieldMappingProfile.fillPermanentLocation(profile.permanentLocation); NewFieldMappingProfile.fillCallNumberType(profile.callNumberType); NewFieldMappingProfile.fillCallNumber('050$a " " 050$b'); - NewFieldMappingProfile.addElectronicAccess('Resource', '856$u'); + NewFieldMappingProfile.addElectronicAccess('"Resource"', '856$u'); FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(profile.name); }; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js new file mode 100644 index 0000000000..03e2420294 --- /dev/null +++ b/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js @@ -0,0 +1,273 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import { + LOCATION_NAMES, + FOLIO_RECORD_TYPE, + ACCEPTED_DATA_TYPE_NAMES, + EXISTING_RECORDS_NAMES, + JOB_STATUS_NAMES, + HOLDINGS_TYPE_NAMES +} from '../../../support/constants'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import Users from '../../../support/fragments/users/users'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import FileManager from '../../../support/utils/fileManager'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; + +describe('ui-data-import', () => { + let user; + let instanceHrid; + const holdingsElectronicAccessData = { + urlRelationship: 'Resource', + uri: 'http://silk.library.umass.edu/login?url=https://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=10241', + linkTextUMass: 'UMass: Link to resource', + urlPublicNote: 'EBSCO' + }; + const callNumberData = { + callNumberType: 'LC Modified', + callNumberPrefix: 'TestPref', + callNumber: '322', + callNumberSuffix: 'TestSuf' + }; + const filePathForCreate = 'marcFileForC401727.mrc'; + const marcFileNameForCreate = `C401727 autotestFileName ${getRandomPostfix()}`; + const marcFileNameForUpdate = `C401727 autotestFileName ${getRandomPostfix()}`; + const editedMarcFileName = `C401727 editedAutotestFileName ${getRandomPostfix()}`; + const holdingsMappingProfile = { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Create simple Holdings ${getRandomPostfix()}}`, + permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }; + const holdingsActionProfile = { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Create simple Holdings ${getRandomPostfix()}` }; + const jobProfile = { + profileName: `C401727 Create simple Instance and Holdings ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + const collectionOfMappingAndActionProfilesForUpdate = [ + { + mappingProfile: { name: `C401727 Update ER holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Update ER holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C401727 Update Call number holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + callNumberType: '852$t', + callNumberPrefix: '852$p', + callNumber: '852$h', + callNumberSuffix: '852$s' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Update Call number holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + }, + { + mappingProfile: { name: `C401727 Update Electronic access holdings ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + relationship: '856$f', + uri: '856$u', + linkText: '856$y', + materialsSpecified: '856$3', + urlPublicNote: '856$z' }, + actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, + name: `C401727 Update Electronic access holdings ${getRandomPostfix()}`, + action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } + } + ]; + const matchProfile = { profileName: `C401727 901 to Holdings HRID match ${getRandomPostfix()}`, + incomingRecordFields: { + field: '901', + subfield: 'a' + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, + holdingsOption: NewMatchProfile.optionsList.holdingsHrid }; + const jobProfileForUpdate = { + ...NewJobProfile.defaultJobProfile, + profileName: `C401727 Update holdings with 901 match ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('create test data', () => { + cy.createTempUser([ + permissions.settingsDataImportEnabled.gui, + permissions.moduleDataImportEnabled.gui, + permissions.inventoryAll.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); + ActionProfiles.deleteActionProfile(holdingsActionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(holdingsMappingProfile.name); + MatchProfiles.deleteMatchProfile(matchProfile.profileName); + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { + ActionProfiles.deleteActionProfile(profile.actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); + }); + // delete downloads folder and created files in fixtures + FileManager.deleteFolder(Cypress.config('downloadsFolder')); + FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) + .then((instance) => { + cy.deleteHoldingRecordViaApi(instance.holdings[0].id); + InventoryInstance.deleteInstanceViaApi(instance.id); + }); + }); + + it('C401727 Verify that 3 successive update actions for Holdings proceed without errors (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create field mapping profile + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(holdingsMappingProfile); + NewFieldMappingProfile.fillPermanentLocation(holdingsMappingProfile.permanentLocation); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfile.name); + + // create action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(holdingsActionProfile, holdingsMappingProfile.name); + ActionProfiles.checkActionProfilePresented(holdingsActionProfile.name); + + // create job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfileByName(holdingsActionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file for creating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadFile(filePathForCreate, marcFileNameForCreate); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForCreate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForCreate); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + FileDetails.columnNameInResultList.holdings, + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + // get Instance hrid for deleting + FileDetails.openInstanceInInventory('Created'); + InventoryInstance.getAssignedHRID().then(hrId => { instanceHrid = hrId; }); + cy.go('back'); + FileDetails.openHoldingsInInventory('Created'); + HoldingsRecordView.getHoldingsHrId().then(initialHrId => { + const holdingsHrId = initialHrId; + + // edit file with the copied value in the 901 field + DataImport.editMarcFile(filePathForCreate, editedMarcFileName, ['ho00004554073'], [holdingsHrId]); + }); + + // create field mapping profiles for updating + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile); + NewFieldMappingProfile.fillHoldingsType(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.holdingsType); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile); + NewFieldMappingProfile.fillCallNumberType(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumberType); + NewFieldMappingProfile.fillCallNumberPrefix(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumberPrefix); + NewFieldMappingProfile.fillCallNumber(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumber); + NewFieldMappingProfile.fillcallNumberSuffix(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.callNumberSuffix); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[1].mappingProfile.name); + + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile); + NewFieldMappingProfile.addElectronicAccess( + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.relationship, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.uri, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.linkText, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.materialsSpecified, + collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.urlPublicNote + ); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(collectionOfMappingAndActionProfilesForUpdate[2].mappingProfile.name); + + // create action profiles for updating + collectionOfMappingAndActionProfilesForUpdate.forEach(profile => { + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(profile.actionProfile, profile.mappingProfile.name); + ActionProfiles.checkActionProfilePresented(profile.actionProfile.name); + }); + + // create match profiles + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfile(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create job profile for creating + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfileForUpdate); + NewJobProfile.linkMatchAndThreeActionProfiles( + matchProfile.profileName, + collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, + collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, + collectionOfMappingAndActionProfilesForUpdate[2].actionProfile.name + ); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); + + // upload a marc file for creating + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.verifyUploadState(); + cy.reload(); + DataImport.uploadFile(editedMarcFileName, marcFileNameForUpdate); + JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFileNameForUpdate); + Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForUpdate); + FileDetails.checkStatusInColumn(FileDetails.status.updated, FileDetails.columnNameInResultList.holdings); + FileDetails.openHoldingsInInventory('Updated'); + + HoldingsRecordView.checkHoldingsType(collectionOfMappingAndActionProfilesForUpdate[0].mappingProfile.holdingsType); + HoldingsRecordView.checkCallNumberType(callNumberData.callNumberType); + HoldingsRecordView.checkCallNumberPrefix(callNumberData.callNumberPrefix); + HoldingsRecordView.checkCallNumber(callNumberData.callNumber); + HoldingsRecordView.checkCallNumberSuffix(callNumberData.callNumberSuffix); + HoldingsRecordView.checkElectronicAccess( + holdingsElectronicAccessData.urlRelationship, + holdingsElectronicAccessData.uri, + holdingsElectronicAccessData.linkTextUMass, + holdingsElectronicAccessData.urlPublicNote + ); + }); +}); diff --git a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js index 09e8a8b983..90fe596f2b 100644 --- a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js +++ b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js @@ -55,7 +55,7 @@ describe('ui-data-import', () => { name: `Create ER Holdings ${getRandomPostfix()}`, holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, permanentLocation: `"${LOCATION_NAMES.ANNEX}"`, - relationship: 'Resource', + relationship: '"Resource"', uri: '856$u', linkText: '856$y', materialsSpecified: '856$3', diff --git a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js index 69c805159a..778449d0d4 100644 --- a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js @@ -242,7 +242,7 @@ describe('ui-data-import', () => { permanentLocationUI: LOCATION_NAMES.ONLINE_UI, callNumberType: CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS, callNumber: '050$a " " 050$b', - relationship: 'Resource', + relationship: '"Resource"', uri: '856$u' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, name: `C356802 update holdings action profile ${Helper.getRandomBarcode()}`, diff --git a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js index 50d96abebe..079526191a 100644 --- a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js +++ b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js @@ -50,7 +50,7 @@ describe('ui-data-import', () => { permanentLocationUI: LOCATION_NAMES.ONLINE_UI, callNumberType: '852$t', callNumber: '852$h', - relationship: 'Resource', + relationship: '"Resource"', uri: '856$u', link: '856$y' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, diff --git a/cypress/fixtures/marcFileForC401727.mrc b/cypress/fixtures/marcFileForC401727.mrc new file mode 100644 index 0000000000..05242a8609 --- /dev/null +++ b/cypress/fixtures/marcFileForC401727.mrc @@ -0,0 +1 @@ +02070cam a2200421Li 4500001001400000003000600014005001700020006001900037007001500056008004100071020003200112020003500144020001500179035002000194040008400214043001200298050002600310100002900336245004900365250001900414264004100433300005100474336002600525337002600551338003600577347001900613490001800632505050800650506004301158588004701201650005101248655002901299830001901328852005101347856017601398901005601574998001801630in00000840947OCoLC20140805232713.0m o u cr cn|||||||||000807s1999 cau o 001 0 eng d a0585165645 (electronic bk.) a9780585165646 (electronic bk.) z0873375351 a(OCoLC)44960117 aN$TbengerdacN$TdOCLdOCLCQdHALANdOCLCQdTUUdOCLCQdOCLCOdOCLCQdUtOrBLW an-us--- 4aKF750.Z9bC585 1999eb1 aClifford, Denis,eauthor10aEstate planning basics /cby Denis Clifford. aFirst edition. 1aBerkeley, Calif. :bNolo.com,c1999. a1 online resource (1 volume (various pagings)) atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier adata file2rda1 aQuick & legal00gChapter 1tA First Look At Estate Planning --gChapter 2tYour Beneficiaries --gChapter 3tChildren --gChapter 4tWills --gChapter 5tLiving Trusts --gChapter 6tOther Probate Avoidance Methods --gChapter 7tRetirement Plans as Estate Planning Devices --gChapter 8tEstate Tax --gChapter 9tReducing Federal Estate Taxes --gChapter 10tProperty Control Trusts --gChapter 11tPlanning For Incapacity: Medical Care and Finances --gChapter 12tLawyers --gChapter 13tFinalizing Your Estate Plan.1 aUMass Amherst patrons have access.5MU aDescription based on print version record. 0aEstate planningzUnited StatesvPopular works. 7aElectronic books.2local 0aQuick & legal. aNICj4354tLC ModifiedpTestPrefh322sTestSuf40uhttp://silk.library.umass.edu/login?url=https://search.ebscohost.com/login.aspx?direct=true&scope=site&db=nlebk&db=nlabk&AN=10241yUMass: Link to resourcezEBSCOfResource aho00004554073b2091fabd-ca95-5e3c-a54f-3c7a4b156a21 aUMb012473750 \ No newline at end of file diff --git a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js index ee061c4bd2..78bc0ece1e 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js +++ b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js @@ -563,7 +563,7 @@ export default { Select({ name:'profile.mappingDetails.mappingFields[23].repeatableFieldAction' }).focus(), Select({ name:'profile.mappingDetails.mappingFields[23].repeatableFieldAction' }).choose(actions.addTheseToExisting), Button('Add electronic access').click(), - TextField('Relationship').fillIn(`"${relationship}"`), + TextField('Relationship').fillIn(relationship), TextField('URI').fillIn(uri), TextField('Link text').fillIn(linkText), TextField('Materials specified').fillIn(materialsSpecified), @@ -641,6 +641,10 @@ export default { waitLoading(); }, + fillCallNumberPrefix:(prefix) => { cy.do(TextField('Call number prefix').fillIn(prefix)); }, + + fillcallNumberSuffix:(prefix) => { cy.do(TextField('Call number suffix').fillIn(prefix)); }, + fillStatus:(itemStatus) => { cy.do(TextField('Status').fillIn(`"${itemStatus}"`)); waitLoading(); diff --git a/cypress/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index 130af789e5..909d51562d 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -116,7 +116,9 @@ export default { checkReadOnlyFields:() => {}, checkHoldingsType: type => cy.expect(KeyValue('Holdings type').has({ value: type })), checkCallNumberType: number => cy.expect(KeyValue('Call number type').has({ value: number })), - checkCallNumber:callNumber => cy.expect(KeyValue('Call number').has({ value: callNumber })), + checkCallNumber: callNumber => cy.expect(KeyValue('Call number').has({ value: callNumber })), + checkCallNumberPrefix: prefix => cy.expect(KeyValue('Call number prefix').has({ value: prefix })), + checkCallNumberSuffix: prefix => cy.expect(KeyValue('Call number suffix').has({ value: prefix })), checkFormerHoldingsId: value => cy.expect(KeyValue('Former holdings ID', { value }).exists()), checkIllPolicy: value => cy.expect(KeyValue('ILL policy', { value }).exists()), checkDigitizationPolicy: expectedPolicy => cy.expect(KeyValue('Digitization policy', { value: expectedPolicy }).exists()), @@ -141,13 +143,19 @@ export default { checkMarkAsSuppressedFromDiscoveryAbsent: () => cy.expect(root .find(HTML(including('Warning: Holdings is marked suppressed from discovery'))) .absent()), - checkElectronicAccess:(relationshipValue, uriValue) => { + checkElectronicAccess:(relationshipValue, uriValue, linkText = '', urlPublicNote = '') => { cy.expect(electronicAccessAccordion .find(MultiColumnListCell({ row: 0, columnIndex: 0, content: relationshipValue })) .exists()); cy.expect(electronicAccessAccordion .find(MultiColumnListCell({ row: 0, columnIndex: 1, content: uriValue })) .exists()); + cy.expect(electronicAccessAccordion + .find(MultiColumnListCell({ row: 0, columnIndex: 2, content: linkText })) + .exists()); + cy.expect(electronicAccessAccordion + .find(MultiColumnListCell({ row: 0, columnIndex: 4, content: urlPublicNote })) + .exists()); }, checkHoldingRecordViewOpened: () => { cy.expect(Pane({ id:'ui-inventory.holdingsRecordView' }).exists()); From b2440b4cc882de6755dfb8e5eea80c30543c1744 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:31:26 +0300 Subject: [PATCH 17/55] Fat 7009 c386867 (#1430) * added test * refactored test --- ...mport-file-for-modify-marcBib-record.cy.js | 16 ++- ...ile-has-modify-after-instance-create.cy.js | 107 ++++++++++++++++++ cypress/fixtures/marcFileForC386867.mrc | 1 + .../data_import/job_profiles/newJobProfile.js | 2 + .../newFieldMappingProfile.js | 8 +- 5 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 cypress/e2e/data-import/log-details/instance-srs-have-status-created-with-job-profile-has-modify-after-instance-create.cy.js create mode 100644 cypress/fixtures/marcFileForC386867.mrc diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js index 21bc92f20a..2891fe4bb9 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js @@ -29,11 +29,20 @@ describe('ui-data-import', () => { const nameForCSVFile = `C345423autotestFile${getRandomPostfix()}.csv`; const nameMarcFileForUpload = `C345423autotestFile.${getRandomPostfix()}.mrc`; const mappingProfileFieldsForModify = { name: `autoTestMappingProf.${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + modifications: { action: 'Add', + field: '947', + ind1: '', + ind2: '', + subfield: 'a', + data: `Test.${getRandomPostfix()}`, + subaction: 'Add subfield', + subfieldInd1: 'b', + subfieldData: `Addition.${getRandomPostfix()}` } }; const actionProfile = { name: `autoTestActionProf.${getRandomPostfix()}`, action: 'Modify (MARC Bibliographic record type only)', - typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; const matchProfile = { profileName: `autoTestMatchProf.${getRandomPostfix()}`, @@ -126,11 +135,10 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfileFieldsForModify); NewFieldMappingProfile.addFieldMappingsForMarc(); - NewFieldMappingProfile.fillModificationSectionWithAdd('Add', '947', 'a', 'Add subfield', 'Test', 'b', 'Addition'); + NewFieldMappingProfile.fillModificationSectionWithAdd(mappingProfileFieldsForModify.modifications); FieldMappingProfiles.saveProfile(); FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfileFieldsForModify.name); FieldMappingProfiles.checkMappingProfilePresented(mappingProfileFieldsForModify.name); - // create Action profile and link it to Field mapping profile cy.visit(SettingsMenu.actionProfilePath); ActionProfiles.create(actionProfile, mappingProfileFieldsForModify.name); diff --git a/cypress/e2e/data-import/log-details/instance-srs-have-status-created-with-job-profile-has-modify-after-instance-create.cy.js b/cypress/e2e/data-import/log-details/instance-srs-have-status-created-with-job-profile-has-modify-after-instance-create.cy.js new file mode 100644 index 0000000000..eb5ce6b065 --- /dev/null +++ b/cypress/e2e/data-import/log-details/instance-srs-have-status-created-with-job-profile-has-modify-after-instance-create.cy.js @@ -0,0 +1,107 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import TestTypes from '../../../support/dictionary/testTypes'; +import DevTeams from '../../../support/dictionary/devTeams'; +import { + FOLIO_RECORD_TYPE, + ACCEPTED_DATA_TYPE_NAMES +} from '../../../support/constants'; +import TopMenu from '../../../support/fragments/topMenu'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import Users from '../../../support/fragments/users/users'; + +describe('ui-data-import', () => { + let user; + const filePathForUpload = 'marcFileForC386867.mrc'; + const fileName = `C386867 autotestFileName${getRandomPostfix()}`; + const mappingProfile = { + name: `C386867 Modify MARC_BIB ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + modifications: { action: 'Add', + field: '900', + ind1: '', + ind2: '', + subfield: 'a', + data: `Added field.${getRandomPostfix()}` } + }; + const actionProfile = { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, + name: `C386867 Modify MARC_BIB ${getRandomPostfix()}`, + action: 'Modify (MARC Bibliographic record type only)' }; + const jobProfile = { + ...NewJobProfile.defaultJobProfile, + profileName: `C386867 Multiple status for instance ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC + }; + + before('login', () => { + cy.createTempUser([ + permissions.moduleDataImportEnabled.gui, + permissions.settingsDataImportEnabled.gui + ]) + .then(userProperties => { + user = userProperties; + + cy.login(user.username, user.password, + { path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading }); + }); + }); + after('delete test data', () => { + Users.deleteViaApi(user.userId); + JobProfiles.deleteJobProfile(jobProfile.profileName); + ActionProfiles.deleteActionProfile(actionProfile.name); + FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); + }); + + it('C386867 Verify that Instance and SRS MARC have status "Created" with job profile that has MARC modify after Instance create (folijet)', + { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { + // create Field mapping profile + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addFieldMappingsForMarc(); + NewFieldMappingProfile.fillModificationSectionWithAdd(mappingProfile.modifications); + NewFieldMappingProfile.addNewFieldInModificationSection(); + NewFieldMappingProfile.fillModificationSectionWithDelete('Delete', '500', 1); + FieldMappingProfiles.saveProfile(); + FieldMappingProfiles.closeViewModeForMappingProfile(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create Action profile and link it to Field mapping profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + // create Job profile + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfileByName('Default - Create instance'); + NewJobProfile.linkActionProfileByName(actionProfile.name); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file + cy.visit(TopMenu.dataImportPath); + // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 + DataImport.uploadFile(filePathForUpload, fileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(fileName); + Logs.openFileDetails(fileName); + [FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance + ].forEach(columnName => { + FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', 0); + FileDetails.checkInstanceQuantityInSummaryTable('1', 0); + FileDetails.checkSrsRecordQuantityInSummaryTable('0', 1); + FileDetails.checkInstanceQuantityInSummaryTable('0', 1); + }); +}); diff --git a/cypress/fixtures/marcFileForC386867.mrc b/cypress/fixtures/marcFileForC386867.mrc new file mode 100644 index 0000000000..58dff95bba --- /dev/null +++ b/cypress/fixtures/marcFileForC386867.mrc @@ -0,0 +1 @@ +01769cas a2200469 a 4500001001200000003000600012005001700018006001900035007001500054008004100069010001700110040005700127019001500184022002800199035003900227042001400266050001600280050001000296082001400306049000900320130005300329210003900382222005400421245004500475246000800520260006100528310001500589336002600604337002600630338003600656362004600692500014700738650004400885650004300929650004100972655002501013710005201038711003501090776010001125841001701225856005701242ocm68188263OCoLC20200717090254.0m o d cr cnu||||||||060504c20069999txufr pso 0 a0eng c a 2006214613 aNSDbengcNSDdWAUdDLCdHULdOCLCQdOCLCFdOCLdAU@ a10582857450 a1931-7603l1931-760321 a(OCoLC)68188263z(OCoLC)1058285745 apccansdp10aISSN RECORD14aQL64010a598.1214 aILGA0 aHerpetological conservation and biology (Online)0 aHerpetol. conserv. biol.b(Online) 0aHerpetological conservation and biologyb(Online)10aHerpetological conservation and biology.13aHCB a[Texarkana, Tex.] :b[publisher not identified],c[2006] aSemiannual atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier1 aBegan with: Vol. 1, issue 1 (Sept. 2006). aPublished in partnership with: Partners in Amphibian & Reptile Conservation (PARC), World Congress of Herpetology, Las Vegas Springs Preserve. 0aHerpetologyxConservationvPeriodicals. 0aAmphibiansxConservationvPeriodicals. 0aReptilesxConservationvPeriodicals. 0aElectronic journals.2 aPartners in Amphibian and Reptile Conservation.2 aWorld Congress of Herpetology.1 tHerpetological conservation and biology (Print)x2151-0733w(DLC) 2009202029w(OCoLC)427887140 av.1- (1992-)40uhttp://www.herpconbio.orgzAvailable to Lehigh users \ No newline at end of file diff --git a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js index 57bf186872..32ef5db91f 100644 --- a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js +++ b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js @@ -158,6 +158,7 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); + cy.wait(8000); // link action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(buttonIndex).click(); cy.do(actionsButton.click()); @@ -173,6 +174,7 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); + cy.wait(8000); // link action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(buttonIndex).click(); cy.do(actionsButton.click()); diff --git a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js index 78bc0ece1e..94e50f231e 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js +++ b/cypress/support/fragments/data_import/mapping_profiles/newFieldMappingProfile.js @@ -762,7 +762,7 @@ export default { data, subaction, subfieldInd1, - subfieldInd2 + subfieldData }) => { cy.do([ Select({ name:'profile.mappingDetails.marcMappingDetails[0].action' }).choose(action), @@ -772,11 +772,13 @@ export default { TextField({ name:'profile.mappingDetails.marcMappingDetails[0].field.subfields[0].subfield' }).fillIn(subfield), TextArea({ name:'profile.mappingDetails.marcMappingDetails[0].field.subfields[0].data.text' }).fillIn(data) ]); + // TODO need to wait until row will be filled + cy.wait(2000); if (subaction) { cy.do([ Select({ name:'profile.mappingDetails.marcMappingDetails[0].field.subfields[0].subaction' }).choose(subaction), - TextArea({ name:'profile.mappingDetails.marcMappingDetails[0].field.subfields[0].data.text' }).fillIn(subfieldInd1), - TextField({ name:'profile.mappingDetails.marcMappingDetails[0].field.subfields[1].subfield' }).fillIn(subfieldInd2), + TextField({ name:'profile.mappingDetails.marcMappingDetails[0].field.subfields[1].subfield' }).fillIn(subfieldInd1), + TextArea({ name:'profile.mappingDetails.marcMappingDetails[0].field.subfields[1].data.text' }).fillIn(subfieldData) ]); } }, From 0b522c8415fae143c4701fcd411063f158e2b1b8 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:01:42 +0500 Subject: [PATCH 18/55] FAT-7059/C396357 (#1424) * added C396357 --- ...n-to-view-all-tags-settings-is-added.cy.js | 80 +++++++++++++++++++ cypress/support/dictionary/permissions.js | 2 + .../fragments/settings/tags/tags-general.js | 34 ++++++++ cypress/support/fragments/settingsMenu.js | 2 + 4 files changed, 118 insertions(+) create mode 100644 cypress/e2e/permissions/permission-to-view-all-tags-settings-is-added.cy.js create mode 100644 cypress/support/fragments/settings/tags/tags-general.js diff --git a/cypress/e2e/permissions/permission-to-view-all-tags-settings-is-added.cy.js b/cypress/e2e/permissions/permission-to-view-all-tags-settings-is-added.cy.js new file mode 100644 index 0000000000..9909c88e77 --- /dev/null +++ b/cypress/e2e/permissions/permission-to-view-all-tags-settings-is-added.cy.js @@ -0,0 +1,80 @@ +import devTeams from '../../support/dictionary/devTeams'; +import permissions from '../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../support/utils/stringTools'; +import TopMenu from '../../support/fragments/topMenu'; +import SettingsMenu from '../../support/fragments/settingsMenu'; +import TestTypes from '../../support/dictionary/testTypes'; +import Users from '../../support/fragments/users/users'; +import PatronGroups from '../../support/fragments/settings/users/patronGroups'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import UserEdit from '../../support/fragments/users/userEdit'; +import TagsGeneral from '../../support/fragments/settings/tags/tags-general'; +import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; + +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + +describe('Permissions Tags', () => { + let userData; + let servicePointId; + const patronGroup = { + name: getTestEntityValue('groupTags'), + }; + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 1"' }).then((servicePoints) => { + servicePointId = servicePoints[0].id; + }); + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser( + [ + permissions.uiUserCanEnableDisableTags.gui, + permissions.uiUserEdit.gui, + permissions.uiUsersView.gui, + permissions.uiUsersPermissions.gui, + permissions.uiViewTagsSettings.gui, + ], + patronGroup.name + ).then((userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi(servicePointId, userData.userId, servicePointId); + cy.login(userData.username, userData.password, { + path: SettingsMenu.tagsGeneralPath, + waiter: TagsGeneral.waitLoading, + }); + }); + }); + }); + + after('Deleting created entities', () => { + cy.loginAsAdmin({ + path: SettingsMenu.tagsGeneralPath, + waiter: TagsGeneral.waitLoading, + }); + TagsGeneral.changeEnableTagsStatus('enable'); + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + }); + + it( + 'C396357 Verify that new permission to view all the Tags settings is added', + { tags: [TestTypes.criticalPath, devTeams.volaris] }, + () => { + TagsGeneral.changeEnableTagsStatus('disable'); + cy.visit(TopMenu.usersPath); + UsersSearchPane.waitLoading(); + UsersSearchPane.searchByUsername(userData.username); + UsersSearchPane.waitLoading(); + UserEdit.addPermissions([permissions.uiUserCanEnableDisableTags.gui]); + UserEdit.saveAndClose(); + cy.login(userData.username, userData.password, { + path: SettingsMenu.tagsGeneralPath, + waiter: TagsGeneral.waitLoading, + }); + TagsGeneral.checkEnableTagsNotAvailable(); + } + ); +}); diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index de7de680da..9b36c0bb2e 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -62,6 +62,8 @@ export default { inventoryCRUDHoldings: { internal: 'ui-inventory.holdings.delete', gui: 'Inventory: View, create, edit, delete holdings' }, // Tags uiTagsPermissionAll: { internal: 'ui-tags.permission.all', gui:'Tags: All permissions' }, + uiViewTagsSettings: { internal: 'ui-tags.settings.view', gui:'Settings (Tags): Can view tags settings' }, + uiUserCanEnableDisableTags: { internal: 'ui-tags.settings.all', gui:'Settings (Tags): Can enable or disable tags for all apps' }, // Settings->Owners uiUsersSettingsAllFeeFinesRelated: { internal: 'ui-users.settings.feefines.all', gui:'Settings (Users): Can create, edit and remove all feefines-related entries' }, uiUsersSettingsOwners: { internal: 'ui-users.settings.owners', gui: 'Settings (Users): Can create, edit and remove owners' }, diff --git a/cypress/support/fragments/settings/tags/tags-general.js b/cypress/support/fragments/settings/tags/tags-general.js new file mode 100644 index 0000000000..f1edc1f7ba --- /dev/null +++ b/cypress/support/fragments/settings/tags/tags-general.js @@ -0,0 +1,34 @@ +import { Button, Checkbox, Heading } from '../../../../../interactors'; +import InteractorsTools from '../../../utils/interactorsTools'; + +const successCalloutMessage = 'Setting was successfully updated.'; +const saveButton = Button('Save'); +const enableTagsCheckbox = Checkbox({ name: 'tags_enabled' }); + +export default { + waitLoading() { + cy.expect(Heading('General').exists()); + }, + + checkEnableTagsNotAvailable() { + cy.expect(Checkbox({ id: 'tags_enabled', disabled: true }).exists()); + }, + + changeEnableTagsStatus(status) { + cy.get('input[name="tags_enabled"]') + .invoke('is', ':checked') + .then((checked) => { + if (!checked && status === 'enable') { + cy.expect(Checkbox({ name: 'tags_enabled', disabled: false }).exists()); + cy.do(enableTagsCheckbox.click()); + cy.do(saveButton.click()); + InteractorsTools.checkCalloutMessage(successCalloutMessage); + } else if (checked && status === 'disable') { + cy.expect(Checkbox({ name: 'tags_enabled', disabled: false }).exists()); + cy.do(enableTagsCheckbox.click()); + cy.do(saveButton.click()); + InteractorsTools.checkCalloutMessage(successCalloutMessage); + } + }); + }, +}; diff --git a/cypress/support/fragments/settingsMenu.js b/cypress/support/fragments/settingsMenu.js index fea0bd9f2e..8ca78fa68b 100644 --- a/cypress/support/fragments/settingsMenu.js +++ b/cypress/support/fragments/settingsMenu.js @@ -93,4 +93,6 @@ export default { // Data export exportMappingProfilePath: 'settings/data-export/mapping-profiles', exportJobProfilePath: 'settings/data-export/job-profiles', + // Tags + tagsGeneralPath: 'settings/tags/general', }; From e0ecfe0f943354c3b7a17ffd85fcc055b774c7d0 Mon Sep 17 00:00:00 2001 From: Jasurbek Erkinov <99860864+re-jas@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:20:40 +0500 Subject: [PATCH 19/55] added C402752 (#1427) --- .../create-new-permission-set.cy.js | 10 +- ...-view-all-settings-works-as-expected.cy.js | 94 +++++++++++++++++++ cypress/e2e/settings/users/waiveReasons.cy.js | 5 +- cypress/support/dictionary/permissions.js | 1 + .../settings/users/paymentMethods.js | 10 +- .../settings/users/usersSettingsGeneral.js | 36 +++++++ .../fragments/settings/users/waiveReasons.js | 10 +- cypress/support/fragments/settingsMenu.js | 1 + 8 files changed, 148 insertions(+), 19 deletions(-) rename cypress/e2e/{users => permissions/permission-sets}/create-new-permission-set.cy.js (74%) create mode 100644 cypress/e2e/permissions/permission-sets/setting-users-view-all-settings-works-as-expected.cy.js create mode 100644 cypress/support/fragments/settings/users/usersSettingsGeneral.js diff --git a/cypress/e2e/users/create-new-permission-set.cy.js b/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js similarity index 74% rename from cypress/e2e/users/create-new-permission-set.cy.js rename to cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js index a97fc623e7..11b011aea8 100644 --- a/cypress/e2e/users/create-new-permission-set.cy.js +++ b/cypress/e2e/permissions/permission-sets/create-new-permission-set.cy.js @@ -1,8 +1,8 @@ -import devTeams from '../../support/dictionary/devTeams'; -import { getTestEntityValue } from '../../support/utils/stringTools'; -import TestTypes from '../../support/dictionary/testTypes'; -import SettingsMenu from '../../support/fragments/settingsMenu'; -import PermissionSets from '../../support/fragments/settings/users/permissionSets'; +import devTeams from '../../../support/dictionary/devTeams'; +import { getTestEntityValue } from '../../../support/utils/stringTools'; +import TestTypes from '../../../support/dictionary/testTypes'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import PermissionSets from '../../../support/fragments/settings/users/permissionSets'; describe('Permission Sets', () => { const newPermissionSet = { diff --git a/cypress/e2e/permissions/permission-sets/setting-users-view-all-settings-works-as-expected.cy.js b/cypress/e2e/permissions/permission-sets/setting-users-view-all-settings-works-as-expected.cy.js new file mode 100644 index 0000000000..f1391a48cb --- /dev/null +++ b/cypress/e2e/permissions/permission-sets/setting-users-view-all-settings-works-as-expected.cy.js @@ -0,0 +1,94 @@ +import uuid from 'uuid'; +import devTeams from '../../../support/dictionary/devTeams'; +import permissions from '../../../support/dictionary/permissions'; +import { getTestEntityValue } from '../../../support/utils/stringTools'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import TestTypes from '../../../support/dictionary/testTypes'; +import Users from '../../../support/fragments/users/users'; +import PatronGroups from '../../../support/fragments/settings/users/patronGroups'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import UserEdit from '../../../support/fragments/users/userEdit'; +import UsersOwners from '../../../support/fragments/settings/users/usersOwners'; +import WaiveReasons from '../../../support/fragments/settings/users/waiveReasons'; +import RefundReasons from '../../../support/fragments/settings/users/refundReasons'; +import PaymentMethods from '../../../support/fragments/settings/users/paymentMethods'; +import UsersSettingsGeneral from '../../../support/fragments/settings/users/usersSettingsGeneral'; + +describe('Permission Sets', () => { + let userData; + const patronGroup = { + name: getTestEntityValue('GroupPermissionSets'), + }; + const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation('autotestPermissionSets', uuid()), + }; + const ownerBody = { + ...UsersOwners.getDefaultNewOwner(uuid()), + servicePointOwner: [ + { + value: testData.userServicePoint.id, + label: testData.userServicePoint.name, + }, + ], + }; + const waiveReason = WaiveReasons.getDefaultNewWaiveReason(uuid()); + const refundReason = RefundReasons.getDefaultNewRefundReason(uuid()); + + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.createViaApi(testData.userServicePoint); + UsersOwners.createViaApi(ownerBody); + WaiveReasons.createViaApi(waiveReason); + PaymentMethods.createViaApi(ownerBody.id).then((paymentRes) => { + testData.paymentMethodId = paymentRes.id; + testData.paymentMethodName = paymentRes.name; + }); + RefundReasons.createViaApi(refundReason); + PatronGroups.createViaApi(patronGroup.name).then((patronGroupResponse) => { + patronGroup.id = patronGroupResponse; + }); + cy.createTempUser([permissions.uiUsersViewAllSettings.gui], patronGroup.name).then((userProperties) => { + userData = userProperties; + UserEdit.addServicePointViaApi( + testData.userServicePoint.id, + userData.userId, + testData.userServicePoint.id + ); + cy.login(userData.username, userData.password); + }); + }); + }); + + after('Deleting created entities', () => { + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + Users.deleteViaApi(userData.userId); + PatronGroups.deleteViaApi(patronGroup.id); + RefundReasons.deleteViaApi(refundReason.id); + WaiveReasons.deleteViaApi(waiveReason.id); + PaymentMethods.deleteViaApi(testData.paymentMethodId); + UsersOwners.deleteViaApi(ownerBody.id); + }); + + it( + 'C402752 Verify that "Setting (Users): View all settings" works as expected Scenario 2 (volaris)', + { tags: [TestTypes.extendedPath, devTeams.volaris] }, + () => { + cy.visit(SettingsMenu.usersOwnersPath); + UsersSettingsGeneral.checkEntityInTable({ reason: ownerBody.owner, description: ownerBody.desc }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.waiveReasons); + UsersSettingsGeneral.checkEntityInTable({ reason: waiveReason.nameReason, description: waiveReason.description }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.paymentsPath); + PaymentMethods.checkPaymentMethodInTable(ownerBody.owner, testData.paymentMethodName); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + + cy.visit(SettingsMenu.refundReasons); + UsersSettingsGeneral.checkEntityInTable({ reason: refundReason.nameReason, description: refundReason.description }); + UsersSettingsGeneral.checkEditDeleteNewButtonsNotDisplayed(); + } + ); +}); diff --git a/cypress/e2e/settings/users/waiveReasons.cy.js b/cypress/e2e/settings/users/waiveReasons.cy.js index ebdd63071b..46d72d163b 100644 --- a/cypress/e2e/settings/users/waiveReasons.cy.js +++ b/cypress/e2e/settings/users/waiveReasons.cy.js @@ -4,6 +4,7 @@ import Features from '../../../support/dictionary/features'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import WaiveReasons from '../../../support/fragments/settings/users/waiveReasons'; import getRandomPostfix from '../../../support/utils/stringTools'; +import UsersSettingsGeneral from '../../../support/fragments/settings/users/usersSettingsGeneral'; describe('Management of waive reasons', () => { beforeEach(() => { @@ -23,14 +24,14 @@ describe('Management of waive reasons', () => { WaiveReasons.fillReasonParameters(testReason); WaiveReasons.checkSaveButtonState({ isDisabled: false }); WaiveReasons.trySave(); - WaiveReasons.checkReason(testReason); + UsersSettingsGeneral.checkEntityInTable(testReason); // update testReason.description = 'test description'; WaiveReasons.startEdit(testReason.reason); WaiveReasons.fillReasonParameters(testReason); WaiveReasons.checkSaveButtonState({ isDisabled: false }); WaiveReasons.trySave(); - WaiveReasons.checkReason(testReason); + UsersSettingsGeneral.checkEntityInTable(testReason); // delete WaiveReasons.delete(testReason.reason); }); diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 9b36c0bb2e..9fbcdd89e4 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -113,6 +113,7 @@ export default { uiUsersCreatePatronLimits: { internal: 'ui-users.settings.limits', gui: 'Settings (Users): Can create, edit and remove patron blocks limits' }, uiUsersCreatePatronConditions: { internal: 'ui-users.settings.conditions', gui: 'Settings (Users): Can view and edit patron blocks conditions' }, uiUsersCustomField: { internal: 'ui-users.settings.customfields.all', gui: 'Settings (Users): Can create, edit, view and delete custom fields' }, + uiUsersViewAllSettings: { internal: 'ui-users.settings.view', gui: 'Settings (Users): View all settings' }, // Remote Storage remoteStorageCRUD: { internal: 'ui-remote-storage.settings.remote-storages.edit', gui: 'Remote storage: Create, edit, delete' }, remoteStorageView: { internal: 'ui-remote-storage.settings.remote-storages.view', gui: 'Remote storage: View' }, diff --git a/cypress/support/fragments/settings/users/paymentMethods.js b/cypress/support/fragments/settings/users/paymentMethods.js index d8fe485195..c30cc5eee6 100644 --- a/cypress/support/fragments/settings/users/paymentMethods.js +++ b/cypress/support/fragments/settings/users/paymentMethods.js @@ -1,7 +1,7 @@ import { not } from 'bigtest'; import uuid from 'uuid'; -import { Button, Pane, Select, TextField, including, TextFieldIcon, MultiColumnListRow, MultiColumnListCell, Modal, HTML } from '../../../../../interactors'; +import { Button, Pane, Select, TextField, including, TextFieldIcon, MultiColumnListRow, MultiColumnListCell, Modal, HTML, EditableList } from '../../../../../interactors'; import getRandomPostfix from '../../../utils/stringTools'; const rootPane = Pane({ id: 'controlled-vocab-pane' }); @@ -21,13 +21,17 @@ const findRowIndex = (paymentMethodName) => cy.then(() => rootPane.find(MultiCol export default { defaultPaymentMethod, save, + waitLoading: () => { + cy.expect(newButton.exists()); + }, checkControls:() => { cy.expect([ownerSelect.exists(), newButton.exists(), rootPane.find(Select({ id:'select-owner' })).has({ value: not('') })]); }, - waitLoading: () => { - cy.expect(newButton.exists()); + checkPaymentMethodInTable:(ownerName, paymentMethodName) => { + cy.do(ownerSelect.choose(ownerName)); + cy.expect(EditableList('editList-settings-payments').find(MultiColumnListCell(paymentMethodName)).exists()); }, pressNew:() => { cy.do(newButton.click()); diff --git a/cypress/support/fragments/settings/users/usersSettingsGeneral.js b/cypress/support/fragments/settings/users/usersSettingsGeneral.js new file mode 100644 index 0000000000..df73da5b9c --- /dev/null +++ b/cypress/support/fragments/settings/users/usersSettingsGeneral.js @@ -0,0 +1,36 @@ +import { + Button, + MultiColumnListCell, + MultiColumnListRow, + Section, + MultiColumnListHeader, + including, +} from '../../../../../interactors'; + +const rootSection = Section({ id: 'controlled-vocab-pane' }); + +const getRowByReason = (reason) => cy.then(() => rootSection.find(MultiColumnListCell(reason)).row()); +const getDescriptionColumnIdex = () => cy.then(() => rootSection.find(MultiColumnListHeader('Description')).index()); + +export default { + checkEntityInTable: ({ reason, description }) => { + getRowByReason(reason).then((row) => { + getDescriptionColumnIdex().then((descriptionColumnIdex) => { + cy.expect( + rootSection + .find(MultiColumnListRow({ ariaRowIndex: row })) + .find(MultiColumnListCell({ columnIndex: descriptionColumnIdex })) + .has({ text: description }) + ); + }); + }); + }, + + checkEditDeleteNewButtonsNotDisplayed: () => { + cy.expect([ + Button({ id: including('clickable-add-settings') }).absent(), + Button({ id: including('clickable-edit-settings') }).absent(), + Button({ id: including('clickable-delete-settings') }).absent(), + ]); + }, +}; diff --git a/cypress/support/fragments/settings/users/waiveReasons.js b/cypress/support/fragments/settings/users/waiveReasons.js index 311cbf4aa3..66f9678621 100644 --- a/cypress/support/fragments/settings/users/waiveReasons.js +++ b/cypress/support/fragments/settings/users/waiveReasons.js @@ -1,5 +1,5 @@ import { including } from 'bigtest'; -import { Button, MultiColumnListCell, MultiColumnListRow, PaneHeader, Section, TextField, Modal, MultiColumnListHeader } from '../../../../../interactors'; +import { Button, MultiColumnListCell, MultiColumnListRow, PaneHeader, Section, TextField, Modal } from '../../../../../interactors'; import { getTestEntityValue } from '../../../utils/stringTools'; @@ -10,7 +10,6 @@ const reasonTextField = rootSection.find(TextField({ placeholder: 'nameReason' } const descriptionTextField = TextField({ placeholder: 'description' }); const getRowByReason = (reason) => cy.then(() => rootSection.find(MultiColumnListCell(reason)).row()); -const getDescriptionColumnIdex = () => cy.then(() => rootSection.find(MultiColumnListHeader('Description')).index()); export default { waitLoading:() => cy.expect(rootSection.find(PaneHeader('Fee/fine: Waive reasons')).exists()), @@ -31,13 +30,6 @@ export default { checkReasonValidatorMessage:() => { cy.expect(reasonTextField.has({ error: 'Please fill this in to continue' })); }, - checkReason:({ reason, description }) => { - getRowByReason(reason).then(row => { - getDescriptionColumnIdex().then(descriptionColumnIdex => { - cy.expect(rootSection.find(MultiColumnListRow({ ariaRowIndex: row })).find(MultiColumnListCell({ columnIndex: descriptionColumnIdex })).has({ text: description })); - }); - }); - }, startEdit:(reason) => { getRowByReason(reason).then(row => { cy.do(rootSection.find(MultiColumnListRow({ ariaRowIndex: row })).find(Button({ icon: 'edit' })).click()); diff --git a/cypress/support/fragments/settingsMenu.js b/cypress/support/fragments/settingsMenu.js index 8ca78fa68b..15cf3017aa 100644 --- a/cypress/support/fragments/settingsMenu.js +++ b/cypress/support/fragments/settingsMenu.js @@ -77,6 +77,7 @@ export default { usersPath: 'settings/users', manualCharges: 'settings/users/feefinestable', paymentsPath: 'settings/users/payments', + refundReasons: 'settings/users/refunds', conditionsPath: 'settings/users/conditions', limitsPath: 'settings/users/limits', waiveReasons: 'settings/users/waivereasons', From 5222c27dc8316faf9163e372b7cf2bf1225459a8 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Tue, 1 Aug 2023 21:20:33 +0300 Subject: [PATCH 20/55] FAT-2702-C387461 (#1432) * FAT-7061-C376946 (#1403) * FAT-7061: Initial commit * FAT-7061: further implementation * FAT-7061: implementation completed * FAT-7061: deleted temporary file * FAT-7218: test implemented * FAT-2702: updated methods, precondition * FAT-2702: methods, preconditions updated --- .../holdings/edit-marc-holdings.cy.js | 98 +++++++++++++++++++ cypress/fixtures/marcBibFileC387461.mrc | 1 + cypress/support/fragments/quickMarcEditor.js | 20 ++++ 3 files changed, 119 insertions(+) create mode 100644 cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js create mode 100644 cypress/fixtures/marcBibFileC387461.mrc diff --git a/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js new file mode 100644 index 0000000000..effc0de4ea --- /dev/null +++ b/cypress/e2e/inventory/holdings/edit-marc-holdings.cy.js @@ -0,0 +1,98 @@ +import TopMenu from '../../../support/fragments/topMenu'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import TestTypes from '../../../support/dictionary/testTypes'; +import QuickMarcEditor from '../../../support/fragments/quickMarcEditor'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import DevTeams from '../../../support/dictionary/devTeams'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import Users from '../../../support/fragments/users/users'; +import Permissions from '../../../support/dictionary/permissions'; + +describe('MARC -> MARC Holdings', () => { + const testData = { + tag001: '001', + tag001value: '$a Second 001 field' + }; + + const marcFile = { + marc: 'marcBibFileC387461.mrc', + fileName: `testMarcFile.C387461.${getRandomPostfix()}.mrc`, + jobProfileToRun: 'Default - Create instance and SRS MARC Bib', + numOfRecords: 1, + }; + + const recordIDs = []; + + before('Creating user, data', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiQuickMarcQuickMarcHoldingsEditorCreate.gui, + Permissions.uiQuickMarcQuickMarcHoldingsEditorAll.gui, + ]).then(createdUserProperties => { + testData.createdUserProperties = createdUserProperties; + + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(() => { + DataImport.uploadFile(marcFile.marc, marcFile.fileName); + JobProfiles.waitLoadingList(); + JobProfiles.searchJobProfileForImport(marcFile.jobProfileToRun); + JobProfiles.runImportFile(); + JobProfiles.waitFileIsImported(marcFile.fileName); + Logs.checkStatusOfJobProfile('Completed'); + Logs.openFileDetails(marcFile.fileName); + Logs.getCreatedItemsID().then(link => { + recordIDs.push(link.split('/')[5]); + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstance.searchByTitle(recordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.goToMarcHoldingRecordAdding(); + QuickMarcEditor.updateExistingField('852', QuickMarcEditor.getExistingLocation()); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveHoldings(); + + HoldingsRecordView.getHoldingsIDInDetailView().then((holdingsID) => { + recordIDs.push(holdingsID); + }); + }); + }); + cy.login(createdUserProperties.username, createdUserProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading }); + }); + }); + }); + + after('Deleting created user, data', () => { + Users.deleteViaApi(testData.createdUserProperties.userId); + cy.deleteHoldingRecordViaApi(recordIDs[1]); + InventoryInstance.deleteInstanceViaApi(recordIDs[0]); + cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }); + DataImport.selectLog(); + DataImport.openDeleteImportLogsModal(); + DataImport.confirmDeleteImportLogs(); + }); + + it('C387461 Add multiple 001s when editing "MARC Holdings" record', { tags: [TestTypes.criticalPath, DevTeams.spitfire] }, () => { + InventoryInstances.searchBySource('MARC'); + InventoryInstance.searchByTitle(recordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.openHoldingView(); + HoldingsRecordView.checkSource('MARC'); + // "Edit in quickMARC" option might not be active immediately when opening MARC Holdings + // this option becomes active after reopening Holdings view window + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); + HoldingsRecordView.editInQuickMarc(); + QuickMarcEditor.addEmptyFields(5); + QuickMarcEditor.checkEmptyFieldAdded(6); + QuickMarcEditor.updateExistingField('', testData.tag001value); + QuickMarcEditor.updateTagNameToLockedTag(6, '001'); + QuickMarcEditor.checkFourthBoxDisabled(6); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveHoldings(); + HoldingsRecordView.editInQuickMarc(); + QuickMarcEditor.checkReadOnlyTags(); + QuickMarcEditor.verifyNoFieldWithContent(testData.tag001value); + }); +}); diff --git a/cypress/fixtures/marcBibFileC387461.mrc b/cypress/fixtures/marcBibFileC387461.mrc new file mode 100644 index 0000000000..38bc75964a --- /dev/null +++ b/cypress/fixtures/marcBibFileC387461.mrc @@ -0,0 +1 @@ +01248cas a2200397 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808200110023322200420024424500510028626000470033726500380038430000150042231000220043732100250045936200230048457000290050765000330053665000450056965500420061470000450065685300180070186300230071990200160074290500210075894800370077995000340081636683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 a270.0504aThe Journal of ecclesiastical history04aThe Journal of ecclesiastical history. C387461 aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N \ No newline at end of file diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index 5f86e0d355..6cefc8d0f4 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -715,6 +715,26 @@ export default { cy.expect(calloutUpdatedRecord.absent()); }, + checkFourthBoxDisabled(rowIndex) { + cy.expect(getRowInteractorByRowNumber(rowIndex).find(TextArea({ ariaLabel: 'Subfield' })).has({ disabled: true })); + }, + + verifyNoFieldWithContent(content) { + cy.expect(TextArea({ ariaLabel: 'Subfield', textContent: including(content) }).absent()); + }, + + updateTagNameToLockedTag(rowIndex, newTagName) { + cy.get(`input[name="records[${rowIndex}].tag"`).type(newTagName); + }, + + checkEmptyFieldAdded(rowIndex, defaultContent = '$a ') { + cy.expect([ + QuickMarcEditorRow({ index: rowIndex }).find(quickMarcEditorRowContent).exists(), + QuickMarcEditorRow({ index: rowIndex }).find(TextField({ name: including('.tag') })).has({ value: '' }), + QuickMarcEditorRow({ index: rowIndex }).find(TextArea({ ariaLabel: 'Subfield' })).has({ textContent: defaultContent }) + ]); + }, + confirmUpdateLinkedBibs(linkedRecordsNumber) { cy.do(saveButton.click()); cy.expect([ From 6b5bc22bfc3d8af2a6805653fee32595ecd2322c Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:19:24 +0300 Subject: [PATCH 21/55] Master fix (#1433) --- .../finance/groups/add-funds-to-group.cy.js | 2 + .../transactions/moving-allocation.cy.js | 17 +++--- .../delete-order-by-user.cy.js | 53 ++++++++++--------- cypress/e2e/orders/pol-search-am-filter.cy.js | 2 + .../orders/create-order-template.cy.js | 2 + .../settings/orders/edit-order-template.cy.js | 2 + .../settings/orders/increase-pol-limit.cy.js | 4 +- .../support/fragments/finance/funds/funds.js | 24 ++++++--- .../fragments/finance/groups/groups.js | 4 ++ .../fragments/finance/ledgers/ledgers.js | 15 +++++- 10 files changed, 82 insertions(+), 43 deletions(-) diff --git a/cypress/e2e/finance/groups/add-funds-to-group.cy.js b/cypress/e2e/finance/groups/add-funds-to-group.cy.js index d243fb9597..467e01d856 100644 --- a/cypress/e2e/finance/groups/add-funds-to-group.cy.js +++ b/cypress/e2e/finance/groups/add-funds-to-group.cy.js @@ -11,6 +11,8 @@ import FinanceHelp from '../../../support/fragments/finance/financeHelper'; import InteractorsTools from '../../../support/utils/interactorsTools'; import Groups from '../../../support/fragments/finance/groups/groups'; +Cypress.on('uncaught:exception', () => false); + describe('ui-finance: Groups', () => { const firstFund = { ...Funds.defaultUiFund }; const secondFund = { diff --git a/cypress/e2e/finance/transactions/moving-allocation.cy.js b/cypress/e2e/finance/transactions/moving-allocation.cy.js index 15bf2dc248..aa160ed905 100644 --- a/cypress/e2e/finance/transactions/moving-allocation.cy.js +++ b/cypress/e2e/finance/transactions/moving-allocation.cy.js @@ -9,6 +9,8 @@ import Users from '../../../support/fragments/users/users'; import Funds from '../../../support/fragments/finance/funds/funds'; import FinanceHelp from '../../../support/fragments/finance/financeHelper'; +Cypress.on('uncaught:exception', () => false); + describe('ui-finance: Transactions', () => { const firstFiscalYear = { ...FiscalYears.defaultRolloverFiscalYear }; const defaultLedger = { ...Ledgers.defaultUiLedger }; @@ -19,17 +21,14 @@ describe('ui-finance: Transactions', () => { externalAccountNo: getRandomPostfix(), fundStatus: 'Active', description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, - allocatedToIds: [{ - 0: firstFund.id, - }], + }; - const allocatedQuantity = '1000'; + const allocatedQuantity = '500'; let user; before(() => { cy.getAdminToken(); - // create first Fiscal Year and prepere 2 Funds for Rollover FiscalYears.createViaApi(firstFiscalYear) .then(firstFiscalYearResponse => { firstFiscalYear.id = firstFiscalYearResponse.id; @@ -53,6 +52,10 @@ describe('ui-finance: Transactions', () => { Funds.createViaApi(secondFund) .then(secondFundResponse => { secondFund.id = secondFundResponse.fund.id; + cy.visit(TopMenu.fundPath); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.addTrunsferTo(firstFund.name); }); }); }); @@ -63,7 +66,7 @@ describe('ui-finance: Transactions', () => { ]) .then(userProperties => { user = userProperties; - cy.login(userProperties.username, userProperties.password, { path:TopMenu.ledgerPath, waiter: Ledgers.waitForLedgerDetailsLoading }); + cy.login(userProperties.username, userProperties.password, { path:TopMenu.fundPath, waiter: Funds.waitLoading }); }); }); @@ -89,6 +92,6 @@ describe('ui-finance: Transactions', () => { FinanceHelp.searchByName(firstFund.name); Funds.selectFund(firstFund.name); Funds.selectBudgetDetails(); - Funds.moveAllocationWithError(firstFund, secondFund, '100'); + Funds.moveAllocationWithError(secondFund, '100'); }); }); diff --git a/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js b/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js index 663c25b39b..09c9243a1c 100644 --- a/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js +++ b/cypress/e2e/orders/edifact-exports/delete-order-by-user.cy.js @@ -15,8 +15,9 @@ import SettingsMenu from '../../../support/fragments/settingsMenu'; import InteractorsTools from '../../../support/utils/interactorsTools'; import DateTools from '../../../support/utils/dateTools'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Edifact export', () => { - const order = { ...NewOrder.defaultOneTimeOrder }; const organization = { ...NewOrganization.defaultUiOrganizations, @@ -49,13 +50,13 @@ describe('orders: Edifact export', () => { cy.getAdminToken(); ServicePoints.getViaApi() - .then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) - .then(res => { - location = res; - }); - }); + .then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)) + .then(res => { + location = res; + }); + }); Organizations.createOrganizationViaApi(organization) .then(organizationsResponse => { @@ -70,20 +71,20 @@ describe('orders: Edifact export', () => { Organizations.fillIntegrationInformation(integrationName1, integartionDescription1, vendorEDICodeFor1Integration, libraryEDICodeFor1Integration, organization.accounts[0].accountNo, 'Purchase', UTCTime); cy.createOrderApi(order) - .then((response) => { - orderNumber = response.body.poNumber; - cy.visit(TopMenu.ordersPath); - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(); - Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); - OrderLines.fillInPOLineInfoForExportWithLocation(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId); - OrderLines.backToEditingOrder(); - }); - + .then((response) => { + orderNumber = response.body.poNumber; + cy.visit(TopMenu.ordersPath); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); + OrderLines.fillInPOLineInfoForExportWithLocation(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId); + OrderLines.backToEditingOrder(); + }); + cy.createTempUser([ permissions.uiOrdersDelete.gui, - permissions.uiOrdersCreate.gui, + permissions.uiOrdersCreate.gui, permissions.uiOrdersEdit.gui, ]) .then(userProperties => { @@ -97,11 +98,11 @@ describe('orders: Edifact export', () => { cy.visit(SettingsMenu.ordersPurchaseOrderLinesLimit); Organizations.deleteOrganizationViaApi(organization.id); NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - location.institutionId, - location.campusId, - location.libraryId, - location.id - ); + location.institutionId, + location.campusId, + location.libraryId, + location.id + ); Users.deleteViaApi(user.userId); }); @@ -109,6 +110,6 @@ describe('orders: Edifact export', () => { Orders.searchByParameter('PO number', orderNumber); Orders.selectFromResultsList(); Orders.deleteOrderViaActions(); - InteractorsTools.checkCalloutMessage(`The purchase order ${orderNumber} was successfully deleted`) + InteractorsTools.checkCalloutMessage(`The purchase order ${orderNumber} was successfully deleted`); }); }); diff --git a/cypress/e2e/orders/pol-search-am-filter.cy.js b/cypress/e2e/orders/pol-search-am-filter.cy.js index 5083bb0480..8bc1aab8f0 100644 --- a/cypress/e2e/orders/pol-search-am-filter.cy.js +++ b/cypress/e2e/orders/pol-search-am-filter.cy.js @@ -13,6 +13,8 @@ import OrderLines from '../../support/fragments/orders/orderLines'; import SettingsMenu from '../../support/fragments/settingsMenu'; import SettingsOrders from '../../support/fragments/settings/orders/settingsOrders'; +Cypress.on('uncaught:exception', () => false); + describe('orders: export', () => { const order = { ...NewOrder.defaultOneTimeOrder }; const organization = { diff --git a/cypress/e2e/settings/orders/create-order-template.cy.js b/cypress/e2e/settings/orders/create-order-template.cy.js index 3684b4619e..d6c438319d 100644 --- a/cypress/e2e/settings/orders/create-order-template.cy.js +++ b/cypress/e2e/settings/orders/create-order-template.cy.js @@ -11,6 +11,8 @@ import getRandomPostfix from '../../../support/utils/stringTools'; import Orders from '../../../support/fragments/orders/orders'; import TopMenu from '../../../support/fragments/topMenu'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Settings', () => { const organization = { ...NewOrganization.defaultUiOrganizations }; const acquisitionMethod = { ...AcquisitionMethods.defaultAcquisitionMethod }; diff --git a/cypress/e2e/settings/orders/edit-order-template.cy.js b/cypress/e2e/settings/orders/edit-order-template.cy.js index 1cd5cbbdfc..f09f7723d2 100644 --- a/cypress/e2e/settings/orders/edit-order-template.cy.js +++ b/cypress/e2e/settings/orders/edit-order-template.cy.js @@ -11,6 +11,8 @@ import getRandomPostfix from '../../../support/utils/stringTools'; import Orders from '../../../support/fragments/orders/orders'; import TopMenu from '../../../support/fragments/topMenu'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Settings', () => { const organization = { ...NewOrganization.defaultUiOrganizations }; const acquisitionMethod = { ...AcquisitionMethods.defaultAcquisitionMethod }; diff --git a/cypress/e2e/settings/orders/increase-pol-limit.cy.js b/cypress/e2e/settings/orders/increase-pol-limit.cy.js index 2e23f55853..ed4ce97acc 100644 --- a/cypress/e2e/settings/orders/increase-pol-limit.cy.js +++ b/cypress/e2e/settings/orders/increase-pol-limit.cy.js @@ -14,6 +14,8 @@ import SettingsOrders from '../../../support/fragments/settings/orders/settingsO import SettingsMenu from '../../../support/fragments/settingsMenu'; import Users from '../../../support/fragments/users/users'; +Cypress.on('uncaught:exception', () => false); + describe('orders: Settings', () => { const order = { ...NewOrder.defaultOneTimeOrder, @@ -97,7 +99,7 @@ describe('orders: Settings', () => { Orders.searchByParameter('PO number', orderNumber); Orders.selectFromResultsList(); Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 1); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource(`${organization.accounts[0].name} (${organization.accounts[0].accountNo})`, 'Purchase', location.institutionId, '4'); OrderLines.backToEditingOrder(); Orders.createPOLineViaActions(); diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 952646f352..d6facae6b2 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -146,6 +146,15 @@ export default { ]); }, + addTrunsferTo: (fund) => { + cy.do([ + actionsButton.click(), + Button('Edit').click(), + MultiSelect({ label: 'Transfer to' }).select([fund]), + saveAndCloseButton.click() + ]); + }, + checkAddGroupToFund: (group) => { cy.expect(Pane({ id: 'pane-fund-details' }).exists()); cy.expect(Accordion({ id: 'information' }).find(KeyValue({ value: group })).exists()); @@ -199,6 +208,9 @@ export default { cy.expect(Modal('Current budget').exists()); cy.do([ Modal('Current budget').find(TextField({ name: 'allocated' })).fillIn(allocatedQuantity.toString()), + ]); + cy.wait(4000); + cy.do([ Button('Save').click() ]); }, @@ -668,21 +680,19 @@ export default { cy.wait(4000); }, - moveAllocationWithError: (firstFund, secondFund, amount) => { + moveAllocationWithError: (secondFund, amount) => { cy.do([ actionsButton.click(), Button('Move allocation').click(), + addTransferModal.find(Button({ name: 'fromFundId' })).click(), ]); - cy.wait(4000); + cy.wait(6000); + cy.get('[role="option"]').contains(`${secondFund.name} (${secondFund.code})`).click(); cy.do([ - addTransferModal.find(Button({ name: 'fromFundId' })).click(), - MultiSelectOption(secondFund.name).click(), - addTransferModal.find(Button({ name: 'toFundId' })).click(), - MultiSelectOption(firstFund.name).click(), addTransferModal.find(TextField({ name: 'amount' })).fillIn(amount), addTransferModal.find(confirmButton).click(), ]); - InteractorsTools.checkCalloutErrorMessage(`$50.00 was not successfully allocated because ${secondFund.code} has no budget`); + InteractorsTools.checkCalloutErrorMessage(`$${amount}.00 was not successfully allocated because ${secondFund.code} has no budget`); cy.do(addTransferModal.find(cancelButton).click()); }, }; diff --git a/cypress/support/fragments/finance/groups/groups.js b/cypress/support/fragments/finance/groups/groups.js index eb59ff5881..99feb17537 100644 --- a/cypress/support/fragments/finance/groups/groups.js +++ b/cypress/support/fragments/finance/groups/groups.js @@ -64,10 +64,14 @@ export default { }, addFundToGroup: (fundName) => { + cy.wait(4000); cy.do([ Section({ id: 'fund' }).find(Button('Add to group')).click(), fundModal.find(SearchField({ id: 'input-record-search' })).fillIn(fundName), fundModal.find(Button({ type: 'submit'})).click(), + ]); + cy.wait(4000); + cy.do([ MultiColumnList({ id: 'list-plugin-find-records' }) .find(MultiColumnListHeader({ id:'list-column-ischecked' })) .find(Checkbox()) diff --git a/cypress/support/fragments/finance/ledgers/ledgers.js b/cypress/support/fragments/finance/ledgers/ledgers.js index 2ea9f0598a..f0275e103e 100644 --- a/cypress/support/fragments/finance/ledgers/ledgers.js +++ b/cypress/support/fragments/finance/ledgers/ledgers.js @@ -39,8 +39,16 @@ export default { }, rollover : () => { + cy.wait(8000); + cy.do([ Button('Actions').click(), + + ]); + cy.wait(8000); + + cy.do([ + rolloverButton.click() ]); }, @@ -62,7 +70,7 @@ export default { fillInRolloverInfo(fiscalYear) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded - cy.wait(3000); + cy.wait(8000); cy.do([ fiscalYearSelect.choose(fiscalYear), rolloverAllocationCheckbox.click(), @@ -72,8 +80,9 @@ export default { Select({ name: 'encumbrancesRollover[2].basedOn' }).choose('Initial encumbrance'), rolloverButton.click(), ]); - cy.wait(4000); + cy.wait(8000); this.continueRollover(); + cy.wait(8000); cy.do([ rolloverConfirmButton.click(), ]); @@ -245,6 +254,8 @@ export default { }), selectLedger:(ledgerName) => { + cy.wait(8000); + cy.do(Pane({ id: 'ledger-results-pane' }).find(Link(ledgerName)).click()); }, From de2b394ac24c027278752ce9921fb6391a8838d7 Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:57:00 +0300 Subject: [PATCH 22/55] IdeaLabs Fix and Merge (#1435) * orders/SantoshIdeyabs C378899, C350428 * Modified files * remove cy.wait() * code refactored * Removed the unused code * Removed Unused code * modified files * Modified data * Modified Data * Added Tags and Assertion * Modified data * Idea Labs fix and merge * Idea Labs fix and merge * Idea Labs fix and merge --------- Co-authored-by: SantoshIdeyalabs Co-authored-by: MaddiSwathiReddy --- .../re-exported-order.cy.js | 19 +++++ ...ses-with-payment-not-required-status.cy.js | 44 ++++++++++++ .../patron-notice.cy.js | 33 +++++++++ cypress/support/dictionary/testTypes.js | 3 +- .../support/fragments/orders/orderLines.js | 72 ++++++++++++------- cypress/support/fragments/orders/orders.js | 38 ++++++---- .../support/fragments/receiving/receiving.js | 46 ++++++++---- .../circulation/titleLevelRequests.js | 26 +++++-- cypress/support/ideyaLabs/orders.js | 43 +++++++++++ 9 files changed, 266 insertions(+), 58 deletions(-) create mode 100644 cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js create mode 100644 cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js create mode 100644 cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js create mode 100644 cypress/support/ideyaLabs/orders.js diff --git a/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js new file mode 100644 index 0000000000..794eb6431a --- /dev/null +++ b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js @@ -0,0 +1,19 @@ +import order from '../../../../support/ideyaLabs/orders'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; + +describe('Orders: Receiving and Check-in ', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C365619 Re-exported Order contains more than two PO lines is successfully exported in the next scheduled run (Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + cy.visit(topMenu.ordersPath); + order.switchToOrders(); + order.status(); + order.poNumberRecord(); + order.reExportActions(); + order.reExportOrderModal(); + }); +}); diff --git a/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js b/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js new file mode 100644 index 0000000000..b8300cde53 --- /dev/null +++ b/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js @@ -0,0 +1,44 @@ +import orderFragment from '../../../../support/fragments/orders/orders'; +import orderLines from '../../../../support/fragments/orders/orderLines'; +import receiving from '../../../../support/fragments/receiving/receiving'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; + +const orderDetails = { + searchByParameter: 'PO line number', + enterPoLineNumber: '20692-1', + checkOrderLineSearchResults: '20692-1', + titleName: 'Approve rolled', + caption: 'Done', + enumeration: 'Electronic', + poLineNumber: '20692-1', +}; + + + + +describe('Orders: Receiving and Check-in ', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C378899 Encumbrance releases when receive piece for order with payment status "Payment Not Required" (Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + cy.visit(topMenu.ordersPath); + orderLines.clickOnOrderLines(); + orderLines.searchByParameter( + orderDetails.searchByParameter, + orderDetails.enterPoLineNumber + ); + orderLines.checkOrderlineSearchResults( + orderDetails.checkOrderLineSearchResults + ); + orderLines.selectOrderline(orderDetails.checkOrderLineSearchResults); + orderLines.receiveOrderLineViaActions(); + orderLines.selectreceivedTitleName(orderDetails.titleName); + receiving.addPieceProcess(orderDetails.caption, orderDetails.enumeration); + receiving.quickReceivePieceAdd(orderDetails.enumeration); + receiving.clickOnPOLnumber(orderDetails.poLineNumber); + orderFragment.selectFundIDFromthelist(); + }); +}); diff --git a/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js b/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js new file mode 100644 index 0000000000..fd11ee7673 --- /dev/null +++ b/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js @@ -0,0 +1,33 @@ +import titleLevelRequests from '../../../../support/fragments/settings/circulation/titleLevelRequests'; +import SettingsMenu from '../../../../support/fragments/settingsMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; + +const patronData = { + notice1: 'Requested item - available', + notice2: 'Test TLR', + notice3: 'Requested item - available', +}; + + + +describe('Orders: Receiving and Check-in ', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C350428 Patron notice (Vega)', { tags: [testTypes.ideaLabsTests, devTeams.vega] }, () => { + cy.visit(SettingsMenu.circulationTitleLevelRequestsPath); + titleLevelRequests.selectConfirmationNoticeDropdown({ + notice1: patronData.notice1, + }); + titleLevelRequests.selectCancelleationNoticeDropdown({ + notice2: patronData.notice2, + }); + titleLevelRequests.selectExpirationNoticeDropdown({ + notice3: patronData.notice3, + }); + titleLevelRequests.clickOnSaveButton(); + titleLevelRequests.checkUpdateTLRCalloutAppeared(); + }); +}); diff --git a/cypress/support/dictionary/testTypes.js b/cypress/support/dictionary/testTypes.js index 1e99f917ef..83cf6717cf 100644 --- a/cypress/support/dictionary/testTypes.js +++ b/cypress/support/dictionary/testTypes.js @@ -2,4 +2,5 @@ export default { smoke:'smoke', criticalPath: 'criticalPth', extendedPath: 'extendedPath', long: 'long', - broken: 'broken' }; + broken: 'broken', + ideaLabsTests: 'ideaLabsTests' }; diff --git a/cypress/support/fragments/orders/orderLines.js b/cypress/support/fragments/orders/orderLines.js index 3bbbd7be19..17555376c7 100644 --- a/cypress/support/fragments/orders/orderLines.js +++ b/cypress/support/fragments/orders/orderLines.js @@ -12,6 +12,7 @@ import { TextField, SelectionOption, Pane, + PaneContent, Link, including, Section, @@ -26,6 +27,7 @@ import InteractorsTools from '../../utils/interactorsTools'; const path = require('path'); +const receivedtitleDetails = PaneContent({ id: 'receiving-results-pane-content' }); const saveAndClose = Button('Save & close'); const actionsButton = Button('Actions'); const searhInputId = 'input-record-search'; @@ -43,6 +45,8 @@ const quantityPhysical = '5'; const electronicUnitPrice = '10'; const quantityElectronic = '5'; const physicalUnitPriceTextField = TextField({ name: 'cost.listUnitPrice' }); +const orderLineButton = Button('Order lines'); +const funddetailsSection = Section({ id: 'FundDistribution' }); const quantityPhysicalTextField = TextField({ name: 'cost.quantityPhysical' }); const electronicUnitPriceTextField = TextField({ name: 'cost.listUnitPriceElectronic' }); const quantityElectronicTextField = TextField({ name: 'cost.quantityElectronic' }); @@ -103,6 +107,11 @@ export default { ]); }, + clickOnOrderLines: () => { + cy.do([ + orderLineButton.click(), + ]); + }, waitLoading() { cy.expect([ Pane({ id: 'order-lines-filters-pane' }).exists(), @@ -110,6 +119,10 @@ export default { ]); }, + selectFund: (FundName) => { + cy.do(funddetailsSection.find(Link(FundName)).click()); + }, + resetFilters: () => { cy.do(Button('Reset all').click()); }, @@ -382,6 +395,13 @@ export default { submitOrderLine(); }, + selectOrderline: (POlinenumber) => { + cy.do(Pane({ id: 'order-lines-results-pane' }).find(Link(POlinenumber)).click()); + }, + selectreceivedTitleName: (title) => { + cy.do(receivedtitleDetails.find((Link(title))).click()); + }, + addFundToPOL(fund, value) { cy.do([ addFundDistributionButton.click(), @@ -744,7 +764,7 @@ export default { editPOLInOrder: () => { cy.do([orderLineDetailsPane.find(paneHeaderOrderLinesDetailes.find(actionsButton)).click(), - Button('Edit').click() + Button('Edit').click() ]); }, @@ -769,56 +789,56 @@ export default { cy.do(Button({ id: 'clickable-updatePoLine' }).click()); }, - openInstance:() => { - cy.do(Section({ id:'ItemDetails' }).find(Link({ href: including('/inventory/view/') })).click()); + openInstance: () => { + cy.do(Section({ id: 'ItemDetails' }).find(Link({ href: including('/inventory/view/') })).click()); }, - openReceiving:() => { + openReceiving: () => { cy.do([ paneHeaderOrderLinesDetailes.find(actionsButton).click(), Button('Receive').click() ]); }, - fillPolByLinkTitle:(instanceTitle) => { + fillPolByLinkTitle: (instanceTitle) => { cy.do(Button('Title look-up').click()); SelectInstanceModal.searchByName(instanceTitle); SelectInstanceModal.selectInstance(instanceTitle); }, - addAcquisitionMethod:(method) => { + addAcquisitionMethod: (method) => { cy.do(acquisitionMethodButton.click()); cy.do(SelectionOption(method).click()); }, - addOrderFormat:(format) => { + addOrderFormat: (format) => { cy.do(orderFormatSelect.choose(format)); }, - fillPhysicalUnitPrice:(price) => { + fillPhysicalUnitPrice: (price) => { cy.do(physicalUnitPriceTextField.fillIn(price)); }, - fillPhysicalUnitQuantity:(quantity) => { + fillPhysicalUnitQuantity: (quantity) => { cy.do(quantityPhysicalTextField.fillIn(quantity)); }, - addCreateInventory:(inventory) => { + addCreateInventory: (inventory) => { cy.do(Select('Create inventory*').choose(inventory)); }, - addMaterialType:(type) => { - cy.do(Select({ name:'physical.materialType' }).choose(type)); + addMaterialType: (type) => { + cy.do(Select({ name: 'physical.materialType' }).choose(type)); // need to wait upload product types cy.wait(1000); }, - savePol:() => { + savePol: () => { cy.do(saveAndClose.click()); - cy.do(Pane({ id:'pane-poLineForm' }).absent()); + cy.do(Pane({ id: 'pane-poLineForm' }).absent()); }, - fillPOLWithTitleLookUp:() => { + fillPOLWithTitleLookUp: () => { cy.do([ orderFormatSelect.choose(ORDER_FORMAT_NAMES.OTHER), acquisitionMethodButton.click(), @@ -835,7 +855,7 @@ export default { ]); }, - selectRandomInstanceInTitleLookUP:(instanceName, rowNumber = 0) => { + selectRandomInstanceInTitleLookUP: (instanceName, rowNumber = 0) => { cy.do([ Button({ id: 'find-instance-trigger' }).click(), selectInstanceModal.find(TextField({ name: 'query' })).fillIn(instanceName), @@ -846,23 +866,23 @@ export default { cy.wait(2000); }, - checkConnectedInstance:() => { + checkConnectedInstance: () => { cy.expect(Section({ id: 'itemDetails' }).find(Link('Connected')).exists()); }, - fillInInvalidDataForPublicationDate:() => { + fillInInvalidDataForPublicationDate: () => { cy.do(TextField({ text: 'Publication date' }).fillIn('Invalid date')); }, - clickNotConnectionInfoButton:() => { + clickNotConnectionInfoButton: () => { cy.do(Section({ id: 'itemDetails' }).find(Button({ icon: 'info' })).click()); }, - selectCurrentEncumbrance:(currentEncumbrance) => { + selectCurrentEncumbrance: (currentEncumbrance) => { cy.do(fundDistributionSection.find(Link(currentEncumbrance)).click()); }, - cancelPOL:() => { + cancelPOL: () => { cy.do([ orderLineDetailsPane .find(paneHeaderOrderLinesDetailes @@ -872,7 +892,7 @@ export default { ]); }, - changeFundInPOL:(fund) => { + changeFundInPOL: (fund) => { cy.do([ fundDistributionSelect.click(), SelectionOption(`${fund.name} (${fund.code})`).click(), @@ -880,11 +900,11 @@ export default { ]); }, - checkFundInPOL:(fund) => { + checkFundInPOL: (fund) => { cy.expect(fundDistributionSection.find(Link(`${fund.name}(${fund.code})`)).exists()); }, - checkCurrencyInPOL:() => { + checkCurrencyInPOL: () => { cy.get('[id=FundDistribution]').contains('a', '$').should('exist'); }, @@ -929,9 +949,9 @@ export default { .click()); }, - getAssignedPOLNumber:() => cy.then(() => Accordion('Purchase order line').find(KeyValue('POL number')).value()), + getAssignedPOLNumber: () => cy.then(() => Accordion('Purchase order line').find(KeyValue('POL number')).value()), - verifyPOLDetailsIsOpened:() => { + verifyPOLDetailsIsOpened: () => { cy.expect(orderLineDetailsPane .find(paneHeaderOrderLinesDetailes) .exists()); diff --git a/cypress/support/fragments/orders/orders.js b/cypress/support/fragments/orders/orders.js index 321da038ba..b82fe89475 100644 --- a/cypress/support/fragments/orders/orders.js +++ b/cypress/support/fragments/orders/orders.js @@ -27,7 +27,6 @@ import { getLongDelay } from '../../utils/cypressTools'; import DateTools from '../../utils/dateTools'; import FileManager from '../../utils/fileManager'; - const numberOfSearchResultsHeader = '//*[@id="paneHeaderorders-results-pane-subtitle"]/span'; const zeroResultsFoundText = '0 records found'; const actionsButton = Button('Actions'); @@ -208,7 +207,7 @@ export default { .find(PaneHeader({ id: 'paneHeaderorder-details' }) .find(actionsButton)).click(), Button('Unopen').click(), - Button({ id:'clickable-order-unopen-confirmation-confirm-delete-holdings' }).click() + Button({ id: 'clickable-order-unopen-confirmation-confirm-delete-holdings' }).click() ]); }, @@ -239,8 +238,8 @@ export default { this.selectVendorOnUi(order.vendor); cy.intercept('POST', '/orders/composite-orders**').as('newOrderID'); cy.do(Select('Order type*').choose(order.orderType)); - if (isApproved) cy.do(Checkbox({ name:'approved' }).click()); - if (isManual) cy.do(Checkbox({ name:'manualPo' }).click()); + if (isApproved) cy.do(Checkbox({ name: 'approved' }).click()); + if (isManual) cy.do(Checkbox({ name: 'manualPo' }).click()); cy.do(saveAndClose.click()); return cy.wait('@newOrderID', getLongDelay()) .then(({ response }) => { @@ -257,7 +256,7 @@ export default { this.selectVendorOnUi(order.vendor); cy.intercept('POST', '/orders/composite-orders**').as('newOrderID'); cy.do(Select('Order type*').choose(order.orderType)); - if (isManual) cy.do(Checkbox({ name:'manualPo' }).click()); + if (isManual) cy.do(Checkbox({ name: 'manualPo' }).click()); cy.do(saveAndClose.click()); return cy.wait('@newOrderID', getLongDelay()) .then(({ response }) => { @@ -276,7 +275,7 @@ export default { this.selectVendorOnUi(order.vendor); cy.intercept('POST', '/orders/composite-orders**').as('newOrderID'); cy.do(Select('Order type*').choose(order.orderType)); - if (isManual) cy.do(Checkbox({ name:'manualPo' }).click()); + if (isManual) cy.do(Checkbox({ name: 'manualPo' }).click()); cy.do(saveAndClose.click()); return cy.wait('@newOrderID', getLongDelay()) .then(({ response }) => { @@ -302,7 +301,7 @@ export default { this.selectVendorOnUi(order.vendor); cy.intercept('POST', '/orders/composite-orders**').as('newOrder'); cy.do(Select('Order type*').choose(order.orderType)); - if (isApproved) cy.do(Checkbox({ name:'approved' }).click()); + if (isApproved) cy.do(Checkbox({ name: 'approved' }).click()); cy.do(saveAndClose.click()); return cy.wait('@newOrder', getLongDelay()) .then(({ response }) => { @@ -328,7 +327,7 @@ export default { MultiSelect({ id: 'order-acq-units' }).find(Button({ ariaLabel: 'open menu' })).click(), MultiSelectOption(AUName).click(), ]); - if (isApproved) cy.do(Checkbox({ name:'approved' }).click()); + if (isApproved) cy.do(Checkbox({ name: 'approved' }).click()); cy.do(saveAndClose.click()); return cy.wait('@newOrderID', getLongDelay()); }, @@ -395,7 +394,7 @@ export default { }, selectFromResultsList(number) { - cy.do(MultiColumnList({ id:'orders-list' }).find(Link(number)).click()); + cy.do(MultiColumnList({ id: 'orders-list' }).find(Link(number)).click()); }, deleteOrderViaActions: () => { @@ -429,7 +428,7 @@ export default { }, checkSearchResults: (orderNumber) => { - cy.expect(MultiColumnList({ id:'orders-list' }).find(Link(orderNumber)).exists()); + cy.expect(MultiColumnList({ id: 'orders-list' }).find(Link(orderNumber)).exists()); }, checkSearchResultsWithClosedOrder: (orderNumber) => { cy.expect(MultiColumnList({ id: 'orders-list' }) @@ -644,7 +643,7 @@ export default { isDefaultSearchParamsRequired: false, }), - checkIsOrderCreated:(orderNumber) => { + checkIsOrderCreated: (orderNumber) => { cy.do(Checkbox({ id: 'clickable-filter-workflowStatus-pending' }).click()); cy.expect(MultiColumnList({ id: 'orders-list' }).find(HTML(including(orderNumber))).exists()); }, @@ -677,11 +676,11 @@ export default { }); }, - selectPendingStatusFilter:() => { + selectPendingStatusFilter: () => { cy.do(Checkbox({ id: 'clickable-filter-workflowStatus-pending' }).click()); }, - selectOngoingOrderTypeInPOForm:() => { + selectOngoingOrderTypeInPOForm: () => { cy.do(Select('Order type*').choose('Ongoing')); }, @@ -692,7 +691,7 @@ export default { cy.expect(orderDetailsAccordion.find(KeyValue({ value: 'Ongoing' })).exists()); }, - errorMessage:(modalName, errorContent) => { + errorMessage: (modalName, errorContent) => { cy.expect(Modal(modalName).content(errorContent)); }, @@ -743,4 +742,15 @@ export default { checkReviewDateOnOngoingOrder() { cy.expect(Section({ id: 'ongoing' }).find(KeyValue('Review date')).has({ value: 'No value set-' })); }, + + selectFundIDFromthelist: () => { + const buttonInteractor = Section({ + id: 'FundDistribution', + }).find(MultiColumnListCell({ row: 0, columnIndex: 5 })) + .find(Button()); + cy.do([ + buttonInteractor.perform((interactor) => interactor.removeAttribute('target')), + buttonInteractor.click(), + ]); + }, }; diff --git a/cypress/support/fragments/receiving/receiving.js b/cypress/support/fragments/receiving/receiving.js index f2c60c9039..94613c8033 100644 --- a/cypress/support/fragments/receiving/receiving.js +++ b/cypress/support/fragments/receiving/receiving.js @@ -25,12 +25,12 @@ const unreceiveButton = Button('Unreceive'); const addPieceModal = Modal({ id: 'add-piece-modal' }); const searchByParameter = (parameter, value) => { cy.do(Select({ id: 'input-record-search-qindex' }).choose(parameter)); - cy.do(TextField({ id:'input-record-search' }).fillIn(value)); + cy.do(TextField({ id: 'input-record-search' }).fillIn(value)); cy.do(Button('Search').click()); }; const filterOpenReceiving = () => { - cy.do(Pane({ id:'receiving-filters-pane' }).find(Button('Order status')).click()); + cy.do(Pane({ id: 'receiving-filters-pane' }).find(Button('Order status')).click()); cy.do(Checkbox({ id: 'clickable-filter-purchaseOrder.workflowStatus-open' }).click()); }; @@ -74,6 +74,16 @@ export default { InteractorsTools.checkCalloutMessage('The piece was successfully saved'); }, + addPieceProcess: (caption, enumeration) => { + cy.expect(Accordion({ id: expectedPiecesAccordionId }).exists()); + cy.do([ + Accordion({ id: expectedPiecesAccordionId }).find(actionsButton).click(), + Button('Add piece').click(), + addPieceModal.find(TextField('Caption')).fillIn(caption), + addPieceModal.find(TextField('Enumeration')).fillIn(enumeration), + ]); + }, + selectPiece: (caption) => { cy.do(Accordion({ id: expectedPiecesAccordionId }).find(MultiColumnListCell(caption)).click()); }, @@ -158,7 +168,7 @@ export default { .find(MultiColumnListCell({ content: caption })).exists()); }, - checkIsPiecesCreated:(title) => { + checkIsPiecesCreated: (title) => { filterOpenReceiving(); cy.expect(Pane('Receiving') .find(MultiColumnList({ id: 'receivings-list' })) @@ -166,30 +176,30 @@ export default { .exists()); }, - selectReceivingItem:(indexRow = 0) => { + selectReceivingItem: (indexRow = 0) => { cy.do(MultiColumnListCell({ 'row': indexRow, 'columnIndex': 0 }).click()); }, - selectInstanceInReceive:(instanceName) => { + selectInstanceInReceive: (instanceName) => { cy.do(Section({ id: 'pane-title-details' }).find(Link(instanceName)).click()); }, - selectPOLInReceive:(POLName) => { + selectPOLInReceive: (POLName) => { cy.do(Section({ id: 'receiving-results-pane' }).find(Link(POLName)).click()); }, - selectConnectedInEditPiece:() => { + selectConnectedInEditPiece: () => { cy.do(Modal('Edit piece').find(Link('Connected')).click()); }, - receiveFromExpectedSection:() => { + receiveFromExpectedSection: () => { cy.do([ Section({ id: 'expected' }).find(actionsButton).click(), receiveButton.click() ]); }, - receiveFromExpectedSectionWithClosePOL:() => { + receiveFromExpectedSectionWithClosePOL: () => { cy.do([ Section({ id: 'expected' }).find(actionsButton).click(), receiveButton.click(), @@ -197,15 +207,15 @@ export default { ]); }, - unreceiveFromReceivedSection:() => { + unreceiveFromReceivedSection: () => { cy.do([ Section({ id: 'received' }).find(actionsButton).click(), unreceiveButton.click() ]); }, - selectFromResultsList: () => { - cy.do(MultiColumnList({ id:'receivings-list' }).find(Link()).click()); + selectFromResultsList1: () => { + cy.do(MultiColumnList({ id: 'receivings-list' }).find(Link()).click()); }, receiveAll: () => { @@ -216,13 +226,23 @@ export default { InteractorsTools.checkCalloutMessage(receivingSuccessful); }, - clickOnInstance:() => { + clickOnInstance: () => { cy.do([ Button('Collapse all').click(), PaneContent({ id: 'pane-title-details-content' }).find(Link()).click() ]); }, + clickOnPOLnumber: (PolNumber) => { + cy.do([ + PaneContent({ id: 'pane-title-details-content' }).find(Link(PolNumber)).click() + ]); + }, + + quickReceivePieceAdd: () => { + cy.do(addPieceModal.find(Button('Quick receive')).click()); + }, + receiveAllPhysicalItemsWithBarcodes: (firstBarcode, secondBarcode) => { cy.do([ Checkbox({ name: 'receivedItems[0].checked' }).clickInput(), diff --git a/cypress/support/fragments/settings/circulation/titleLevelRequests.js b/cypress/support/fragments/settings/circulation/titleLevelRequests.js index 116812e218..1824d56035 100644 --- a/cypress/support/fragments/settings/circulation/titleLevelRequests.js +++ b/cypress/support/fragments/settings/circulation/titleLevelRequests.js @@ -1,8 +1,11 @@ -import { Pane, Button, Checkbox, NavListItem } from '../../../../../interactors'; +import { Pane, Button, Select, Checkbox, NavListItem } from '../../../../../interactors'; import InteractorsTools from '../../../utils/interactorsTools'; -const SaveButton = Button('Save'); +const saveButton = Button('Save'); const TLRCheckbox = Checkbox({ name: 'titleLevelRequestsFeatureEnabled' }); +const confirmationNotice = Select({ name: 'confirmationPatronNoticeTemplateId' }); +const cancellationNotice = Select({ name:'cancellationPatronNoticeTemplateId' }); +const expirationNotice = Select({ name:'expirationPatronNoticeTemplateId' }); export default { waitLoading() { @@ -12,6 +15,21 @@ export default { checkCirculationHasTLR() { cy.expect(Pane({ id: 'app-settings-nav-pane' }).find(NavListItem('Title level requests')).exists()); }, + selectConfirmationNoticeDropdown: (notice) => { + cy.do(confirmationNotice.choose(notice.notice1)); + }, + + selectCancelleationNoticeDropdown: (notice) => { + cy.do(cancellationNotice.choose(notice.notice2)); + }, + + selectExpirationNoticeDropdown: (notice) => { + cy.do(expirationNotice.choose(notice.notice3)); + }, + + clickOnSaveButton:() => { + cy.do(saveButton.click()); + }, changeTitleLevelRequestsStatus(status) { cy.get('input[name="titleLevelRequestsFeatureEnabled"]') @@ -20,7 +38,7 @@ export default { if (!checked && status === 'allow') { cy.expect(Checkbox({ name: 'titleLevelRequestsFeatureEnabled', disabled: false }).exists()); cy.do(TLRCheckbox.click()); - cy.do(SaveButton.click()); + cy.do(saveButton.click()); this.checkUpdateTLRCalloutAppeared(); } else if (checked && status === 'forbid') { cy.expect(Checkbox({ name: 'titleLevelRequestsFeatureEnabled', disabled: false }).exists()); @@ -32,7 +50,7 @@ export default { if (body.find('div[label*="Cannot change"]').length) { cy.do(Button('Close').click()); } else { - cy.do(SaveButton.click()); + cy.do(saveButton.click()); this.checkUpdateTLRCalloutAppeared(); } }); diff --git a/cypress/support/ideyaLabs/orders.js b/cypress/support/ideyaLabs/orders.js new file mode 100644 index 0000000000..182725ab91 --- /dev/null +++ b/cypress/support/ideyaLabs/orders.js @@ -0,0 +1,43 @@ +import { + Button, + Checkbox, + Link, + Modal, + PaneContent, + PaneHeader, + Section, +} from '../../../interactors'; + +const ordersButton = Button('Orders'); +const ordersPane = PaneContent({ id: 'orders-filters-pane-content' }); +const statusDropDown = Button('Status'); +const openCheckBox = Checkbox('Open'); +const poNumber = Link('21211'); +const actionsButton = Button('Actions'); +const ordersSection = Section({ id: 'order-details' }); +const paneHeaderOrderDetails = PaneHeader({ id: 'paneHeaderorder-details' }); +const orderDetailsActions = Section({ id: 'order-details-actions' }); +const reExportButton = Button('Re-export'); +const reExportModal = Modal({ id: 'reexport-order-confirm-modal' }); +const confirmButton = Button('Confirm'); + +export default { + switchToOrders: () => { + cy.do(ordersPane.find(ordersButton).click()); + }, + status: () => { + cy.do([ordersPane.find(statusDropDown).click(), openCheckBox.click()]); + }, + poNumberRecord: () => { + cy.do(poNumber.click()); + }, + reExportActions() { + cy.do([ + ordersSection.find(paneHeaderOrderDetails).find(actionsButton).click(), + orderDetailsActions.find(reExportButton).click(), + ]); + }, + reExportOrderModal: () => { + cy.do(reExportModal.find(confirmButton).click()); + }, +}; From 10acc415c20616a7b98efe33620e395e20cd48a2 Mon Sep 17 00:00:00 2001 From: Vineethasakhamuri <117971735+Vineethasakhamuri@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:05:09 +0530 Subject: [PATCH 23/55] ExportManager/vineethaideyalabs (#1392) * ExportManager/vineethaideyalabs C365123, C358971 * ExportManager/vineethaideyalabs exportjobs.js * ExportManager/vineethaideyalabs * Modified exportjob file * ExportManager/vineethaideyalabs * Added Tags * Added Tags * Idea Labs fix and merge * Idea Labs fix and merge --------- Co-authored-by: pavithradasari Co-authored-by: SantoshIdeyalabs Co-authored-by: IhorBohdan --- .../B_exportManager.cy.js | 56 ++++++++ .../check-in-actions/checkInActions.js | 2 +- .../exportManager/exportManagerSearchPane.js | 8 +- cypress/support/ideyaLabs/exportJobs.js | 125 ++++++++++++++++++ 4 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js create mode 100644 cypress/support/ideyaLabs/exportJobs.js diff --git a/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js new file mode 100644 index 0000000000..fbf1417cb0 --- /dev/null +++ b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js @@ -0,0 +1,56 @@ +import exportJobs from '../../../../../support/ideyalabs/exportJobs'; +import devTeams from '../../../../../support/dictionary/devTeams'; +import testTypes from '../../../../../support/dictionary/testTypes'; +import exportManagerSearchPane from '../../../../../support/fragments/exportManager/exportManagerSearchPane'; +import topMenu from '../../../../../support/fragments/topMenu'; + +const testData = { + integrationMethod: 'Integration name', + sucessStatus: 'Successful', + failedStatus: 'Failed', + exportMethod: 'Integration name', + fileName: 'AAA_Integration name_2023-06-20_14_36_04.edi', + jobFileName: 'AAA_Integration name_2023-06-20_14:36:04.edi', +}; + +describe('Export Manager', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C358971 Already exported order is not included repeatedly in next exports(thunderjet)', + { tags: [testTypes.extendedPath, devTeams.thunderjet] }, + () => { + cy.visit(topMenu.exportManagerOrganizationsPath); + exportManagerSearchPane.selectExportMethod(testData.integrationMethod); + exportManagerSearchPane.searchBySuccessful(); + exportManagerSearchPane.verifyResult(testData.sucessStatus); + exportManagerSearchPane.verifyResultAndClick(testData.sucessStatus); + cy.exec('java -jar sikuli_ide.jar -r ftp.sikuli'); + // Used sikuli to open the exported .edi file with ""Notepad"" + // Based on the Testcase we need to change the PNG in the sikuli folder as it changes from the system to system + exportManagerSearchPane.rerunJob(); + cy.reload(); + exportManagerSearchPane.verifyResult(testData.failedStatus); + } + ); + + it( + 'C365123 Downloading the exact .edi file that was exported for a given export job with Successful status(thunderjet)', + { tags: [testTypes.extendedPath, devTeams.thunderjet] }, + () => { + cy.visit(topMenu.exportManagerOrganizationsPath); + exportManagerSearchPane.selectExportMethod(testData.exportMethod); + exportManagerSearchPane.searchBySuccessful(); + exportManagerSearchPane.selectSearchResultItem(); + exportJobs.verifyFileName(testData.jobFileName); + exportManagerSearchPane.verifyResultAndClick(testData.sucessStatus); + exportManagerSearchPane.downloadJob(); + cy.verifyDownload(testData.fileName); + cy.exec('java -jar sikuli_ide.jar -r ss.sikuli'); + // Used sikuli to Navigate to local directory for downloaded files and open downloaded file with ""Notepad"" + // Based on the Testcase we need to change the PNG in the sikuli folder as it changes from the system to system + } + ); +}); diff --git a/cypress/support/fragments/check-in-actions/checkInActions.js b/cypress/support/fragments/check-in-actions/checkInActions.js index d57967207b..1165cf6572 100644 --- a/cypress/support/fragments/check-in-actions/checkInActions.js +++ b/cypress/support/fragments/check-in-actions/checkInActions.js @@ -186,7 +186,7 @@ export default { .find(HTML(including('No items have been entered yet.'))) .exists()); }, - + backdateCheckInItem:(date, barcode) => { cy.do(Button('today').click()); cy.do(TextField({ name:'item.checkinDate' }).fillIn(date)); diff --git a/cypress/support/fragments/exportManager/exportManagerSearchPane.js b/cypress/support/fragments/exportManager/exportManagerSearchPane.js index 0fbad51ba3..24a654f140 100644 --- a/cypress/support/fragments/exportManager/exportManagerSearchPane.js +++ b/cypress/support/fragments/exportManager/exportManagerSearchPane.js @@ -11,7 +11,8 @@ import { MultiColumnList, PaneHeader, KeyValue, - HTML + HTML, + MultiColumnListRow, } from '../../../../interactors'; const searchButton = Button({ type: 'submit' }); @@ -42,7 +43,10 @@ export default { selectJob(content) { return cy.do(MultiColumnListCell(including(content)).click()); }, - + verifyResultAndClick(content) { + cy.expect(MultiColumnListCell(including(content)).exists()); + cy.do(MultiColumnListRow({ index:0 }).click()); + }, selectJobByIndex(content, index) { cy.get('div[class*=mclRow-]').contains(content).then(element => { element.prevObject[index].click(); diff --git a/cypress/support/ideyaLabs/exportJobs.js b/cypress/support/ideyaLabs/exportJobs.js new file mode 100644 index 0000000000..2c6fdb0cb9 --- /dev/null +++ b/cypress/support/ideyaLabs/exportJobs.js @@ -0,0 +1,125 @@ +import { + Button, + Callout, + KeyValue, + Modal, + MultiSelect, + MultiSelectMenu, + MultiSelectOption, + PaneHeader, + RadioButton, + Section, + TextField, +} from '../../../interactors'; +import exportManagerSearchPane from '../fragments/exportManager/exportManagerSearchPane'; +import topMenu from '../fragments/topMenu'; + +const actionsBtn = Button('Actions'); +const radioPackageFieldsToExport = RadioButton({ + id: 'selected-package-fields', +}); +const radioTitleFieldsToExport = RadioButton({ id: 'selected-title-fields' }); +const allPackageRadioButton = RadioButton({ + ariaLabel: 'Export all fields', + name: 'packageFields', +}); +const allTitleRadioButton = RadioButton({ + ariaLabel: 'Export all fields', + name: 'titleFields', +}); +const exportButton = Button('Export'); +const crossIcon = Button({ icon: 'times' }); +const exportSettingsModal = Modal({ id: 'eholdings-export-modal' }); +const cancelButton = Button('Cancel'); +const titlesSection = Section({ id: 'packageShowTitles' }); +const searchIcon = Button({ icon: 'search' }); +const filterTitlesModal = Modal({ id: 'eholdings-details-view-search-modal' }); +const titlesSearchField = TextField({ id: 'eholdings-search' }); +const selectionStatusButton = Button('Selection status'); +const notSelectedRadioButton = RadioButton('Not selected'); +const searchButton = Button('Search'); + +export default { + exportsPackageCSVClick: () => { + cy.do(actionsBtn.click()); + cy.do(Button('Export package (CSV)').click()); + }, + filterTitles: (title) => { + cy.do([ + titlesSection.find(searchIcon).click(), + filterTitlesModal.find(titlesSearchField).fillIn(title), + filterTitlesModal.find(selectionStatusButton).click(), + filterTitlesModal.find(notSelectedRadioButton).click(), + filterTitlesModal.find(searchButton).click(), + ]); + }, + + packageFieldsToExportRadio: () => { + cy.do(radioPackageFieldsToExport.click()); + }, + allPackageFieldsToExportRadioButton: () => { + cy.do(allPackageRadioButton.click()); + }, + + packageFieldsSelectFromExportDropdown: (options) => { + cy.do([ + radioPackageFieldsToExport.click(), + MultiSelect({ ariaLabelledby: 'selected-package-fields' }).toggle(), + MultiSelectMenu().find(MultiSelectOption(options)).click(), + exportSettingsModal.find(crossIcon).click(), + ]); + }, + + packageFieldsToExportDropdown: (options) => { + cy.do([ + radioPackageFieldsToExport.click(), + MultiSelect({ ariaLabelledby: 'selected-package-fields' }).toggle(), + MultiSelectMenu().find(MultiSelectOption(options)).click(), + ]); + }, + + allTitleFieldsToExportRadioButton: () => { + cy.do(allTitleRadioButton.click()); + }, + + titleFieldsToExportRadio: () => { + cy.do(radioTitleFieldsToExport.click()); + }, + + titleFieldsToExportDropDown: (options) => { + cy.do([ + MultiSelect({ ariaLabelledby: 'selected-title-fields' }).toggle(), + MultiSelectMenu().find(MultiSelectOption(options)).click(), + ]); + }, + + clickExportButton: () => { + cy.do(exportSettingsModal.find(exportButton).click()); + }, + + clickCancelButton: () => { + cy.do(exportSettingsModal.find(cancelButton).click()); + }, + + verifyJobIDRecord() { + cy.expect(Callout({ type: 'success' }).exists()); + cy.wrap(Callout({ type: 'success' }).text()).as('message'); + cy.get('@message').then((val) => { + const txt1 = val.slice(31, 37); + cy.visit(topMenu.exportManagerPath); + exportManagerSearchPane.searchBySuccessful(); + exportManagerSearchPane.downloadLastCreatedJob(txt1); + }); + }, + + getFileName: () => cy.then(() => KeyValue('File name').value()), + verifyFileName(fileName) { + this.getFileName().then((val) => { + expect(val).to.include(fileName); + }); + }, + + verifyThirdPaneExportJobExist() { + cy.expect(PaneHeader('Export jobs').exists()); + }, +}; From 176edc3ec0fc2dd4cf8e222fb1c8a026020858dc Mon Sep 17 00:00:00 2001 From: MaddiSwathiReddy <130063494+MaddiSwathiReddy@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:53:32 +0530 Subject: [PATCH 24/55] invoices/swathiideyalabs (#1389) * invoices/swathiideyalabs C353566,C368486 * Update invoice1.js * Removed unwanted script * updated unwanted scripts * removed cy.wait * Update invoice.cy.js * removed cy.wait * added assertions for C368486 * Remove unused code * code refactored * Update invoice.js * updated invoice.js * Update invoice.cy.js * added tags * Idea Labs fix and merge --------- Co-authored-by: IhorBohdan --- .../funds/correct-fund-validation.cy.js | 97 ++++ .../editing-fund-distribution-in-pol.cy.js | 36 ++ cypress/support/commands.js | 7 + .../support/fragments/ideyalabs/invoice.js | 274 +++++++++++ .../support/fragments/invoices/invoices.js | 427 ++++++++++++------ 5 files changed, 706 insertions(+), 135 deletions(-) create mode 100644 cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js create mode 100644 cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js create mode 100644 cypress/support/fragments/ideyalabs/invoice.js diff --git a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js new file mode 100644 index 0000000000..fcce3b78fb --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js @@ -0,0 +1,97 @@ +import invoice from '../../../../support/fragments/ideyalabs/invoice'; +import invoices from '../../../../support/fragments/invoices/invoices'; +import topMenu from '../../../../support/fragments/topMenu'; +import dateTools from '../../../../support/utils/dateTools'; +import getRandomPostfix from '../../../../support/utils/stringTools'; +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; + +const orderOne = { + templateName: 'Adlibris book order (adlibris)', + orderType: 'One-time', +}; + +const orderOnePOLine = { + title: `AutoTest_${getRandomPostfix}`, + fundID: 'Alpha FYRO (AFYRO)', +}; + +const orderTwo = { + templateName: 'Amazon book orders (Amazon-B)', + orderType: 'Ongoing', +}; + +const orderTwoPOLine = { + title: `AutoTest_${getRandomPostfix}`, + fundID: 'PO Fund 1 (POF1)', + price: '1', + valueOne: '90', + valueTwo: '10', +}; + +const newInvoice = { + invoiceDate: dateTools.getCurrentDate(), + status: 'Open', + invoiceNumber: getRandomPostfix(), + vendorName: '1517 THE LEGACY PROJECT', + accountingCode: '1233', + batchGroup: 'BG1', +}; + +const invoiceLines = { + invoiceLineOne: '12320886456-1', + invoiceLineTwo: '12320886456-1', + invoiceLineThree: '12320877456-1', + invoiceLineFour: '12320873456-1', +}; + +const fundDistribution = { + fundIDOne: 'Alpha FYRO (AFYRO)', + fundIDTwo: 'Beta FYRO (BFYRO)', +}; + +describe('ui-invoices: Invoice creation', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(topMenu.ordersPath); + }); + + it( + 'C353566 Correct fund validation to approve invoice (thunderjet)', + { tags: [testTypes.extendedPath, devTeams.thunderjet] }, + () => { + invoice.createOrder(orderOne.orderType, orderOne.templateName); + invoice.POLines(orderOnePOLine.title, orderOnePOLine.fundID); + invoice.purchaseOrder(); + invoice.createAnotherOrder(orderTwo.orderType, orderTwo.templateName); + invoice.POLinesForAnotherOrder( + orderTwoPOLine.title, + orderTwoPOLine.price, + orderTwoPOLine.fundID, + orderTwoPOLine.valueOne, + orderTwoPOLine.valueTwo + ); + invoice.purchaseAnotherOrder(); + cy.visit(topMenu.invoicesPath); + invoices.createVendorInvoice(newInvoice); + invoice.searchByNumber(newInvoice.invoiceNumber); + invoice.selectInvoice(newInvoice.invoiceNumber); + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineOne); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineTwo); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineThree); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoices.createInvoiceLineFromPol(invoiceLines.invoiceLineFour); + invoices.applyConfirmationalPopup(); // confirmation for 1st time + invoices.applyConfirmationalPopup(); // confirmation for 2nd time + invoice.addFundDistributionToLine2(fundDistribution.fundIDOne); + invoice.addFundDistributionToLine4(fundDistribution.fundIDTwo); + invoice.adjustments(); + invoice.approveInvoice(); // Approve API failure + } + ); +}); diff --git a/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js new file mode 100644 index 0000000000..fab03092dc --- /dev/null +++ b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js @@ -0,0 +1,36 @@ +import invoice from '../../../support/fragments/ideyalabs/invoice'; +import topMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; + +const searchInvoiceNumber = { + parameter: 'Keyword', + value: '17210-4', +}; + +const fundID = 'Fund B (b)'; + +describe('ui-invoices: Invoice creation', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(topMenu.ordersPath); + }); + + it( + 'C368486 Editing fund distribution in PO line when related Reviewed invoice exists (thunderjet)', + { tags: [testTypes.criticalPath, devTeams.thunderjet] }, + () => { + cy.visit(topMenu.orderLinesPath); + invoice.searchByParameter( + searchInvoiceNumber.parameter, + searchInvoiceNumber.value + ); + invoice.orderLinesResults(); + invoice.orderList(searchInvoiceNumber.value); + invoice.PODetails(fundID); // API getting failed while changing Fund ID in bugfest ENV + invoice.clickOnViewTransactions(); + cy.visit(topMenu.invoicesPath); + invoice.verifyTransactionsPane(); + } + ); +}); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c1d21b845a..c231b76c3e 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1 +1,8 @@ require('cypress-downloadfile/lib/downloadFileCommand'); + +Cypress.on('uncaught:exception', (err, runnable) => { + // returning false here prevents Cypress from + // failing the test + console.log(`${runnable?.title}: ${err?.message}`); + return false; +}); diff --git a/cypress/support/fragments/ideyalabs/invoice.js b/cypress/support/fragments/ideyalabs/invoice.js new file mode 100644 index 0000000000..0d607f1bc8 --- /dev/null +++ b/cypress/support/fragments/ideyalabs/invoice.js @@ -0,0 +1,274 @@ +import { + Button, + Checkbox, + FieldSet, + Link, + MultiColumnList, + MultiColumnListCell, + MultiColumnListRow, + Pane, + PaneContent, + PaneHeader, + SearchField, + Section, + Select, + SelectionOption, + TextField, +} from '../../../../interactors'; +import InteractorsTools from '../../utils/interactorsTools'; + +const invoiceStates = { + invoiceCreatedMessage: 'Invoice has been saved', + invoiceLineCreatedMessage: 'Invoice line has been saved', + invoiceApprovedMessage: 'Invoice has been approved successfully', +}; +const actionsButton = Button('Actions'); +const invoiceLineDetailsPane = PaneHeader({ + id: 'paneHeaderpane-invoiceLineDetails', +}); +const searchInputId = 'input-record-search'; +const invoiceDetailsPaneId = 'paneHeaderpane-invoiceDetails'; +const invoiceLineAdjustments = Select({ name: 'adjustments[0].prorate' }); +const newButton = Button('New'); +const orderType = Select('Order type*'); +const saveAndCloseButton = Button('Save & close'); +const orderDetails = PaneHeader({ id: 'paneHeaderorder-details' }); +const addPOLineButton = Button('Add PO line'); +const titleField = TextField({ name: 'titleOrPackage' }); +const addFundDistributionButton = Button({ id: 'fundDistribution-add-button' }); +const fundDistributionFieldSet = FieldSet({ id: 'fundDistributions' }); +const fundIDDropdown = Button({ id: 'fundDistribution[0].fundId' }); +const fundIDButton = Button({ id: 'fundDistributions[0].fundId' }); +const valueText = TextField({ name: 'fundDistribution[0].value' }); +const valueText1 = TextField({ name: 'fundDistribution[1].value' }); +const costDetails = TextField({ name: 'cost.listUnitPrice' }); +const fundIDForAnotherOrder = Button({ id: 'fundDistribution[1].fundId' }); +const backArrow = Button({ icon: 'arrow-left' }); +const openButton = Button('Open'); +const submitButton = Button('Submit'); +const closeButton = Button('Close'); +const invoiceLines = Section({ id: 'invoiceLines' }); +const ordersList = PaneContent({ id: 'order-lines-results-pane-content' }); +const orderLineDetails = Section({ id: 'order-lines-details' }); +const searchForm = SearchField({ id: 'input-record-search' }); +const fundDistribution = FieldSet({ id: 'fundDistribution' }); +const selectStatusSection = Section({ id: 'status' }); +const invoiceLinesSection = Section({ id: 'invoiceLines' }); +const fundDistributionSection = Section({ id: 'invoiceLineFundDistribution' }); +const encumbrancePane = Section({ id: 'pane-transaction-details' }); +const crossButton = Button({ icon: 'times' }); +const searchButton = Button('Search'); +const fundResultsPane = Section({ id: 'fund-results-pane' }); +const currentBudget = Section({ id: 'currentBudget' }); +const budgetInformation = Section({ id: 'information' }); +const orderLinesResults = Pane({ id: 'order-lines-results-pane' }); + +export default { + createOrder: (orderTypes, templateNames) => { + cy.do([ + actionsButton.click(), + newButton.click(), + orderType.choose(orderTypes), + Button({ id: 'order-template' }).click(), + SelectionOption(templateNames).click(), + saveAndCloseButton.click(), + Section({ id: 'POListing' }).find(Button('Actions')).click(), + addPOLineButton.click(), + ]); + }, + + createAnotherOrder: (orderTypes, templateNames) => { + cy.do([ + PaneHeader({ id: 'paneHeaderorders-results-pane' }) + .find(Button('Actions')) + .click(), + newButton.click(), + orderType.choose(orderTypes), + Button({ id: 'order-template' }).click(), + SelectionOption(templateNames).click(), + saveAndCloseButton.click(), + Section({ id: 'POListing' }).find(Button('Actions')).click(), + addPOLineButton.click(), + ]); + }, + + POLines: (titles, id) => { + cy.do(titleField.fillIn(titles)); + cy.expect(addFundDistributionButton.exists()); + cy.do([ + addFundDistributionButton.click(), + fundIDDropdown.click(), + SelectionOption(id).click(), + saveAndCloseButton.click(), + backArrow.click(), + ]); + }, + + POLinesForAnotherOrder: (titles, price, id, valText, valText1) => { + cy.do([ + titleField.fillIn(titles), + costDetails.fillIn(price), + addFundDistributionButton.click(), + fundIDForAnotherOrder.click(), + SelectionOption(id).click(), + valueText.fillIn(valText), + valueText1.fillIn(valText1), + saveAndCloseButton.click(), + backArrow.click(), + ]); + }, + + purchaseOrder: () => { + cy.do([ + orderDetails.find(Button('Actions')).click(), + openButton.click(), + submitButton.click(), + ]); + cy.expect(closeButton.exists()); + cy.do(closeButton.click()); + }, + + purchaseAnotherOrder: () => { + cy.do([ + orderDetails.find(Button('Actions')).click(), + openButton.click(), + submitButton.click(), + ]); + }, + + closeOrder: () => { + PaneHeader({ id: 'paneHeaderorder-details' }).find(crossButton).click(); + }, + + searchByNumber: (invoiceNumber) => { + cy.do([ + SearchField({ id: searchInputId }).selectIndex('Vendor invoice number'), + SearchField({ id: searchInputId }).fillIn(invoiceNumber), + searchButton.click(), + ]); + }, + + searchByKeyword: (invoiceNumber) => { + cy.do([ + SearchField({ id: searchInputId }).selectIndex('Vendor invoice number'), + SearchField({ id: searchInputId }).fillIn(invoiceNumber), + searchButton.click(), + ]); + }, + + selectInvoice: (invoiceNumber) => { + cy.do( + Pane({ id: 'invoice-results-pane' }).find(Link(invoiceNumber)).click() + ); + }, + + addFundDistributionToLine2: (id) => { + cy.do([ + invoiceLines.find(MultiColumnListRow({ index: 1 })).click(), + invoiceLineDetailsPane.find(actionsButton).click(), + Button('Edit').click(), + fundDistributionFieldSet.find(fundIDButton).click(), + SelectionOption(id).click(), + saveAndCloseButton.click(), + ]); + }, + + addFundDistributionToLine4: (id) => { + cy.do([ + invoiceLines.find(MultiColumnListRow({ index: 3 })).click(), + invoiceLineDetailsPane.find(actionsButton).click(), + Button('Edit').click(), + fundDistributionFieldSet.find(fundIDButton).click(), + SelectionOption(id).click(), + saveAndCloseButton.click(), + ]); + }, + + approveInvoice: () => { + cy.do([ + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), + Button('Approve').click(), + submitButton.click(), + ]); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceApprovedMessage); + }, + + adjustments: () => { + cy.do([ + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), + Button('Edit').click(), + invoiceLineAdjustments.choose('By amount'), + saveAndCloseButton.click(), + ]); + }, + + searchByParameter: (parameter, value) => { + cy.do([ + searchForm.selectIndex(parameter), + searchForm.fillIn(value), + searchButton.click(), + ]); + }, + + orderList: (POLnumber) => { + cy.do(ordersList.find(Link(POLnumber)).click()); + }, + + orderLinesResults: () => { + cy.expect(orderLinesResults.exists()); + }, + + PODetails: (id) => { + cy.do([ + orderLineDetails.find(Button('Actions')).click(), + Button('Edit').click(), + fundDistribution + .find(Button({ id: 'fundDistribution[0].fundId' })) + .click(), + SelectionOption(id).click(), + saveAndCloseButton.click(), + ]); + cy.expect(Section({ id: 'order-lines-details' }).exists()); + }, + + clickOnViewTransactions: () => { + const buttonInteractor = Section({ id: 'FundDistribution' }) + .find(MultiColumnListCell({ row: 0, columnIndex: 5 })) + .find(Button()); + cy.do([ + buttonInteractor.perform((interactor) => interactor.removeAttribute('target')), + buttonInteractor.click(), + encumbrancePane.find(crossButton).click(), + crossButton.click(), // Transaction details + crossButton.click(), // budget screen + searchForm.fillIn('Fund A'), + searchButton.click(), + fundResultsPane.find(Link('Fund A')).click(), + currentBudget.find(MultiColumnListRow({ index: 0 })).click(), + budgetInformation.find(Link('View transactions')).click(), + ]); + cy.expect(Section({ id: 'transaction-results-pane' }).exists()); + }, + + verifyTransactionsPane() { + const buttonInteractor = fundDistributionSection + .find(MultiColumnListCell({ row: 0, columnIndex: 5 })) + .find(Button()); + cy.do([ + selectStatusSection.find(Button('Status')).click(), + Checkbox('Reviewed').click(), + MultiColumnList({ id: 'invoices-list' }) + .find(MultiColumnListCell({ row: 3, columnIndex: 0 })) + .find(Link('234')) + .click(), + invoiceLinesSection.find(MultiColumnListRow({ index: 0 })).click(), + buttonInteractor.perform((interactor) => interactor.removeAttribute('target')), + buttonInteractor.click(), + ]); + cy.expect( + Section({ id: 'transaction-results-pane' }) + .find(MultiColumnListRow({ index: 0 })) + .exists() + ); + }, +}; diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index 4b7ef48c3f..f6bcbed4f8 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -1,35 +1,34 @@ import { + Accordion, Button, - TextField, - Selection, - SelectionList, - SearchField, + Checkbox, KeyValue, - Accordion, - Pane, - PaneHeader, - MultiColumnListCell, + Link, Modal, - Checkbox, MultiColumnList, + MultiColumnListCell, MultiColumnListRow, - Select, + Pane, + PaneHeader, + SearchField, Section, - Link, - SelectionOption + Select, + Selection, + SelectionList, + SelectionOption, + TextField, } from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; import Helper from '../finance/financeHelper'; - const buttonNew = Button('New'); const saveAndClose = Button('Save & close'); const invoiceStates = { invoiceCreatedMessage: 'Invoice has been saved', invoiceLineCreatedMessage: 'Invoice line has been saved', - InvoiceApprovedMessage: 'Invoice has been approved successfully', - InvoicePaidMessage: 'Invoice has been paid successfully', - InvoiceDeletedMessage: 'Invoice has been deleted' + invoiceApprovedMessage: 'Invoice has been approved successfully', + invoicePaidMessage: 'Invoice has been paid successfully', + invoiceDeletedMessage: 'Invoice has been deleted', }; const vendorDetailsAccordionId = 'vendorDetails'; const invoiceLinesAccordionId = 'invoiceLines'; @@ -38,11 +37,14 @@ const submitButton = Button('Submit'); const searchButton = Button('Search'); const invoiceDetailsPaneId = 'paneHeaderpane-invoiceDetails'; const searhInputId = 'input-record-search'; -const numberOfSearchResultsHeader = '//*[@id="paneHeaderinvoice-results-pane-subtitle"]/span'; +const numberOfSearchResultsHeader = + '//*[@id="paneHeaderinvoice-results-pane-subtitle"]/span'; const zeroResultsFoundText = '0 records found'; const searchForm = SearchField({ id: 'input-record-search' }); const resetButton = Button({ id: 'reset-invoice-filters' }); -const invoiceLineDetailsPane = PaneHeader({ id: 'paneHeaderpane-invoiceLineDetails' }); +const invoiceLineDetailsPane = PaneHeader({ + id: 'paneHeaderpane-invoiceLineDetails', +}); const deleteButton = Button('Delete'); const invoiceFiltersSection = Section({ id: 'invoice-filters-pane' }); const batchGroupFilterSection = Section({ id: 'batchGroupId' }); @@ -56,7 +58,6 @@ const selectOrderLinesModal = Modal('Select order lines'); const fundInInvoiceSection = Section({ id: 'invoiceLineForm-fundDistribution' }); export default { - checkZeroSearchResultsHeader: () => { cy.xpath(numberOfSearchResultsHeader) .should('be.visible') @@ -81,7 +82,7 @@ export default { Selection('Batch group*').open(), SelectionList().select(invoice.batchGroup), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').click() + Checkbox('Export to accounting').click(), ]); this.checkVendorPrimaryAddress(vendorPrimaryAddress); cy.do(saveAndClose.click()); @@ -103,7 +104,7 @@ export default { Selection('Batch group*').open(), SelectionList().select('FOLIO'), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').checked(false) + Checkbox('Export to accounting').checked(false), ]); cy.do(saveAndClose.click()); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); @@ -121,21 +122,44 @@ export default { ]); this.selectVendorOnUi(invoice.vendorName); cy.do([ - Selection('Accounting code').open(), + Selection('Accounting code*').open(), SelectionList().select(`Default (${invoice.accountingCode})`), Selection('Batch group*').open(), SelectionList().select(invoice.batchGroup), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').click() + Checkbox('Export to accounting').click(), ]); cy.do(saveAndClose.click()); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); }, + + createVendorInvoice(invoice) { + cy.do(actionsButton.click()); + cy.expect(buttonNew.exists()); + cy.do([ + buttonNew.click(), + Selection('Status*').open(), + SelectionList().select(invoice.status), + TextField('Invoice date*').fillIn(invoice.invoiceDate), + TextField('Vendor invoice number*').fillIn(invoice.invoiceNumber), + ]); + this.selectVendorOnUi(invoice.vendorName); + cy.do([ + Selection('Accounting code*').open(), + SelectionList().select(`Default (${invoice.accountingCode})`), + Selection('Batch group*').open(), + SelectionList().select(invoice.batchGroup), + Select({ id: 'invoice-payment-method' }).choose('Cash'), + ]); + cy.do(saveAndClose.click()); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); + }, + selectVendorOnUi: (organizationName) => { cy.do([ Button('Organization look-up').click(), SearchField({ id: searhInputId }).fillIn(organizationName), - searchButton.click() + searchButton.click(), ]); Helper.selectFromResultsList(); }, @@ -156,9 +180,21 @@ export default { checkCreatedInvoice(invoice, vendorPrimaryAddress) { this.checkVendorPrimaryAddress(vendorPrimaryAddress); cy.expect(Pane({ id: 'pane-invoiceDetails' }).exists()); - cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.invoiceNumber })).exists()); - cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.vendorName })).exists()); - cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.accountingCode })).exists()); + cy.expect( + Accordion({ id: vendorDetailsAccordionId }) + .find(KeyValue({ value: invoice.invoiceNumber })) + .exists() + ); + cy.expect( + Accordion({ id: vendorDetailsAccordionId }) + .find(KeyValue({ value: invoice.vendorName })) + .exists() + ); + cy.expect( + Accordion({ id: vendorDetailsAccordionId }) + .find(KeyValue({ value: invoice.accountingCode })) + .exists() + ); }, deleteInvoiceViaActions() { @@ -172,39 +208,55 @@ export default { cy.do([ invoiceLineDetailsPane.find(actionsButton).click(), deleteButton.click(), - Modal({ id: 'delete-invoice-line-confirmation' }).find(deleteButton).click() + Modal({ id: 'delete-invoice-line-confirmation' }) + .find(deleteButton) + .click(), ]); }, confirmInvoiceDeletion: () => { - cy.do(Button('Delete', { id: 'clickable-delete-invoice-confirmation-confirm' }).click()); - InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceDeletedMessage); + cy.do( + Button('Delete', { + id: 'clickable-delete-invoice-confirmation-confirm', + }).click() + ); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceDeletedMessage); }, createInvoiceLine: (invoiceLine) => { - cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); - cy.do(newBlankLineButton.click()); + cy.do( + Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click() + ); + cy.do(Button('New blank line').click()); // TODO: update using interactors once we will be able to pass negative value into text field cy.xpath('//*[@id="subTotal"]').type(invoiceLine.subTotal); cy.do([ TextField('Description*').fillIn(invoiceLine.description), TextField('Quantity*').fillIn(invoiceLine.quantity.toString()), - saveAndClose.click() + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, createInvoiceLinePOLLookUp: (orderNumber) => { - cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); - cy.do(newBlankLineButton.click()); - cy.do([ - polLookUpButton.click(), - selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(orderNumber), - searchButton.click() + cy.do( + Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click() + ); + cy.do(Button('New blank line').click()); + cy.do([ + Button('POL look-up').click(), + Modal('Select order lines') + .find(SearchField({ id: searhInputId })) + .fillIn(orderNumber), + searchButton.click(), ]); Helper.selectFromResultsList(); cy.do(saveAndClose.click()); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, createInvoiceLinePOLLookUWithSubTotal: (orderNumber, total) => { @@ -231,72 +283,98 @@ export default { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), Button('Add line from POL').click(), - selectOrderLinesModal.find(SearchField()).fillIn(orderNumber), - MultiColumnListRow({ index: rowNumber = 0 }).click() + Modal('Select order lines').find(SearchField()).fillIn(orderNumber), + MultiColumnListRow({ index: (rowNumber = 0) }).click(), ]); }, createInvoiceLineFromPol: (orderNumber, rowNumber = 0) => { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), - Button('Add line from POL').click() + Button('Add line from POL').click(), ]); cy.expect(selectOrderLinesModal.exists()); cy.do([ - selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(orderNumber), - selectOrderLinesModal.find(searchButton).click(), + Modal('Select order lines') + .find(SearchField({ id: searhInputId })) + .fillIn(orderNumber), + Modal('Select order lines').find(searchButton).click(), Checkbox({ ariaLabel: `record ${rowNumber} checkbox` }).clickInput(), - Button('Save').click() + Button('Save').click(), ]); }, checkInvoiceLine: (invoiceLine, currency = '$') => { cy.expect(Accordion({ id: invoiceLinesAccordionId }).exists()); - cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.description })).exists()); - cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.quantity.toString() })).exists()); - cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: currency.concat(invoiceLine.subTotal.toFixed(2)) })).exists()); + cy.expect( + Accordion({ id: invoiceLinesAccordionId }) + .find(MultiColumnListCell({ content: invoiceLine.description })) + .exists() + ); + cy.expect( + Accordion({ id: invoiceLinesAccordionId }) + .find(MultiColumnListCell({ content: invoiceLine.quantity.toString() })) + .exists() + ); + cy.expect( + Accordion({ id: invoiceLinesAccordionId }) + .find( + MultiColumnListCell({ + content: currency.concat(invoiceLine.subTotal.toFixed(2)), + }) + ) + .exists() + ); }, addFundDistributionToLine: (invoiceLine, fund) => { cy.do([ - Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.description })).click(), - invoiceLineDetailsPane - .find(actionsButton).click(), + Accordion({ id: invoiceLinesAccordionId }) + .find(MultiColumnListCell({ content: invoiceLine.description })) + .click(), + invoiceLineDetailsPane.find(actionsButton).click(), Button('Edit').click(), Button({ id: 'fundDistributions-add-button' }).click(), Selection('Fund ID*').open(), - SelectionList().select((fund.name).concat(' ', '(', fund.code, ')')), - saveAndClose.click() + SelectionList().select(fund.name.concat(' ', '(', fund.code, ')')), + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, addFundToLine: (fund) => { cy.do([ Button({ id: 'fundDistributions-add-button' }).click(), Selection('Fund ID*').open(), - SelectionList().select((fund.name).concat(' ', '(', fund.code, ')')), - saveAndClose.click() + SelectionList().select(fund.name.concat(' ', '(', fund.code, ')')), + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, deleteFundInInvoiceLine: () => { cy.do([ - fundInInvoiceSection.find(Button({ icon: 'trash' })).click(), - saveAndClose.click() + Section({ id: 'invoiceLineForm-fundDistribution' }) + .find(Button({ icon: 'trash' })) + .click(), + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, approveInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Approve').click(), - submitButton.click() + submitButton.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceApprovedMessage); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceApprovedMessage); }, searchByNumber: (invoiceNumber) => { @@ -307,32 +385,30 @@ export default { ]); }, - searchByParameter(parameter, value) { + searchByParameter(parameter, values) { cy.do([ searchForm.selectIndex(parameter), - searchForm.fillIn(value), + searchForm.fillIn(values), Button('Search').click(), ]); }, payInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Pay').click(), - submitButton.click() + submitButton.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.InvoicePaidMessage); + InteractorsTools.checkCalloutMessage(invoiceStates.invoicePaidMessage); }, updateCurrency: (currency) => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Edit').click(), Selection('Currency*').open(), SelectionList().select(currency), - saveAndClose.click() + saveAndClose.click(), ]); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); }, @@ -349,20 +425,37 @@ export default { switch (currencyShortName) { // TODO: add other currencies if needed case 'USD': - cy.expect(Accordion({ id: 'extendedInformation' }).find(KeyValue({ value: 'US Dollar' })).exists()); + cy.expect( + Accordion({ id: 'extendedInformation' }) + .find(KeyValue({ value: 'US Dollar' })) + .exists() + ); break; case 'EUR': - cy.expect(Accordion({ id: 'extendedInformation' }).find(KeyValue({ value: 'Euro' })).exists()); + cy.expect( + Accordion({ id: 'extendedInformation' }) + .find(KeyValue({ value: 'Euro' })) + .exists() + ); break; default: cy.log(`No such currency short name like ${currencyShortName}`); } }, + editVendorInvoiceNumber: () => { + cy.do([ + PaneHeader({ id: 'paneHeaderpane-invoiceDetails' }) + .find(actionsButton) + .click(), + Button('Edit').click(), + Button('Cancel').click(), + ]); + }, openPolSearchPlugin: () => { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), - Button('Add line from POL').click() + Button('Add line from POL').click(), ]); cy.expect(selectOrderLinesModal.exists()); }, @@ -370,18 +463,22 @@ export default { checkSearchPolPlugin: (searchParamsMap, titleOrPackage) => { for (const [key, value] of searchParamsMap.entries()) { cy.do([ - selectOrderLinesModal.find(SearchField({ id: searhInputId })).selectIndex(key), - selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(value), - selectOrderLinesModal.find(searchButton).click() + Modal('Select order lines') + .find(SearchField({ id: searhInputId })) + .selectIndex(key), + Modal('Select order lines') + .find(SearchField({ id: searhInputId })) + .fillIn(value), + Modal('Select order lines').find(searchButton).click(), ]); // verify that first row in the result list contains related order line title - cy.expect(MultiColumnList({ id: 'list-plugin-find-records' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 2 })) - .has({ content: titleOrPackage })); - cy.do([ - Button({ id: 'reset-find-records-filters' }).click() - ]); + cy.expect( + MultiColumnList({ id: 'list-plugin-find-records' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 2 })) + .has({ content: titleOrPackage }) + ); + cy.do([Button({ id: 'reset-find-records-filters' }).click()]); // TODO: remove waiter - currenty it's a workaround for incorrect selection from search list cy.wait(1000); } @@ -394,29 +491,39 @@ export default { voucherExport: (batchGroup) => { cy.do([ PaneHeader({ id: 'paneHeaderinvoice-results-pane' }) - .find(actionsButton).click(), + .find(actionsButton) + .click(), Button('Voucher export').click(), Select().choose(batchGroup), Button('Run manual export').click(), - Button({ id: 'clickable-run-manual-export-confirmation-confirm' }).click(), + Button({ + id: 'clickable-run-manual-export-confirmation-confirm', + }).click(), ]); cy.wait(2000); - cy.do(MultiColumnList({ id: 'batch-voucher-exports' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 3 })) - .find(Button({ icon: 'download' })) - .click()); + cy.do( + MultiColumnList({ id: 'batch-voucher-exports' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 3 })) + .find(Button({ icon: 'download' })) + .click() + ); }, + getSearchParamsMap(orderNumber, orderLine) { const searchParamsMap = new Map(); - searchParamsMap.set('Keyword', orderNumber) + searchParamsMap + .set('Keyword', orderNumber) .set('Contributor', orderLine.contributors[0].contributor) .set('PO line number', orderNumber.toString().concat('-1')) .set('Requester', orderLine.requester) .set('Title or package name', orderLine.titleOrPackage) .set('Publisher', orderLine.publisher) .set('Vendor account', orderLine.vendorDetail.vendorAccount) - .set('Vendor reference number', orderLine.vendorDetail.referenceNumbers[0].refNumber) + .set( + 'Vendor reference number', + orderLine.vendorDetail.referenceNumbers[0].refNumber + ) .set('Donor', orderLine.donor) .set('Selector', orderLine.selector) .set('Volumes', orderLine.physical.volumes[0]) @@ -425,32 +532,39 @@ export default { return searchParamsMap; }, - waitLoading : () => { + waitLoading: () => { cy.expect(Pane({ id: 'invoice-results-pane' }).exists()); }, selectInvoiceLine: () => { - cy.do(Section({ id: 'invoiceLines' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .click()); + cy.do( + Section({ id: 'invoiceLines' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .click() + ); }, cancelInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Cancel').click(), - submitButton.click() + submitButton.click(), ]); }, - selectInvoice:(invoiceNumber) => { - cy.do(Pane({ id: 'invoice-results-pane' }).find(Link(invoiceNumber)).click()); + selectInvoice: (invoiceNumber) => { + cy.do( + Pane({ id: 'invoice-results-pane' }).find(Link(invoiceNumber)).click() + ); }, - closeInvoiceDetailsPane:() => { - cy.do(Pane({ id: 'pane-invoiceDetails' }).find(Button({ icon: 'times' })).click()); + closeInvoiceDetailsPane: () => { + cy.do( + Pane({ id: 'pane-invoiceDetails' }) + .find(Button({ icon: 'times' })) + .click() + ); }, resetFilters: () => { @@ -458,83 +572,126 @@ export default { cy.expect(resetButton.is({ disabled: true })); }, - editInvoiceLine:() => { + editInvoiceLine: () => { cy.do([ Section({ id: 'pane-invoiceLineDetails' }).find(actionsButton).click(), Button('Edit').click(), ]); }, - addAdjustment:(descriptionInput, valueInput, typeToggle, realtioToTotal) => { + addAdjustment: (descriptionInput, valueInput, typeToggle, realtioToTotal) => { cy.do([ Button({ id: 'adjustments-add-button' }).click(), - TextField({ name: 'adjustments[0].description' }).fillIn(descriptionInput), + TextField({ name: 'adjustments[0].description' }).fillIn( + descriptionInput + ), TextField({ name: 'adjustments[0].value' }).fillIn(valueInput), - Section({ id: 'invoiceLineForm-adjustments' }).find(Button(typeToggle)).click(), + Section({ id: 'invoiceLineForm-adjustments' }) + .find(Button(typeToggle)) + .click(), Select({ name: 'adjustments[0].relationToTotal' }).choose(realtioToTotal), saveAndClose.click(), ]); }, - checkFundInInvoiceLine:(fund) => { - cy.expect(Section({ id: 'invoiceLineFundDistribution' }).find(Link(`${fund.name}(${fund.code})`)).exists()); + checkFundInInvoiceLine: (fund) => { + cy.expect( + Section({ id: 'invoiceLineFundDistribution' }) + .find(Link(`${fund.name}(${fund.code})`)) + .exists() + ); }, - selectStatusFilter:(status) => { + selectStatusFilter: (status) => { cy.do([ - invoiceFiltersSection.find(Section({ id: 'status' })).find(Button({ ariaLabel: 'Status filter list' })).click(), + invoiceFiltersSection + .find(Section({ id: 'status' })) + .find(Button({ ariaLabel: 'Status filter list' })) + .click(), Checkbox(status).click(), ]); }, selectVendorFilter: (organization) => { cy.do([ - invoiceFiltersSection.find(Section({ id: 'vendorId' })).find(Button({ ariaLabel: 'Vendor name filter list' })).click(), + invoiceFiltersSection + .find(Section({ id: 'vendorId' })) + .find(Button({ ariaLabel: 'Vendor name filter list' })) + .click(), Button('Organization look-up').click(), - Modal('Select Organization').find(SearchField({ id: searhInputId })).fillIn(organization.name), + Modal('Select Organization') + .find(SearchField({ id: searhInputId })) + .fillIn(organization.name), searchButton.click(), ]); Helper.selectFromResultsList(); }, - selectApprovalDateFilter:(dateFrom, dateTo) => { + selectApprovalDateFilter: (dateFrom, dateTo) => { cy.do([ - invoiceFiltersSection.find(approvalDateFilterSection).find(Button({ ariaLabel: 'Approval date filter list' })).click(), - approvalDateFilterSection.find(TextField({ name: 'startDate' })).fillIn(dateFrom), - approvalDateFilterSection.find(TextField({ name: 'endDate' })).fillIn(dateTo), + invoiceFiltersSection + .find(approvalDateFilterSection) + .find(Button({ ariaLabel: 'Approval date filter list' })) + .click(), + approvalDateFilterSection + .find(TextField({ name: 'startDate' })) + .fillIn(dateFrom), + approvalDateFilterSection + .find(TextField({ name: 'endDate' })) + .fillIn(dateTo), approvalDateFilterSection.find(Button('Apply')).click(), ]); }, - selectInvoiceDateFilter:(dateFrom, dateTo) => { + selectInvoiceDateFilter: (dateFrom, dateTo) => { cy.do([ - invoiceFiltersSection.find(invoiceDateFilterSection).find(Button({ ariaLabel: 'Invoice date filter list' })).click(), - invoiceDateFilterSection.find(TextField({ name: 'startDate' })).fillIn(dateFrom), - invoiceDateFilterSection.find(TextField({ name: 'endDate' })).fillIn(dateTo), + invoiceFiltersSection + .find(invoiceDateFilterSection) + .find(Button({ ariaLabel: 'Invoice date filter list' })) + .click(), + invoiceDateFilterSection + .find(TextField({ name: 'startDate' })) + .fillIn(dateFrom), + invoiceDateFilterSection + .find(TextField({ name: 'endDate' })) + .fillIn(dateTo), invoiceDateFilterSection.find(Button('Apply')).click(), ]); }, - selectFundCodeFilter:(fundCode) => { + selectFundCodeFilter: (fundCode) => { cy.do([ - invoiceFiltersSection.find(fundCodeFilterSection).find(Button({ ariaLabel: 'Fund code filter list' })).click(), + invoiceFiltersSection + .find(fundCodeFilterSection) + .find(Button({ ariaLabel: 'Fund code filter list' })) + .click(), fundCodeFilterSection.find(Button({ id: 'fundCode-selection' })).click(), fundCodeFilterSection.find(SelectionOption(fundCode)).click(), ]); }, - selectFiscalYearFilter:(fiscalYear) => { + selectFiscalYearFilter: (fiscalYear) => { cy.do([ - invoiceFiltersSection.find(fiscalYearFilterSection).find(Button({ ariaLabel: 'Fiscal year filter list' })).click(), - fiscalYearFilterSection.find(Button({ id: 'fiscalYearId-selection' })).click(), + invoiceFiltersSection + .find(fiscalYearFilterSection) + .find(Button({ ariaLabel: 'Fiscal year filter list' })) + .click(), + fiscalYearFilterSection + .find(Button({ id: 'fiscalYearId-selection' })) + .click(), fiscalYearFilterSection.find(SelectionOption(fiscalYear)).click(), ]); }, - selectButchGroupFilter:(batchGroup) => { + selectButchGroupFilter: (batchGroup) => { cy.do([ - invoiceFiltersSection.find(batchGroupFilterSection).find(Button({ ariaLabel: 'Batch group filter list' })).click(), - batchGroupFilterSection.find(Button({ id: 'batchGroupId-selection' })).click(), + invoiceFiltersSection + .find(batchGroupFilterSection) + .find(Button({ ariaLabel: 'Batch group filter list' })) + .click(), + batchGroupFilterSection + .find(Button({ id: 'batchGroupId-selection' })) + .click(), batchGroupFilterSection.find(SelectionOption(batchGroup)).click(), ]); }, From 1c619a94e4af4815020433ad691336a266a4c653 Mon Sep 17 00:00:00 2001 From: pavithradasari <139527611+pavithradasari@users.noreply.github.com> Date: Wed, 2 Aug 2023 17:34:04 +0530 Subject: [PATCH 25/55] ledger/pavithradasari (#1387) * ledger/pavithradasari C377030,C396360,C359604,C375267 * Remove cy.wait() * code refactor * added assertions for C377030,C359604,C375267 * Removed Unused Code * Modified Data * Added tags * Modified data --------- Co-authored-by: MaddiSwathiReddy Co-authored-by: santosh Co-authored-by: IhorBohdan --- .../B_exportManager.cy.js | 2 +- .../available-balance-is-displayed.cy.js | 94 ++++ ...cumbrances-are-rolled-over-correctly.cy.js | 116 +++++ ...-for-one-ledger-and-same-fiscal year.cy.js | 63 +++ .../funds/correct-fund-validation.cy.js | 2 +- .../editing-fund-distribution-in-pol.cy.js | 4 +- .../re-exported-order.cy.js | 2 +- ...-year-after-fund-distribution-change.cy.js | 133 +++++ .../fragments/finance/financeHelper.js | 18 +- .../finance/fiscalYears/fiscalYears.js | 50 +- .../support/fragments/finance/funds/funds.js | 484 ++++++++++++------ .../fragments/finance/groups/groups.js | 5 +- .../fragments/finance/ledgers/ledgers.js | 268 +++++++--- .../support/fragments/invoices/invoices.js | 442 +++++----------- 14 files changed, 1121 insertions(+), 562 deletions(-) create mode 100644 cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js create mode 100644 cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js create mode 100644 cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js create mode 100644 cypress/e2e/invoices/save-invoice-fiscal-year-after-fund-distribution-change.cy.js diff --git a/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js index fbf1417cb0..f8fb6544cb 100644 --- a/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js +++ b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js @@ -20,7 +20,7 @@ describe('Export Manager', () => { it( 'C358971 Already exported order is not included repeatedly in next exports(thunderjet)', - { tags: [testTypes.extendedPath, devTeams.thunderjet] }, + { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { cy.visit(topMenu.exportManagerOrganizationsPath); exportManagerSearchPane.selectExportMethod(testData.integrationMethod); diff --git a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js new file mode 100644 index 0000000000..b5e84fae01 --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js @@ -0,0 +1,94 @@ +import financeHelper from '../../../support/fragments/finance/financeHelper'; +import fiscalYears from '../../../support/fragments/finance/fiscalYears/fiscalYears'; +import funds from '../../../support/fragments/finance/funds/funds'; +import groups from '../../../support/fragments/finance/groups/groups'; +import ledgers from '../../../support/fragments/finance/ledgers/ledgers'; +import topMenu from '../../../support/fragments/topMenu'; +import testTypes from '../../../support/dictionary/testTypes'; +import devTeams from '../../../support/dictionary/devTeams'; + +const testData = { + fiscalName: 'Fiscal Year 2024', + selectName: 'Fiscal Year 2024', + ledgerName: 'Future', + fiscalYearQuantity1: '300.00', + fiscalYearQuantity2: '300.00', + selectLedgerName: 'Future', + groupsName: 'Test N5', + selectGroupName: 'Test N5', + fundName: 'AA1', + selectFundName: 'AA1', + searchByInvoiceName: '12344', + selectSearchByInvoiceNameRecord: '12344', + selectInvoiceLineNumber: '12320886456-1', + searchByFinanceName: 'Ledger NIX 1', + selectsearchByFinanceNameRecord: 'Ledger NIX 1', + fillRolloverFiscalYearINFo: 'NIX2024', + ledgername2: 'Ledger NIX 1', + selectLedgerName2: 'Ledger NIX 1', + searchByParameterFiscalYear: 'Name', + searchByNameFiscalYesar: 'AA2023', + selectFirstFiscalRecord: 'AA2023', + searchByParameterFiscalYear2: 'Name', + searchByNameFiscalYear2: 'AA2024', + selectSecondFiscalRecord: 'AA2024', + searchByInvoiceName2: '12344', + selectSearchByInvoiceNameRecord2: '12344', + selectFundIDFromthelist: 'Fund A(A)', + selectCurrentBudgerFromthelist: 'A-FYA2023', + selectTransactionListDetailsResultsFromCurrentBudget: '3/6/2023, 7:48 AM', + selectviewDetailsPreviousBudgets: 'BFYRO-FYRO2021', + searchFundName: 'AF2', + selectFundNameRecordList: 'AF2', + selectCurrentBudgerFromthelistFunds: 'AF2-AF2024', + selectTransactionListDetailsResultsFromEmbaranceDate: '6/20/2023, 5:39 AM', + viewDetailsPreviousBudgetsRecord: 'AF2-AF2021', + fundFinancialQuantity1: '1,000.00', + fundFinancialQuantity2: '974.00', + groupFinancialQuantity1: '2,000.00', + groupFinancialQuantity2: '2,000.00', + ledgerFinancialQuantity1: '0.00', + ledgerFinancialQuantity2: '0.00', +}; + +describe('Finance: Funds', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C377030 "Available balance" is displayed as a negative number when running a deficit(Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + cy.visit(topMenu.financePath); + fiscalYears.clickOnFiscalYear(); + financeHelper.searchByName(testData.fiscalName); + financeHelper.selectFirstFinance(testData.selectName); + ledgers.checkFinancialSummeryQuality( + testData.fiscalYearQuantity1, + testData.fiscalYearQuantity2 + ); + ledgers.closeOpenedPage(); + fiscalYears.clickOnLedgerTab(); + financeHelper.searchByName(testData.ledgerName); + ledgers.selectLedger(testData.selectLedgerName); + ledgers.checkFinancialSummeryQuality( + testData.ledgerFinancialQuantity1, + testData.ledgerFinancialQuantity2 + ); + ledgers.closeOpenedPage(); + groups.clickOnGroupTab(); + groups.searchByName(testData.groupsName); + groups.selectGroup(testData.selectGroupName); + ledgers.checkFinancialSummeryQuality( + testData.groupFinancialQuantity1, + testData.groupFinancialQuantity2 + ); + ledgers.closeOpenedPage(); + funds.clickOnFundsTab(); + funds.searchByName(testData.fundName); + funds.selectFund(testData.selectFundName); + funds.selectBudgetDetails(); + funds.checkBudgetQuantity1( + testData.fundFinancialQuantity1, + testData.fundFinancialQuantity2 + ); + }); +}); diff --git a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js new file mode 100644 index 0000000000..429deb521a --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js @@ -0,0 +1,116 @@ +import financeHelper from '../../../../support/fragments/finance/financeHelper'; +import ledgers from '../../../../support/fragments/finance/ledgers/ledgers'; +import invoices from '../../../../support/fragments/invoices/invoices'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; + +const testData = { + fiscalName: 'Fiscal Year 2024', + selectName: 'Fiscal Year 2024', + ledgerName: 'Future', + fiscalYearQuantity1: '300.00', + fiscalYearQuantity2: '300.00', + selectLedgerName: 'Future', + groupsName: 'Test N5', + selectGroupName: 'Test N5', + fundName: 'AA1', + selectFundName: 'AA1', + searchByInvoiceName: '12344', + selectSearchByInvoiceNameRecord: '12344', + selectInvoiceLineNumber: '12320886456-1', + searchByFinanceName: 'Ledger NIX 1', + selectsearchByFinanceNameRecord: 'Ledger NIX 1', + fillRolloverFiscalYearINFo: 'NIX2024', + ledgername2: 'Ledger NIX 1', + selectLedgerName2: 'Ledger NIX 1', + searchByParameterFiscalYear: 'Name', + searchByNameFiscalYesar: 'AA2023', + selectFirstFiscalRecord: 'AA2023', + searchByParameterFiscalYear2: 'Name', + searchByNameFiscalYear2: 'AA2024', + selectSecondFiscalRecord: 'AA2024', + searchByInvoiceName2: '12344', + selectSearchByInvoiceNameRecord2: '12344', + selectFundIDFromthelist: 'Fund A(A)', + selectCurrentBudgerFromthelist: 'A-FYA2023', + selectTransactionListDetailsResultsFromCurrentBudget: '3/6/2023, 7:48 AM', + selectviewDetailsPreviousBudgets: 'BFYRO-FYRO2021', + searchFundName: 'AF2', + selectFundNameRecordList: 'AF2', + selectCurrentBudgerFromthelistFunds: 'AF2-AF2024', + selectTransactionListDetailsResultsFromEmbaranceDate: '6/20/2023, 5:39 AM', + viewDetailsPreviousBudgetsRecord: 'AF2-AF2021', + fundFinancialQuantity1: '1,000.00', + fundFinancialQuantity2: '974.00', + groupFinancialQuantity1: '2,000.00', + groupFinancialQuantity2: '2,000.00', + ledgerFinancialQuantity1: '0.00', + ledgerFinancialQuantity2: '0.00', +}; +const rollOverData = { + ledgerName: 'AE2', + selectLedger: 'AE2', + fiscalYearDate: 'AE2025', + rollOverDate: '7/21/2023', + searchByParameter: 'Name', + searchByName: 'AE2', + selectFundRecord: 'AE2', + searchledger: 'Test N8', + selectLedgerName: 'Test N8', + fillInRolloverInfo: 'FYG2222', + currentBudeget: 'Test N11-FYG2024', + plannedBudget: 'Test N11-FYG1111', + selectEmbranceResult: '6/20/2023, 4:41 AM', +}; + +const encumbranceData = { + searchByName: 'autotest_ledger_275.5001376680388208', + selectFirstLedger: 'autotest_ledger_275.5001376680388208', + selectFirstCheckBox: 'FY2024', + rollOverDate: '7/21/2023', + fillInRolloverInfo: 'FY2029', + ledgerName: 'AJ', + selectLedgerName: 'AJ', + fundName: 'AJ2', + selectFund: 'AJ2', + selectCurrentBudgerFromthelist: 'AJ2-AJ2024', + transactionListDetailsResultsFromEmbarance: '7/3/2023, 8:12 AM', +}; + +describe('Finance: Fiscal Year Rollover', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C375267 Encumbrances are rolled over correctly when order fund distribution was changed and related paid invoice exists (based on Remaining) (Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + cy.visit(topMenu.financePath); + financeHelper.searchByName(encumbranceData.searchByName); + financeHelper.selectFirstLedger(encumbranceData.selectFirstLedger); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.selectFirstCheckBox(encumbranceData.selectFirstCheckBox); + ledgers.clickonViewledgerDetails(); + ledgers.rolloverLogs(); + ledgers.exportRollover(encumbranceData.rollOverDate); + ledgers.closeOpenedPage(); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.fillInRolloverInfo(encumbranceData.fillInRolloverInfo); + ledgers.clickonViewledgerDetails(); + ledgers.resetAll(); + financeHelper.searchByName(encumbranceData.ledgerName); + financeHelper.selectFirstLedger(encumbranceData.selectLedgerName); + ledgers.selectFund(); + ledgers.closeOpenedPage(); + financeHelper.searchByName(encumbranceData.fundName); + financeHelper.selectFirstFundRecord(encumbranceData.selectFund); + invoices.selectCurrentBudgerFromthelist( + encumbranceData.selectCurrentBudgerFromthelist + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromEmbarance( + encumbranceData.transactionListDetailsResultsFromEmbarance + ); + }); +}); diff --git a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js new file mode 100644 index 0000000000..b5419d59e0 --- /dev/null +++ b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js @@ -0,0 +1,63 @@ +import financeHelper from '../../../../support/fragments/finance/financeHelper'; +import ledgers from '../../../../support/fragments/finance/ledgers/ledgers'; +import invoices from '../../../../support/fragments/invoices/invoices'; +import topMenu from '../../../../support/fragments/topMenu'; +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; + +const rollOverData = { + ledgerName: 'AE2', + selectLedger: 'AE2', + fiscalYearDate: 'AE2025', + rollOverDate: '7/21/2023', + searchByParameter: 'Name', + searchByName: 'AE2', + selectFundRecord: 'AE2', + searchledger: 'Test N8', + selectLedgerName: 'Test N8', + fillInRolloverInfo: 'FYG2222', + currentBudeget: 'Test N11-FYG2024', + plannedBudget: 'Test N11-FYG1111', + selectEmbranceResult: '6/20/2023, 4:41 AM', +}; + +describe('Finance: Fiscal Year Rollover', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C359604 Make more than one preview for one ledger and same fiscal year with ""Test rollover"", check test rollover results(Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + cy.visit(topMenu.financePath); + financeHelper.searchByName(rollOverData.ledgerName); + financeHelper.selectFirstLedger(rollOverData.selectLedger); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.selectFirstCheckBox(rollOverData.fiscalYearDate); + ledgers.clickonViewledgerDetails(); + ledgers.rolloverLogs(); + ledgers.exportRollover(rollOverData.rollOverDate); + ledgers.closeOpenedPage(); + ledgers.clickOnFundTab(); + invoices.searchByParameter( + rollOverData.searchByParameter, + rollOverData.searchByName + ); + financeHelper.selectFirstFundRecord(rollOverData.selectFundRecord); + ledgers.clickOnFiscalyearTab(); + ledgers.clickOnLedgerTab(); + financeHelper.searchByName(rollOverData.searchledger); + financeHelper.selectFirstLedger(rollOverData.selectLedgerName); + ledgers.clickonViewledgerDetails(); + ledgers.rollover(); + ledgers.fillInRolloverInfo(rollOverData.fillInRolloverInfo); + ledgers.clickonViewledgerDetails(); + ledgers.selectFund(); + invoices.selectCurrentBudgerFromthelist(rollOverData.currentBudeget); + ledgers.closeOpenedPage(); + invoices.viewDetailsPlannedBudgets(rollOverData.plannedBudget); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromEmbarance( + rollOverData.selectEmbranceResult + ); + }); +}); diff --git a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js index fcce3b78fb..0d754643d1 100644 --- a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js +++ b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js @@ -58,7 +58,7 @@ describe('ui-invoices: Invoice creation', () => { it( 'C353566 Correct fund validation to approve invoice (thunderjet)', - { tags: [testTypes.extendedPath, devTeams.thunderjet] }, + { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { invoice.createOrder(orderOne.orderType, orderOne.templateName); invoice.POLines(orderOnePOLine.title, orderOnePOLine.fundID); diff --git a/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js index fab03092dc..aa866a6a3e 100644 --- a/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js +++ b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js @@ -10,7 +10,7 @@ const searchInvoiceNumber = { const fundID = 'Fund B (b)'; -describe('ui-invoices: Invoice creation', () => { +describe('Orders', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); cy.visit(topMenu.ordersPath); @@ -18,7 +18,7 @@ describe('ui-invoices: Invoice creation', () => { it( 'C368486 Editing fund distribution in PO line when related Reviewed invoice exists (thunderjet)', - { tags: [testTypes.criticalPath, devTeams.thunderjet] }, + { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { cy.visit(topMenu.orderLinesPath); invoice.searchByParameter( diff --git a/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js index 794eb6431a..4a6e7d65f2 100644 --- a/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js +++ b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js @@ -3,7 +3,7 @@ import topMenu from '../../../../support/fragments/topMenu'; import testTypes from '../../../../support/dictionary/testTypes'; import devTeams from '../../../../support/dictionary/devTeams'; -describe('Orders: Receiving and Check-in ', () => { +describe('Orders: Export in edifact format ', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); diff --git a/cypress/e2e/invoices/save-invoice-fiscal-year-after-fund-distribution-change.cy.js b/cypress/e2e/invoices/save-invoice-fiscal-year-after-fund-distribution-change.cy.js new file mode 100644 index 0000000000..c23a276d8c --- /dev/null +++ b/cypress/e2e/invoices/save-invoice-fiscal-year-after-fund-distribution-change.cy.js @@ -0,0 +1,133 @@ +import financeHelper from '../../support/fragments/finance/financeHelper'; +import fiscalYears from '../../support/fragments/finance/fiscalYears/fiscalYears'; +import ledgers from '../../support/fragments/finance/ledgers/ledgers'; +import invoices from '../../support/fragments/invoices/invoices'; +import topMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; + +const testData = { + fiscalName: 'Fiscal Year 2024', + selectName: 'Fiscal Year 2024', + ledgerName: 'Future', + fiscalYearQuantity1: '300.00', + fiscalYearQuantity2: '300.00', + selectLedgerName: 'Future', + groupsName: 'Test N5', + selectGroupName: 'Test N5', + fundName: 'AA1', + selectFundName: 'AA1', + searchByInvoiceName: '12344', + selectSearchByInvoiceNameRecord: '12344', + selectInvoiceLineNumber: '12320886456-1', + searchByFinanceName: 'Ledger NIX 1', + selectsearchByFinanceNameRecord: 'Ledger NIX 1', + fillRolloverFiscalYearINFo: 'NIX2024', + ledgername2: 'Ledger NIX 1', + selectLedgerName2: 'Ledger NIX 1', + searchByParameterFiscalYear: 'Name', + searchByNameFiscalYesar: 'AA2023', + selectFirstFiscalRecord: 'AA2023', + searchByParameterFiscalYear2: 'Name', + searchByNameFiscalYear2: 'AA2024', + selectSecondFiscalRecord: 'AA2024', + searchByInvoiceName2: '12344', + selectSearchByInvoiceNameRecord2: '12344', + selectFundIDFromthelist: 'Fund A(A)', + selectCurrentBudgerFromthelist: 'A-FYA2023', + selectTransactionListDetailsResultsFromCurrentBudget: '3/6/2023, 7:48 AM', + selectviewDetailsPreviousBudgets: 'BFYRO-FYRO2021', + searchFundName: 'AF2', + selectFundNameRecordList: 'AF2', + selectCurrentBudgerFromthelistFunds: 'AF2-AF2024', + selectTransactionListDetailsResultsFromEmbaranceDate: '6/20/2023, 5:39 AM', + viewDetailsPreviousBudgetsRecord: 'AF2-AF2021', + fundFinancialQuantity1: '1,000.00', + fundFinancialQuantity2: '974.00', + groupFinancialQuantity1: '2,000.00', + groupFinancialQuantity2: '2,000.00', + ledgerFinancialQuantity1: '0.00', + ledgerFinancialQuantity2: '0.00', +}; + +describe('Users-loans App', () => { + before(() => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C396360 Save invoice fiscal year after fund distribution change to fund using different ledger if FY was undefined(Thunderjet)', { tags: [testTypes.criticalPath, devTeams.thunderjet] }, () => { + cy.visit(topMenu.invoicesPath); + invoices.searchByNumber(testData.searchByInvoiceName); + invoices.clickOnFirstInvoicesResultList( + testData.selectSearchByInvoiceNameRecord + ); + invoices.selectInvoiceLine(testData.selectInvoiceLineNumber); + invoices.editInvoiceLine(); + invoices.selectFundID(); + invoices.editVendorInvoiceNumber(); + cy.visit(topMenu.financePath); + financeHelper.searchByName(testData.searchByFinanceName); + financeHelper.selectFirstLedger(testData.selectsearchByFinanceNameRecord); + ledgers.clickonViewledgerDetails(); + ledgers.resetAll(); + financeHelper.searchByName(testData.ledgername2); + financeHelper.selectFirstLedger(testData.selectLedgerName2); + ledgers.clickOnFiscalyearTab(); + invoices.searchByParameter( + testData.searchByParameterFiscalYear, + testData.searchByNameFiscalYesar + ); + financeHelper.selectFirstFiscalRecord(testData.selectFirstFiscalRecord); + fiscalYears.editFiscalYearDetails(); + fiscalYears.filltheStartAndEndDateoncalenderstartDateField1(); + ledgers.resetAll(); + invoices.searchByParameter( + testData.searchByParameterFiscalYear2, + testData.searchByNameFiscalYear2 + ); + financeHelper.selectFirstFiscalRecord(testData.selectSecondFiscalRecord); + fiscalYears.editFiscalYearDetails(); + fiscalYears.filltheStartAndEndDateoncalenderstartDateField2(); + cy.visit(topMenu.invoicesPath); + invoices.searchByNumber(testData.searchByInvoiceName2); + invoices.clickOnFirstInvoicesResultList( + testData.selectSearchByInvoiceNameRecord2 + ); + invoices.approveInvoice(); // API Failure + invoices.selectInvoiceLine(testData.selectInvoiceLineNumber); + invoices.selectFundIDFromthelist(testData.selectFundIDFromthelist); + invoices.selectCurrentBudgerFromthelist( + testData.selectCurrentBudgerFromthelist + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromCurrentBudget( + testData.selectTransactionListDetailsResultsFromCurrentBudget + ); + invoices.closeTwoXmarkInOneScreen(); + ledgers.closeOpenedPage(); + ledgers.closeOpenedPage(); + invoices.viewDetailsPreviousBudgets( + testData.selectviewDetailsPreviousBudgets + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromPreviousBudget(); + cy.visit(topMenu.financePath); + ledgers.clickOnFundTab(); + invoices.searchByParameter(testData.searchByParameterFiscalYear, testData.searchFundName); + financeHelper.selectFirstFundRecord(testData.selectFundNameRecordList); + invoices.selectCurrentBudgerFromthelist( + testData.selectTransactionListDetailsResultsFromEmbaranceDate + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromEmbarance( + testData.selectTransactionListDetailsResultsFromEmbaranceDate + ); + ledgers.closeOpenedPage(); + ledgers.closeOpenedPage(); + invoices.viewDetailsPreviousBudgets( + testData.viewDetailsPreviousBudgetsRecord + ); + invoices.clickOnViewTransactionsHyperText(); + invoices.transactionListDetailsResultsFromPreviousBudgetEmbrance(); + }); +}); diff --git a/cypress/support/fragments/finance/financeHelper.js b/cypress/support/fragments/finance/financeHelper.js index c9e3c45795..f99f366aa0 100644 --- a/cypress/support/fragments/finance/financeHelper.js +++ b/cypress/support/fragments/finance/financeHelper.js @@ -1,8 +1,12 @@ -import { Button, Checkbox, MultiColumnListRow, SearchField } from '../../../../interactors'; +import { Button, Checkbox, MultiColumnListRow, Link, SearchField, PaneContent } from '../../../../interactors'; const searchField = SearchField({ id: 'input-record-search' }); const noResultsMessageLabel = '//span[contains(@class,"noResultsMessageLabel")]'; const chooseAFilterMessage = 'Choose a filter or enter a search query to show results.'; +const fiscalResultsList = PaneContent({ id : 'fiscal-year-results-pane-content' }); +const ledgerResultList = PaneContent({ id:'ledger-results-pane-content' }); +const FundResultList = PaneContent({ id:'fund-results-pane-content' }); +const FiscalYearResultList = PaneContent({ id:'fiscal-year-results-pane-content' }); export default { @@ -49,6 +53,18 @@ export default { selectCheckboxFromResultsList: (rowNumber = 0) => { cy.do(MultiColumnListRow({ index: rowNumber }).find(Checkbox()).click()); }, + selectFirstFinance: (name) => { + cy.do(fiscalResultsList.find((Link(name))).click()); + }, + selectFirstLedger: (name) => { + cy.do(ledgerResultList.find((Link(name))).click()); + }, + selectFirstFundRecord: (name) => { + cy.do(FundResultList.find((Link(name))).click()); + }, + selectFirstFiscalRecord: (name) => { + cy.do(FiscalYearResultList.find((Link(name))).click()); + }, checkZeroSearchResultsMessage : () => { cy.xpath(noResultsMessageLabel) diff --git a/cypress/support/fragments/finance/fiscalYears/fiscalYears.js b/cypress/support/fragments/finance/fiscalYears/fiscalYears.js index 5e0cf78b5f..b808c3b103 100644 --- a/cypress/support/fragments/finance/fiscalYears/fiscalYears.js +++ b/cypress/support/fragments/finance/fiscalYears/fiscalYears.js @@ -21,7 +21,10 @@ const saveAndClose = Button('Save & Close'); const agreements = Button('Agreements'); const buttonNew = Button('New'); const actions = Button('Actions'); +const edit = Button('Edit'); const deleteButton = Button('Delete'); +const fiscalYear = Button('Fiscal year'); +const Ledgertab = Button('Ledger'); const resetButton = Button({ id: 'reset-fiscal-years-filters' }); export default { @@ -33,6 +36,7 @@ export default { description: `This is fiscal year created by E2E test automation script_${getRandomPostfix()}`, series: 'FY' }, + defaultRolloverFiscalYear: { name: `autotest_year_${getRandomPostfix()}`, code: DateTools.getRandomFiscalYearCodeForRollover(2000, 9999), @@ -42,7 +46,7 @@ export default { series: 'FYTA' }, - waitForFiscalYearDetailsLoading : () => { + waitForFiscalYearDetailsLoading: () => { cy.do(Pane({ id: 'pane-fiscal-year-details' }).exists); }, @@ -65,6 +69,22 @@ export default { openAcquisitionAccordion() { cy.do(Button({ id: 'accordion-toggle-button-acqUnitIds' }).click()); }, + clickOnFiscalYear: () => { + cy.do([ + fiscalYear.click() + ]); + }, + clickOnLedgerTab: () => { + cy.do([ + Ledgertab.click() + ]); + }, + editFiscalYearDetails: () => { + cy.do([ + actions.click(), + edit.click() + ]); + }, selectNoAcquisitionUnit() { cy.do([Button({ id: 'acqUnitIds-selection' }).click(), @@ -78,6 +98,24 @@ export default { .should('be.visible') .and('have.text', fiscalYearName); }, + filltheStartAndEndDateoncalenderstartDateField1: () => { + cy.do([ + TextField({ name: 'periodStart' }).clear(), + TextField({ name: 'periodStart' }).fillIn('01/01/2022'), + TextField({ name: 'periodEnd' }).clear(), + TextField({ name: 'periodEnd' }).fillIn('12/30/2022'), + saveAndClose.click() + ]); + }, + filltheStartAndEndDateoncalenderstartDateField2: () => { + cy.do([ + TextField({ name: 'periodStart' }).clear(), + TextField({ name: 'periodStart' }).fillIn('01/01/2024'), + TextField({ name: 'periodEnd' }).clear(), + TextField({ name: 'periodEnd' }).fillIn('12/30/2024'), + saveAndClose.click() + ]); + }, tryToCreateFiscalYearWithoutMandatoryFields: (fiscalYearName) => { cy.do([ @@ -107,6 +145,10 @@ export default { .find(MultiColumnListCell(fiscalYear)) .exists()); }, + checkSearchResults1: (fiscalYear) => { + cy.expect(MultiColumnList({ id: 'fiscal-years-list' }) + .find(MultiColumnListCell(fiscalYear)).click()); + }, fiscalYearsDisplay: () => { cy.expect(MultiColumnList({ id: 'fiscal-years-list' }).exists()); @@ -120,7 +162,7 @@ export default { cy.do([ actions.click(), deleteButton.click(), - Button('Delete', { id:'clickable-fiscal-year-remove-confirmation-confirm' }).click() + Button('Delete', { id: 'clickable-fiscal-year-remove-confirmation-confirm' }).click() ]); }, @@ -148,11 +190,11 @@ export default { isDefaultSearchParamsRequired: false, }), - selectFY:(FYName) => { + selectFY: (FYName) => { cy.do(Section({ id: 'fiscal-year-results-pane' }).find(Link(FYName)).click()); }, - expextFY:(FYName) => { + expextFY: (FYName) => { cy.expect(Section({ id: 'fiscal-year-results-pane' }).find(Link(FYName)).exists()); }, diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index d6facae6b2..2df9e41b2e 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -27,8 +27,10 @@ import getRandomPostfix from '../../../utils/stringTools'; import Describer from '../../../utils/describer'; import InteractorsTools from '../../../utils/interactorsTools'; -const createdFundNameXpath = '//*[@id="paneHeaderpane-fund-details-pane-title"]/h2/span'; -const numberOfSearchResultsHeader = '//*[@id="paneHeaderfund-results-pane-subtitle"]/span'; +const createdFundNameXpath = + '//*[@id="paneHeaderpane-fund-details-pane-title"]/h2/span'; +const numberOfSearchResultsHeader = + '//*[@id="paneHeaderfund-results-pane-subtitle"]/span'; const zeroResultsFoundText = '0 records found'; const budgetTitleXpath = '//*[@id="paneHeaderpane-budget-pane-title"]/h2/span'; const noItemsMessage = 'The list contains no items'; @@ -40,6 +42,8 @@ const currentBudgetSection = Section({ id: 'currentBudget' }); const actionsButton = Button('Actions'); const deleteButton = Button('Delete'); const transferButton = Button('Transfer'); +const FundsTab = Button('Fund'); +const searchField = SearchField({ id: 'input-record-search' }); const amountTextField = TextField({ name: 'amount' }); const confirmButton = Button('Confirm'); const newButton = Button('New'); @@ -59,7 +63,6 @@ const addTransferModal = Modal({ id: 'add-transfer-modal' }); const closeWithoutSavingButton = Button('Close without saving'); export default { - defaultUiFund: { name: `autotest_fund_${getRandomPostfix()}`, code: getRandomPostfix(), @@ -74,11 +77,11 @@ export default { allowableExpenditure: 100, budgetStatus: 'Active', }, - waitLoading : () => { + waitLoading: () => { cy.expect(Pane({ id: 'fund-results-pane' }).exists()); }, - waitLoadingTransactions : () => { + waitLoadingTransactions: () => { cy.expect(Pane({ id: 'transaction-results-pane' }).exists()); }, @@ -86,7 +89,7 @@ export default { cy.expect(MultiColumnList({ id: 'funds-list' }).has({ rowCount: 1 })); }, - waitForFundDetailsLoading : () => { + waitForFundDetailsLoading: () => { cy.do(Section({ id: 'pane-fund-details' }).visible()); }, @@ -98,7 +101,7 @@ export default { externalAccountField.fillIn(fund.externalAccount), ledgerSelection.open(), SelectionList().select(fund.ledgerName), - saveAndCloseButton.click() + saveAndCloseButton.click(), ]); this.waitForFundDetailsLoading(); }, @@ -133,7 +136,7 @@ export default { nameField.fillIn(fund.name), codeField.fillIn(fund.code), externalAccountField.fillIn(fund.externalAccountNo), - ledgerSelection.find(Button()).click() + ledgerSelection.find(Button()).click(), ]); }, @@ -142,7 +145,7 @@ export default { actionsButton.click(), Button('Edit').click(), MultiSelect({ label: 'Group' }).select([group]), - saveAndCloseButton.click() + saveAndCloseButton.click(), ]); }, @@ -157,7 +160,11 @@ export default { checkAddGroupToFund: (group) => { cy.expect(Pane({ id: 'pane-fund-details' }).exists()); - cy.expect(Accordion({ id: 'information' }).find(KeyValue({ value: group })).exists()); + cy.expect( + Accordion({ id: 'information' }) + .find(KeyValue({ value: group })) + .exists() + ); }, checkWarningMessageFundCodeUsed: () => { @@ -183,9 +190,22 @@ export default { Button('Agreements').click(), Button('Keep editing').click, cancelButton.click(), - closeWithoutSavingButton.click() + Button('Close without saving').click(), ]); }, + checkBudgetQuantity1: (quantityValue1, quantityValue2) => { + // TODO: refactor using interactors (Mutli column list) + cy.expect( + Section({ id: budgetPaneId }) + .find(HTML(including('Cash balance: $' + quantityValue1))) + .exists() + ); + cy.expect( + Section({ id: budgetPaneId }) + .find(HTML(including('Available balance: $' + quantityValue2))) + .exists() + ); + }, checkZeroSearchResultsHeader: () => { cy.xpath(numberOfSearchResultsHeader) @@ -198,7 +218,9 @@ export default { cy.do([ actionsButton.click(), deleteButton.click(), - Button('Delete', { id:'clickable-fund-remove-confirmation-confirm' }).click() + Button('Delete', { + id: 'clickable-fund-remove-confirmation-confirm', + }).click(), ]); cy.wait(4000); }, @@ -207,11 +229,10 @@ export default { cy.do(Accordion('Current budget').find(newButton).click()); cy.expect(Modal('Current budget').exists()); cy.do([ - Modal('Current budget').find(TextField({ name: 'allocated' })).fillIn(allocatedQuantity.toString()), - ]); - cy.wait(4000); - cy.do([ - Button('Save').click() + Modal('Current budget') + .find(TextField({ name: 'allocated' })) + .fillIn(allocatedQuantity.toString()), + Button('Save').click(), ]); }, @@ -228,11 +249,19 @@ export default { transactionList .find(MultiColumnListRow({ index: 0 })) .find(MultiColumnListCell({ columnIndex: 4 })) - .has({ content: `${fundCode}` }) + .has({ content: `${fundCode}` }), ]); }, - checkTransactionDetails: (indexNumber, fiscalYear, amount, source, type, fund, status) => { + checkTransactionDetails: ( + indexNumber, + fiscalYear, + amount, + source, + type, + fund, + status + ) => { cy.do( transactionList .find(MultiColumnListRow({ index: indexNumber })) @@ -240,16 +269,24 @@ export default { .click() ); cy.expect( - transactionDetailSection.find(KeyValue('Fiscal year')).has({ value: fiscalYear }), + transactionDetailSection + .find(KeyValue('Fiscal year')) + .has({ value: fiscalYear }), transactionDetailSection.find(KeyValue('Amount')).has({ value: amount }), transactionDetailSection.find(KeyValue('Source')).has({ value: source }), transactionDetailSection.find(KeyValue('Type')).has({ value: type }), transactionDetailSection.find(KeyValue('From')).has({ value: fund }), - transactionDetailSection.find(KeyValue('Status')).has({ value: status }), + transactionDetailSection.find(KeyValue('Status')).has({ value: status }) ); }, - checkPaymentInTransactionDetails: (indexNumber, fiscalYear, source, fund, amount) => { + checkPaymentInTransactionDetails: ( + indexNumber, + fiscalYear, + source, + fund, + amount + ) => { cy.do( transactionList .find(MultiColumnListRow({ index: indexNumber })) @@ -257,11 +294,13 @@ export default { .click() ); cy.expect( - transactionDetailSection.find(KeyValue('Fiscal year')).has({ value: fiscalYear }), + transactionDetailSection + .find(KeyValue('Fiscal year')) + .has({ value: fiscalYear }), transactionDetailSection.find(KeyValue('Amount')).has({ value: amount }), transactionDetailSection.find(KeyValue('Source')).has({ value: source }), transactionDetailSection.find(KeyValue('Type')).has({ value: 'Payment' }), - transactionDetailSection.find(KeyValue('From')).has({ value: fund }), + transactionDetailSection.find(KeyValue('From')).has({ value: fund }) ); }, @@ -282,28 +321,10 @@ export default { transactionList .find(MultiColumnListRow({ index: 1 })) .find(MultiColumnListCell({ columnIndex: 5 })) - .has({ content: 'PO line' }) + .has({ content: 'PO line' }), ]); }, - checkInvoiceInTransactionList: (indexnumber, type, amount, source) => { - cy.expect([ - transactionList - .find(MultiColumnListRow({ index: indexnumber })) - .find(MultiColumnListCell({ columnIndex: 1 })) - .has({ content: type }), - transactionList - .find(MultiColumnListRow({ index: indexnumber })) - .find(MultiColumnListCell({ columnIndex: 2 })) - .has({ content: `${amount}` }), - transactionList - .find(MultiColumnListRow({ index: indexnumber })) - .find(MultiColumnListCell({ columnIndex: 5 })) - .has({ content: source }) - ]); - }, - - increaseAllocation: () => { cy.do([ actionsButton.click(), @@ -327,7 +348,6 @@ export default { ]); }, - checkCreatedBudget: (fundCode, fiscalYear) => { cy.expect(budgetSummaryAcordion.exists()); cy.expect(budgetInformationAcordion.exists()); @@ -336,74 +356,167 @@ export default { .and('have.text', fundCode.concat('-', fiscalYear)); }, - checkFundingInformation: (amountInitialAllocation, amountIncreaseInAllocation, amountDecreaseInAllocation, amountTotalAllocated, amountNetTransfers, amountTotalFunding) => { + checkFundingInformation: ( + amountInitialAllocation, + amountIncreaseInAllocation, + amountDecreaseInAllocation, + amountTotalAllocated, + amountNetTransfers, + amountTotalFunding + ) => { cy.expect(budgetSummaryAcordion.exists()); cy.expect(budgetInformationAcordion.exists()); cy.expect([ - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-0' })).find(MultiColumnListCell({ content: 'Initial allocation' })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-0' })).find(MultiColumnListCell({ content: amountInitialAllocation })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-1' })).find(MultiColumnListCell({ content: 'Increase in allocation' })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-1' })).find(MultiColumnListCell({ content: amountIncreaseInAllocation })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-2' })).find(MultiColumnListCell({ content: 'Decrease in allocation' })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-2' })).find(MultiColumnListCell({ content: amountDecreaseInAllocation })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-3' })).find(MultiColumnListCell({ content: 'Total allocated' })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-3' })).find(MultiColumnListCell({ content: amountTotalAllocated })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-4' })).find(MultiColumnListCell({ content: 'Net transfers' })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-4' })).find(MultiColumnListCell({ content: amountNetTransfers })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-5' })).find(MultiColumnListCell({ content: 'Total funding' })).exists(), - fundingInformationMCList.find(MultiColumnListRow({ indexRow: 'row-5' })).find(MultiColumnListCell({ content: amountTotalFunding })).exists(), - ]); - }, - - checkFinancialActivityAndOverages: (amountEncumbered, amountAwaitingPayment, amountExpended, amountUnavailable) => { + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-0' })) + .find(MultiColumnListCell({ content: 'Initial allocation' })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-0' })) + .find(MultiColumnListCell({ content: amountInitialAllocation })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-1' })) + .find(MultiColumnListCell({ content: 'Increase in allocation' })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-1' })) + .find(MultiColumnListCell({ content: amountIncreaseInAllocation })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-2' })) + .find(MultiColumnListCell({ content: 'Decrease in allocation' })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-2' })) + .find(MultiColumnListCell({ content: amountDecreaseInAllocation })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-3' })) + .find(MultiColumnListCell({ content: 'Total allocated' })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-3' })) + .find(MultiColumnListCell({ content: amountTotalAllocated })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-4' })) + .find(MultiColumnListCell({ content: 'Net transfers' })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-4' })) + .find(MultiColumnListCell({ content: amountNetTransfers })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-5' })) + .find(MultiColumnListCell({ content: 'Total funding' })) + .exists(), + fundingInformationMCList + .find(MultiColumnListRow({ indexRow: 'row-5' })) + .find(MultiColumnListCell({ content: amountTotalFunding })) + .exists(), + ]); + }, + + checkFinancialActivityAndOverages: ( + amountEncumbered, + amountAwaitingPayment, + amountExpended, + amountUnavailable + ) => { cy.expect(budgetSummaryAcordion.exists()); cy.expect(budgetInformationAcordion.exists()); cy.expect([ - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-0' })).find(MultiColumnListCell({ content: 'Encumbered' })).exists(), - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-0' })).find(MultiColumnListCell({ content: amountEncumbered })).exists(), - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-1' })).find(MultiColumnListCell({ content: 'Awaiting payment' })).exists(), - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-1' })).find(MultiColumnListCell({ content: amountAwaitingPayment })).exists(), - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-2' })).find(MultiColumnListCell({ content: 'Expended' })).exists(), - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-2' })).find(MultiColumnListCell({ content: amountExpended })).exists(), - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-3' })).find(MultiColumnListCell({ content: 'Unavailable' })).exists(), - FinancialActivityAndOveragesMCList.find(MultiColumnListRow({ indexRow: 'row-3' })).find(MultiColumnListCell({ content: amountUnavailable })).exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-0' }) + ) + .find(MultiColumnListCell({ content: 'Encumbered' })) + .exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-0' }) + ) + .find(MultiColumnListCell({ content: amountEncumbered })) + .exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-1' }) + ) + .find(MultiColumnListCell({ content: 'Awaiting payment' })) + .exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-1' }) + ) + .find(MultiColumnListCell({ content: amountAwaitingPayment })) + .exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-2' }) + ) + .find(MultiColumnListCell({ content: 'Expended' })) + .exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-2' }) + ) + .find(MultiColumnListCell({ content: amountExpended })) + .exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-3' }) + ) + .find(MultiColumnListCell({ content: 'Unavailable' })) + .exists(), + FinancialActivityAndOveragesMCList.find( + MultiColumnListRow({ indexRow: 'row-3' }) + ) + .find(MultiColumnListCell({ content: amountUnavailable })) + .exists(), ]); }, checkBudgetQuantity: (quantityValue) => { // TODO: refactor using interactors (Mutli column list) - cy.expect(Section({ id: budgetPaneId }).find(HTML(including('Cash balance: $' + quantityValue.toFixed(2)))).exists()); - cy.expect(Section({ id: budgetPaneId }).find(HTML(including('Available balance: $' + quantityValue.toFixed(2)))).exists()); + cy.expect( + Section({ id: budgetPaneId }) + .find(HTML(including('Cash balance: $' + quantityValue.toFixed(2)))) + .exists() + ); + cy.expect( + Section({ id: budgetPaneId }) + .find( + HTML(including('Available balance: $' + quantityValue.toFixed(2))) + ) + .exists() + ); }, openTransactions: () => { - cy.expect(Section({ id: 'information' }).find(KeyValue('Transactions')).exists()); + cy.expect( + Section({ id: 'information' }).find(KeyValue('Transactions')).exists() + ); // TODO: refactor via using interactors. Simple click() doesn't work, need to find a way to work with child cy.xpath(viewTransactionsLinkXpath).click(); }, checkTransaction: (rowNumber, transaction) => { - Describer.getProperties(transaction) - .forEach(function (val) { - cy.expect(Pane({ id: transactionResultPaneId }) + Describer.getProperties(transaction).forEach(function (val) { + cy.expect( + Pane({ id: transactionResultPaneId }) .find(MultiColumnListRow({ index: rowNumber })) - .find(MultiColumnListCell({ content: transaction[val] })).exists()); - }); + .find(MultiColumnListCell({ content: transaction[val] })) + .exists() + ); + }); }, transferAmount: (amount, fundFrom, fundTo) => { - cy.do([ - actionsButton.click(), - transferButton.click() - ]); + cy.do([actionsButton.click(), transferButton.click()]); cy.expect(Modal('Transfer').exists()); cy.do([ TextField('Amount*').fillIn(amount.toString()), Selection('From').open(), - SelectionList().select((fundFrom.name).concat(' ', '(', fundFrom.code, ')')), + SelectionList().select( + fundFrom.name.concat(' ', '(', fundFrom.code, ')') + ), Selection('To').open(), - SelectionList().select((fundTo.name).concat(' ', '(', fundTo.code, ')')), - confirmButton.click() + SelectionList().select(fundTo.name.concat(' ', '(', fundTo.code, ')')), + confirmButton.click(), ]); }, @@ -412,7 +525,9 @@ export default { cy.do([ actionsButton.click(), deleteButton.click(), - Button('Delete', { id:'clickable-budget-remove-confirmation-confirm' }).click() + Button('Delete', { + id: 'clickable-budget-remove-confirmation-confirm', + }).click(), ]); this.waitForFundDetailsLoading(); }, @@ -421,14 +536,18 @@ export default { cy.do([ actionsButton.click(), deleteButton.click(), - Button('Delete', { id:'clickable-budget-remove-confirmation-confirm' }).click() + Button('Delete', { + id: 'clickable-budget-remove-confirmation-confirm', + }).click(), ]); cy.expect(Section({ id: 'summary' }).exists()); }, checkDeletedBudget: (budgetSectionId) => { cy.expect( - Section({ id: budgetSectionId }).find(HTML(including(noItemsMessage))).exists() + Section({ id: budgetSectionId }) + .find(HTML(including(noItemsMessage))) + .exists() ); }, @@ -450,28 +569,50 @@ export default { cy.do(Checkbox({ id: 'clickable-filter-fundStatus-inactive' }).click()); break; default: - cy.log('No such status like ' + fundStatus + '. Please use frozen, active or inactive'); + cy.log( + 'No such status like ' + + fundStatus + + '. Please use frozen, active or inactive' + ); } }, - checkFundFilters(ledgerName, fundType, fundStatus, aUnits, tags, groupName, fundName) { + checkFundFilters( + ledgerName, + fundType, + fundStatus, + aUnits, + tags, + groupName, + fundName + ) { // TODO: check how it can be achieved with interactors - cy.xpath('//*[@id="accordion-toggle-button-fundStatus"]').should('be.visible'); + cy.xpath('//*[@id="accordion-toggle-button-fundStatus"]').should( + 'be.visible' + ); this.selectStatusInSearch(fundStatus); // TODO: check how it can be achieved with interactors - cy.xpath('//*[@id="accordion-toggle-button-ledgerId"]').should('be.visible'); + cy.xpath('//*[@id="accordion-toggle-button-ledgerId"]').should( + 'be.visible' + ); cy.do([ Accordion({ id: 'ledgerId' }).clickHeader(), Selection({ id: 'ledgerId-selection' }).open(), - SelectionList({ id: 'sl-container-ledgerId-selection' }).select(ledgerName), + SelectionList({ id: 'sl-container-ledgerId-selection' }).select( + ledgerName + ), Accordion({ id: 'fundTypeId' }).clickHeader(), Selection({ id: 'fundTypeId-selection' }).open(), - SelectionList({ id: 'sl-container-fundTypeId-selection' }).select(fundType), + SelectionList({ id: 'sl-container-fundTypeId-selection' }).select( + fundType + ), Accordion({ id: 'groupFundFY.groupId' }).clickHeader(), Selection({ id: 'groupFundFY.groupId-selection' }).open(), - SelectionList({ id: 'sl-container-groupFundFY.groupId-selection' }).select(groupName), + SelectionList({ + id: 'sl-container-groupFundFY.groupId-selection', + }).select(groupName), Accordion({ id: 'acqUnitIds' }).clickHeader(), Selection({ id: 'acqUnitIds-selection' }).open(), @@ -496,64 +637,67 @@ export default { restrictEncumbrance: false, restrictExpenditures: false, acqUnitIds: '', - fiscalYearOneId: '' + fiscalYearOneId: '', }; cy.getAdminToken(); - cy.getAcqUnitsApi({ limit: 1 }) - .then( - ({ body }) => { - ledger.acqUnitIds = [body.acquisitionsUnits[0].id]; - cy.getFiscalYearsApi({ limit: 1 }) - .then((response) => { - ledger.fiscalYearOneId = response.body.fiscalYears[0].id; - cy.createLedgerApi({ - ...ledger - }); - fund.ledgerName = ledger.name; - cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); - cy.visit(TopMenu.fundPath); - this.createFund(fund); - this.checkCreatedFund(fund.name); - cy.wrap(ledger).as('createdLedger'); - return cy.get('@createdLedger'); - }); - } - ); + cy.getAcqUnitsApi({ limit: 1 }).then(({ body }) => { + ledger.acqUnitIds = [body.acquisitionsUnits[0].id]; + cy.getFiscalYearsApi({ limit: 1 }).then((response) => { + ledger.fiscalYearOneId = response.body.fiscalYears[0].id; + cy.createLedgerApi({ + ...ledger, + }); + fund.ledgerName = ledger.name; + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(TopMenu.fundPath); + this.createFund(fund); + this.checkCreatedFund(fund.name); + cy.wrap(ledger).as('createdLedger'); + return cy.get('@createdLedger'); + }); + }); return cy.get('@createdLedger'); }, openBudgetDetails: (fundCode, fiscalYear) => { cy.do([ - Accordion({ id: 'currentBudget' }).find(MultiColumnListCell({ content: fundCode.concat('-', fiscalYear) })).click() + Accordion({ id: 'currentBudget' }) + .find( + MultiColumnListCell({ content: fundCode.concat('-', fiscalYear) }) + ) + .click(), ]); }, - selectBudgetDetails:(rowNumber = 0) => { + selectBudgetDetails: (rowNumber = 0) => { cy.do([ - currentBudgetSection.find(MultiColumnListRow({ index: rowNumber })).click() + currentBudgetSection + .find(MultiColumnListRow({ index: rowNumber })) + .click(), ]); }, - selectPlannedBudgetDetails:(rowNumber = 0) => { + selectPlannedBudgetDetails: (rowNumber = 0) => { cy.do([ - Section({ id: 'plannedBudget' }).find(MultiColumnListRow({ index: rowNumber })).click() + Section({ id: 'plannedBudget' }) + .find(MultiColumnListRow({ index: rowNumber })) + .click(), ]); }, - checkIsBudgetDeleted:(rowNumber = 0) => { + checkIsBudgetDeleted: (rowNumber = 0) => { cy.expect([ - currentBudgetSection.find(MultiColumnListRow({ index: rowNumber })).absent() + currentBudgetSection + .find(MultiColumnListRow({ index: rowNumber })) + .absent(), ]); }, - editBudget:() => { - cy.do([ - actionsButton.click(), - Button('Edit').click() - ]); + editBudget: () => { + cy.do([actionsButton.click(), Button('Edit').click()]); }, - addExpensesClass:(firstExpenseClassName) => { + addExpensesClass: (firstExpenseClassName) => { cy.do([ Button({ id: 'budget-status-expense-classes-add-button' }).click(), Button({ name: 'statusExpenseClasses[0].expenseClassId' }).click(), @@ -563,11 +707,13 @@ export default { cy.do(saveAndCloseButton.click()); cy.wait(2000); }, - deleteExpensesClass:() => { + deleteExpensesClass: () => { cy.wait(2000); cy.do([ - Section({ id: 'expense-classes' }).find(Button({ icon: 'trash' })).click(), - saveAndCloseButton.click() + Section({ id: 'expense-classes' }) + .find(Button({ icon: 'trash' })) + .click(), + saveAndCloseButton.click(), ]); }, @@ -575,7 +721,7 @@ export default { return cy .okapiRequest({ path: 'finance/funds', - body: { fund:fundProperties }, + body: { fund: fundProperties }, method: 'POST', isDefaultSearchParamsRequired: false, }) @@ -620,70 +766,94 @@ export default { // Need wait, while data is loading cy.wait(4000); cy.do([ - MultiSelect({ id: 'fund-acq-units' }).find(Button({ ariaLabel: 'open menu' })).click(), + MultiSelect({ id: 'fund-acq-units' }) + .find(Button({ ariaLabel: 'open menu' })) + .click(), MultiSelectOption(AUName).click(), saveAndCloseButton.click(), ]); this.waitForFundDetailsLoading(); }, - selectTransaction:(inexRowNumber) => { + selectTransaction: (indexRowNumber) => { cy.do([ - MultiColumnListRow({ indexRow: inexRowNumber }).find(Link()).click(), + MultiColumnListRow({ indexRow: indexRowNumber }).find(Link()).click(), ]); }, - checkEncumbrance:(orderNumber) => { + checkEncumbrance: (orderNumber) => { cy.expect([ KeyValue('Amount').exists(), KeyValue({ value: '$0.00' }).exists(), - KeyValue({ value: `${orderNumber}-1` }) + KeyValue({ value: `${orderNumber}-1` }), ]); }, - checkPendingPayment:(invoiceNumber) => { + checkPendingPayment: (invoiceNumber) => { cy.expect(KeyValue({ value: invoiceNumber }).exists()); }, - checkCancelPendingPayment:(invoiceNumber) => { + checkCancelPendingPayment: (invoiceNumber) => { cy.expect(KeyValue({ value: invoiceNumber }).exists()); - cy.do(Section({ id: 'information' }).find(Button({ icon: 'info' })).click()); + cy.do( + Section({ id: 'information' }) + .find(Button({ icon: 'info' })) + .click() + ); + }, + clickOnFundsTab: () => { + cy.do([FundsTab.click()]); + }, + searchByName: (name) => { + cy.do([ + searchField.selectIndex('Name'), + searchField.fillIn(name), + Button('Search').click(), + ]); + cy.wait(4000); }, - selectFund:(FundName) => { + selectFund: (FundName) => { cy.do(Pane({ id: 'fund-results-pane' }).find(Link(FundName)).click()); }, - closeMenu:() => { + closeMenu: () => { cy.do(Button({ icon: 'times' }).click()); }, - closeTransactionDetails:() => { - cy.do(Section({ id: 'pane-transaction-details' }).find(Button({ icon: 'times' })).click()); + closeTransactionDetails: () => { + cy.do( + Section({ id: 'pane-transaction-details' }) + .find(Button({ icon: 'times' })) + .click() + ); }, - clickInfoInTransactionDetails:() => { - cy.do(Section({ id: 'pane-transaction-details' }).find(Button({ icon: 'info' })).click()); + clickInfoInTransactionDetails: () => { + cy.do( + Section({ id: 'pane-transaction-details' }) + .find(Button({ icon: 'info' })) + .click() + ); }, addAUToFund: (AUName) => { - cy.do([ - actionsButton.click(), - Button('Edit').click(), - ]); + cy.do([actionsButton.click(), Button('Edit').click()]); cy.wait(4000); cy.do([ - MultiSelect({ id: 'fund-acq-units' }).find(Button({ ariaLabel: 'open menu' })).click(), + MultiSelect({ id: 'fund-acq-units' }) + .find(Button({ ariaLabel: 'open menu' })) + .click(), MultiSelectOption(AUName).click(), - saveAndCloseButton.click() + saveAndCloseButton.click(), ]); cy.wait(4000); }, - moveAllocationWithError: (secondFund, amount) => { + moveAllocationWithError: (firstFund, secondFund, amount) => { + cy.do([actionsButton.click(), Button('Move allocation').click()]); + cy.wait(4000); cy.do([ - actionsButton.click(), - Button('Move allocation').click(), addTransferModal.find(Button({ name: 'fromFundId' })).click(), ]); cy.wait(6000); @@ -692,7 +862,9 @@ export default { addTransferModal.find(TextField({ name: 'amount' })).fillIn(amount), addTransferModal.find(confirmButton).click(), ]); - InteractorsTools.checkCalloutErrorMessage(`$${amount}.00 was not successfully allocated because ${secondFund.code} has no budget`); + InteractorsTools.checkCalloutErrorMessage( + `$50.00 was not successfully allocated because ${secondFund.code} has no budget` + ); cy.do(addTransferModal.find(cancelButton).click()); }, }; diff --git a/cypress/support/fragments/finance/groups/groups.js b/cypress/support/fragments/finance/groups/groups.js index 99feb17537..054377ae5d 100644 --- a/cypress/support/fragments/finance/groups/groups.js +++ b/cypress/support/fragments/finance/groups/groups.js @@ -68,10 +68,7 @@ export default { cy.do([ Section({ id: 'fund' }).find(Button('Add to group')).click(), fundModal.find(SearchField({ id: 'input-record-search' })).fillIn(fundName), - fundModal.find(Button({ type: 'submit'})).click(), - ]); - cy.wait(4000); - cy.do([ + fundModal.find(Button({ type: 'submit' })).click(), MultiColumnList({ id: 'list-plugin-find-records' }) .find(MultiColumnListHeader({ id:'list-column-ischecked' })) .find(Checkbox()) diff --git a/cypress/support/fragments/finance/ledgers/ledgers.js b/cypress/support/fragments/finance/ledgers/ledgers.js index f0275e103e..1ce22c4cb6 100644 --- a/cypress/support/fragments/finance/ledgers/ledgers.js +++ b/cypress/support/fragments/finance/ledgers/ledgers.js @@ -1,4 +1,5 @@ -import { Button, +import { + Button, Accordion, Checkbox, SelectionList, @@ -11,96 +12,145 @@ import { Button, Link, MultiColumnListCell, Modal, - MultiColumnList } from '../../../../../interactors'; + MultiColumnList, + MultiColumnListRow, + HTML, + including, +} from '../../../../../interactors'; import FinanceHelper from '../financeHelper'; import getRandomPostfix from '../../../utils/stringTools'; -const createdLedgerNameXpath = '//*[@id="paneHeaderpane-ledger-details-pane-title"]/h2/span'; -const numberOfSearchResultsHeader = '//*[@id="paneHeaderledger-results-pane-subtitle"]/span'; +const createdLedgerNameXpath = + '//*[@id="paneHeaderpane-ledger-details-pane-title"]/h2/span'; +const numberOfSearchResultsHeader = + '//*[@id="paneHeaderledger-results-pane-subtitle"]/span'; const rolloverButton = Button('Rollover'); +const continueButton = Button('Continue'); +const confirmButton = Button('Confirm'); +const ledgertab = Button('Ledger'); +const fundtab = Button('Fund'); +const fiscalYearTab = Button('Fiscal year'); const zeroResultsFoundText = '0 records found'; const fiscalYearCss = 'select[name^="fiscalYearOneId"]'; -const rolloverConfirmButton = Button({ id: 'clickable-rollover-confirmation-confirm' }); +const rolloverConfirmButton = Button({ + id: 'clickable-rollover-confirmation-confirm', +}); const fiscalYearSelect = Select({ name: 'toFiscalYearId' }); -const rolloverAllocationCheckbox = Checkbox({ name: 'budgetsRollover[0].rolloverAllocation' }); -const rolloverBudgetVelue = Select({ name: 'budgetsRollover[0].rolloverBudgetValue' }); -const addAvailableToSelect = Select({ name: 'budgetsRollover[0].addAvailableTo' }); +const rolloverAllocationCheckbox = Checkbox({ + name: 'budgetsRollover[0].rolloverAllocation', +}); +const rolloverBudgetVelue = Select({ + name: 'budgetsRollover[0].rolloverBudgetValue', +}); +const addAvailableToSelect = Select({ + name: 'budgetsRollover[0].addAvailableTo', +}); const resetButton = Button({ id: 'reset-ledgers-filters' }); + export default { defaultUiLedger: { name: `autotest_ledger_${getRandomPostfix()}`, ledgerStatus: 'Active', code: `test_automation_code_${getRandomPostfix()}`, - description: 'This is ledger created by E2E test automation script' + description: 'This is ledger created by E2E test automation script', }, - waitForLedgerDetailsLoading : () => { + waitForLedgerDetailsLoading: () => { cy.do(Section({ id: 'pane-ledger-details' }).visible); }, - rollover : () => { - cy.wait(8000); - - cy.do([ - Button('Actions').click(), - - ]); - cy.wait(8000); - - cy.do([ - - rolloverButton.click() - ]); + rollover: () => { + cy.do([Button('Actions').click(), rolloverButton.click()]); + }, + clickOnLedgerTab: () => { + cy.do([ledgertab.click()]); + }, + clickOnFiscalyearTab: () => { + cy.do([fiscalYearTab.click()]); + }, + clickOnFundTab: () => { + cy.do([fundtab.click()]); }, - closeRolloverInfo : () => { + closeRolloverInfo: () => { cy.do(Button('Close & view ledger details').click()); }, - closeOpenedPage : () => { + closeOpenedPage: () => { cy.do(Button({ icon: 'times' }).click()); }, - - selectFundInLedger : (fund) => { + selectFirstCheckBox: (fiscalYear) => { + cy.do(fiscalYearSelect.click()); + // Need to wait,while date of fiscal year will be loaded + cy.wait(3000); + cy.do([ + fiscalYearSelect.choose(fiscalYear), + Checkbox({ name: 'encumbrancesRollover[0].rollover' }).click(), + Select({ name: 'encumbrancesRollover[0].basedOn' }).choose('Expended'), + Checkbox({ name: 'encumbrancesRollover[2].rollover' }).click(), + Select({ name: 'encumbrancesRollover[2].basedOn' }).choose( + 'Initial encumbrance' + ), + Button('Test rollover').click(), + continueButton.click(), + confirmButton.click(), + ]); + }, + selectFundInLedger: (fund) => { cy.do([ - Section({ id: 'fund' }).find(MultiColumnListCell({ content: fund })).click(), + Section({ id: 'fund' }) + .find(MultiColumnListCell({ content: fund })) + .click(), ]); }, fillInRolloverInfo(fiscalYear) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded - cy.wait(8000); + cy.wait(3000); cy.do([ fiscalYearSelect.choose(fiscalYear), - rolloverAllocationCheckbox.click(), + // rolloverAllocationCheckbox.click(), Checkbox({ name: 'encumbrancesRollover[0].rollover' }).click(), Select({ name: 'encumbrancesRollover[0].basedOn' }).choose('Expended'), Checkbox({ name: 'encumbrancesRollover[2].rollover' }).click(), - Select({ name: 'encumbrancesRollover[2].basedOn' }).choose('Initial encumbrance'), + Select({ name: 'encumbrancesRollover[2].basedOn' }).choose( + 'Initial encumbrance' + ), rolloverButton.click(), ]); - cy.wait(8000); + cy.wait(4000); this.continueRollover(); - cy.wait(8000); - cy.do([ - rolloverConfirmButton.click(), - ]); + cy.do([rolloverConfirmButton.click()]); }, - continueRollover:() => { + continueRollover: () => { const continueButton = Button('Continue'); - cy.get('body').then($body => { + cy.get('body').then(($body) => { if ($body.find('[id=unpaid-invoice-list-modal]').length) { cy.wait(4000); - cy.do(Modal({ id: 'unpaid-invoice-list-modal' }).find(continueButton).click()); + cy.do( + Modal({ id: 'unpaid-invoice-list-modal' }) + .find(continueButton) + .click() + ); } else { // do nothing if modal is not displayed } }); }, + clickonViewledgerDetails: () => { + cy.do([Button('Close & view ledger details').click()]); + }, + resetAll() { + cy.do(Button('Reset all').click()); + }, - fillInRolloverForCashBalance(fiscalYear, rolloverBudgetValue, rolloverValueAs) { + fillInRolloverForCashBalance( + fiscalYear, + rolloverBudgetValue, + rolloverValueAs + ) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded cy.wait(3000); @@ -113,12 +163,28 @@ export default { ]); cy.wait(4000); this.continueRollover(); - cy.do([ - rolloverConfirmButton.click(), - ]); + cy.do([rolloverConfirmButton.click()]); + }, + selectFund: () => { + cy.do( + Section({ id: 'fund' }) + .find(MultiColumnListRow({ index: 0 })) + .click() + ); + }, + selectSecondFund: () => { + cy.do( + Section({ id: 'fund' }) + .find(MultiColumnListRow({ index: 1 })) + .click() + ); }, - fillInRolloverForCashBalanceWithNotActiveAllocation(fiscalYear, rolloverBudgetValue, rolloverValueAs) { + fillInRolloverForCashBalanceWithNotActiveAllocation( + fiscalYear, + rolloverBudgetValue, + rolloverValueAs + ) { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded cy.wait(3000); @@ -130,12 +196,14 @@ export default { ]); cy.wait(4000); this.continueRollover(); - cy.do([ - rolloverConfirmButton.click(), - ]); + cy.do([rolloverConfirmButton.click()]); }, - fillInTestRolloverInfoCashBalance : (fiscalYear, rolloverBudgetValue, rolloverValueAs) => { + fillInTestRolloverInfoCashBalance: ( + fiscalYear, + rolloverBudgetValue, + rolloverValueAs + ) => { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded cy.wait(3000); @@ -152,13 +220,13 @@ export default { ]); }, - checkZeroSearchResultsHeader : () => { + checkZeroSearchResultsHeader: () => { cy.xpath(numberOfSearchResultsHeader) .should('be.visible') .and('have.text', zeroResultsFoundText); }, - checkCreatedLedgerName : (ledger) => { + checkCreatedLedgerName: (ledger) => { cy.xpath(createdLedgerNameXpath) .should('be.visible') .and('have.text', ledger.name); @@ -171,8 +239,7 @@ export default { TextField('Code*').fillIn(defaultLedger.code), ]); // TODO: check ability to work through interactors - cy.get(fiscalYearCss) - .select(defaultLedger.fiscalYear); + cy.get(fiscalYearCss).select(defaultLedger.fiscalYear); cy.do(Button('Save & Close').click()); this.waitForLedgerDetailsLoading(); }, @@ -193,7 +260,7 @@ export default { Button('Agreements').click(), Button('Keep editing').click, Button('Cancel').click(), - Button('Close without saving').click() + Button('Close without saving').click(), ]); }, @@ -201,18 +268,24 @@ export default { cy.do([ Button('Actions').click(), Button('Delete').click(), - Button('Delete', { id:'clickable-ledger-remove-confirmation-confirm' }).click() + Button('Delete', { + id: 'clickable-ledger-remove-confirmation-confirm', + }).click(), ]); }, searchByStatusUnitsAndName(status, acquisitionUnitsName, ledgerName) { // TODO: check how it can be achieved with interactors - cy.xpath('//*[@id="accordion-toggle-button-ledgerStatus"]').should('be.visible'); + cy.xpath('//*[@id="accordion-toggle-button-ledgerStatus"]').should( + 'be.visible' + ); this.selectStatusInSearch(status); cy.do([ Accordion({ id: 'acqUnitIds' }).clickHeader(), Selection({ id: 'acqUnitIds-selection' }).open(), - SelectionList({ id: 'sl-container-acqUnitIds-selection' }).select(acquisitionUnitsName), + SelectionList({ id: 'sl-container-acqUnitIds-selection' }).select( + acquisitionUnitsName + ), SearchField({ id: 'input-record-search' }).fillIn(ledgerName), Button('Search').click(), ]); @@ -228,10 +301,16 @@ export default { cy.do(Checkbox({ id: 'clickable-filter-ledgerStatus-active' }).click()); break; case FinanceHelper.statusInactive: - cy.do(Checkbox({ id: 'clickable-filter-ledgerStatus-inactive' }).click()); + cy.do( + Checkbox({ id: 'clickable-filter-ledgerStatus-inactive' }).click() + ); break; default: - cy.log('No such status like ' + ledgerStatus + '. Please use frozen, active or inactive'); + cy.log( + 'No such status like ' + + ledgerStatus + + '. Please use frozen, active or inactive' + ); } }, @@ -240,7 +319,7 @@ export default { .okapiRequest({ path: 'finance/ledgers', body: ledgersProperties, - method: 'POST' + method: 'POST', }) .then((response) => { return response.body; @@ -250,55 +329,79 @@ export default { deleteledgerViaApi: (ledgerId) => cy.okapiRequest({ method: 'DELETE', path: `finance/ledgers/${ledgerId}`, - isDefaultSearchParamsRequired: false + isDefaultSearchParamsRequired: false, }), - selectLedger:(ledgerName) => { - cy.wait(8000); - + selectLedger: (ledgerName) => { cy.do(Pane({ id: 'ledger-results-pane' }).find(Link(ledgerName)).click()); }, - rolloverLogs:() => { - cy.do([ - Button('Actions').click(), - Button('Rollover logs').click() - ]); + rolloverLogs: () => { + cy.do([Button('Actions').click(), Button('Rollover logs').click()]); + }, + + checkFinancialSummeryQuality: (quantityValue1, quantityValue2) => { + cy.expect( + Section({ id: 'financial-summary' }) + .find(HTML(including('Cash balance: $' + quantityValue1))) + .exists() + ); + cy.expect( + Section({ id: 'financial-summary' }) + .find(HTML(including('Available balance: $' + quantityValue2))) + .exists() + ); }, - exportRollover:(dataFile) => { + exportRollover: (dataFile) => { cy.get('#rollover-logs-list') .find('div[role="gridcell"]') .contains('a', `${dataFile}-result`) .click(); }, - checkRolloverLogs:(dataFile) => { + checkRolloverLogs: (dataFile) => { cy.expect([ - MultiColumnList({ id: 'rollover-logs-list' }).find(MultiColumnListCell('Successful')).exists() + MultiColumnList({ id: 'rollover-logs-list' }) + .find(MultiColumnListCell('Successful')) + .exists(), ]); cy.get('#rollover-logs-list') .find('div[role="gridcell"]') - .contains('a', `${dataFile}-result`); + .contains('result', `${dataFile}-result`); cy.get('#rollover-logs-list') .find('div[role="gridcell"]') - .contains('a', `${dataFile}-settings`); + .contains('result', `${dataFile}-settings`); }, - - checkDownloadedFile(fileName, fund, secondFiscalYear, allowableEncumbrance, allowableExpenditure, initialAllocation, totalAllocation, totalFunding, cashBalance, available) { + checkDownloadedFile( + fileName, + fund, + secondFiscalYear, + allowableEncumbrance, + allowableExpenditure, + initialAllocation, + totalAllocation, + totalFunding, + cashBalance, + available + ) { cy.wait(3000); // wait for the file to load - cy.readFile(`cypress/downloads/${fileName}`).then(fileContent => { - // Split the contents of a file into lines + cy.readFile(`cypress/downloads/${fileName}`).then((fileContent) => { + // Split the contents of a file into lines const fileRows = fileContent.split('\n'); - expect(fileRows[0].trim()).to.equal('"Name (Fund)","Code (Fund)","Status (Fund)","Type","Group (Code)","Acquisition unit","Transfer from","Transfer to","External account number","Description","Name (Budget)","Status (Budget)","Allowable encumbrance","Allowable expenditure","Initial allocation","Increase","Decrease","Total allocation","Transfers","Total Funding","Encumbered (Budget)","Awaiting payment (Budget)","Expended (Budget)","Unavailable","Over encumbered","Over expended","Cash balance","Available","Name (Exp Class)","Code (Exp Class)","Status (Exp Class)","Encumbered (Exp Class)","Awaiting payment (Exp Class)","Expended (Exp Class)","Percentage of total expended"'); + expect(fileRows[0].trim()).to.equal( + '"Name (Fund)","Code (Fund)","Status (Fund)","Type","Group (Code)","Acquisition unit","Transfer from","Transfer to","External account number","Description","Name (Budget)","Status (Budget)","Allowable encumbrance","Allowable expenditure","Initial allocation","Increase","Decrease","Total allocation","Transfers","Total Funding","Encumbered (Budget)","Awaiting payment (Budget)","Expended (Budget)","Unavailable","Over encumbered","Over expended","Cash balance","Available","Name (Exp Class)","Code (Exp Class)","Status (Exp Class)","Encumbered (Exp Class)","Awaiting payment (Exp Class)","Expended (Exp Class)","Percentage of total expended"' + ); const actualData = fileRows[1].trim().split(','); expect(actualData[0]).to.equal(`"${fund.name}"`); expect(actualData[1]).to.equal(`"${fund.code}"`); expect(actualData[9]).to.equal(`"${fund.description}"`); - expect(actualData[10]).to.equal(`"${fund.code}-${secondFiscalYear.code}"`); + expect(actualData[10]).to.equal( + `"${fund.code}-${secondFiscalYear.code}"` + ); expect(actualData[12]).to.equal(allowableEncumbrance); expect(actualData[13]).to.equal(allowableExpenditure); expect(actualData[14]).to.equal(initialAllocation); @@ -314,7 +417,11 @@ export default { cy.exec(`del "${filePath}"`, { failOnNonZeroExit: false }); }, - fillInTestRolloverInfoCashBalanceWithNotActiveAllocation : (fiscalYear, rolloverBudgetValue, rolloverValueAs) => { + fillInTestRolloverInfoCashBalanceWithNotActiveAllocation: ( + fiscalYear, + rolloverBudgetValue, + rolloverValueAs + ) => { cy.do(fiscalYearSelect.click()); // Need to wait,while date of fiscal year will be loaded cy.wait(3000); @@ -329,5 +436,4 @@ export default { Button({ id: 'clickable-test-rollover-confirmation-confirm' }).click(), ]); }, - }; diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index f6bcbed4f8..a3f9ea6132 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -1,34 +1,35 @@ import { - Accordion, Button, - Checkbox, + TextField, + Selection, + SelectionList, + SearchField, KeyValue, - Link, + Accordion, + Pane, + PaneHeader, + MultiColumnListCell, Modal, + Checkbox, MultiColumnList, - MultiColumnListCell, MultiColumnListRow, - Pane, - PaneHeader, - SearchField, - Section, Select, - Selection, - SelectionList, - SelectionOption, - TextField, + Section, + Link, + SelectionOption } from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; import Helper from '../finance/financeHelper'; + const buttonNew = Button('New'); const saveAndClose = Button('Save & close'); const invoiceStates = { invoiceCreatedMessage: 'Invoice has been saved', invoiceLineCreatedMessage: 'Invoice line has been saved', - invoiceApprovedMessage: 'Invoice has been approved successfully', - invoicePaidMessage: 'Invoice has been paid successfully', - invoiceDeletedMessage: 'Invoice has been deleted', + InvoiceApprovedMessage: 'Invoice has been approved successfully', + InvoicePaidMessage: 'Invoice has been paid successfully', + InvoiceDeletedMessage: 'Invoice has been deleted' }; const vendorDetailsAccordionId = 'vendorDetails'; const invoiceLinesAccordionId = 'invoiceLines'; @@ -37,14 +38,11 @@ const submitButton = Button('Submit'); const searchButton = Button('Search'); const invoiceDetailsPaneId = 'paneHeaderpane-invoiceDetails'; const searhInputId = 'input-record-search'; -const numberOfSearchResultsHeader = - '//*[@id="paneHeaderinvoice-results-pane-subtitle"]/span'; +const numberOfSearchResultsHeader = '//*[@id="paneHeaderinvoice-results-pane-subtitle"]/span'; const zeroResultsFoundText = '0 records found'; const searchForm = SearchField({ id: 'input-record-search' }); const resetButton = Button({ id: 'reset-invoice-filters' }); -const invoiceLineDetailsPane = PaneHeader({ - id: 'paneHeaderpane-invoiceLineDetails', -}); +const invoiceLineDetailsPane = PaneHeader({ id: 'paneHeaderpane-invoiceLineDetails' }); const deleteButton = Button('Delete'); const invoiceFiltersSection = Section({ id: 'invoice-filters-pane' }); const batchGroupFilterSection = Section({ id: 'batchGroupId' }); @@ -52,12 +50,9 @@ const fundCodeFilterSection = Section({ id: 'fundCode' }); const fiscalYearFilterSection = Section({ id: 'fiscalYearId' }); const invoiceDateFilterSection = Section({ id: 'invoiceDate' }); const approvalDateFilterSection = Section({ id: 'approvalDate' }); -const newBlankLineButton = Button('New blank line'); -const polLookUpButton = Button('POL look-up'); -const selectOrderLinesModal = Modal('Select order lines'); -const fundInInvoiceSection = Section({ id: 'invoiceLineForm-fundDistribution' }); export default { + checkZeroSearchResultsHeader: () => { cy.xpath(numberOfSearchResultsHeader) .should('be.visible') @@ -82,7 +77,7 @@ export default { Selection('Batch group*').open(), SelectionList().select(invoice.batchGroup), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').click(), + Checkbox('Export to accounting').checked(false).click() ]); this.checkVendorPrimaryAddress(vendorPrimaryAddress); cy.do(saveAndClose.click()); @@ -104,7 +99,7 @@ export default { Selection('Batch group*').open(), SelectionList().select('FOLIO'), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').checked(false), + Checkbox('Export to accounting').checked(false) ]); cy.do(saveAndClose.click()); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); @@ -122,34 +117,12 @@ export default { ]); this.selectVendorOnUi(invoice.vendorName); cy.do([ - Selection('Accounting code*').open(), - SelectionList().select(`Default (${invoice.accountingCode})`), - Selection('Batch group*').open(), - SelectionList().select(invoice.batchGroup), - Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').click(), - ]); - cy.do(saveAndClose.click()); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); - }, - - createVendorInvoice(invoice) { - cy.do(actionsButton.click()); - cy.expect(buttonNew.exists()); - cy.do([ - buttonNew.click(), - Selection('Status*').open(), - SelectionList().select(invoice.status), - TextField('Invoice date*').fillIn(invoice.invoiceDate), - TextField('Vendor invoice number*').fillIn(invoice.invoiceNumber), - ]); - this.selectVendorOnUi(invoice.vendorName); - cy.do([ - Selection('Accounting code*').open(), + Selection('Accounting code').open(), SelectionList().select(`Default (${invoice.accountingCode})`), Selection('Batch group*').open(), SelectionList().select(invoice.batchGroup), Select({ id: 'invoice-payment-method' }).choose('Cash'), + Checkbox('Export to accounting').click() ]); cy.do(saveAndClose.click()); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); @@ -159,7 +132,7 @@ export default { cy.do([ Button('Organization look-up').click(), SearchField({ id: searhInputId }).fillIn(organizationName), - searchButton.click(), + searchButton.click() ]); Helper.selectFromResultsList(); }, @@ -180,21 +153,9 @@ export default { checkCreatedInvoice(invoice, vendorPrimaryAddress) { this.checkVendorPrimaryAddress(vendorPrimaryAddress); cy.expect(Pane({ id: 'pane-invoiceDetails' }).exists()); - cy.expect( - Accordion({ id: vendorDetailsAccordionId }) - .find(KeyValue({ value: invoice.invoiceNumber })) - .exists() - ); - cy.expect( - Accordion({ id: vendorDetailsAccordionId }) - .find(KeyValue({ value: invoice.vendorName })) - .exists() - ); - cy.expect( - Accordion({ id: vendorDetailsAccordionId }) - .find(KeyValue({ value: invoice.accountingCode })) - .exists() - ); + cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.invoiceNumber })).exists()); + cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.vendorName })).exists()); + cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.accountingCode })).exists()); }, deleteInvoiceViaActions() { @@ -208,75 +169,39 @@ export default { cy.do([ invoiceLineDetailsPane.find(actionsButton).click(), deleteButton.click(), - Modal({ id: 'delete-invoice-line-confirmation' }) - .find(deleteButton) - .click(), + Modal({ id: 'delete-invoice-line-confirmation' }).find(deleteButton).click() ]); }, confirmInvoiceDeletion: () => { - cy.do( - Button('Delete', { - id: 'clickable-delete-invoice-confirmation-confirm', - }).click() - ); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceDeletedMessage); + cy.do(Button('Delete', { id: 'clickable-delete-invoice-confirmation-confirm' }).click()); + InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceDeletedMessage); }, createInvoiceLine: (invoiceLine) => { - cy.do( - Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click() - ); + cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); cy.do(Button('New blank line').click()); // TODO: update using interactors once we will be able to pass negative value into text field cy.xpath('//*[@id="subTotal"]').type(invoiceLine.subTotal); cy.do([ TextField('Description*').fillIn(invoiceLine.description), TextField('Quantity*').fillIn(invoiceLine.quantity.toString()), - saveAndClose.click(), + saveAndClose.click() ]); - InteractorsTools.checkCalloutMessage( - invoiceStates.invoiceLineCreatedMessage - ); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); }, createInvoiceLinePOLLookUp: (orderNumber) => { - cy.do( - Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click() - ); + cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); cy.do(Button('New blank line').click()); cy.do([ Button('POL look-up').click(), - Modal('Select order lines') - .find(SearchField({ id: searhInputId })) - .fillIn(orderNumber), - searchButton.click(), - ]); - Helper.selectFromResultsList(); - cy.do(saveAndClose.click()); - InteractorsTools.checkCalloutMessage( - invoiceStates.invoiceLineCreatedMessage - ); - }, - - createInvoiceLinePOLLookUWithSubTotal: (orderNumber, total) => { - cy.do([ - Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), - newBlankLineButton.click() - ]); - cy.do([ - polLookUpButton.click(), - selectOrderLinesModal.find(SearchField({ id: searhInputId })).fillIn(orderNumber), + Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(orderNumber), searchButton.click() ]); Helper.selectFromResultsList(); - cy.get('input[name="subTotal"]').clear().type(total); - cy.do([ - fundInInvoiceSection.find(Button('%')).click(), - saveAndClose.click(), - ]); + cy.do(saveAndClose.click()); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); - cy.wait(4000); }, addLineFromPol: (orderNumber) => { @@ -284,97 +209,71 @@ export default { Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), Button('Add line from POL').click(), Modal('Select order lines').find(SearchField()).fillIn(orderNumber), - MultiColumnListRow({ index: (rowNumber = 0) }).click(), + MultiColumnListRow({ index: rowNumber = 0 }).click() ]); }, createInvoiceLineFromPol: (orderNumber, rowNumber = 0) => { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), - Button('Add line from POL').click(), + Button('Add line from POL').click() ]); - cy.expect(selectOrderLinesModal.exists()); + cy.expect(Modal('Select order lines').exists()); cy.do([ - Modal('Select order lines') - .find(SearchField({ id: searhInputId })) - .fillIn(orderNumber), + Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(orderNumber), Modal('Select order lines').find(searchButton).click(), Checkbox({ ariaLabel: `record ${rowNumber} checkbox` }).clickInput(), - Button('Save').click(), + Button('Save').click() ]); }, checkInvoiceLine: (invoiceLine, currency = '$') => { cy.expect(Accordion({ id: invoiceLinesAccordionId }).exists()); - cy.expect( - Accordion({ id: invoiceLinesAccordionId }) - .find(MultiColumnListCell({ content: invoiceLine.description })) - .exists() - ); - cy.expect( - Accordion({ id: invoiceLinesAccordionId }) - .find(MultiColumnListCell({ content: invoiceLine.quantity.toString() })) - .exists() - ); - cy.expect( - Accordion({ id: invoiceLinesAccordionId }) - .find( - MultiColumnListCell({ - content: currency.concat(invoiceLine.subTotal.toFixed(2)), - }) - ) - .exists() - ); + cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.description })).exists()); + cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.quantity.toString() })).exists()); + cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: currency.concat(invoiceLine.subTotal.toFixed(2)) })).exists()); }, addFundDistributionToLine: (invoiceLine, fund) => { cy.do([ - Accordion({ id: invoiceLinesAccordionId }) - .find(MultiColumnListCell({ content: invoiceLine.description })) - .click(), - invoiceLineDetailsPane.find(actionsButton).click(), + Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.description })).click(), + invoiceLineDetailsPane + .find(actionsButton).click(), Button('Edit').click(), Button({ id: 'fundDistributions-add-button' }).click(), Selection('Fund ID*').open(), - SelectionList().select(fund.name.concat(' ', '(', fund.code, ')')), - saveAndClose.click(), + SelectionList().select((fund.name).concat(' ', '(', fund.code, ')')), + saveAndClose.click() ]); - InteractorsTools.checkCalloutMessage( - invoiceStates.invoiceLineCreatedMessage - ); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); }, addFundToLine: (fund) => { cy.do([ Button({ id: 'fundDistributions-add-button' }).click(), Selection('Fund ID*').open(), - SelectionList().select(fund.name.concat(' ', '(', fund.code, ')')), - saveAndClose.click(), + SelectionList().select((fund.name).concat(' ', '(', fund.code, ')')), + saveAndClose.click() ]); - InteractorsTools.checkCalloutMessage( - invoiceStates.invoiceLineCreatedMessage - ); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); }, deleteFundInInvoiceLine: () => { cy.do([ - Section({ id: 'invoiceLineForm-fundDistribution' }) - .find(Button({ icon: 'trash' })) - .click(), - saveAndClose.click(), + Section({ id: 'invoiceLineForm-fundDistribution' }).find(Button({ icon: 'trash' })).click(), + saveAndClose.click() ]); - InteractorsTools.checkCalloutMessage( - invoiceStates.invoiceLineCreatedMessage - ); + InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); }, approveInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }) + .find(actionsButton).click(), Button('Approve').click(), - submitButton.click(), + submitButton.click() ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceApprovedMessage); + InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceApprovedMessage); }, searchByNumber: (invoiceNumber) => { @@ -385,30 +284,32 @@ export default { ]); }, - searchByParameter(parameter, values) { + searchByParameter(parameter, value) { cy.do([ searchForm.selectIndex(parameter), - searchForm.fillIn(values), + searchForm.fillIn(value), Button('Search').click(), ]); }, payInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }) + .find(actionsButton).click(), Button('Pay').click(), - submitButton.click(), + submitButton.click() ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoicePaidMessage); + InteractorsTools.checkCalloutMessage(invoiceStates.InvoicePaidMessage); }, updateCurrency: (currency) => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }) + .find(actionsButton).click(), Button('Edit').click(), Selection('Currency*').open(), SelectionList().select(currency), - saveAndClose.click(), + saveAndClose.click() ]); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); }, @@ -425,60 +326,39 @@ export default { switch (currencyShortName) { // TODO: add other currencies if needed case 'USD': - cy.expect( - Accordion({ id: 'extendedInformation' }) - .find(KeyValue({ value: 'US Dollar' })) - .exists() - ); + cy.expect(Accordion({ id: 'extendedInformation' }).find(KeyValue({ value: 'US Dollar' })).exists()); break; case 'EUR': - cy.expect( - Accordion({ id: 'extendedInformation' }) - .find(KeyValue({ value: 'Euro' })) - .exists() - ); + cy.expect(Accordion({ id: 'extendedInformation' }).find(KeyValue({ value: 'Euro' })).exists()); break; default: cy.log(`No such currency short name like ${currencyShortName}`); } }, - editVendorInvoiceNumber: () => { - cy.do([ - PaneHeader({ id: 'paneHeaderpane-invoiceDetails' }) - .find(actionsButton) - .click(), - Button('Edit').click(), - Button('Cancel').click(), - ]); - }, openPolSearchPlugin: () => { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), - Button('Add line from POL').click(), + Button('Add line from POL').click() ]); - cy.expect(selectOrderLinesModal.exists()); + cy.expect(Modal('Select order lines').exists()); }, checkSearchPolPlugin: (searchParamsMap, titleOrPackage) => { for (const [key, value] of searchParamsMap.entries()) { cy.do([ - Modal('Select order lines') - .find(SearchField({ id: searhInputId })) - .selectIndex(key), - Modal('Select order lines') - .find(SearchField({ id: searhInputId })) - .fillIn(value), - Modal('Select order lines').find(searchButton).click(), + Modal('Select order lines').find(SearchField({ id: searhInputId })).selectIndex(key), + Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(value), + Modal('Select order lines').find(searchButton).click() ]); // verify that first row in the result list contains related order line title - cy.expect( - MultiColumnList({ id: 'list-plugin-find-records' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 2 })) - .has({ content: titleOrPackage }) - ); - cy.do([Button({ id: 'reset-find-records-filters' }).click()]); + cy.expect(MultiColumnList({ id: 'list-plugin-find-records' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 2 })) + .has({ content: titleOrPackage })); + cy.do([ + Button({ id: 'reset-find-records-filters' }).click() + ]); // TODO: remove waiter - currenty it's a workaround for incorrect selection from search list cy.wait(1000); } @@ -491,39 +371,29 @@ export default { voucherExport: (batchGroup) => { cy.do([ PaneHeader({ id: 'paneHeaderinvoice-results-pane' }) - .find(actionsButton) - .click(), + .find(actionsButton).click(), Button('Voucher export').click(), Select().choose(batchGroup), Button('Run manual export').click(), - Button({ - id: 'clickable-run-manual-export-confirmation-confirm', - }).click(), + Button({ id: 'clickable-run-manual-export-confirmation-confirm' }).click(), ]); cy.wait(2000); - cy.do( - MultiColumnList({ id: 'batch-voucher-exports' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 3 })) - .find(Button({ icon: 'download' })) - .click() - ); + cy.do(MultiColumnList({ id: 'batch-voucher-exports' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 3 })) + .find(Button({ icon: 'download' })) + .click()); }, - getSearchParamsMap(orderNumber, orderLine) { const searchParamsMap = new Map(); - searchParamsMap - .set('Keyword', orderNumber) + searchParamsMap.set('Keyword', orderNumber) .set('Contributor', orderLine.contributors[0].contributor) .set('PO line number', orderNumber.toString().concat('-1')) .set('Requester', orderLine.requester) .set('Title or package name', orderLine.titleOrPackage) .set('Publisher', orderLine.publisher) .set('Vendor account', orderLine.vendorDetail.vendorAccount) - .set( - 'Vendor reference number', - orderLine.vendorDetail.referenceNumbers[0].refNumber - ) + .set('Vendor reference number', orderLine.vendorDetail.referenceNumbers[0].refNumber) .set('Donor', orderLine.donor) .set('Selector', orderLine.selector) .set('Volumes', orderLine.physical.volumes[0]) @@ -532,39 +402,32 @@ export default { return searchParamsMap; }, - waitLoading: () => { + waitLoading : () => { cy.expect(Pane({ id: 'invoice-results-pane' }).exists()); }, selectInvoiceLine: () => { - cy.do( - Section({ id: 'invoiceLines' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .click() - ); + cy.do(Section({ id: 'invoiceLines' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .click()); }, cancelInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }) + .find(actionsButton).click(), Button('Cancel').click(), - submitButton.click(), + submitButton.click() ]); }, - selectInvoice: (invoiceNumber) => { - cy.do( - Pane({ id: 'invoice-results-pane' }).find(Link(invoiceNumber)).click() - ); + selectInvoice:(invoiceNumber) => { + cy.do(Pane({ id: 'invoice-results-pane' }).find(Link(invoiceNumber)).click()); }, - closeInvoiceDetailsPane: () => { - cy.do( - Pane({ id: 'pane-invoiceDetails' }) - .find(Button({ icon: 'times' })) - .click() - ); + closeInvoiceDetailsPane:() => { + cy.do(Pane({ id: 'pane-invoiceDetails' }).find(Button({ icon: 'times' })).click()); }, resetFilters: () => { @@ -572,127 +435,84 @@ export default { cy.expect(resetButton.is({ disabled: true })); }, - editInvoiceLine: () => { + editInvoiceLine:() => { cy.do([ Section({ id: 'pane-invoiceLineDetails' }).find(actionsButton).click(), Button('Edit').click(), ]); }, - addAdjustment: (descriptionInput, valueInput, typeToggle, realtioToTotal) => { + addAdjustment:(descriptionInput, valueInput, typeToggle, realtioToTotal) => { cy.do([ Button({ id: 'adjustments-add-button' }).click(), - TextField({ name: 'adjustments[0].description' }).fillIn( - descriptionInput - ), + TextField({ name: 'adjustments[0].description' }).fillIn(descriptionInput), TextField({ name: 'adjustments[0].value' }).fillIn(valueInput), - Section({ id: 'invoiceLineForm-adjustments' }) - .find(Button(typeToggle)) - .click(), + Section({ id: 'invoiceLineForm-adjustments' }).find(Button(typeToggle)).click(), Select({ name: 'adjustments[0].relationToTotal' }).choose(realtioToTotal), saveAndClose.click(), ]); }, - checkFundInInvoiceLine: (fund) => { - cy.expect( - Section({ id: 'invoiceLineFundDistribution' }) - .find(Link(`${fund.name}(${fund.code})`)) - .exists() - ); + checkFundInInvoiceLine:(fund) => { + cy.expect(Section({ id: 'invoiceLineFundDistribution' }).find(Link(`${fund.name}(${fund.code})`)).exists()); }, - selectStatusFilter: (status) => { + selectStatusFilter:(status) => { cy.do([ - invoiceFiltersSection - .find(Section({ id: 'status' })) - .find(Button({ ariaLabel: 'Status filter list' })) - .click(), + invoiceFiltersSection.find(Section({ id: 'status' })).find(Button({ ariaLabel: 'Status filter list' })).click(), Checkbox(status).click(), ]); }, selectVendorFilter: (organization) => { cy.do([ - invoiceFiltersSection - .find(Section({ id: 'vendorId' })) - .find(Button({ ariaLabel: 'Vendor name filter list' })) - .click(), + invoiceFiltersSection.find(Section({ id: 'vendorId' })).find(Button({ ariaLabel: 'Vendor name filter list' })).click(), Button('Organization look-up').click(), - Modal('Select Organization') - .find(SearchField({ id: searhInputId })) - .fillIn(organization.name), + Modal('Select Organization').find(SearchField({ id: searhInputId })).fillIn(organization.name), searchButton.click(), ]); Helper.selectFromResultsList(); }, - selectApprovalDateFilter: (dateFrom, dateTo) => { + selectApprovalDateFilter:(dateFrom, dateTo) => { cy.do([ - invoiceFiltersSection - .find(approvalDateFilterSection) - .find(Button({ ariaLabel: 'Approval date filter list' })) - .click(), - approvalDateFilterSection - .find(TextField({ name: 'startDate' })) - .fillIn(dateFrom), - approvalDateFilterSection - .find(TextField({ name: 'endDate' })) - .fillIn(dateTo), + invoiceFiltersSection.find(approvalDateFilterSection).find(Button({ ariaLabel: 'Approval date filter list' })).click(), + approvalDateFilterSection.find(TextField({ name: 'startDate' })).fillIn(dateFrom), + approvalDateFilterSection.find(TextField({ name: 'endDate' })).fillIn(dateTo), approvalDateFilterSection.find(Button('Apply')).click(), ]); }, - selectInvoiceDateFilter: (dateFrom, dateTo) => { + selectInvoiceDateFilter:(dateFrom, dateTo) => { cy.do([ - invoiceFiltersSection - .find(invoiceDateFilterSection) - .find(Button({ ariaLabel: 'Invoice date filter list' })) - .click(), - invoiceDateFilterSection - .find(TextField({ name: 'startDate' })) - .fillIn(dateFrom), - invoiceDateFilterSection - .find(TextField({ name: 'endDate' })) - .fillIn(dateTo), + invoiceFiltersSection.find(invoiceDateFilterSection).find(Button({ ariaLabel: 'Invoice date filter list' })).click(), + invoiceDateFilterSection.find(TextField({ name: 'startDate' })).fillIn(dateFrom), + invoiceDateFilterSection.find(TextField({ name: 'endDate' })).fillIn(dateTo), invoiceDateFilterSection.find(Button('Apply')).click(), ]); }, - selectFundCodeFilter: (fundCode) => { + selectFundCodeFilter:(fundCode) => { cy.do([ - invoiceFiltersSection - .find(fundCodeFilterSection) - .find(Button({ ariaLabel: 'Fund code filter list' })) - .click(), + invoiceFiltersSection.find(fundCodeFilterSection).find(Button({ ariaLabel: 'Fund code filter list' })).click(), fundCodeFilterSection.find(Button({ id: 'fundCode-selection' })).click(), fundCodeFilterSection.find(SelectionOption(fundCode)).click(), ]); }, - selectFiscalYearFilter: (fiscalYear) => { + selectFiscalYearFilter:(fiscalYear) => { cy.do([ - invoiceFiltersSection - .find(fiscalYearFilterSection) - .find(Button({ ariaLabel: 'Fiscal year filter list' })) - .click(), - fiscalYearFilterSection - .find(Button({ id: 'fiscalYearId-selection' })) - .click(), + invoiceFiltersSection.find(fiscalYearFilterSection).find(Button({ ariaLabel: 'Fiscal year filter list' })).click(), + fiscalYearFilterSection.find(Button({ id: 'fiscalYearId-selection' })).click(), fiscalYearFilterSection.find(SelectionOption(fiscalYear)).click(), ]); }, - selectButchGroupFilter: (batchGroup) => { + selectButchGroupFilter:(batchGroup) => { cy.do([ - invoiceFiltersSection - .find(batchGroupFilterSection) - .find(Button({ ariaLabel: 'Batch group filter list' })) - .click(), - batchGroupFilterSection - .find(Button({ id: 'batchGroupId-selection' })) - .click(), + invoiceFiltersSection.find(batchGroupFilterSection).find(Button({ ariaLabel: 'Batch group filter list' })).click(), + batchGroupFilterSection.find(Button({ id: 'batchGroupId-selection' })).click(), batchGroupFilterSection.find(SelectionOption(batchGroup)).click(), ]); }, -}; +}; \ No newline at end of file From 96586b9e0ce1151b0f8923fbbe8ad5048792986a Mon Sep 17 00:00:00 2001 From: Vineethasakhamuri <117971735+Vineethasakhamuri@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:06:03 +0530 Subject: [PATCH 26/55] circulationlog/vineethaideyalabs (#1385) --- cypress/e2e/ideyalabs/circulationLog.cy.js | 63 +++++++++++++++++++ .../fragments/users/usersSearchPane.js | 2 +- cypress/support/ideyalabs/circulationlog.js | 33 ++++++++++ 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/ideyalabs/circulationLog.cy.js create mode 100644 cypress/support/ideyalabs/circulationlog.js diff --git a/cypress/e2e/ideyalabs/circulationLog.cy.js b/cypress/e2e/ideyalabs/circulationLog.cy.js new file mode 100644 index 0000000000..8cc1c6265b --- /dev/null +++ b/cypress/e2e/ideyalabs/circulationLog.cy.js @@ -0,0 +1,63 @@ +import devTeams from '../../support/dictionary/devTeams'; +import testTypes from '../../support/dictionary/testTypes'; +import searchPane from '../../support/fragments/circulation-log/searchPane'; +import marcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import topMenu from '../../support/fragments/topMenu'; +import usersSearchPane from '../../support/fragments/users/usersSearchPane'; +import circulationlog from '../../support/ideyalabs/circulationlog'; + +const testData = { + itemA: '4502015', + barcode: '43505853', + accordion: 'notice', + checkboxOption: 'Send', + resultsPaneHeadings: { + userBarcode: 'User barcode', + itemBarcode: 'Item barcode', + object: 'Object', + circAction: 'Circ action', + date: 'Date', + servicePoint: 'Service point', + source: 'Source', + description: 'Description' + }, +}; + +describe('CirculationLog App', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it('C17092 Filter circulation log by (notice) send (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + cy.visit(topMenu.circulationLogPath); + searchPane.setFilterOptionFromAccordion( + testData.accordion, + testData.checkboxOption + ); + searchPane.verifyResult(testData.checkboxOption); + searchPane.resetFilters(); + searchPane.searchByItemBarcode(testData.barcode); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.userBarcode); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.itemBarcode); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.object); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.circAction); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.date); + marcAuthorities.checkColumnExists( + testData.resultsPaneHeadings.servicePoint + ); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.source); + marcAuthorities.checkColumnExists(testData.resultsPaneHeadings.description); + searchPane.verifyResult(testData.checkboxOption); + }); + + it('C16999 Filter circulation log by Closed loan', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.usersPath); + usersSearchPane.searchByStatus('Active'); + circulationlog.clickOnStatus(); + cy.visit(topMenu.checkInPath); + circulationlog.checkIn(testData.itemA); + cy.visit(topMenu.circulationLogPath); + searchPane.searchByCheckedOut(); + searchPane.verifyClosedloanlist(); + }); +}); diff --git a/cypress/support/fragments/users/usersSearchPane.js b/cypress/support/fragments/users/usersSearchPane.js index 940921b480..6d98562095 100644 --- a/cypress/support/fragments/users/usersSearchPane.js +++ b/cypress/support/fragments/users/usersSearchPane.js @@ -12,7 +12,7 @@ import { } from '../../../../interactors'; // Cypress clicks before the UI loads, use when there is no way to attach waiter to element -const waitClick = () => { cy.wait(1000); }; +const waitClick = () => { cy.wait(1000)}; export default { waitLoading:() => cy.expect(PaneHeader('User search').exists()), diff --git a/cypress/support/ideyalabs/circulationlog.js b/cypress/support/ideyalabs/circulationlog.js new file mode 100644 index 0000000000..241b161af6 --- /dev/null +++ b/cypress/support/ideyalabs/circulationlog.js @@ -0,0 +1,33 @@ +import { + Button, + Link, + MultiColumnListRow, + PaneContent, + Section, + TextField, +} from '../../../interactors'; +import usersSearchPane from '../fragments/users/usersSearchPane'; + +const userSearchPaneContent = PaneContent({ + id: 'users-search-results-pane-content', +}); + +export default { + clickOnStatus() { + usersSearchPane.searchByStatus('Active'); + cy.do([ + userSearchPaneContent + .find(MultiColumnListRow({ index: 2 }).find(Link('A2L 1, Holly'))) + .click(), + Button({ id: 'accordion-toggle-button-loansSection' }).click(), + Section({ id: 'loansSection' }).find(Link('1 open loan')).click(), + ]); + }, + + checkIn: (barcode) => { + cy.do([ + TextField('Item ID').fillIn(barcode), + Button('Enter').click(), + ]); + }, +}; From 8a5724d0e3b2864b0141691ad9331dfd8d1a7e03 Mon Sep 17 00:00:00 2001 From: pavithradasari <139527611+pavithradasari@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:17:26 +0530 Subject: [PATCH 27/55] agreements/pavithradasari (#1386) * fix for tests Co-authored-by: SantoshIdeyalabs --- .../e2e/ideyalabs/agreements/agreements.cy.js | 43 +++++ .../B_exportManager.cy.js | 5 +- .../available-balance-is-displayed.cy.js | 3 +- ...cumbrances-are-rolled-over-correctly.cy.js | 3 +- ...-for-one-ledger-and-same-fiscal year.cy.js | 3 +- .../funds/correct-fund-validation.cy.js | 3 +- .../editing-fund-distribution-in-pol.cy.js | 3 +- .../re-exported-order.cy.js | 3 +- ...ses-with-payment-not-required-status.cy.js | 3 +- .../patron-notice.cy.js | 3 +- cypress/support/dictionary/devTeams.js | 2 +- .../fragments/agreements/agreementsDetails.js | 33 ++-- .../fragments/agreements/newAgreement.js | 157 +++++++++++++----- .../fragments/eholdings/eHoldingsPackages.js | 61 ++++--- cypress/support/utils/stringTools.js | 2 + 15 files changed, 236 insertions(+), 91 deletions(-) create mode 100644 cypress/e2e/ideyalabs/agreements/agreements.cy.js diff --git a/cypress/e2e/ideyalabs/agreements/agreements.cy.js b/cypress/e2e/ideyalabs/agreements/agreements.cy.js new file mode 100644 index 0000000000..260cf8466f --- /dev/null +++ b/cypress/e2e/ideyalabs/agreements/agreements.cy.js @@ -0,0 +1,43 @@ +import testTypes from '../../../support/dictionary/testTypes'; +import agreementsDetails from '../../../support/fragments/agreements/agreementsDetails'; +import newAgreement from '../../../support/fragments/agreements/newAgreement'; +import eHoldingsPackages from '../../../support/fragments/eholdings/eHoldingsPackages'; +import topMenu from '../../../support/fragments/topMenu'; +import dateTools from '../../../support/utils/dateTools'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +const defaultAgreement = { + name: `autotest_agreement_${getRandomPostfix()}`, + status: 'Active', + startDate: dateTools.getCurrentDate() +}; +describe('Agreement', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Delete test data', () => { + newAgreement.findAgreement(defaultAgreement); + newAgreement.deleteAgreement(); + newAgreement.searchAgreement(); + agreementsDetails.remove(); + }); + + it('C757 Create an Agreement (ERM)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.agreementsPath); + newAgreement.newButtonClick(); + newAgreement.fill(); + newAgreement.save(); + newAgreement.validateDateAndTime(); + }); + + it('C1295 Create a new Agreement and attach a package (spitfire)', { tags: [testTypes.ideaLabsTests] }, () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsPackages.packageSearch(); + eHoldingsPackages.openPackage(); + newAgreement.newButton(); + newAgreement.fill(defaultAgreement); + newAgreement.save(); + newAgreement.agreementLine(); + }); +}); diff --git a/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js index f8fb6544cb..ba7ae891ab 100644 --- a/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js +++ b/cypress/e2e/ideyalabs/export-manager/export-orders-in-edifact-format/orders-export-to-a-vendor/B_exportManager.cy.js @@ -1,5 +1,4 @@ import exportJobs from '../../../../../support/ideyalabs/exportJobs'; -import devTeams from '../../../../../support/dictionary/devTeams'; import testTypes from '../../../../../support/dictionary/testTypes'; import exportManagerSearchPane from '../../../../../support/fragments/exportManager/exportManagerSearchPane'; import topMenu from '../../../../../support/fragments/topMenu'; @@ -20,7 +19,7 @@ describe('Export Manager', () => { it( 'C358971 Already exported order is not included repeatedly in next exports(thunderjet)', - { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, + { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.exportManagerOrganizationsPath); exportManagerSearchPane.selectExportMethod(testData.integrationMethod); @@ -38,7 +37,7 @@ describe('Export Manager', () => { it( 'C365123 Downloading the exact .edi file that was exported for a given export job with Successful status(thunderjet)', - { tags: [testTypes.extendedPath, devTeams.thunderjet] }, + { tags: [testTypes.extendedPath] }, () => { cy.visit(topMenu.exportManagerOrganizationsPath); exportManagerSearchPane.selectExportMethod(testData.exportMethod); diff --git a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js index b5e84fae01..4bf2eaaa76 100644 --- a/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js +++ b/cypress/e2e/ideyalabs/finance/available-balance-is-displayed.cy.js @@ -5,7 +5,6 @@ import groups from '../../../support/fragments/finance/groups/groups'; import ledgers from '../../../support/fragments/finance/ledgers/ledgers'; import topMenu from '../../../support/fragments/topMenu'; import testTypes from '../../../support/dictionary/testTypes'; -import devTeams from '../../../support/dictionary/devTeams'; const testData = { fiscalName: 'Fiscal Year 2024', @@ -56,7 +55,7 @@ describe('Finance: Funds', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C377030 "Available balance" is displayed as a negative number when running a deficit(Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + it('C377030 "Available balance" is displayed as a negative number when running a deficit(Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.financePath); fiscalYears.clickOnFiscalYear(); financeHelper.searchByName(testData.fiscalName); diff --git a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js index 429deb521a..f0ed0f6af2 100644 --- a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js +++ b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/encumbrances-are-rolled-over-correctly.cy.js @@ -3,7 +3,6 @@ import ledgers from '../../../../support/fragments/finance/ledgers/ledgers'; import invoices from '../../../../support/fragments/invoices/invoices'; import topMenu from '../../../../support/fragments/topMenu'; import testTypes from '../../../../support/dictionary/testTypes'; -import devTeams from '../../../../support/dictionary/devTeams'; const testData = { fiscalName: 'Fiscal Year 2024', @@ -83,7 +82,7 @@ describe('Finance: Fiscal Year Rollover', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C375267 Encumbrances are rolled over correctly when order fund distribution was changed and related paid invoice exists (based on Remaining) (Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + it('C375267 Encumbrances are rolled over correctly when order fund distribution was changed and related paid invoice exists (based on Remaining) (Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.financePath); financeHelper.searchByName(encumbranceData.searchByName); financeHelper.selectFirstLedger(encumbranceData.selectFirstLedger); diff --git a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js index b5419d59e0..f4392b981c 100644 --- a/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js +++ b/cypress/e2e/ideyalabs/finance/fiscal-year-rollover/preview-for-one-ledger-and-same-fiscal year.cy.js @@ -3,7 +3,6 @@ import ledgers from '../../../../support/fragments/finance/ledgers/ledgers'; import invoices from '../../../../support/fragments/invoices/invoices'; import topMenu from '../../../../support/fragments/topMenu'; import testTypes from '../../../../support/dictionary/testTypes'; -import devTeams from '../../../../support/dictionary/devTeams'; const rollOverData = { ledgerName: 'AE2', @@ -26,7 +25,7 @@ describe('Finance: Fiscal Year Rollover', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C359604 Make more than one preview for one ledger and same fiscal year with ""Test rollover"", check test rollover results(Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + it('C359604 Make more than one preview for one ledger and same fiscal year with ""Test rollover"", check test rollover results(Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.financePath); financeHelper.searchByName(rollOverData.ledgerName); financeHelper.selectFirstLedger(rollOverData.selectLedger); diff --git a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js index 0d754643d1..084f3cb7fb 100644 --- a/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js +++ b/cypress/e2e/ideyalabs/finance/funds/correct-fund-validation.cy.js @@ -4,7 +4,6 @@ import topMenu from '../../../../support/fragments/topMenu'; import dateTools from '../../../../support/utils/dateTools'; import getRandomPostfix from '../../../../support/utils/stringTools'; import testTypes from '../../../../support/dictionary/testTypes'; -import devTeams from '../../../../support/dictionary/devTeams'; const orderOne = { templateName: 'Adlibris book order (adlibris)', @@ -58,7 +57,7 @@ describe('ui-invoices: Invoice creation', () => { it( 'C353566 Correct fund validation to approve invoice (thunderjet)', - { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, + { tags: [testTypes.ideaLabsTests] }, () => { invoice.createOrder(orderOne.orderType, orderOne.templateName); invoice.POLines(orderOnePOLine.title, orderOnePOLine.fundID); diff --git a/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js index aa866a6a3e..ca1cce5b27 100644 --- a/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js +++ b/cypress/e2e/ideyalabs/orders/editing-fund-distribution-in-pol.cy.js @@ -1,7 +1,6 @@ import invoice from '../../../support/fragments/ideyalabs/invoice'; import topMenu from '../../../support/fragments/topMenu'; import testTypes from '../../../support/dictionary/testTypes'; -import devTeams from '../../../support/dictionary/devTeams'; const searchInvoiceNumber = { parameter: 'Keyword', @@ -18,7 +17,7 @@ describe('Orders', () => { it( 'C368486 Editing fund distribution in PO line when related Reviewed invoice exists (thunderjet)', - { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, + { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.orderLinesPath); invoice.searchByParameter( diff --git a/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js index 4a6e7d65f2..9a294037ab 100644 --- a/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js +++ b/cypress/e2e/ideyalabs/orders/export-in-edifact-format/re-exported-order.cy.js @@ -1,14 +1,13 @@ import order from '../../../../support/ideyaLabs/orders'; import topMenu from '../../../../support/fragments/topMenu'; import testTypes from '../../../../support/dictionary/testTypes'; -import devTeams from '../../../../support/dictionary/devTeams'; describe('Orders: Export in edifact format ', () => { before(() => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C365619 Re-exported Order contains more than two PO lines is successfully exported in the next scheduled run (Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + it('C365619 Re-exported Order contains more than two PO lines is successfully exported in the next scheduled run (Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.ordersPath); order.switchToOrders(); order.status(); diff --git a/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js b/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js index b8300cde53..a72d36a89f 100644 --- a/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js +++ b/cypress/e2e/ideyalabs/orders/receiving-and-check-in/encumbrance-releases-with-payment-not-required-status.cy.js @@ -3,7 +3,6 @@ import orderLines from '../../../../support/fragments/orders/orderLines'; import receiving from '../../../../support/fragments/receiving/receiving'; import topMenu from '../../../../support/fragments/topMenu'; import testTypes from '../../../../support/dictionary/testTypes'; -import devTeams from '../../../../support/dictionary/devTeams'; const orderDetails = { searchByParameter: 'PO line number', @@ -23,7 +22,7 @@ describe('Orders: Receiving and Check-in ', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C378899 Encumbrance releases when receive piece for order with payment status "Payment Not Required" (Thunderjet)', { tags: [testTypes.ideaLabsTests, devTeams.thunderjet] }, () => { + it('C378899 Encumbrance releases when receive piece for order with payment status "Payment Not Required" (Thunderjet)', { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(topMenu.ordersPath); orderLines.clickOnOrderLines(); orderLines.searchByParameter( diff --git a/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js b/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js index fd11ee7673..7bbe13ad6e 100644 --- a/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js +++ b/cypress/e2e/ideyalabs/title-level-request/request-notice-itle-level-request-settings/patron-notice.cy.js @@ -1,7 +1,6 @@ import titleLevelRequests from '../../../../support/fragments/settings/circulation/titleLevelRequests'; import SettingsMenu from '../../../../support/fragments/settingsMenu'; import testTypes from '../../../../support/dictionary/testTypes'; -import devTeams from '../../../../support/dictionary/devTeams'; const patronData = { notice1: 'Requested item - available', @@ -16,7 +15,7 @@ describe('Orders: Receiving and Check-in ', () => { cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); }); - it('C350428 Patron notice (Vega)', { tags: [testTypes.ideaLabsTests, devTeams.vega] }, () => { + it('C350428 Patron notice (Vega)', { tags: [testTypes.ideaLabsTests] }, () => { cy.visit(SettingsMenu.circulationTitleLevelRequestsPath); titleLevelRequests.selectConfirmationNoticeDropdown({ notice1: patronData.notice1, diff --git a/cypress/support/dictionary/devTeams.js b/cypress/support/dictionary/devTeams.js index eb2a9b04f8..26e8ef2a20 100644 --- a/cypress/support/dictionary/devTeams.js +++ b/cypress/support/dictionary/devTeams.js @@ -4,5 +4,5 @@ export default { spitfire: 'spitfire', thunderjet: 'thunderjet', folijet: 'folijet', - volaris: 'volaris', + volaris: 'volaris' }; diff --git a/cypress/support/fragments/agreements/agreementsDetails.js b/cypress/support/fragments/agreements/agreementsDetails.js index ec8aaba836..4732c28ddd 100644 --- a/cypress/support/fragments/agreements/agreementsDetails.js +++ b/cypress/support/fragments/agreements/agreementsDetails.js @@ -1,18 +1,15 @@ -import { Accordion, Button, including, HTML, Section, MultiColumnListCell, Badge, Modal, Checkbox, MultiColumnList, MultiColumnListRow, SelectionOption, SearchField } from '../../../../interactors'; -import NewNote from '../notes/newNote'; +import { Accordion, Badge, Button, Checkbox, HTML, Modal, MultiColumnList, MultiColumnListCell, MultiColumnListRow, SearchField, Section, SelectionOption, Spinner, including } from '../../../../interactors'; import { getLongDelay } from '../../utils/cypressTools'; import ExistingNoteEdit from '../notes/existingNoteEdit'; - +import NewNote from '../notes/newNote'; const rootXpath = '//section[@id="pane-view-agreement"]'; -const rootSection = Section({ id : 'pane-view-agreement' }); +const rootSection = Section({ id: 'pane-view-agreement' }); const headerXpath = `${rootXpath}//div[@id="pane-view-agreement-content"]//h2`; const rootCss = 'section[id=pane-view-agreement]'; const notesSectionXpath = `${rootXpath}//section[@id="notes"]`; const noteTitleXpath = `${notesSectionXpath}//strong[contains(.,'Title')]/..`; const notesAccordionXpath = `${notesSectionXpath}//button[@id="accordion-toggle-button-notes"]`; - - const newNoteButton = Button('New', { id: 'note-create-button' }); const actionsButton = Button('Actions'); const deleteButton = Button('Delete'); @@ -20,6 +17,7 @@ const deleteButtonInConfirmation = Button('Delete', { id: 'clickable-delete-agre const showMoreLink = Button('Show more'); const notesAccordion = rootSection.find(Accordion({ id: 'notes' })); const deleteConfirmationModal = Modal({ id: 'delete-agreement-confirmation' }); +const cancelButton = Button('Cancel'); function waitLoading() { cy.xpath(headerXpath).should('be.visible'); @@ -31,11 +29,11 @@ export default { waitLoadingWithExistingNote(title) { waitLoading(); - cy.expect(rootSection.find(Section({ id: 'notes' })).find(MultiColumnListCell({ columnIndex:1 })).find(HTML(including(title))).exists()); + cy.expect(rootSection.find(Section({ id: 'notes' })).find(MultiColumnListCell({ columnIndex: 1 })).find(HTML(including(title))).exists()); }, openNotesSection() { - cy.do(rootSection.find(Section({ id :'notes' })).find(Button({ id:'accordion-toggle-button-notes' })).click()); + cy.do(rootSection.find(Section({ id: 'notes' })).find(Button({ id: 'accordion-toggle-button-notes' })).click()); cy.expect(rootSection.find(newNoteButton).exists()); }, @@ -45,6 +43,16 @@ export default { NewNote.save(); }, + clickOnNoteRecord() { + cy.expect(Spinner().absent()); + cy.do((MultiColumnList({ id: 'notes-list' }).click({ row: 0 }))); + }, + + clickOnNewButton() { + cy.expect(rootSection.exists()); + cy.do(rootSection.find(newNoteButton).click()); + }, + checkNotesCount(notesCount) { cy.expect(rootSection.find(Section({ id: 'notes' }).find(Badge())).has({ value: notesCount.toString() })); }, @@ -93,17 +101,22 @@ export default { cy.do(Button('Local KB search').click()); }, + clickCancelButton() { + cy.expect((cancelButton).exists()); + cy.do(cancelButton.click()); + }, + selectCurrentStatusInPackages() { cy.wait(4000); cy.do(Section({ id: 'filter-accordion-status' }).find(Checkbox({ id: 'clickable-filter-status-current' })).click()); }, selectPackageFromList(row = 0) { - cy.do(MultiColumnList({ id:'list-packages' }).find(MultiColumnListRow({ indexRow: `row-${row}` })).click()); + cy.do(MultiColumnList({ id: 'list-packages' }).find(MultiColumnListRow({ indexRow: `row-${row}` })).click()); }, addPackageToBusket() { - cy.do(Section({ id:'pane-view-eresource' }).find(Button('Add package to basket')).click()); + cy.do(Section({ id: 'pane-view-eresource' }).find(Button('Add package to basket')).click()); }, openBusket() { diff --git a/cypress/support/fragments/agreements/newAgreement.js b/cypress/support/fragments/agreements/newAgreement.js index 811df256ea..041e30108a 100644 --- a/cypress/support/fragments/agreements/newAgreement.js +++ b/cypress/support/fragments/agreements/newAgreement.js @@ -1,47 +1,120 @@ +import { Accordion, Badge, Button, Callout, HTML, Link, Modal, MultiColumnListRow, Section, TextField, including } from '../../../../interactors'; import DateTools from '../../utils/dateTools'; import getRandomPostfix from '../../utils/stringTools'; -import { Button, TextField } from '../../../../interactors'; +import topMenu from '../topMenu'; export default class NewAgreement { - // TODO: start to use interactors instead of selectors - static #rootCss = 'section[id="pane-agreement-form"]' - static #statusCss = `${this.#rootCss} select[id="edit-agreement-status"]`; - static #nameField = TextField({ id: 'edit-agreement-name' }); - static #startDateField = TextField({ id: 'period-start-date-0' }); - static #saveButton = Button('Save & close'); - - static #statusValue = { - closed: 'Closed', - draft: 'Draft', - requested: 'Requested', - inNegotiation: 'In negotiation', - active: 'Active', - } - - static #defaultAgreement = { - name: `autotest_agreement_${getRandomPostfix()}`, - status: this.#statusValue.draft, - startDate: DateTools.getCurrentDate() - } - - static get defaultAgreement() { - return this.#defaultAgreement; - } - - - static fill(specialAgreement = this.#defaultAgreement) { - cy.do(this.#nameField.fillIn(specialAgreement.name)); - cy.get(this.#statusCss) - .select(specialAgreement.status) - .should('have.value', specialAgreement.status.toLowerCase()); - cy.do(this.#startDateField.fillIn(specialAgreement.startDate)); - } - - static save() { - cy.do(this.#saveButton.click()); - } - - static waitLoading() { - cy.expect(this.#nameField.exists()); - } + + // TODO: start to use interactors instead of selectors + static #rootCss = 'section[id="pane-agreement-form"]' + static #statusCss = `${this.#rootCss} select[id="edit-agreement-status"]`; + static #nameField = TextField({ id: 'edit-agreement-name' }); + static #startDateField = TextField({ id: 'period-start-date-0' }); + static #saveButton = Button('Save & close'); + + static #newButton = Section({ id: 'packageShowAgreements' }).find(Button('New')) + static #agreementLine = Section({ id: 'lines' }).find(Button('Agreement lines')) + static #agreementBadge = Section({ id: 'lines' }) + static #rowInList = Section({ id: 'lines' }).find(MultiColumnListRow({ index: 0 }).find(Link('VLeBooks'))) + static #rowClick = Section({ id: 'lines' }).find(MultiColumnListRow({ index: 0 })) + static #cancel = Button({ ariaLabel: 'Close VLeBooks' }) + static #newButtonClick = Button('New') + static #recordLastUpdated = Section({ id: 'agreementInfoRecordMeta' }).find(Button(including('Record last updated'))) + static #actionButton = Section({ id: 'pane-view-agreement' }).find(Button('Actions')) + static #deleteButton = Button('Delete') + static #deleteConfirmationModal = Modal({ id: 'delete-agreement-confirmation' }); + static #deleteButtonInConfirmation = Button('Delete', { id: 'clickable-delete-agreement-confirmation-confirm' }); + static #searchAgreement = TextField({ id: 'input-agreement-search' }) + static #agreementLineDeleteModel = Modal({ id: 'delete-agreement-line-confirmation' }) + static #deleteButtonInLine = Button('Delete', { id:'clickable-delete-agreement-line-confirmation-confirm' }) + + static #statusValue = { + closed: 'Closed', + draft: 'Draft', + requested: 'Requested', + inNegotiation: 'In negotiation', + active: 'Active', + } + + static #defaultAgreement = { + name: `autotest_agreement_${getRandomPostfix()}`, + status: this.#statusValue.draft, + startDate: DateTools.getCurrentDate() + } + + static get defaultAgreement() { + return this.#defaultAgreement; + } + + static fill(specialAgreement = this.#defaultAgreement) { + cy.do(this.#nameField.fillIn(specialAgreement.name)); + cy.get(this.#statusCss) + .select(specialAgreement.status) + .should('have.value', specialAgreement.status.toLowerCase()); + cy.do(this.#startDateField.fillIn(specialAgreement.startDate)); + } + + static save() { + cy.do(this.#saveButton.click()); + } + + static waitLoading() { + cy.expect(this.#nameField.exists()); + } + + static searchAgreement(specialAgreement = this.#defaultAgreement) { + cy.do(this.#searchAgreement.fillIn(specialAgreement.name)); + cy.do(Button('Search').click()); + cy.expect(Section({ id:'pane-view-agreement' }).find(HTML(including(specialAgreement.name, { class: 'headline' }))).exists()); + } + + static validateDateAndTime() { + cy.wrap(this.#recordLastUpdated.text()).as('date'); + cy.get('@date').then((val) => { + const dateTimePattern = /\d{1,2}\/\d{1,2}\/\d{4} \d{1,2}:\d{2} [AP]M/g; + const dateTimes = val.match(dateTimePattern)[0]; + cy.expect(this.#recordLastUpdated.has({ text: including(`Record last updated: ${dateTimes}`) })); + cy.expect(Accordion({ headline: 'Update information' }).has({ content: including(`Record created: ${dateTimes}`) })); + }); + } + + static newButton() { + cy.do(this.#newButton.click()); + } + + static agreementLine() { + cy.do([this.#agreementLine.click(), + this.#rowInList.click(), + this.#cancel.click()]); + } + + static findAgreement(specialAgreement = this.#defaultAgreement) { + cy.visit(topMenu.agreementsPath); + cy.do([this.#searchAgreement.fillIn(specialAgreement.name), + Button('Search').click(), + ]); + } + + static deleteAgreement() { + cy.do([ + this.#agreementLine.click(), + this.#rowClick.click()]); + cy.do([Section({ id:'pane-view-agreement-line' }).find(Button('Actions')).click(), + Button('Delete').click(), + this.#agreementLineDeleteModel.find(this.#deleteButtonInLine).click()]); + cy.expect([Callout({ type:'success' }).exists(), + Callout({ type:'success' }).has({ text:'Agreement line deleted' })]); + cy.expect(this.#agreementBadge.find(Badge()).has({ value: '0' })); + cy.do(this.#actionButton.click()); + cy.expect(this.#deleteButton.exists()); + cy.do(this.#deleteButton.click()); + cy.expect(this.#deleteConfirmationModal.exists()); + cy.do(this.#deleteConfirmationModal.find(this.#deleteButtonInConfirmation).click()); + cy.expect([Callout({ type:'success' }).exists(), + Callout({ type:'success' }).has({ text:'Agreement line deleted' })]); + } + + static newButtonClick() { + cy.do(this.#newButtonClick.click()); + } } diff --git a/cypress/support/fragments/eholdings/eHoldingsPackages.js b/cypress/support/fragments/eholdings/eHoldingsPackages.js index ced87bf1ae..e6b2836814 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackages.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackages.js @@ -1,26 +1,32 @@ -import { Button, ListItem, Section, HTML, including, or } from '../../../../interactors'; +import { Button, HTML, ListItem, Section, including, or } from '../../../../interactors'; import getRandomPostfix from '../../utils/stringTools'; +import topMenu from '../topMenu'; import eHoldingsNewCustomPackage from './eHoldingsNewCustomPackage'; +// eslint-disable-next-line import/no-cycle import eHoldingsPackage from './eHoldingsPackage'; +import eHoldingsPackagesSearch from './eHoldingsPackagesSearch'; +import eHoldingsProvidersSearch from './eHoldingsProvidersSearch'; +import eHoldingsSearch from './eHoldingsSearch'; const resultSection = Section({ id: 'search-results' }); export default { - create:(packageName = `package_${getRandomPostfix()}`) => { + create: (packageName = `package_${getRandomPostfix()}`) => { cy.do(Button('New').click()); eHoldingsNewCustomPackage.fillInRequiredProperties(packageName); eHoldingsNewCustomPackage.saveAndClose(); return packageName; }, + waitLoading: () => { cy.expect(or( resultSection.find(ListItem({ className: including('list-item-'), index: 1 }).find(Button())).exists(), resultSection.find(HTML(including('Enter a query to show search results.'))).exists() )); }, + openPackage: (rowNumber = 0) => { const specialRow = resultSection.find(ListItem({ className: including('list-item-'), index: rowNumber })); - cy.then(() => specialRow.h3Value()) .then(specialPackage => { cy.do(resultSection @@ -31,13 +37,17 @@ export default { }); return cy.get('@selectedPackage'); }, - getPackageName:(rowNumber = 0) => { + + getPackageName: (rowNumber = 0) => { return cy.then(() => resultSection.find(ListItem({ className: including('list-item-'), index: rowNumber })).h3Value()); }, - getCustomPackageViaApi:() => { - cy.okapiRequest({ path: 'eholdings/packages', - searchParams: { 'filter[custom]':true, count:10, pageSize:10 }, - isDefaultSearchParamsRequired : false }).then(({ body }) => { + + getCustomPackageViaApi: () => { + cy.okapiRequest({ + path: 'eholdings/packages', + searchParams: { 'filter[custom]': true, count: 10, pageSize: 10 }, + isDefaultSearchParamsRequired: false + }).then(({ body }) => { const initialPackageNames = body.data.filter(specialPackage => specialPackage?.attributes?.isCustom) .map(customePackage => customePackage.attributes?.name) .filter(name => name); @@ -45,14 +55,17 @@ export default { }); return cy.get('@customePackageName'); }, - getNotCustomSelectedPackageIdViaApi:() => { - cy.okapiRequest({ path: 'eholdings/packages', - searchParams: { 'filter[selected]':true, count:100, pageSize:100 }, - isDefaultSearchParamsRequired : false }).then(({ body }) => { + + getNotCustomSelectedPackageIdViaApi: () => { + cy.okapiRequest({ + path: 'eholdings/packages', + searchParams: { 'filter[selected]': true, count: 100, pageSize: 100 }, + isDefaultSearchParamsRequired: false + }).then(({ body }) => { const initialPackageIds = body.data.filter(specialPackage => !specialPackage?.attributes?.isCustom && specialPackage?.attributes?.name - // TODO: can't see not complete package in response now - // && specialPackage.attributes?.packageType !== 'Complete' + // TODO: can't see not complete package in response now + // && specialPackage.attributes?.packageType !== 'Complete' // TODO: potencial issue with this package && !['123Library eBooks'].includes(specialPackage?.attributes?.name)) .map(customePackage => ({ id: customePackage.id, name: customePackage.attributes.name })); @@ -60,10 +73,13 @@ export default { }); return cy.get('@packageId'); }, - getNotSelectedPackageIdViaApi:() => { - cy.okapiRequest({ path: 'eholdings/packages', - searchParams: { 'filter[selected]':false, count:100, pageSize:100 }, - isDefaultSearchParamsRequired : false }).then(({ body }) => { + + getNotSelectedPackageIdViaApi: () => { + cy.okapiRequest({ + path: 'eholdings/packages', + searchParams: { 'filter[selected]': false, count: 100, pageSize: 100 }, + isDefaultSearchParamsRequired: false + }).then(({ body }) => { const initialPackageIds = body.data.filter(specialPackage => !specialPackage?.attributes?.isCustom && specialPackage?.attributes?.name && specialPackage.attributes?.packageType !== 'Complete' @@ -73,5 +89,12 @@ export default { cy.wrap([...new Set(initialPackageIds)][0]).as('packageId'); }); return cy.get('@packageId'); - } + }, + + packageSearch() { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('VLeBooks'); + eHoldingsPackagesSearch.bySelectionStatus('Selected'); + }, }; diff --git a/cypress/support/utils/stringTools.js b/cypress/support/utils/stringTools.js index 0b97d0eca6..f74bee330a 100644 --- a/cypress/support/utils/stringTools.js +++ b/cypress/support/utils/stringTools.js @@ -4,3 +4,5 @@ export default function getRandomPostfix() { } export const getTestEntityValue = (entityName) => `autotest_${entityName ? `${entityName}_` : ''}${getRandomPostfix()}`; export const replaceByIndex = (initialString, index, newChar) => `${initialString.substring(0, index)}${newChar}${initialString.substring(index + 1)}`; +export const randomFourDigitNumber = () => Math.floor(Math.random(9000) * 1000) + 1000; +export const randomTwoDigitNumber = () => Math.floor(Math.random() * 2); From 76c257975c27c71657983e014ff4a062a81d3219 Mon Sep 17 00:00:00 2001 From: SantoshIdeyalabs <92138239+SantoshIdeyalabs@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:49:36 +0530 Subject: [PATCH 28/55] settings/santhoshIdeyalabs (#1382) * settings/santhoshIdeyalabs --- .../create-text-field-custom-field.cy.js | 137 ++++++++++++++++++ cypress/e2e/ideyalabs/notes/note-type.cy.js | 52 +++++++ .../organizations/create-new-categories.cy.js | 30 ++++ cypress/support/dictionary/devTeams.js | 3 +- .../fragments/agreements/agreementsDetails.js | 6 +- .../fragments/notes/existingNoteView.js | 1 - cypress/support/fragments/notes/newNote.js | 1 - .../fragments/settings/users/customFields.js | 99 ++++++++++++- cypress/support/fragments/settingsMenu.js | 2 + cypress/support/fragments/topMenu.js | 9 ++ .../fragments/users/usersSearchPane.js | 82 ++++++++++- 11 files changed, 410 insertions(+), 12 deletions(-) create mode 100644 cypress/e2e/ideyalabs/custom-fields/create-text-field-custom-field.cy.js create mode 100644 cypress/e2e/ideyalabs/notes/note-type.cy.js create mode 100644 cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js diff --git a/cypress/e2e/ideyalabs/custom-fields/create-text-field-custom-field.cy.js b/cypress/e2e/ideyalabs/custom-fields/create-text-field-custom-field.cy.js new file mode 100644 index 0000000000..22623deb69 --- /dev/null +++ b/cypress/e2e/ideyalabs/custom-fields/create-text-field-custom-field.cy.js @@ -0,0 +1,137 @@ +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import CustomFields from '../../../support/fragments/settings/users/customFields'; +import TopMenu from '../../../support/fragments/topMenu'; +import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; +import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; + +const textFieldData = { + fieldLabel: `Test${getFourDigitRandomNumber()}`, + helpText: `Testdata${getFourDigitRandomNumber()}`, +}; +const testAreaData = { + fieldLabel: `dataArea${getFourDigitRandomNumber()}`, + helpText: `fillData${getFourDigitRandomNumber()}`, +}; +const checkboxData = { + fieldLabel: `CheckBox${getFourDigitRandomNumber()}`, + helpText: `testdata${getFourDigitRandomNumber()}`, +}; +const radioButtonData = { + data: { + fieldLabel: `RadioButton${getFourDigitRandomNumber()}`, + helpText: `testData${getFourDigitRandomNumber()}`, + label1: `Radio1${getFourDigitRandomNumber()}`, + label2: `Radio2${getFourDigitRandomNumber()}`, + }, +}; +const label2 = `select${getFourDigitRandomNumber()}`; +const singleSelectData = { + data: { + fieldLabel: `Single Select Dropdown${getFourDigitRandomNumber()}`, + helpText: 'select One Data', + label1: `Select${getFourDigitRandomNumber()}`, + label2, + }, +}; + +describe('Settings', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Delete test data', () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.editButton(); + CustomFields.deleteCustomField(`${textFieldData.fieldLabel} · Text field`); + CustomFields.deleteCustomField(`${testAreaData.fieldLabel} · Text area`); + CustomFields.deleteCustomField(`${checkboxData.fieldLabel} · Checkbox`); + CustomFields.deleteCustomField(`${radioButtonData.data.fieldLabel} · Radio button set`); + CustomFields.deleteCustomField(`${singleSelectData.data.fieldLabel} · Single select`); + CustomFields.confirmDeletion(); + CustomFields.verifyDeletedCustomFields(`${textFieldData.fieldLabel} · Text field`); + CustomFields.verifyDeletedCustomFields(`${testAreaData.fieldLabel} · Text area`); + CustomFields.verifyDeletedCustomFields(`${checkboxData.fieldLabel} · Checkbox`); + CustomFields.verifyDeletedCustomFields(`${radioButtonData.data.fieldLabel} · Radio button set`); + CustomFields.verifyDeletedCustomFields(`${singleSelectData.data.fieldLabel} · Single select`); + }); + + it( + 'C15693 Create a text field custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomTextField(textFieldData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyTextField(textFieldData.fieldLabel); + } + ); + + it( + 'C15694 Create a text area custom field and add help text (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomTextArea(testAreaData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyTextArea(testAreaData.fieldLabel); + } + ); + + it( + 'C15695 Create a checkbox custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomCheckBox(checkboxData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyCheckBox(checkboxData.fieldLabel); + } + ); + + it( + 'C15696 Create a radio button custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomRadioButton(radioButtonData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyRadioButton(radioButtonData.data.fieldLabel); + } + ); + + it( + 'C15697 Create a single select custom field (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.addCustomSingleSelect(singleSelectData); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifySingleSelect(singleSelectData.data.fieldLabel, label2); + } + ); + + it( + 'C15701 Change custom fields order (volaris)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.customFieldsPath); + CustomFields.editButton(); + UsersSearchPane.dragAndDropCustomFields(); + cy.visit(TopMenu.usersPath); + UsersSearchPane.searchByKeywords('testing'); + UsersSearchPane.selectFirstUser('Excel, Testing'); + UsersSearchPane.verifyDragItem(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/notes/note-type.cy.js b/cypress/e2e/ideyalabs/notes/note-type.cy.js new file mode 100644 index 0000000000..866e103227 --- /dev/null +++ b/cypress/e2e/ideyalabs/notes/note-type.cy.js @@ -0,0 +1,52 @@ +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import AgreementsDetails from '../../../support/fragments/agreements/agreementsDetails'; +import ExistingNoteEdit from '../../../support/fragments/notes/existingNoteEdit'; +import ExistingNoteView from '../../../support/fragments/notes/existingNoteView'; +import NewNote from '../../../support/fragments/notes/newNote'; +import TopMenu from '../../../support/fragments/topMenu'; +import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; + +const noteData = `New Note${getFourDigitRandomNumber()}`; +const noteType = `Item${getFourDigitRandomNumber()}`; + +describe('Settings', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C16985 Settings | Set up a note type (spitfire)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.notesPath); + NewNote.fillNote(noteData); + cy.visit(TopMenu.agreementsPath); + AgreementsDetails.agreementListClick('2020 ACS Publications'); + AgreementsDetails.openNotesSection(); + AgreementsDetails.clickOnNewButton(); + NewNote.clickOnNoteType(noteData); + NewNote.deleteNote(noteData); + } + ); + + it( + 'C1304 Settings | Edit a note type (spitfire)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(TopMenu.notesPath); + ExistingNoteEdit.clickEditButton(noteType); + cy.visit(TopMenu.agreementsPath); + AgreementsDetails.agreementListClick('2020 ACS Publications'); + AgreementsDetails.openNotesSection(); + AgreementsDetails.clickOnNewButton(); + NewNote.clickOnNoteType(noteType); + AgreementsDetails.clickCancelButton(); + NewNote.closeWithoutSaveButton(); + AgreementsDetails.openNotesSection(); + AgreementsDetails.clickOnNoteRecord(); + ExistingNoteView.gotoEdit(); + NewNote.clickOnNoteType(noteType); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js new file mode 100644 index 0000000000..4d05ff24a4 --- /dev/null +++ b/cypress/e2e/ideyalabs/organizations/create-new-categories.cy.js @@ -0,0 +1,30 @@ +import DevTeams from '../../../support/dictionary/devTeams'; +import TestTypes from '../../../support/dictionary/testTypes'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import TopMenu from '../../../support/fragments/topMenu'; +import { getFourDigitRandomNumber } from '../../../support/utils/stringTools'; + +const categoryName = `Test${getFourDigitRandomNumber()}`; + +describe('Settings', () => { + before('Login to Folio', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C731 Create new categories (thunderjet)', + { tags: [TestTypes.ideaLabsTests, DevTeams.ideaLabsTests] }, + () => { + cy.visit(SettingsMenu.organizationsPath); + Organizations.addNewCategory(categoryName); + cy.visit(TopMenu.organizationsPath); + Organizations.searchByParameters('All', 'organization'); + Organizations.selectOrganization('New organization'); + Organizations.editOrganization(); + Organizations.verifyNewCategory(categoryName); + cy.visit(SettingsMenu.organizationCategoryPath); + Organizations.deleteCreatedCategory(categoryName); + } + ); +}); diff --git a/cypress/support/dictionary/devTeams.js b/cypress/support/dictionary/devTeams.js index 26e8ef2a20..0a1dc0631c 100644 --- a/cypress/support/dictionary/devTeams.js +++ b/cypress/support/dictionary/devTeams.js @@ -4,5 +4,6 @@ export default { spitfire: 'spitfire', thunderjet: 'thunderjet', folijet: 'folijet', - volaris: 'volaris' + volaris: 'volaris', + ideaLabsTests: 'ideaLabsTests' }; diff --git a/cypress/support/fragments/agreements/agreementsDetails.js b/cypress/support/fragments/agreements/agreementsDetails.js index 4732c28ddd..1332804ac6 100644 --- a/cypress/support/fragments/agreements/agreementsDetails.js +++ b/cypress/support/fragments/agreements/agreementsDetails.js @@ -1,4 +1,4 @@ -import { Accordion, Badge, Button, Checkbox, HTML, Modal, MultiColumnList, MultiColumnListCell, MultiColumnListRow, SearchField, Section, SelectionOption, Spinner, including } from '../../../../interactors'; +import { Accordion, Button, including, HTML, Section, MultiColumnListCell, Badge, Modal, Checkbox, MultiColumnList, MultiColumnListRow, SelectionOption, SearchField, Spinner } from '../../../../interactors'; import { getLongDelay } from '../../utils/cypressTools'; import ExistingNoteEdit from '../notes/existingNoteEdit'; import NewNote from '../notes/newNote'; @@ -149,4 +149,8 @@ export default { Button('Save & close').click() ]); }, + + agreementListClick(agreementName) { + cy.do(MultiColumnListCell(agreementName).click()); + } }; diff --git a/cypress/support/fragments/notes/existingNoteView.js b/cypress/support/fragments/notes/existingNoteView.js index c7914e0575..e89bbab2d5 100644 --- a/cypress/support/fragments/notes/existingNoteView.js +++ b/cypress/support/fragments/notes/existingNoteView.js @@ -5,7 +5,6 @@ import ExistingNoteEdit from './existingNoteEdit'; const section = Section({ id: 'pane-note-view' }); const title = section.find(KeyValue('Note title')); const details = section.find(KeyValue('Details')); - const closeButton = section.find(Button({ icon: 'times' })); const actionsButton = Button('Actions'); const editButton = Button('Edit'); diff --git a/cypress/support/fragments/notes/newNote.js b/cypress/support/fragments/notes/newNote.js index f4cfab3959..1b4e0aef78 100644 --- a/cypress/support/fragments/notes/newNote.js +++ b/cypress/support/fragments/notes/newNote.js @@ -4,7 +4,6 @@ import getRandomPostfix from '../../utils/stringTools'; export default class NewNote { static #titleTextField = TextField('Note title*'); - static #saveButton = Button('Save & close'); static #defaultNote = { diff --git a/cypress/support/fragments/settings/users/customFields.js b/cypress/support/fragments/settings/users/customFields.js index 0066e6f7bb..a610a6ba16 100644 --- a/cypress/support/fragments/settings/users/customFields.js +++ b/cypress/support/fragments/settings/users/customFields.js @@ -1,11 +1,21 @@ import { including } from 'bigtest'; -import { Pane, Button, Dropdown, TextField, MultiColumnListRow, Accordion } from '../../../../../interactors'; +import { + Accordion, + Button, + Dropdown, + Modal, + MultiColumnListRow, + Pane, + TextField +} from '../../../../../interactors'; const customFieldsPane = Pane('Custom fields'); const editNewButton = Button({ href: '/settings/users/custom-fields/edit' }); const addCustomFieldDropdown = Dropdown('Add custom field'); const saveAndCloseButton = Button('Save & close'); const saveLoseDataButton = Button('Save & lose data'); +const fieldLabel = TextField('Field label*'); +const helpText = TextField('Help text'); export default { waitLoading() { @@ -22,7 +32,6 @@ export default { saveAndCloseButton.click(), ]); }, - editMultiSelectCustomField(oldData, newData) { cy.do([ editNewButton.click(), @@ -53,4 +62,90 @@ export default { saveLoseDataButton.click(), ]); }, + + addCustomTextField(data) { + cy.do([ + editNewButton.click(), + addCustomFieldDropdown.choose('Text field'), + fieldLabel.fillIn(data.fieldLabel), + helpText.fillIn(data.helpText), + saveAndCloseButton.click(), + ]); + cy.expect(saveAndCloseButton.absent()); + cy.expect(Accordion(`${data.fieldLabel} · Text field`).exists()); + }, + + addCustomTextArea(data) { + cy.do([ + editNewButton.click(), + addCustomFieldDropdown.choose('Text area'), + fieldLabel.fillIn(data.fieldLabel), + helpText.fillIn(data.helpText), + saveAndCloseButton.click(), + ]); + cy.expect(saveAndCloseButton.absent()); + cy.expect(Accordion(`${data.fieldLabel} · Text area`).exists()); + }, + + addCustomCheckBox(data) { + cy.do([ + editNewButton.click(), + addCustomFieldDropdown.choose('Checkbox'), + fieldLabel.fillIn(data.fieldLabel), + helpText.fillIn(data.helpText), + saveAndCloseButton.click(), + ]); + cy.expect(saveAndCloseButton.absent()); + cy.expect(Accordion(`${data.fieldLabel} · Checkbox`).exists()); + }, + + addCustomRadioButton({ data }) { + cy.do([ + editNewButton.click(), + addCustomFieldDropdown.choose('Radio button set'), + fieldLabel.fillIn(data.fieldLabel), + helpText.fillIn(data.helpText), + MultiColumnListRow({ indexRow: 'row-1' }) + .find(TextField()) + .fillIn(data.label1), + MultiColumnListRow({ indexRow: 'row-2' }) + .find(TextField()) + .fillIn(data.label2), + saveAndCloseButton.click(), + ]); + cy.expect(saveAndCloseButton.absent()); + cy.expect(Accordion(`${data.fieldLabel} · Radio button set`).exists()); + }, + + addCustomSingleSelect({ data }) { + cy.do([ + editNewButton.click(), + addCustomFieldDropdown.choose('Single select'), + fieldLabel.fillIn(data.fieldLabel), + helpText.fillIn(data.helpText), + MultiColumnListRow({ indexRow: 'row-1' }) + .find(TextField()) + .fillIn(data.label1), + MultiColumnListRow({ indexRow: 'row-2' }) + .find(TextField()) + .fillIn(data.label2), + saveAndCloseButton.click(), + ]); + cy.expect(saveAndCloseButton.absent()); + cy.expect(Accordion(`${data.fieldLabel} · Single select`).exists()); + }, + + editButton() { + cy.expect(editNewButton.exists()); + cy.do([editNewButton.click()]); + }, + + confirmDeletion() { + cy.do(Button('Save & close').click()); + cy.do(Modal('Delete field data').find(Button('Save & lose data')).click()); + }, + + verifyDeletedCustomFields(field) { + cy.expect(Accordion(field).absent()); + }, }; diff --git a/cypress/support/fragments/settingsMenu.js b/cypress/support/fragments/settingsMenu.js index 15cf3017aa..dd70662522 100644 --- a/cypress/support/fragments/settingsMenu.js +++ b/cypress/support/fragments/settingsMenu.js @@ -94,6 +94,8 @@ export default { // Data export exportMappingProfilePath: 'settings/data-export/mapping-profiles', exportJobProfilePath: 'settings/data-export/job-profiles', + // Organizations + organizationCategoryPath: 'settings/organizations/category', // Tags tagsGeneralPath: 'settings/tags/general', }; diff --git a/cypress/support/fragments/topMenu.js b/cypress/support/fragments/topMenu.js index 9d572b786a..ee97996dfe 100644 --- a/cypress/support/fragments/topMenu.js +++ b/cypress/support/fragments/topMenu.js @@ -28,6 +28,11 @@ const receivingPath = '/receiving'; const bulkEditPath = '/bulk-edit'; const exportManagerPath = '/export-manager'; const exportManagerOrganizationsPath = 'export-manager/edi-jobs'; +const customFieldsPath = '/settings/users/custom-fields'; +const notesPath = '/settings/notes/general'; +const permissionSetPath = '/settings/users/perms?layer=add'; +const customLabel = '/settings/eholdings'; + export default { // direct paths to folio apps to use in cy.visit() into initial steps of our scenarios @@ -59,6 +64,10 @@ export default { bulkEditPath, exportManagerPath, exportManagerOrganizationsPath, + customFieldsPath, + notesPath, + permissionSetPath, + customLabel, openCheckInApp:() => { cy.do(Link({ href: including('/checkin') }).click()); }, diff --git a/cypress/support/fragments/users/usersSearchPane.js b/cypress/support/fragments/users/usersSearchPane.js index 6d98562095..e71ece67c5 100644 --- a/cypress/support/fragments/users/usersSearchPane.js +++ b/cypress/support/fragments/users/usersSearchPane.js @@ -1,21 +1,30 @@ import { including } from '@interactors/html'; import { Accordion, - Checkbox, - TextField, Button, + Checkbox, Link, - PaneHeader, - Pane, MultiColumnListCell, + Pane, + PaneHeader, + RadioButtonGroup, + Section, Select, + Spinner, + TextArea, + TextField } from '../../../../interactors'; // Cypress clicks before the UI loads, use when there is no way to attach waiter to element const waitClick = () => { cy.wait(1000)}; +const actionButton = Section({ id: 'pane-userdetails' }).find(Button('Actions')); +const editButton = Button('Edit'); +const additionalInfo = Button('Additional information'); +const saveAndClose = Button('Save & close'); + export default { - waitLoading:() => cy.expect(PaneHeader('User search').exists()), + waitLoading: () => cy.expect(PaneHeader('User search').exists()), searchByStatus(status) { waitClick(); @@ -38,11 +47,72 @@ export default { waitClick(); }, + selectFirstUser: (userName) => { + cy.expect(Spinner().absent()); + cy.do(Pane({ id: 'users-search-results-pane' }).find(Link(userName)).click()); + }, + + selectUserFromList: (userName) => { - cy.do(Pane({ id:'users-search-results-pane' }).find(MultiColumnListCell(userName)).click()); + cy.do(Pane({ id: 'users-search-results-pane' }).find(MultiColumnListCell(userName)).click()); }, openUser(userId) { return cy.do(Link({ href: including(userId) }).click()); }, + + verifyTextField: (name) => { + cy.do([actionButton.click(), + editButton.click(), + ]); + cy.expect(TextField(name).exists()); + }, + + verifyTextArea: (name) => { + cy.do([actionButton.click(), + editButton.click(), + ]); + cy.expect(TextArea(name).exists()); + }, + + verifyCheckBox: (name) => { + cy.do([actionButton.click(), + editButton.click(), + ]); + cy.expect(Checkbox(name).exists()); + }, + + verifyRadioButton: (name) => { + cy.do([actionButton.click(), + editButton.click(), + ]); + cy.expect(RadioButtonGroup(name).exists()); + }, + + verifySingleSelect: (name, label) => { + cy.do([actionButton.click(), + editButton.click(), + Select(name).choose(label), + saveAndClose.click(), + additionalInfo.click() + ]); + }, + + dragAndDropCustomFields: () => { + cy.get('[class^=FieldAccordionDraggableWrapper---]').then((elements) => { + const draggableElement = elements[0]; + const targetElement = elements[1]; + if (targetElement) { + cy.get(draggableElement).dragAndDrop( + draggableElement, + targetElement + ); + } + }); + }, + + verifyDragItem() { + cy.expect(additionalInfo.exists()); + cy.do(additionalInfo.click()); + } }; From cecf9d0fd57bebf9c21633469fefaf92d11b54ef Mon Sep 17 00:00:00 2001 From: SantoshIdeyalabs <92138239+SantoshIdeyalabs@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:53:54 +0530 Subject: [PATCH 29/55] eHoldings/SaantoshIdeyalabs (#1388) * eHoldings/SaantoshIdeyalabs Co-authored-by: Vineethasakhamuri --- .../e2e/ideyalabs/eholdings/G_eholdings.cy.js | 234 +++++++++ cypress/e2e/ideyalabs/eholdings/eHolding.js | 293 +++++++++++ .../circulation/circulation-rules.js | 43 +- .../eholdings/eHoldingsNewCustomPackage.js | 19 +- .../fragments/eholdings/eHoldingsPackage.js | 110 ++-- .../fragments/eholdings/eHoldingsPackages.js | 30 +- .../eholdings/eHoldingsProviderEdit.js | 18 +- .../fragments/eholdings/eHoldingsProviders.js | 97 +++- .../eholdings/eHoldingsProvidersSearch.js | 11 +- .../fragments/organizations/organizations.js | 482 +++++++++++++----- .../support/fragments/requests/newRequest.js | 30 +- cypress/support/fragments/topMenu.js | 7 +- cypress/support/utils/dateTools.js | 95 +++- cypress/support/utils/stringTools.js | 5 +- interactors/key-value.js | 2 +- 15 files changed, 1263 insertions(+), 213 deletions(-) create mode 100644 cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js create mode 100644 cypress/e2e/ideyalabs/eholdings/eHolding.js diff --git a/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js new file mode 100644 index 0000000000..418646a72f --- /dev/null +++ b/cypress/e2e/ideyalabs/eholdings/G_eholdings.cy.js @@ -0,0 +1,234 @@ +import devTeams from '../../../support/dictionary/devTeams'; +import testTypes from '../../../support/dictionary/testTypes'; +import circulationRules from '../../../support/fragments/circulation/circulation-rules'; +import eHoldingsNewCustomPackage from '../../../support/fragments/eholdings/eHoldingsNewCustomPackage'; +import eHoldingsPackages from '../../../support/fragments/eholdings/eHoldingsPackages'; +import eHoldingsPackagesSearch from '../../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import eHoldingsProviderEdit from '../../../support/fragments/eholdings/eHoldingsProviderEdit'; +import eHoldingsProviders from '../../../support/fragments/eholdings/eHoldingsProviders'; +import eHoldingsProvidersSearch from '../../../support/fragments/eholdings/eHoldingsProvidersSearch'; +import eHoldingsSearch from '../../../support/fragments/eholdings/eHoldingsSearch'; +import organizations from '../../../support/fragments/organizations/organizations'; +import newRequest from '../../../support/fragments/requests/newRequest'; +import settingsMenu from '../../../support/fragments/settingsMenu'; +import topMenu from '../../../support/fragments/topMenu'; +import eHolding from './eHolding'; + +describe('Create a custom package', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + cy.visit(topMenu.eholdingsPath); + }); + after('Deleting created Package', () => { + eHolding.deletePackage(); + }); + it( + 'C683 Search packages for [JSTOR]. Filter results to only show selected packages (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + eHolding.switchToPackage(); + eHolding.verifyPackage(); + } + ); + it( + 'C692 Create a custom package', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHolding.createAndVerify(); + } + ); + it( + 'C695 Package Record: Search all titles included in a package (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + eHolding.switchToPackageAndSearch(); + eHoldingsPackages.openPackage(); + eHoldingsProviders.titlesSearch(); + eHoldingsProviders.clickSearchTitles(); + eHoldingsProviders.subjectsAssertion(); + } + ); + it( + 'C17090 Title Record - Packages accordion - Filter packages list (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToTitles(); + eHoldingsProvidersSearch.byProvider('Journal of Fish Biology'); + eHoldingsProviders.viewPackage(); + eHolding.searchButton(); + eHolding.dropdownValuesSelect([ + 'Agricultural & Environmental Science Database (DRAA)', + 'Biological Sciences Database (DRAA)', + ]); + eHolding.searchActions(); + eHolding.verifyFilterPackages(); + } + ); + it( + 'C157916 Title - Packages accordion - Filter by Holding Status (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToTitles(); + eHoldingsProvidersSearch.byProvider('Journal of Fish Biology'); + eHoldingsProviders.viewPackage(); + eHolding.searchButton(); + eHolding.bySelectionStatusSection('Selected'); + } + ); + it( + 'C360543 Check the content of ""Title information"" accordion in ""Title"" detail record (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit( + 'https://bugfest-orchid.int.aws.folio.org/eholdings/titles/41327?searchType=titles&q=journal&offset=1' + ); + eHolding.verifyAlternativesTitles(); + } + ); + it( + 'C367967 Verify that ""Packages"" accordion will return records after collapsing/expanding in ""Provider"" detail record (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsProvidersSearch.byProvider('Wiley'); + eHoldingsProviders.viewProvider(); + eHolding.packageAccordionClick(); + eHolding.verifyPackageButtonClick('Collapse all', 'false'); + eHolding.packageAccordionClick(); + eHolding.verifyPackageButtonClick('Expand all', 'true'); + } + ); + it( + 'C703 Set [Show titles in package to patrons] to Hide (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Edinburgh Scholarship Online'); + eHoldingsPackagesSearch.bySelectionStatus('Selected'); + eHoldingsProviders.viewPackage(); + eHolding.editActions(); + eHolding.patronRadioButton(); + eHoldingsProviderEdit.saveAndClose(); + eHolding.verifyAlternativeRadio(); + } + ); + it( + 'C3464 Update Package Proxy (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Edinburgh Scholarship Online'); + eHoldingsProviders.viewPackage(); + eHoldingsPackages.updateProxy(); + eHolding.verifyProxy(); + } + ); + it( + 'C648 Closed Library Due Date (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToTitles(); + eHoldingsProvidersSearch.byProvider('Fashion'); + eHoldingsProvidersSearch.verifyTitleSearch(); + } + ); + it( + 'C350418 Check that user can create ""Recall"" Item level request (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.requestsPath); + newRequest.openNewRequestPane(); + newRequest.enterItemInfo('1234567890'); + newRequest.verifyRequestInformation(); + newRequest.enterRequesterInfo({ + requesterBarcode: '000000098538', + pickupServicePoint: 'API', + }); + newRequest.enterRequestAndPatron('Testing'); + newRequest.saveRequestAndClose(); + } + ); + it( + 'C3466 Edit/Add a token to the Gale Academic OneFile (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Gale Academic OneFile'); + eHoldingsPackagesSearch.bySelectionStatus('Selected'); + eHoldingsProviders.viewPackage(); + eHolding.editActions(); + eHolding.providerToken(); + eHolding.checkToken(); + } + ); + it( + 'C694 Search providers for [Gale | Cengage]. Then Search list of packages on Provider detail record for all selected packages (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + eHolding.switchToPackages(); + eHoldingsPackages.openPackage(); + eHolding.packageButton(); + eHolding.bySelectionStatusOpen('Selected'); + } + ); + it( + 'C654 Test behavior for incomplete vs complete circulation rules (i.e., all policy types must be present; else error (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.settingsPath); + cy.visit(settingsMenu.circulationRulesPath); + circulationRules.fillInPolicy({ + priorityType: 'g ', + loanPolicyName: 'irina-loan-policy', + overdueFinePolicyName: 'no-overdue-fine', + lostItemFeePolicyName: 'lostsetfines', + requestPolicyName: 'allow-all', + noticePolicyName: 'julies-check-out-policy', + priorityTypeName: 'ip', + }); + circulationRules.saveCirculationRules(); + circulationRules.verifyToast(); + } + ); + it( + 'C656 Ensure interface alerts user of syntax errors in rules (vega)', + { tags: [testTypes.ideaLabsTests] }, + () => { + circulationRules.policyError({ + priorityType: 'g ', + priorityTypeName: 'ip', + loanPolicyName: 'irina-loan-policy', + }); + circulationRules.saveCirculationRules(); + circulationRules.verifyError(); + } + ); + it( + 'C699 Add or edit package custom coverage (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHolding.switchToPackage(); + eHoldingsPackages.openPackage(); + organizations.editOrganization(); + eHolding.generateRandomDates(); + eHolding.verifyAlternativeDates(); + } + ); + it( + 'C343241 Access eholdings app menu (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsNewCustomPackage.clickOneHoldingCarat(); + } + ); +}); diff --git a/cypress/e2e/ideyalabs/eholdings/eHolding.js b/cypress/e2e/ideyalabs/eholdings/eHolding.js new file mode 100644 index 0000000000..5ea99c3ca9 --- /dev/null +++ b/cypress/e2e/ideyalabs/eholdings/eHolding.js @@ -0,0 +1,293 @@ +import { + Accordion, + Button, + FieldSet, + KeyValue, + Modal, + MultiSelect, + NavListItem, + PaneContent, + RadioButton, + Section, + Select, + Spinner, + TextArea, + TextField, +} from '../../../interactors'; +import eHoldingsNewCustomPackage from '../../support/fragments/eholdings/eHoldingsNewCustomPackage'; +import eHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; +import eholdingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import eHoldingsProvidersSearch from '../../support/fragments/eholdings/eHoldingsProvidersSearch'; +import eHoldingsSearch from '../../support/fragments/eholdings/eHoldingsSearch'; +import topMenu from '../../support/fragments/topMenu'; +import dateTools from '../../support/utils/dateTools'; +import getRandomPostfix, { + randomFourDigitNumber, + randomTwoDigitNumber, +} from '../../support/utils/stringTools'; + +const editButton = Button('Edit'); +const actionsButton = Button('Actions'); +const searchButton = Button('Search'); +const description = TextArea({ name: 'description' }); +const SaveAndClose = Button('Save & close'); +const availableProxies = ['Inherited - None', 'FOLIO-Bugfest', 'EZProxy']; +const SearchButton = Section({ id: 'providerShowProviderList' }).find( + Button({ ariaLabel: 'Toggle filters pane' }) +); +const iconSearch = Button({ icon: 'search' }); +const proxySelect = Select({ id: 'eholdings-proxy-id' }); +const selectionStatusAccordion = Accordion({ + id: 'accordion-toggle-button-filter-packages-selected', +}); +const selectionStatusSection = Section({ id: 'filter-packages-selected' }); +const accordionClick = Button({ + id: 'accordion-toggle-button-providerShowProviderList', +}); +const patronRadioButton = FieldSet('Show titles in package to patrons').find( + RadioButton({ checked: false }) +); +const tagsClick = Button({ id: 'accordion-toggle-button-providerShowTags' }); +const providerClick = Button({ + id: 'accordion-toggle-button-providerShowProviderSettings', +}); +const notesClick = Button({ id: 'accordion-toggle-button-providerShowNotes' }); +const packagesClick = Button({ + id: 'accordion-toggle-button-providerShowProviderInformation', +}); +const packageName = `package_${getRandomPostfix()}`; +const deletePackage = Button('Delete package'); +const confirmModal = Modal('Delete custom package'); + +export default { + packageAccordionClick() { + cy.expect(accordionClick.exists()); + cy.do([accordionClick.click(), accordionClick.click()]); + cy.expect(Spinner().absent()); + }, + verifyPackageButtonClick(name, open) { + cy.expect(Button(name).exists()); + cy.do(Button(name).click()); + cy.expect([ + accordionClick.has({ ariaExpanded: open }), + tagsClick.has({ ariaExpanded: open }), + providerClick.has({ ariaExpanded: open }), + notesClick.has({ ariaExpanded: open }), + packagesClick.has({ ariaExpanded: open }), + ]); + }, + + createAndVerify: () => { + cy.do(Button('New').click()); + eHoldingsNewCustomPackage.fillInRequiredProperties(packageName); + eHoldingsNewCustomPackage.saveAndClose(); + cy.expect(PaneContent({ id: `${packageName}-content` }).exists()); + return packageName; + }, + + deletePackage: () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider(packageName); + eHoldingsPackages.openPackage(); + cy.do(actionsButton.click()); + cy.do(deletePackage.click()); + cy.do(confirmModal.find(Button('Yes, delete')).click()); + }, + + switchToPackage() { + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('JSTOR'); + eholdingsPackagesSearch.bySelectionStatus('Selected'); + }, + + verifyPackage() { + cy.expect(PaneContent({ id: 'search-results-content' }).exists()); + }, + + switchToPackages() { + cy.visit(topMenu.eholdingsPath); + eHoldingsProvidersSearch.byProvider('Gale Cengage'); + }, + + switchToPackageAndSearch() { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('Wiley Online Library'); + eholdingsPackagesSearch.bySelectionStatus('Selected'); + }, + + editActions: () => { + cy.expect(Spinner().absent()); + cy.do(actionsButton.click()); + cy.expect(editButton.exists()); + cy.do(editButton.click()); + }, + + getAlternateTitles: () => cy.then(() => KeyValue('Alternate title(s)').value()), + + verifyAlternativesTitles() { + this.getAlternateTitles().then((val) => { + expect(val).to.include(';'); + }); + }, + + searchActions() { + cy.expect(searchButton.exists()); + cy.do(searchButton.click()); + }, + + verifyFilterPackages() { + cy.expect(Section({ id: 'titleShowPackages' }).exists()); + }, + + patronRadioButton: () => { + cy.expect(patronRadioButton.exists()); + cy.do(patronRadioButton.click()); + }, + + changeProxy: () => { + cy.get('select#eholdings-proxy-id option:selected') + .invoke('text') + .then((text) => { + const options = availableProxies.filter((option) => option !== text); + cy.do(proxySelect.choose(options[randomTwoDigitNumber()])); + }); + }, + + dropdownValuesSelect(names) { + cy.expect(MultiSelect().exists()); + cy.do(MultiSelect().select(names)); + }, + + bySelectionStatus(selectionStatus) { + cy.expect(selectionStatusAccordion.exists()); + cy.do(selectionStatusAccordion.clickHeader()); + cy.do(selectionStatusAccordion.find(RadioButton(selectionStatus)).click()); + cy.do(Button('Search').click()); + }, + + bySelectionStatusSection(selectionStatus) { + cy.expect(selectionStatusSection.exists()); + cy.do(selectionStatusSection.find(RadioButton(selectionStatus)).click()); + }, + + bySelectionStatusOpen(selectionStatus) { + cy.do(selectionStatusSection.find(Button('Selection status')).click()); + cy.do(selectionStatusSection.find(RadioButton(selectionStatus)).click()); + cy.do(Button('Search').click()); + }, + + editSchedule({ data }) { + cy.do([ + NavListItem(data.name).click(), + Button('Actions').click(), + Button('Edit').click(), + description.fillIn(data.description), + SaveAndClose.click(), + ]); + }, + + packageSearch() { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsProvidersSearch.byProvider('VLeBooks'); + eholdingsPackagesSearch.bySelectionStatus('Selected'); + }, + + packageButton: () => { + cy.expect(SearchButton.exists()); + cy.do(SearchButton.click()); + }, + + searchButton() { + cy.expect(iconSearch.exists()); + cy.do(iconSearch.click()); + }, + + modelSearch() { + cy.do(Modal({ id: 'package-filter-modal' }).find(Button('Search').click())); + }, + + providerToken() { + cy.do( + TextArea({ name: 'providerTokenValue' }).fillIn( + `Test${randomFourDigitNumber()}` + ) + ); + cy.expect(SaveAndClose.exists()); + cy.do(SaveAndClose.click()); + }, + + getProxyValue: () => cy.then(() => KeyValue('Proxy').value()), + + verifyProxy() { + this.getProxyValue().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + + getToken: () => cy.then(() => KeyValue('Provider token').value()), + + checkToken() { + this.getToken().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + + getAlternateRadio: () => cy.then(() => KeyValue('Show titles in package to patrons').value()), + + verifyAlternativeRadio() { + this.getAlternateRadio().then((val) => { + const radioArray = ['Yes', 'No']; + const newRadioArray = radioArray.filter((x) => !x.includes(val)); + expect(val).to.not.equal(newRadioArray[0]); + }); + }, + + getDatesValue: () => cy.then(() => KeyValue('Custom coverage dates').value()), + + verifyAlternativeDates() { + this.getDatesValue().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + + formatDate(dateString) { + const date = new Date(dateString); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are zero-based, so we add 1 + const day = date.getDate().toString().padStart(2, '0'); + const year = date.getFullYear(); + return `${month}/${day}/${year}`; + }, + + generateRandomDates() { + const startDate = new Date(dateTools.editFromDateRange()); // Use your desired start date + const endDate = new Date(dateTools.editEndDateRange()); // Use your desired end date + let fromDate = this.getRandomDate(startDate, endDate); + let toDate = this.getRandomDate(startDate, endDate); + // Keep generating new dates until the "to" date is greater than the "from" date + while (toDate <= fromDate) { + fromDate = this.getRandomDate(startDate, endDate); + toDate = this.getRandomDate(startDate, endDate); + } + const reqFromDate = this.formatDate(fromDate); + const reqToDate = this.formatDate(endDate); + // Start the fill in process in dates + cy.do([ + TextField({ id: 'begin-coverage-0' }).fillIn(reqFromDate), + TextField({ id: 'end-coverage-0' }).fillIn(reqToDate), + SaveAndClose.click(), + ]); + }, + + getRandomDate(startDate, endDate) { + const start = startDate.getTime(); + const end = endDate.getTime(); + const randomTime = start + Math.random() * (end - start); + return new Date(randomTime); + }, +}; diff --git a/cypress/support/fragments/circulation/circulation-rules.js b/cypress/support/fragments/circulation/circulation-rules.js index 8b3dc2b8b6..86b600a16f 100644 --- a/cypress/support/fragments/circulation/circulation-rules.js +++ b/cypress/support/fragments/circulation/circulation-rules.js @@ -1,11 +1,12 @@ import { kebabCase } from 'lodash'; import { + Button, CodeMirror, CodeMirrorHint, - Button, } from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; + const calloutMessages = { CIRCULATION_RULES_UPDATE_SUCCESS: 'Rules were successfully updated.', }; @@ -14,23 +15,47 @@ export default { defaultcirculationPolicy: { 'rulesAsText': 'circulation policy' }, + + verifyError() { + cy.expect(cy.get("[class^='rule-error']").contains('Must contain one of each policy type, missing type r')); + }, + + policyError({ + priorityType, + priorityTypeName, + loanPolicyName, + }) { + if (priorityType) { + this.fillInCirculationRules(priorityType); + this.clickCirculationRulesHintItem(priorityTypeName); + this.fillInCirculationRules(': '); + } + this.fillInCirculationRules('l '); + this.clickCirculationRulesHintItem(loanPolicyName); + }, + clearCirculationRules() { cy.do(CodeMirror().clear()); }, + fillInCirculationRules(value) { cy.do(CodeMirror().fillIn(value)); }, + fillInPriority(value = 'priority: t, s, c, b, a, m, g') { this.fillInCirculationRules(value); this.fillInNewLine(); }, + fillInNewLine() { this.fillInCirculationRules('\n'); }, + fillInFallbackPolicy(policyData) { this.fillInCirculationRules('fallback-policy: '); this.fillInPolicy(policyData); }, + fillInPolicy({ priorityType, priorityTypeName, @@ -57,33 +82,44 @@ export default { this.clickCirculationRulesHintItem(noticePolicyName); this.fillInNewLine(); }, + clickCirculationRulesHintItem(name) { cy.do(CodeMirrorHint().clickItem(kebabCase(name))); }, + saveCirculationRules() { + cy.expect(Button('Save').exists()); cy.do(Button('Save').click()); }, + + verifyToast() { + InteractorsTools.checkCalloutMessage('Rules were successfully updated.'); + }, + checkUpdateCirculationRulesCalloutAppeared() { InteractorsTools.checkCalloutMessage(calloutMessages.CIRCULATION_RULES_UPDATE_SUCCESS); }, + checkNoticePolicyAddedToCirculationRules(noticePolicyId) { this.getViaApi().then((circulationRules) => { cy.expect(circulationRules.rulesAsText).to.include(`n ${noticePolicyId}`); }); }, + getViaApi() { return cy.getCirculationRules(); }, + updateViaApi(data) { return cy.updateCirculationRules(data); }, + getRuleProps(defaultRules) { const oIndex = defaultRules.indexOf(' o ', 2); const lIndex = defaultRules.indexOf(' l ', 2); const iIndex = defaultRules.indexOf(' i ', 2); const rIndex = defaultRules.indexOf(' r ', 2); const nIndex = defaultRules.indexOf(' n ', 2); - const baseRuleProps = { 'o': defaultRules.substring(oIndex + 3, oIndex + 39), 'l': defaultRules.substring(lIndex + 3, lIndex + 39), @@ -91,13 +127,14 @@ export default { 'r': defaultRules.substring(rIndex + 3, rIndex + 39), 'n': defaultRules.substring(nIndex + 3, nIndex + 39) }; - return baseRuleProps; }, + addRuleViaApi(defaultRules, ruleParams, priority, priorityId) { const withNewRule = defaultRules + ' \n' + priority + priorityId + ': i ' + ruleParams.i + ' l ' + ruleParams.l + ' r ' + ruleParams.r + ' o ' + ruleParams.o + ' n ' + ruleParams.n; return cy.updateCirculationRules({ rulesAsText: withNewRule }); }, + deleteRuleViaApi(rule) { this.getViaApi().then((circulationRules) => { const allRules = circulationRules.rulesAsText; diff --git a/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js b/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js index 500cf20ba2..0c9a765442 100644 --- a/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js +++ b/cypress/support/fragments/eholdings/eHoldingsNewCustomPackage.js @@ -1,15 +1,28 @@ -import { HTML, including, Button, TextField } from '../../../../interactors'; +import { Button, HTML, TextField, including } from '../../../../interactors'; + +const caratButton = Button({ className: 'navButton---wRwTS interactionStylesControl---e1lwD button---mtWnz' }); +const keyboardShortcut = Button('Keyboard shortcuts'); +const KBcontent = Button({ id: 'content-item' }); +const systemStatus = Button({ id: 'system-status-item' }); export default { - waitLoading:() => { + waitLoading: () => { cy.expect(HTML(including('New custom package')).exists()); }, fillInRequiredProperties: (packageName) => { cy.do(TextField('Name*').fillIn(packageName)); }, - saveAndClose:() => { + saveAndClose: () => { cy.do(Button('Save & close').click()); + }, + clickOneHoldingCarat: () => { + cy.do([caratButton.click(), + KBcontent.click(), + caratButton.click(), + systemStatus.click(), + caratButton.click(), + keyboardShortcut.click()]); } }; diff --git a/cypress/support/fragments/eholdings/eHoldingsPackage.js b/cypress/support/fragments/eholdings/eHoldingsPackage.js index 81fe440b57..d02efc35b1 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackage.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackage.js @@ -1,24 +1,31 @@ -import { Accordion, Button, Modal, Section, RadioButton, HTML, including, MultiSelect, KeyValue, MultiSelectOption, ValueChipRoot, Spinner } from '../../../../interactors'; -import getRandomPostfix from '../../utils/stringTools'; +import { Accordion, Button, Checkbox, HTML, KeyValue, Modal, RadioButton, MultiSelect, MultiSelectOption, Section, Select, Spinner, TextField, ValueChipRoot, including } from '../../../../interactors'; import { getLongDelay } from '../../utils/cypressTools'; +import getRandomPostfix, { randomTwoDigitNumber } from '../../utils/stringTools'; -const titlesFilterModal = Modal({ id : 'eholdings-details-view-search-modal' }); +const titlesFilterModal = Modal({ id: 'eholdings-details-view-search-modal' }); const tagsSection = Section({ id: 'packageShowTags' }); const closeButton = Button({ icon: 'times' }); const actionsButton = Button('Actions'); +const editButton = Button('Edit'); const removeFromHoldingsButton = Button('Remove from holdings'); const confirmButton = Button('Yes, remove'); - -const filterStatuses = { all: 'All', +const filterStatuses = { + all: 'All', selected: 'Selected', - notSelected: 'Not selected' }; - + notSelected: 'Not selected' +}; const packageHoldingStatusSection = Section({ id: 'packageShowHoldingStatus' }); const titlesSection = Section({ id: 'packageShowTitles' }); -const confirmationModal = Modal({ id:'eholdings-confirmation-modal' }); - +const confirmationModal = Modal({ id: 'eholdings-confirmation-modal' }); +const availableProxies = ['Inherited - None', 'FOLIO-Bugfest', 'EZProxy']; +const proxySelect = Select({ id: 'eholdings-proxy-id' }); +const customLabelButton = Button('Custom labels'); +const displayLabel = TextField({ name: 'customLabel1.displayLabel' }); +const displayLabel1 = TextField({ name: 'customLabel2.displayLabel' }); +const fullTextFinderCheckbox = Checkbox({ name: 'customLabel2.displayOnFullTextFinder' }); +const saveButton = Button('Save'); +const verifyCustomLabel = Section({ id: 'resourceShowCustomLabels' }); const getElementIdByName = (packageName) => packageName.replaceAll(' ', '-').toLowerCase(); - const waitTitlesLoading = () => cy.url().then(url => { const packageId = url.split('?')[0].split('/').at(-1); cy.intercept(`eholdings/packages/${packageId}/resources?**`).as('getTitles'); @@ -28,16 +35,10 @@ const waitTitlesLoading = () => cy.url().then(url => { export default { filterStatuses, waitLoading: (specialPackage) => { - cy.expect(Section({ id : getElementIdByName(specialPackage) }).exists()); + cy.expect(Section({ id: getElementIdByName(specialPackage) }).exists()); cy.expect(tagsSection.find(MultiSelect()).exists()); }, - addToHodlings: () => { - cy.do(packageHoldingStatusSection.find(Button('Add package to holdings')).click()); - cy.expect(confirmationModal.exists()); - cy.do(confirmationModal.find(Button('Add package (all titles) to holdings')).click()); - cy.expect(confirmationModal.absent()); - }, filterTitles: (selectionStatus = filterStatuses.notSelected) => { cy.do(titlesSection.find(Button({ icon: 'search' })).click()); cy.expect(titlesFilterModal.exists()); @@ -51,7 +52,8 @@ export default { cy.expect(Spinner().absent()); }); }, - verifyHoldingStatus:(expectedStatus = filterStatuses.selected) => { + + verifyHoldingStatus: (expectedStatus = filterStatuses.selected) => { cy.expect(packageHoldingStatusSection.find(HTML(including(expectedStatus))).exists()); // TODO: request dynamic loading of titles // need to load changed state of titles @@ -66,10 +68,23 @@ export default { }); }); }, - checkEmptyTitlesList:() => { - cy.expect(titlesSection.find(KeyValue('Records found', { value:'0' }))); + + customLabel(name) { + cy.do([(customLabelButton).click(), + displayLabel.fillIn(name.label1), + displayLabel1.fillIn(name.label2), + fullTextFinderCheckbox.click(), + saveButton.click() + ]); + cy.visit('/eholdings/resources/58-473-185972'); + cy.expect(verifyCustomLabel.exists()); }, - removeFromHoldings:() => { + + checkEmptyTitlesList: () => { + cy.expect(titlesSection.find(KeyValue('Records found', { value: '0' }))); + }, + + removeFromHoldings: () => { cy.do(actionsButton.click()); cy.expect(removeFromHoldingsButton.exists()); cy.do(removeFromHoldingsButton.click()); @@ -77,7 +92,8 @@ export default { cy.do(confirmationModal.find(confirmButton).click()); cy.expect(confirmationModal.absent()); }, - addTag:() => { + + addTag: () => { const newTag = `tag${getRandomPostfix()}`; cy.then(() => tagsSection.find(MultiSelect()).selected()) .then(selectedTags => { @@ -85,20 +101,22 @@ export default { cy.do(MultiSelectOption(`Add tag for: ${newTag}`).click()); cy.expect(tagsSection.find(MultiSelect({ selected: [...selectedTags, newTag].sort() })).exists()); }); - return newTag; }, - close:(packageName) => { + + close: (packageName) => { const packageId = getElementIdByName(packageName); - const section = Section({ id : packageId }); - cy.do(section.find(Button({ icon:'times', ariaLabel:`Close ${packageName}` })).click()); + const section = Section({ id: packageId }); + cy.do(section.find(Button({ icon: 'times', ariaLabel: `Close ${packageName}` })).click()); cy.expect(section.absent()); }, - verifyExistingTags:(...expectedTags) => { + + verifyExistingTags: (...expectedTags) => { expectedTags.forEach(tag => { cy.expect(tagsSection.find(HTML(including(tag))).exists()); }); }, + removeExistingTags: () => { cy.then(() => tagsSection.find(MultiSelect()).selected()) .then(selectedTags => { @@ -109,9 +127,43 @@ export default { }); }); }, - verifyDeletedTags:(...expectedTags) => { + + verifyDeletedTags: (...expectedTags) => { expectedTags.forEach(tag => { cy.expect(tagsSection.find(HTML(including(tag))).absent()); }); - } + }, + + addToHoldings: () => { + cy.do(packageHoldingStatusSection.find(Button('Add package to holdings')).click()); + cy.expect(confirmationModal.exists()); + cy.do(confirmationModal.find(Button('Add package (all titles) to holdings')).click()); + cy.expect(confirmationModal.absent()); + }, + + editProxyActions: () => { + cy.expect(Spinner().absent()); + cy.do(actionsButton.click()); + cy.expect(editButton.exists()); + cy.do(editButton.click()); + }, + getProxyValue: () => cy.then(() => KeyValue('Proxy').value()), + proxy() { + this.getProxyValue().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + changeProxy: () => { + cy.get('select#eholdings-proxy-id option:selected') + .invoke('text') + .then((text) => { + const options = availableProxies.filter((option) => option !== text); + cy.do(proxySelect.choose(options[randomTwoDigitNumber()])); + }); + }, + + saveAndClose: () => { + cy.do(Button('Save & close').click()); + }, }; diff --git a/cypress/support/fragments/eholdings/eHoldingsPackages.js b/cypress/support/fragments/eholdings/eHoldingsPackages.js index e6b2836814..757a353c10 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackages.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackages.js @@ -1,4 +1,4 @@ -import { Button, HTML, ListItem, Section, including, or } from '../../../../interactors'; +import { Button, HTML, ListItem, Modal, Section, including, or } from '../../../../interactors'; import getRandomPostfix from '../../utils/stringTools'; import topMenu from '../topMenu'; import eHoldingsNewCustomPackage from './eHoldingsNewCustomPackage'; @@ -9,6 +9,10 @@ import eHoldingsProvidersSearch from './eHoldingsProvidersSearch'; import eHoldingsSearch from './eHoldingsSearch'; const resultSection = Section({ id: 'search-results' }); +const selectedText = "#packageShowHoldingStatus div[class^='headline']"; +const actionButton = Button('Actions'); +const deletePackageButton = Button('Delete package'); +const confirmModal = Modal('Delete custom package'); export default { create: (packageName = `package_${getRandomPostfix()}`) => { @@ -18,6 +22,12 @@ export default { return packageName; }, + deletePackage: () => { + cy.do([actionButton.click(), + deletePackageButton.click(), + confirmModal.find(Button('Yes, delete')).click()]); + }, + waitLoading: () => { cy.expect(or( resultSection.find(ListItem({ className: including('list-item-'), index: 1 }).find(Button())).exists(), @@ -32,7 +42,6 @@ export default { cy.do(resultSection .find(ListItem({ className: including('list-item-'), index: rowNumber }) .find(Button())).click()); - eHoldingsPackage.waitLoading(specialPackage); cy.wrap(specialPackage).as('selectedPackage'); }); return cy.get('@selectedPackage'); @@ -91,6 +100,23 @@ export default { return cy.get('@packageId'); }, + updateProxy() { + cy.get(selectedText) + .invoke('text') + .then((text) => { + if (text === 'Selected') { + eHoldingsPackage.editProxyActions(); + eHoldingsPackage.changeProxy(); + eHoldingsPackage.saveAndClose(); + } else { + eHoldingsPackage.addToHoldings(); + eHoldingsPackage.editProxyActions(); + eHoldingsPackage.changeProxy(); + eHoldingsPackage.saveAndClose(); + } + }); + }, + packageSearch() { cy.visit(topMenu.eholdingsPath); eHoldingsSearch.switchToPackages(); diff --git a/cypress/support/fragments/eholdings/eHoldingsProviderEdit.js b/cypress/support/fragments/eholdings/eHoldingsProviderEdit.js index e5b7147724..c166bc2221 100644 --- a/cypress/support/fragments/eholdings/eHoldingsProviderEdit.js +++ b/cypress/support/fragments/eholdings/eHoldingsProviderEdit.js @@ -1,6 +1,5 @@ -import { Select, Section, Button, HTML, including } from '../../../../interactors'; +import { Button, HTML, Section, Select, including } from '../../../../interactors'; import { getLongDelay } from '../../utils/cypressTools'; -import eHoldingsProviderView from './eHoldingsProviderView'; const availableProxies = [ 'chalmers', @@ -8,15 +7,17 @@ const availableProxies = [ 'TestingFolio' ]; const proxySelect = Select('Proxy'); +const saveAndCloseButton = Button('Save & close'); export default { waitLoading: (providerName) => { cy.intercept('eholdings/providers/**').as('getProviderProperties'); cy.wait('@getProviderProperties', getLongDelay()).then(request => { - cy.expect(Section({ id : providerName.replaceAll(' ', '-').toLowerCase() }).exists()); - cy.expect(proxySelect.has({ value: request.response.body.data.attributes.proxy.id })); + cy.expect(Section({ id: providerName.replaceAll(' ', '-').toLowerCase() }).exists()); + cy.expect(proxySelect.has({ value: request.response.body.data.attributes.proxy.id })); }); }, + changeProxy: () => { return cy.then(() => proxySelect.value()) .then(selectedProxy => { @@ -26,8 +27,9 @@ export default { return cy.wrap(notSelectedProxy); }); }, - saveAndClose:() => { - cy.do(Button('Save & close').click()); - eHoldingsProviderView.waitLoading(); - } + + saveAndClose() { + cy.expect(saveAndCloseButton.exists()); + cy.do(saveAndCloseButton.click()); + }, }; diff --git a/cypress/support/fragments/eholdings/eHoldingsProviders.js b/cypress/support/fragments/eholdings/eHoldingsProviders.js index 239aea3dea..85e0983708 100644 --- a/cypress/support/fragments/eholdings/eHoldingsProviders.js +++ b/cypress/support/fragments/eholdings/eHoldingsProviders.js @@ -1,16 +1,99 @@ -import { Button, ListItem, Section, including } from '../../../../interactors'; +import { + Accordion, + Button, + KeyValue, + ListItem, + RadioButton, + Section, + Spinner, + TextField, + including +} from '../../../../interactors'; import eHoldingsProviderView from './eHoldingsProviderView'; - +// eslint-disable-next-line import/no-cycle const resultSection = Section({ id: 'search-results' }); +const searchButton = Button('Search'); +const packageList = Section({ id: 'packageShowTitles' }); +const selectionStatusSection = Section({ id: 'filter-packages-selected' }); +const selectionStatusAccordion = Accordion({ + id: 'accordion-toggle-button-filter-packages-selected', +}); export default { waitLoading: () => { - cy.expect(resultSection - .find(ListItem({ className: including('list-item-'), index: 1 }) - .find(Button())).exists()); + cy.expect( + resultSection + .find( + ListItem({ className: including('list-item-'), index: 1 }).find( + Button() + ) + ) + .exists() + ); }, + viewProvider: (rowNumber = 0) => { - cy.do(resultSection.find(ListItem({ className: including('list-item-'), index: rowNumber })).find(Button()).click()); + cy.do( + resultSection + .find( + ListItem({ className: including('list-item-'), index: rowNumber }) + ) + .find(Button()) + .click() + ); eHoldingsProviderView.waitLoading(); - } + }, + + bySelectionStatus(selectionStatus) { + cy.do(selectionStatusAccordion.clickHeader()); + cy.do(selectionStatusAccordion.find(RadioButton(selectionStatus)).click()); + cy.do(Button('Search').click()); + }, + + clickSearchTitles: (rowNumber = 0) => { + cy.do( + packageList + .find( + ListItem({ className: including('list-item-'), index: rowNumber }) + ) + .find(Button()) + .click() + ); + }, + + getSubjectValue: () => cy.then(() => KeyValue('Subjects').value()), + subjectsAssertion() { + this.getSubjectValue().then((val) => { + // eslint-disable-next-line no-unused-expressions + expect(val).to.be.exist; + }); + }, + + titlesSearch: () => { + cy.expect(Button({ icon: 'search' }).exists()); + cy.do(Button({ icon: 'search' }).click()); + cy.expect(TextField({ id: 'eholdings-search' }).exists()); + cy.do([ + TextField({ id: 'eholdings-search' }).fillIn('engineering'), + searchButton.click(), + ]); + }, + + viewPackage: (rowNumber = 0) => { + cy.expect(Spinner().absent); + cy.do( + resultSection + .find( + ListItem({ className: including('list-item-'), index: rowNumber }) + ) + .find(Button()) + .click() + ); + }, + + bySelectionStatusOpen(selectionStatus) { + cy.do(selectionStatusSection.find(Button('Selection status')).click()); + cy.do(selectionStatusSection.find(RadioButton(selectionStatus)).click()); + cy.do(Button('Search').click()); + }, }; diff --git a/cypress/support/fragments/eholdings/eHoldingsProvidersSearch.js b/cypress/support/fragments/eholdings/eHoldingsProvidersSearch.js index aaa9035d8b..b621af0aab 100644 --- a/cypress/support/fragments/eholdings/eHoldingsProvidersSearch.js +++ b/cypress/support/fragments/eholdings/eHoldingsProvidersSearch.js @@ -1,10 +1,15 @@ -import { Button, TextField } from '../../../../interactors'; -import eHoldingsProviders from './eHoldingsProviders'; +import { Button, TextField, PaneContent } from '../../../../interactors'; + export default { byProvider(provider) { cy.do(TextField({ id: 'eholdings-search' }).fillIn(provider)); cy.do(Button('Search').click()); - eHoldingsProviders.waitLoading(); + // waitLoading is not working fine + // eHoldingsProviders.waitLoading(); + }, + + verifyTitleSearch() { + cy.expect(PaneContent({ id: 'search-results-content' }).exists()); } }; diff --git a/cypress/support/fragments/organizations/organizations.js b/cypress/support/fragments/organizations/organizations.js index 87a4059284..88a7da29f7 100644 --- a/cypress/support/fragments/organizations/organizations.js +++ b/cypress/support/fragments/organizations/organizations.js @@ -1,15 +1,38 @@ -import { Button, TextField, Select, KeyValue, Accordion, Pane, Checkbox, MultiColumnList, MultiColumnListCell, SearchField, MultiColumnListRow, SelectionOption, Section, TextArea, MultiSelect, MultiSelectOption, PaneHeader, Link, Modal } from '../../../../interactors'; -import getRandomPostfix from '../../utils/stringTools'; +import { + Accordion, + Button, + Checkbox, + KeyValue, + Link, + Modal, + MultiColumnList, + MultiColumnListCell, + MultiColumnListRow, + MultiSelect, + MultiSelectOption, + Pane, + PaneHeader, + SearchField, + Section, + Select, + SelectionOption, + Spinner, + TextArea, + TextField, +} from '../../../../interactors'; import DateTools from '../../utils/dateTools'; -import SearchHelper from '../finance/financeHelper'; import InteractorsTools from '../../utils/interactorsTools'; +import getRandomPostfix from '../../utils/stringTools'; +import SearchHelper from '../finance/financeHelper'; const buttonNew = Button('New'); const saveAndClose = Button('Save & close'); const summaryAccordionId = 'summarySection'; const organizationDetails = Pane({ id: 'pane-organization-details' }); +const contactPeopleDetails = MultiColumnList({ id: 'contact-list' }); const organizationsList = MultiColumnList({ id: 'organizations-list' }); const blueColor = 'rgba(0, 0, 0, 0)'; +const tagButton = Button({ icon: 'tag' }); const summarySection = Accordion({ id: summaryAccordionId }); const searchInput = SearchField({ id: 'input-record-search' }); const vendorEDICodeEdited = `${getRandomPostfix()}`; @@ -20,35 +43,51 @@ const ediSection = Section({ id: 'edi' }); const ftpSection = Section({ id: 'ftp' }); const schedulingSection = Section({ id: 'scheduling' }); const actionsButton = Button('Actions'); -const numberOfSearchResultsHeader = '//*[@id="paneHeaderorganizations-results-pane-subtitle"]/span'; +const numberOfSearchResultsHeader = + '//*[@id="paneHeaderorganizations-results-pane-subtitle"]/span'; +const categoryDropdown = Button('Category'); const zeroResultsFoundText = '0 records found'; const organizationStatus = Select('Organization status*'); const organizationNameField = TextField('Name*'); +const nameTextField = TextField('[object Object] 0'); const organizationCodeField = TextField('Code*'); const today = new Date(); const todayDate = DateTools.getFormattedDate({ date: today }, 'MM/DD/YYYY'); const resetButton = Button('Reset all'); -const openContactSectionButton = Button({ id: 'accordion-toggle-button-contactPeopleSection' }); +const openContactSectionButton = Button({ + id: 'accordion-toggle-button-contactPeopleSection', +}); +const newButton = Button('+ New'); const addContacsModal = Modal('Add contacts'); const lastNameField = TextField({ name: 'lastName' }); const firstNameField = TextField({ name: 'firstName' }); -const saveButtonInCotact = Button({ id: 'clickable-save-contact-person-footer' }); +const saveButtonInCotact = Button({ + id: 'clickable-save-contact-person-footer', +}); const editButton = Button('Edit'); +const deleteButton = Button('Delete'); const contactPeopleSection = Section({ id: 'contactPeopleSection' }); const addContactButton = Button('Add contact'); -const openInterfaceSectionButton = Button({ id: 'accordion-toggle-button-interfacesSection' }); +const openInterfaceSectionButton = Button({ + id: 'accordion-toggle-button-interfacesSection', +}); const interfaceSection = Section({ id: 'interfacesSection' }); const addInterfaceButton = Button('Add interface'); const addInterfacesModal = Modal('Add interfaces'); const saveButton = Button('Save'); +const confirmButton = Button('Confirm'); const searchButtonInModal = Button({ type: 'submit' }); const timesButton = Button({ icon: 'times' }); -const openintegrationDetailsSectionButton = Button({ id: 'accordion-toggle-button-integrationDetailsSection' }); -const listIntegrationConfigs = MultiColumnList({ id: 'list-integration-configs' }); +const categoryButton = Button('Categories'); +const openintegrationDetailsSectionButton = Button({ + id: 'accordion-toggle-button-integrationDetailsSection', +}); +const listIntegrationConfigs = MultiColumnList({ + id: 'list-integration-configs', +}); export default { - - waitLoading : () => { + waitLoading: () => { cy.expect(Pane({ id: 'organizations-results-pane' }).exists()); }, @@ -65,7 +104,7 @@ export default { organizationStatus.choose(organization.status), organizationNameField.fillIn(organization.name), organizationCodeField.fillIn(organization.code), - saveAndClose.click() + saveAndClose.click(), ]); }, @@ -80,30 +119,65 @@ export default { // Need to wait while Acquisition Unit data will be loaded cy.wait(4000); cy.do([ - MultiSelect({ id: 'org-acq-units' }).find(Button({ ariaLabel: 'open menu' })).click(), + MultiSelect({ id: 'org-acq-units' }) + .find(Button({ ariaLabel: 'open menu' })) + .click(), MultiSelectOption(AcquisitionUnit).click(), - saveAndClose.click() + saveAndClose.click(), ]); }, checkCreatedOrganization: (organization) => { cy.expect(organizationDetails.exists()); - cy.expect(summarySection.find(KeyValue({ value: organization.name })).exists()); - cy.expect(summarySection.find(KeyValue({ value: organization.code })).exists()); + cy.expect( + summarySection.find(KeyValue({ value: organization.name })).exists() + ); + cy.expect( + summarySection.find(KeyValue({ value: organization.code })).exists() + ); + }, + + organizationTagDetails: () => { + cy.do([tagButton.click()]); + }, + + tagFilter: () => { + cy.do([ + Section({ id: 'org-filter-tags' }).find(Button('Tags')).click(), + Button({ className: 'multiSelectToggleButton---cD_fu' }).click(), + MultiSelectOption('^').click(), + ]); }, selectActiveStatus: () => { cy.do(Checkbox('Active').click()); }, + selectInActiveStatus: () => { + cy.do(Checkbox('Inactive').click()); + }, + selectPendingStatus: () => { + cy.do(Checkbox('Pending').click()); + }, checkOrganizationFilter: () => { cy.expect(organizationsList.exists()); }, + addNewCategory: (value) => { + cy.do(categoryButton.click()); + cy.expect(newButton.exists()); + cy.do(newButton.click()); + cy.do(nameTextField.fillIn(value)); + cy.do(saveButton.click()); + cy.contains(value).should('exist'); + }, + chooseOrganizationFromList: (organization) => { - cy.do(organizationsList - .find(MultiColumnListCell({ content: organization.name })) - .click()); + cy.do( + organizationsList + .find(MultiColumnListCell({ content: organization.name })) + .click() + ); }, addIntegration: () => { @@ -116,22 +190,42 @@ export default { selectIntegration: (integrationName) => { cy.do([ openintegrationDetailsSectionButton.click(), - listIntegrationConfigs.find(MultiColumnListCell({ content: integrationName })).click(), + listIntegrationConfigs + .find(MultiColumnListCell({ content: integrationName })) + .click(), ]); }, - fillIntegrationInformation: (integrationName, integartionDescription, vendorEDICode, libraryEDICode, accountNumber, acquisitionMethod, UTCTime) => { + fillIntegrationInformation: ( + integrationName, + integartionDescription, + vendorEDICode, + libraryEDICode, + accountNumber, + acquisitionMethod, + UTCTime + ) => { cy.do([ - Section({ id: 'integrationInfo' }).find(TextField('Integration name*')).fillIn(integrationName), + Section({ id: 'integrationInfo' }) + .find(TextField('Integration name*')) + .fillIn(integrationName), TextArea('Description').fillIn(integartionDescription), ediSection.find(TextField('Vendor EDI code*')).fillIn(vendorEDICode), ediSection.find(TextField('Library EDI code*')).fillIn(libraryEDICode), ediSection.find(Button({ icon: 'info' })).click(), - Checkbox({ name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.supportOrder' }).click(), - Checkbox({ name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.supportInvoice' }).click(), + Checkbox({ + name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.supportOrder', + }).click(), + Checkbox({ + name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.supportInvoice', + }).click(), ]); - cy.get('select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.accountNoList"]').select(accountNumber); - cy.get('select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.defaultAcquisitionMethods"]').select(acquisitionMethod); + cy.get( + 'select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.accountNoList"]' + ).select(accountNumber); + cy.get( + 'select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.defaultAcquisitionMethods"]' + ).select(acquisitionMethod); cy.do([ ftpSection.find(Select('EDI FTP')).choose('FTP'), ftpSection.find(TextField('Server address*')).fillIn(serverAddress), @@ -139,26 +233,59 @@ export default { ftpSection.find(TextField('Username')).fillIn('folio'), ftpSection.find(TextField('Password')).fillIn('Ffx29%pu'), ftpSection.find(TextField('Order directory')).fillIn('/files'), - schedulingSection.find(Checkbox({ name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule.enableScheduledExport' })).click(), + schedulingSection + .find( + Checkbox({ + name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule.enableScheduledExport', + }) + ) + .click(), schedulingSection.find(TextField('Schedule frequency*')).fillIn('1'), - schedulingSection.find(Select({ name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule.scheduleParameters.schedulePeriod' })).choose('Daily'), - schedulingSection.find(TextField({ name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule.scheduleParameters.schedulingDate' })).fillIn(`${todayDate}`), + schedulingSection + .find( + Select({ + name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule.scheduleParameters.schedulePeriod', + }) + ) + .choose('Daily'), + schedulingSection + .find( + TextField({ + name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule.scheduleParameters.schedulingDate', + }) + ) + .fillIn(`${todayDate}`), schedulingSection.find(TextField('Time*')).fillIn(`${UTCTime}`), ]); cy.do(saveAndClose.click()); }, - fillIntegrationInformationWithoutScheduling: (integrationName, integartionDescription, vendorEDICode, libraryEDICode, accountNumber, acquisitionMethod) => { + fillIntegrationInformationWithoutScheduling: ( + integrationName, + integartionDescription, + vendorEDICode, + libraryEDICode, + accountNumber, + acquisitionMethod + ) => { cy.do([ - Section({ id: 'integrationInfo' }).find(TextField('Integration name*')).fillIn(integrationName), + Section({ id: 'integrationInfo' }) + .find(TextField('Integration name*')) + .fillIn(integrationName), TextArea('Description').fillIn(integartionDescription), ediSection.find(TextField('Vendor EDI code*')).fillIn(vendorEDICode), ediSection.find(TextField('Library EDI code*')).fillIn(libraryEDICode), ediSection.find(Button({ icon: 'info' })).click(), - Checkbox({ name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.supportInvoice' }).click(), + Checkbox({ + name: 'exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.supportInvoice', + }).click(), ]); - cy.get('select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.accountNoList"]').select(accountNumber); - cy.get('select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.defaultAcquisitionMethods"]').select(acquisitionMethod); + cy.get( + 'select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.accountNoList"]' + ).select(accountNumber); + cy.get( + 'select[name="exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediConfig.defaultAcquisitionMethods"]' + ).select(acquisitionMethod); cy.do([ ftpSection.find(Select('EDI FTP')).choose('FTP'), ftpSection.find(TextField('Server address*')).fillIn(serverAddress), @@ -171,21 +298,34 @@ export default { cy.do([ actionsButton.click(), editButton.click(), - ediSection.find(TextField('Vendor EDI code*')).fillIn(vendorEDICodeEdited), - ediSection.find(TextField('Library EDI code*')).fillIn(libraryEDICodeEdited), + ediSection + .find(TextField('Vendor EDI code*')) + .fillIn(vendorEDICodeEdited), + ediSection + .find(TextField('Library EDI code*')) + .fillIn(libraryEDICodeEdited), saveAndClose.click(), ]); }, expectColorFromList: () => { - cy.get('#organizations-list').should('have.css', 'background-color', blueColor); + cy.get('#organizations-list').should( + 'have.css', + 'background-color', + blueColor + ); }, checkOpenOrganizationInfo: (organization) => { cy.expect(organizationDetails.exists()); - cy.expect(summarySection.find(KeyValue({ value: organization.name })).exists()); - cy.expect(summarySection.find(KeyValue({ value: organization.code })).exists()); + cy.expect( + summarySection.find(KeyValue({ value: organization.name })).exists() + ); + cy.expect( + summarySection.find(KeyValue({ value: organization.code })).exists() + ); }, + searchByParameters: (parameter, value) => { cy.do([ searchInput.selectIndex(parameter), @@ -196,22 +336,48 @@ export default { resetFilters: () => { cy.do(resetButton.click()); - cy.expect(resetButton.is({ disabled: true })); + cy.expect(resetButton.is({ disabled: true })); // Actual : true }, checkSearchResults: (organization) => { - cy.expect(organizationsList - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .has({ content: organization.name })); + cy.expect( + organizationsList + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 3 })) + .has({ content: organization.name }) + ); }, + selectYesInIsVendor: () => { cy.do([ - Button({ id: 'accordion-toggle-button-isVendor' }).click(), + Button({ id: 'accordion-toggle-button-org-filter-isVendor' }).click(), Checkbox('Yes').click(), ]); }, + selectNoInIsVendor: () => { + cy.do([ + Button({ id: 'accordion-toggle-button-org-filter-isVendor' }).click(), + Checkbox('No').click(), + ]); + }, + + selectVendor: () => { + cy.do([Checkbox('Vendor').click(), saveAndClose.click()]); + }, + + deselectVendor: () => { + cy.do([ + Checkbox('Vendor').click(), + confirmButton.click(), + saveAndClose.click(), + ]); + }, + + closeDetailsPane: () => { + cy.do([timesButton.click()]); + }, + selectCountryFilter: () => { cy.do([ Button({ id: 'accordion-toggle-button-plugin-country-filter' }).click(), @@ -227,40 +393,60 @@ export default { SelectionOption('English').click(), ]); }, + selectCashInPaymentMethod: () => { cy.do([ Button({ id: 'accordion-toggle-button-paymentMethod' }).click(), Checkbox('Cash').click(), ]); }, + deleteOrganizationViaApi: (organizationId) => cy.okapiRequest({ method: 'DELETE', path: `organizations/organizations/${organizationId}`, isDefaultSearchParamsRequired: false, }), - getOrganizationViaApi: (searchParams) => cy.okapiRequest({ - path: 'organizations/organizations', - searchParams - }).then(response => { return response.body.organizations[0]; }), - - createOrganizationViaApi: (organization) => cy.okapiRequest({ - method: 'POST', - path: 'organizations/organizations', - body: organization, - isDefaultSearchParamsRequired: false, - }).then(response => response.body.id), + getOrganizationViaApi: (searchParams) => cy + .okapiRequest({ + path: 'organizations/organizations', + searchParams, + }) + .then((response) => { + return response.body.organizations[0]; + }), + + createOrganizationViaApi: (organization) => cy + .okapiRequest({ + method: 'POST', + path: 'organizations/organizations', + body: organization, + isDefaultSearchParamsRequired: false, + }) + .then((response) => response.body.id), editOrganization: () => { + cy.expect(Spinner().absent()); + cy.expect(actionsButton.exists()); + cy.do(actionsButton.click()); + cy.expect(editButton.exists()); + cy.do(editButton.click()); + }, + + verifyNewCategory: (category) => { cy.do([ - actionsButton.click(), - editButton.click(), + openContactSectionButton.click(), + contactPeopleSection.find(addContactButton).click(), + categoryDropdown.click(), + cy.contains(category).should('exist'), ]); }, addAccount: () => { cy.do([ - Button({ id: 'accordion-toggle-button-org-filter-paymentMethod' }).click(), + Button({ + id: 'accordion-toggle-button-org-filter-paymentMethod', + }).click(), Checkbox('Cash').click(), ]); }, @@ -272,34 +458,59 @@ export default { addContacsModal.find(buttonNew).click(), lastNameField.fillIn(contact.lastName), firstNameField.fillIn(contact.firstName), - saveButtonInCotact.click() + saveButtonInCotact.click(), ]); InteractorsTools.checkCalloutMessage('The contact was saved'); }, + deleteContact: () => { + cy.do([actionsButton.click(), deleteButton.click(), confirmButton.click()]); + }, + + selectCategories: (category) => { + cy.do([ + MultiSelect().select(category), + saveAndClose.click(), + timesButton.click(), + openContactSectionButton.click(), + ]); + cy.expect( + contactPeopleDetails + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 1 })) + .has({ content: 'claim' }) + ); + cy.do([timesButton.click()]); + }, + addNewInterface: (defaultInterface) => { cy.do([ openInterfaceSectionButton.click(), interfaceSection.find(addInterfaceButton).click(), addInterfacesModal.find(buttonNew).click(), TextField({ name: 'name' }).fillIn(defaultInterface.name), - saveButton.click() + saveButton.click(), ]); InteractorsTools.checkCalloutMessage('The interface was saved'); }, + openContactPeopleSection: () => { + cy.do([openContactSectionButton.click()]); + }, + addContactToOrganization: (contact) => { cy.do([ openContactSectionButton.click(), contactPeopleSection.find(addContactButton).click(), - addContacsModal.find(SearchField({ id: 'input-record-search' })).fillIn(contact.lastName), - addContacsModal.find(searchButtonInModal).click() + addContacsModal + .find(SearchField({ id: 'input-record-search' })) + .fillIn(contact.lastName), + addContacsModal.find(searchButtonInModal).click(), ]); - cy.wait(4000); SearchHelper.selectCheckboxFromResultsList(); cy.do([ addContacsModal.find(saveButton).click(), - Button({ id: 'organization-form-save' }).click() + Button('Save & close').click(), ]); }, @@ -307,14 +518,16 @@ export default { cy.do([ openInterfaceSectionButton.click(), interfaceSection.find(addInterfaceButton).click(), - addInterfacesModal.find(TextField({ name: 'query' })).fillIn(defaultInterface.name), - addInterfacesModal.find(searchButtonInModal).click() + addInterfacesModal + .find(TextField({ name: 'query' })) + .fillIn(defaultInterface.name), + addInterfacesModal.find(searchButtonInModal).click(), ]); cy.wait(4000); SearchHelper.selectCheckboxFromResultsList(); cy.do([ addInterfacesModal.find(saveButton).click(), - Button({ id: 'organization-form-save' }).click() + Button({ id: 'organization-form-save' }).click(), ]); }, @@ -331,17 +544,19 @@ export default { }, checkContactIsAdd: (contact) => { - cy.expect(contactPeopleSection - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .has({ content: `${contact.lastName}, ${contact.firstName}` })); + cy.expect( + contactPeopleSection + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .has({ content: `${contact.lastName}, ${contact.firstName}` }) + ); }, checkInterfaceIsAdd: (defaultInterface) => { cy.do(openInterfaceSectionButton.click()); - cy.expect(interfaceSection - .find(KeyValue({ value: defaultInterface.name })) - .exists()); + cy.expect( + interfaceSection.find(KeyValue({ value: defaultInterface.name })).exists() + ); }, selectInterface: (defaultInterface) => { @@ -355,14 +570,19 @@ export default { cy.do([ actionsButton.click(), Button('Delete').click(), - Button({ id: 'clickable-delete-interface-modal-confirm' }).click() + Button({ id: 'clickable-delete-interface-modal-confirm' }).click(), ]); }, selectContact: (contact) => { - cy.wait(4000); cy.do([ - contactPeopleSection.find(MultiColumnListCell({ content: `${contact.lastName}, ${contact.firstName}` })).click(), + contactPeopleSection + .find( + MultiColumnListCell({ + content: `${contact.lastName}, ${contact.firstName}`, + }) + ) + .click(), ]); }, @@ -372,62 +592,90 @@ export default { editButton.click(), lastNameField.fillIn(`${contact.lastName}-edited`), firstNameField.fillIn(`${contact.firstName}-edited`), - saveButtonInCotact.click() + saveButtonInCotact.click(), ]); }, checkIntegrationsAdd: (integrationName, integartionDescription) => { - cy.do([ - openintegrationDetailsSectionButton.click(), - ]); - cy.expect(listIntegrationConfigs - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .has({ content: integrationName })); - cy.expect(listIntegrationConfigs - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 1 })) - .has({ content: integartionDescription })); - }, - - checkTwoIntegationsAdd: (integrationName1, integartionDescription1, integrationName2, integartionDescription2) => { - cy.do([ - openintegrationDetailsSectionButton.click(), - ]); - cy.expect(listIntegrationConfigs - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .has({ content: integrationName1 })); - cy.expect(listIntegrationConfigs - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 1 })) - .has({ content: integartionDescription1 })); - cy.expect(listIntegrationConfigs - .find(MultiColumnListRow({ index: 1 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .has({ content: integrationName2 })); - cy.expect(listIntegrationConfigs - .find(MultiColumnListRow({ index: 1 })) - .find(MultiColumnListCell({ columnIndex: 1 })) - .has({ content: integartionDescription2 })); + cy.do([openintegrationDetailsSectionButton.click()]); + cy.expect( + listIntegrationConfigs + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .has({ content: integrationName }) + ); + cy.expect( + listIntegrationConfigs + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 1 })) + .has({ content: integartionDescription }) + ); + }, + + checkTwoIntegationsAdd: ( + integrationName1, + integartionDescription1, + integrationName2, + integartionDescription2 + ) => { + cy.do([openintegrationDetailsSectionButton.click()]); + cy.expect( + listIntegrationConfigs + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .has({ content: integrationName1 }) + ); + cy.expect( + listIntegrationConfigs + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 1 })) + .has({ content: integartionDescription1 }) + ); + cy.expect( + listIntegrationConfigs + .find(MultiColumnListRow({ index: 1 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .has({ content: integrationName2 }) + ); + cy.expect( + listIntegrationConfigs + .find(MultiColumnListRow({ index: 1 })) + .find(MultiColumnListCell({ columnIndex: 1 })) + .has({ content: integartionDescription2 }) + ); }, deleteOrganization: () => { cy.do([ - PaneHeader({ id: 'paneHeaderpane-organization-details' }).find(actionsButton).click(), + PaneHeader({ id: 'paneHeaderpane-organization-details' }) + .find(actionsButton) + .click(), Button('Delete').click(), - Button({ id: 'clickable-delete-organization-confirmation-confirm' }).click() + Button({ + id: 'clickable-delete-organization-confirmation-confirm', + }).click(), ]); }, - selectOrganization:(organizationName) => { - cy.do(Pane({ id: 'organizations-results-pane' }).find(Link(organizationName)).click()); + selectOrganization: (organizationName) => { + cy.do( + Pane({ id: 'organizations-results-pane' }) + .find(Link(organizationName)) + .click() + ); + }, + + checkTextofElement: () => { + cy.xpath(numberOfSearchResultsHeader).then(($value) => { + const textValue = $value.length; + cy.log(textValue); + }); }, editOrganizationName: (organization) => { cy.do([ organizationNameField.fillIn(`${organization.name}-edited`), - saveAndClose.click() + saveAndClose.click(), ]); }, diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index db552fddda..449c7af6fc 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -1,18 +1,7 @@ /* eslint-disable cypress/no-unnecessary-waiting */ -import { - Button, - TextField, - Pane, - Select, - HTML, - including, - Checkbox, - Section, - Accordion, - TextArea, - MultiColumnListCell, -} from '../../../../interactors'; +import { Accordion, Button, Checkbox, HTML, MultiColumnListCell, Pane, Section, Select, Spinner, TextArea, TextField, including } from '../../../../interactors'; import { ITEM_STATUS_NAMES, REQUEST_TYPES } from '../../constants'; +import dateTools from '../../utils/dateTools'; import InteractorsTools from '../../utils/interactorsTools'; import SelectUser from './selectUser'; @@ -24,13 +13,13 @@ const requesterBarcodeInput = TextField({ name: 'requester.barcode' }); const enterItemBarcodeButton = Button({ id: 'clickable-select-item' }); const enterRequesterBarcodeButton = Button({ id: 'clickable-select-requester' }); const saveAndCloseButton = Button('Save & close'); -const selectServicePoint = Select({ name:'pickupServicePointId' }); +const selectServicePoint = Select({ name: 'pickupServicePointId' }); const selectRequestType = Select({ name: 'requestType' }); const titleLevelRequest = Checkbox({ name: 'createTitleLevelRequest' }); const selectItemPane = Pane({ id: 'items-dialog-instance-items-list' }); function addRequester(userName) { - cy.do(Button({ id:'requestform-addrequest' }).click()); + cy.do(Button({ id: 'requestform-addrequest' }).click()); SelectUser.searchUser(userName); SelectUser.selectUserFromList(userName); } @@ -78,8 +67,8 @@ export default { cy.expect(HTML(including(pickupServicePoint)).exists()); }, - saveRequestAndClose:() => cy.do(saveAndCloseButton.click()), - waitLoading:() => cy.expect(Pane({ title: 'Request Detail' }).exists()), + saveRequestAndClose: () => cy.do(saveAndCloseButton.click()), + waitLoading: () => cy.expect(Pane({ title: 'Request Detail' }).exists()), createNewRequest(newRequest) { openNewRequestPane(); @@ -180,6 +169,13 @@ export default { ]); }, + enterRequestAndPatron: (patron) => { + cy.do([TextField({ id: 'requestExpirationDate' }).fillIn(dateTools.getCurrentDate()), + TextArea({ id: 'patronComments' }).fillIn(patron), + Checkbox({ name: 'createTitleLevelRequest' }).click()]) + cy.expect(Spinner().absent()) + }, + chooseRequestType(requestType) { cy.do(selectRequestType.choose(requestType)); }, diff --git a/cypress/support/fragments/topMenu.js b/cypress/support/fragments/topMenu.js index ee97996dfe..ce88380216 100644 --- a/cypress/support/fragments/topMenu.js +++ b/cypress/support/fragments/topMenu.js @@ -31,7 +31,7 @@ const exportManagerOrganizationsPath = 'export-manager/edi-jobs'; const customFieldsPath = '/settings/users/custom-fields'; const notesPath = '/settings/notes/general'; const permissionSetPath = '/settings/users/perms?layer=add'; -const customLabel = '/settings/eholdings'; +const customLabel = '/settings/eholdings' export default { @@ -65,8 +65,13 @@ export default { exportManagerPath, exportManagerOrganizationsPath, customFieldsPath, +<<<<<<< HEAD + notesPath, + permissionSetPath, +======= notesPath, permissionSetPath, +>>>>>>> 76c257975c27c71657983e014ff4a062a81d3219 customLabel, openCheckInApp:() => { cy.do(Link({ href: including('/checkin') }).click()); diff --git a/cypress/support/utils/dateTools.js b/cypress/support/utils/dateTools.js index b65199a95a..619bbefea3 100644 --- a/cypress/support/utils/dateTools.js +++ b/cypress/support/utils/dateTools.js @@ -1,28 +1,43 @@ import moment from 'moment'; import getRandomStringCode from './genereteTextCode'; -const padWithZero = value => String(value).padStart(2, '0'); +const padWithZero = (value) => String(value).padStart(2, '0'); +const currentStartDate = new Date(); +currentStartDate.setDate(currentStartDate.getDate()); +const currentEndDate = new Date(); +currentEndDate.setDate(currentEndDate.getDate() + 4); export default { padWithZero, getCurrentDate: () => { const currentDate = new Date(); - return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero(currentDate.getDate())}/${currentDate.getFullYear()}`; + return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero( + currentDate.getDate() + )}/${currentDate.getFullYear()}`; }, getCurrentDateForFileNaming: () => { const currentDate = new Date(); - return `${padWithZero(currentDate.getMonth() + 1)}_${padWithZero(currentDate.getDate())}_${currentDate.getFullYear()}`; + return `${padWithZero(currentDate.getMonth() + 1)}_${padWithZero( + currentDate.getDate() + )}_${currentDate.getFullYear()}`; }, getCurrentDateForFiscalYear: () => { const currentDate = new Date(); - return `${currentDate.getFullYear()}-${padWithZero(currentDate.getMonth() + 1)}-${padWithZero(currentDate.getDate())}`; + return `${currentDate.getFullYear()}-${padWithZero( + currentDate.getMonth() + 1 + )}-${padWithZero(currentDate.getDate())}`; }, getRandomFiscalYearCodeForRollover: (min, max) => { // returns random 4 digit code for the Fiscal Year - return 'FYTA' + Math.floor((Math.random() * (Math.floor(max) - Math.ceil(min)) + Math.ceil(min))).toString(); + return ( + 'FYTA' + + Math.floor( + Math.random() * (Math.floor(max) - Math.ceil(min)) + Math.ceil(min) + ).toString() + ); }, getPreviousDayDate: () => { @@ -37,7 +52,9 @@ export default { const month = yesterday.getMonth() + 1; const day = yesterday.getDate(); const year = yesterday.getFullYear(); - return `${month.toString().padStart(2, '0')}/${day.toString().padStart(2, '0')}/${year}`; + return `${month.toString().padStart(2, '0')}/${day + .toString() + .padStart(2, '0')}/${year}`; }, getTomorrowDayDateForFiscalYear: () => { @@ -52,22 +69,30 @@ export default { const month = tomorrow.getMonth() + 1; const day = tomorrow.getDate(); const year = tomorrow.getFullYear(); - return `${month.toString().padStart(2, '0')}/${day.toString().padStart(2, '0')}/${year}`; + return `${month.toString().padStart(2, '0')}/${day + .toString() + .padStart(2, '0')}/${year}`; }, getDayAfterTomorrowDateForFiscalYear: () => { const currentDate = new Date(); - return `${currentDate.getFullYear()}-${padWithZero(currentDate.getMonth() + 1)}-${padWithZero(currentDate.getDate() + 2)}`; + return `${currentDate.getFullYear()}-${padWithZero( + currentDate.getMonth() + 1 + )}-${padWithZero(currentDate.getDate() + 2)}`; }, getDayTomorrowDateForFiscalYear: () => { const currentDate = new Date(); - return `${currentDate.getFullYear()}-${padWithZero(currentDate.getMonth() + 1)}-${padWithZero(currentDate.getDate() + 1)}`; + return `${currentDate.getFullYear()}-${padWithZero( + currentDate.getMonth() + 1 + )}-${padWithZero(currentDate.getDate() + 1)}`; }, getPreviousDayDateForFiscalYear: () => { const currentDate = new Date(); - return `${currentDate.getFullYear()}-${padWithZero(currentDate.getMonth() + 1)}-${padWithZero(currentDate.getDate() - 1)}`; + return `${currentDate.getFullYear()}-${padWithZero( + currentDate.getMonth() + 1 + )}-${padWithZero(currentDate.getDate() - 1)}`; }, getPreviousFiscalYearCode: () => { @@ -75,12 +100,17 @@ export default { }, getCurrentFiscalYearCode: () => { - return 'FY' + (new Date().getFullYear()).toString(); + return 'FY' + new Date().getFullYear().toString(); }, getRandomFiscalYearCode: (min, max) => { // returns random 4 digit code for the Fiscal Year - return (getRandomStringCode(4)) + Math.floor((Math.random() * (Math.floor(max) - Math.ceil(min)) + Math.ceil(min))).toString(); + return ( + getRandomStringCode(4) + + Math.floor( + Math.random() * (Math.floor(max) - Math.ceil(min)) + Math.ceil(min) + ).toString() + ); }, getDateRanges: (rangesCount = 1, isInDifferentYears = false) => { @@ -91,9 +121,11 @@ export default { for (let i = 0; i < rangesCount; i++) { const specialRange = { startDay: new Date(currentDate), - endDay: new Date(currentDate) + endDay: new Date(currentDate), }; - specialRange.startDay.setDate(currentDate.getDate() - ((i + 1) * rangeLength) + 1); + specialRange.startDay.setDate( + currentDate.getDate() - (i + 1) * rangeLength + 1 + ); specialRange.endDay.setDate(currentDate.getDate() - i * rangeLength); resultRanges.push(specialRange); if (isInDifferentYears) { @@ -117,12 +149,18 @@ export default { // Formats date as YYYY-MM-DD or MM/DD/YYYY getFormattedDate({ date }, type = 'YYYY-MM-DD') { if (type === 'MM/DD/YYYY') { - return `${padWithZero(date.getMonth() + 1)}/${padWithZero(date.getDate())}/${date.getFullYear()}`; + return `${padWithZero(date.getMonth() + 1)}/${padWithZero( + date.getDate() + )}/${date.getFullYear()}`; } if (type === 'DD/MM/YYYY') { - return `${padWithZero(date.getDate())}/${padWithZero(date.getMonth() + 1)}/${date.getFullYear()}`; + return `${padWithZero(date.getDate())}/${padWithZero( + date.getMonth() + 1 + )}/${date.getFullYear()}`; } - return `${date.getFullYear()}-${padWithZero(date.getMonth() + 1)}-${padWithZero(date.getDate())}`; + return `${date.getFullYear()}-${padWithZero( + date.getMonth() + 1 + )}-${padWithZero(date.getDate())}`; }, // Formats date as MM/DD/YYYY without zeros - used in settings getFormattedDateWithSlashes({ date }) { @@ -180,7 +218,7 @@ export default { hour: 'numeric', minute: 'numeric', hour12: true, - timeZone: 'UTC' + timeZone: 'UTC', }; const formattedTime = currentDate.toLocaleString('en-US', options); return formattedTime; @@ -188,6 +226,23 @@ export default { getCurrentDateYYMMDD() { const initialCurrentDate = new Date(); - return `${initialCurrentDate.getFullYear().toString().substring(2)}${padWithZero(initialCurrentDate.getMonth() + 1)}${padWithZero(initialCurrentDate.getDate())}`; - } + return `${initialCurrentDate + .getFullYear() + .toString() + .substring(2)}${padWithZero( + initialCurrentDate.getMonth() + 1 + )}${padWithZero(initialCurrentDate.getDate())}`; + }, + + editFromDateRange() { + return `${(currentStartDate.getMonth() + 1).toString().padStart(2, '0')} + ${currentStartDate.getDate().toString().padStart(2, '0')}/ + ${currentStartDate.getFullYear()}`; + }, + + editEndDateRange() { + return `${(currentEndDate.getMonth() + 1).toString().padStart(2, '0')} + ${currentEndDate.getDate().toString().padStart(2, '0')}/ + ${currentEndDate.getFullYear()}`; + }, }; diff --git a/cypress/support/utils/stringTools.js b/cypress/support/utils/stringTools.js index f74bee330a..e1dd5ba6d5 100644 --- a/cypress/support/utils/stringTools.js +++ b/cypress/support/utils/stringTools.js @@ -1,6 +1,7 @@ export default function getRandomPostfix() { - return `${(Math.random() * 1000) - .toString(10)}${new Date().getMilliseconds()}`; + return `${(Math.random() * 1000).toString( + 10 + )}${new Date().getMilliseconds()}`; } export const getTestEntityValue = (entityName) => `autotest_${entityName ? `${entityName}_` : ''}${getRandomPostfix()}`; export const replaceByIndex = (initialString, index, newChar) => `${initialString.substring(0, index)}${newChar}${initialString.substring(index + 1)}`; diff --git a/interactors/key-value.js b/interactors/key-value.js index 3a6a61b8e4..576ef22392 100644 --- a/interactors/key-value.js +++ b/interactors/key-value.js @@ -11,5 +11,5 @@ export default createInteractor('key value') }) .actions({ // Use in case when link inside keyValue doesn't have href attribute - clickLink: ({ perform }) => perform((el) => el.querySelector('[data-testid=text-link]').click()), + clickLink: ({ perform }) => perform((el) => el.querySelector('[data-testid=text-link]').click()) }); From 6f158a9587bdea5ced24ad67d1e4586abd9c8ef2 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:37:12 +0300 Subject: [PATCH 30/55] FAT-7197 (#1438) * deleted cy.reload() C358137 * deleted skip * fixed C17033 * fixed C350590 * deleted cy.reload() from tests * deleted method for deleting download folder * refactored code * fixed linter issue --- .../delete-all-logs-from-landing-page.cy.js | 1 - ...mport-file-for-create-invoice-record.cy.js | 1 - .../e2e/edi-import-large-invoice-file.cy.js | 1 - .../e2e/field-protection-overrides.cy.js | 3 - .../e2e/field-protection-settings.cy.js | 2 - ...r-and-delete-import-logs-on-view-all.cy.js | 4 +- .../e2e/match-on-holdings-856-u.cy.js | 2 - .../match-on-instance-identifier-scen1.cy.js | 2 - .../match-on-instance-identifier-scen2.cy.js | 6 +- .../match-on-pol-and-update-instance.cy.js | 19 +++--- .../e2e/match-on-pol-and-update-items.cy.js | 32 +++++----- .../e2e/match-on-vrn-and-update-items.cy.js | 22 ++++--- .../mrc-import-file-for-create-items.cy.js | 1 - ...mport-file-for-modify-marcBib-record.cy.js | 5 +- .../mrc-import-file-for-update-items.cy.js | 11 ++-- .../e2e/mrc-import-with-matching-001.cy.js | 2 - .../e2e/mrc-import-with-matching-999ff.cy.js | 2 - .../e2e/data-import/e2e/view-all-filter.cy.js | 3 - cypress/e2e/data-import/e2e/view-all.cy.js | 1 - ...ecords-with-999-ff-field-and-without.cy.js | 2 +- ...ndling-for-new-and-update-srs-record.cy.js | 16 ++--- ...-for-holdings-proceed-without-errors.cy.js | 5 +- ...on-and-field-mapping-create-instance.cy.js | 1 - ...when-job-profile-not-create-instance.cy.js | 20 +++---- ...-not-processed-for-invalid-marc-bibs.cy.js | 5 +- ...it-file-and-reimport-to-update-items.cy.js | 3 - .../field-protection-modification.cy.js | 11 ++-- ...import-a-bunch-of-marc-files-at-once.cy.js | 1 - ...stopping-running-job-and-deleting-it.cy.js | 2 - ...import-of-orders-with-pending-status.cy.js | 1 - ...lectronic-resource-with-no-inventory.cy.js | 1 - ...-orders-other-with-instance-holdings.cy.js | 1 - ...source-with-instances-holdings-items.cy.js | 1 - ...orting-ebook-orders-with-open-status.cy.js | 1 - .../item-update-via-match-by-status.cy.js | 37 ++++++------ ...d-check-in-out-notes-from-marc-field.cy.js | 19 +++--- ...-update-select-fields-works-properly.cy.js | 21 ++++--- .../match-on-instance-identifier-scen3.cy.js | 2 - .../match-on-instance-identifier-scen4.cy.js | 2 - .../match-on-location.cy.js | 2 - .../match-on-oclc-and-update-instance.cy.js | 2 - ...g-on-newly-created-035-does-not-work.cy.js | 22 +++---- ...-pe-mix-with-instance-holdings-items.cy.js | 1 - ...rc-import-with-999-field-and-without.cy.js | 1 - ...tches-under-actions-in-a-job-profile.cy.js | 5 +- ...es-does-not-duplicate-control-fields.cy.js | 1 - ...n-incoming-records-not-deleted-scen1.cy.js | 1 - ...record-import-with-running-large-job.cy.js | 1 - ...or-marc-indicators-in-match-profiles.cy.js | 3 - .../test-remove-field-mapping-option.cy.js | 6 +- ...e-holdings-via-static-value-submatch.cy.js | 2 - .../updates-should-add-035-field.cy.js | 2 - ...aking-incorrect-records-into-account.cy.js | 3 - ...-records-do-or-do-not-have-999-field.cy.js | 7 +-- .../delete-logs-from-view-all.cy.js | 4 +- ...-discarded-error-actions-for-invoice.cy.js | 1 - ...instance-using-marc-to-marc-submatch.cy.js | 6 -- ...t-summary-table-for-creating-actions.cy.js | 40 +++++-------- ...ary-table-with-create-update-actions.cy.js | 7 +-- ...t-summury-table-for-updating-actions.cy.js | 59 +++++++++---------- ...orting-of-orders-with-pending-status.cy.js | 1 - ...s-for-created-imported-order-records.cy.js | 1 - ...y-records-created-after-not-matching.cy.js | 1 - ...not-exceed-number-of-records-in-file.cy.js | 2 - ...ile-only-involves-holdings-and-items.cy.js | 5 -- .../can-view-only-permission.cy.js | 4 +- .../user-cannot-delete-import-logs.cy.js | 5 +- ...-limited-permissions-can-import-file.cy.js | 29 +++------ ...ve-mapping-profile-to-action-profile.cy.js | 6 +- ...-profile-with-associated-job-profile.cy.js | 10 ++-- .../edit-existing-action-profile.cy.js | 6 +- .../edit-existing-mapping-profile.cy.js | 6 +- .../edit-existing-match-profile.cy.js | 6 +- .../fund-and-expense-class-mappings.cy.js | 4 -- ...elds-required-in-invoice-map-profile.cy.js | 4 +- ...-after-editing-marc-bib-in-quickMarc.cy.js | 3 +- ...ields-after-editing-marc-bib-outside.cy.js | 4 +- .../e2e/inventory/keyboard-shortcuts.cy.js | 2 +- cypress/e2e/requests/edit-request.cy.js | 2 +- .../data_import/job_profiles/newJobProfile.js | 56 +++--------------- .../fragments/data_import/logs/logs.js | 6 +- .../mapping_profiles/fieldMappingProfiles.js | 6 +- .../match_profiles/newMatchProfile.js | 12 ++-- .../fragments/inventory/holdingsRecordView.js | 2 +- .../fragments/inventory/instanceRecordView.js | 2 +- .../fragments/inventory/inventoryInstances.js | 2 +- .../support/fragments/orders/orderLines.js | 1 + 87 files changed, 228 insertions(+), 408 deletions(-) diff --git a/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js b/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js index 3f894d5b10..0c609b08a7 100644 --- a/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js +++ b/cypress/e2e/data-import/e2e/delete-all-logs-from-landing-page.cy.js @@ -41,7 +41,6 @@ describe('ui-data-import', () => { fileNameToUpload = `C358137autotestFile.${getRandomPostfix()}.mrc`; // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.waitLoading(); DataImport.uploadFile(filePath, fileNameToUpload); JobProfiles.searchJobProfileForImport(jobProfileToRun); diff --git a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js index 474b7612fb..a9b11614fa 100644 --- a/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-file-for-create-invoice-record.cy.js @@ -93,7 +93,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('ediFileForC343338.edi', fileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.selectJobProfile(); diff --git a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js index 4881eda291..b4e60d87cf 100644 --- a/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js +++ b/cypress/e2e/data-import/e2e/edi-import-large-invoice-file.cy.js @@ -75,7 +75,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('ediFileForC347615.edi', fileName); DataImport.waitFileIsUploaded(); JobProfiles.searchJobProfileForImport(jobProfile.profileName); diff --git a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js index f1f4e40c09..0c7526ccdc 100644 --- a/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-overrides.cy.js @@ -245,7 +245,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC17018-BeforeOverride.mrc', fileNameForCreatingInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -269,7 +268,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedFileNameRev1, fileNameForProtect); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); @@ -300,7 +298,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedFileNameRev2, fileNameForOverride); JobProfiles.searchJobProfileForImport(jobProfileForOverride.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js index b0992a76e3..bbe2e104e8 100644 --- a/cypress/e2e/data-import/e2e/field-protection-settings.cy.js +++ b/cypress/e2e/data-import/e2e/field-protection-settings.cy.js @@ -155,7 +155,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC17017.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -208,7 +207,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js b/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js index 0836c20767..c77b831aa1 100644 --- a/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js +++ b/cypress/e2e/data-import/e2e/filter-and-delete-import-logs-on-view-all.cy.js @@ -11,7 +11,6 @@ import JobProfiles from '../../../support/fragments/data_import/job_profiles/job import DevTeams from '../../../support/dictionary/devTeams'; import Logs from '../../../support/fragments/data_import/logs/logs'; import TestTypes from '../../../support/dictionary/testTypes'; -import Helper from '../../../support/fragments/finance/financeHelper'; import { JOB_STATUS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { @@ -39,7 +38,7 @@ describe('ui-data-import', () => { }); // 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${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); } @@ -63,7 +62,6 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcAuthority.mrc', nameMarcFileForCreate); // need to wait until file will be uploaded in loop cy.wait(8000); diff --git a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js index 3b08eb1235..eabbc625dc 100644 --- a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js @@ -155,7 +155,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC17025.mrc', nameForCreateMarcFile); JobProfiles.searchJobProfileForImport(createInstanceAndEHoldingsJobProfile.profileName); JobProfiles.runImportFile(); @@ -172,7 +171,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC17025.mrc', nameForUpdateCreateMarcFile); JobProfiles.searchJobProfileForImport(updateEHoldingsJobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js index 98eb34b89a..90219409b7 100644 --- a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen1.cy.js @@ -104,7 +104,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForMatchOnIdentifierForCreate.mrc', fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -144,7 +143,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForMatchOnIdentifierForUpdate_1.mrc', fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js index 7782df3552..a56bc2d8ec 100644 --- a/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-instance-identifier-scen2.cy.js @@ -1,3 +1,5 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import TopMenu from '../../../support/fragments/topMenu'; @@ -6,7 +8,6 @@ import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -import getRandomPostfix from '../../../support/utils/stringTools'; import DataImport from '../../../support/fragments/data_import/dataImport'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../../support/fragments/data_import/logs/logs'; @@ -19,7 +20,6 @@ import ActionProfiles from '../../../support/fragments/data_import/action_profil import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; -import permissions from '../../../support/dictionary/permissions'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; @@ -107,7 +107,6 @@ describe('ui-data-import', () => { it('C347829 MODDICORE-231 "Match on Instance identifier match meets both the Identifier type and Data requirements" Scenario 2 (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -146,7 +145,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForUpdateInstance, fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js b/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js index e930bd3bdf..dd26d636b4 100644 --- a/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-pol-and-update-instance.cy.js @@ -21,7 +21,6 @@ import NewFieldMappingProfile from '../../../support/fragments/data_import/mappi import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; @@ -51,31 +50,31 @@ describe('ui-data-import', () => { const collectionOfProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350944 Update Instance by POL match ${Helper.getRandomBarcode()}` }, + name: `C350944 Update Instance by POL match ${getRandomPostfix()}` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350944 Update Instance by POL match ${Helper.getRandomBarcode()}`, + name: `C350944 Update Instance by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350944 Create Holdings by POL match ${Helper.getRandomBarcode()}`, + name: `C350944 Create Holdings by POL match ${getRandomPostfix()}`, callNumberType: `"${CALL_NUMBER_TYPE_NAMES.LIBRARY_OF_CONGRESS}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350944 Create Holdings by POL match ${Helper.getRandomBarcode()}` } + name: `C350944 Create Holdings by POL match ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350944 Create Item by POL match ${Helper.getRandomBarcode()}`, + name: `C350944 Create Item by POL match ${getRandomPostfix()}`, status: ITEM_STATUS_NAMES.AVAILABLE, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350944 Create Item by POL match ${Helper.getRandomBarcode()}` } + name: `C350944 Create Item by POL match ${getRandomPostfix()}` } } ]; const matchProfile = { - profileName: `C350944 935 $a POL to Instance POL ${Helper.getRandomBarcode()}`, + profileName: `C350944 935 $a POL to Instance POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield:'a' @@ -86,7 +85,7 @@ describe('ui-data-import', () => { }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350944 Update Instance, and create Holdings, Item based on POL match ${Helper.getRandomBarcode()}`, + profileName: `C350944 Update Instance, and create Holdings, Item based on POL match ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; const order = { ...NewOrder.defaultOneTimeOrder, @@ -227,7 +226,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC350944.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -257,7 +255,6 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js index 2223e7409a..5509cb0abd 100644 --- a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js @@ -1,5 +1,6 @@ import uuid from 'uuid'; import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import { FOLIO_RECORD_TYPE, LOCATION_NAMES, @@ -65,37 +66,37 @@ describe('ui-data-import', () => { quantity: '1', price: '20' }; - const editedMarcFileName = `C350590 marcFileForMatchOnPol.${Helper.getRandomBarcode()}.mrc`; + const editedMarcFileName = `C350590 marcFileForMatchOnPol.${getRandomPostfix()}.mrc`; const collectionOfProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350590 Update Instance by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Instance by POL match ${getRandomPostfix()}`, update: true }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C350590 Update Instance by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Instance by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350590 Update Holdings by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Holdings by POL match ${getRandomPostfix()}`, update: true }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C350590 Update Holdings by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Holdings by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350590 Update Item by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Item by POL match ${getRandomPostfix()}`, update: true }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C350590 Update Item by POL match ${Helper.getRandomBarcode()}`, + name: `C350590 Update Item by POL match ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } ]; const collectionOfMatchProfiles = [ { - matchProfile: { profileName: `C350590 935 $a POL to Instance POL ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C350590 935 $a POL to Instance POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield:'a' @@ -105,7 +106,7 @@ describe('ui-data-import', () => { instanceOption: NewMatchProfile.optionsList.pol } }, { - matchProfile: { profileName: `C350590 935 $a POL to Holdings POL ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C350590 935 $a POL to Holdings POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield: 'a' @@ -116,7 +117,7 @@ describe('ui-data-import', () => { }, { matchProfile: { - profileName: `C350590 935 $a POL to Item POL ${Helper.getRandomBarcode()}`, + profileName: `C350590 935 $a POL to Item POL ${getRandomPostfix()}`, incomingRecordFields: { field: '935', subfield: 'a' @@ -129,7 +130,7 @@ describe('ui-data-import', () => { ]; const specialJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350590 autotestJobProf${Helper.getRandomBarcode()}`, + profileName: `C350590 autotestJobProf${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; before('create test data', () => { @@ -247,7 +248,7 @@ describe('ui-data-import', () => { const checkReceivedPiece = (number, title) => { cy.visit(TopMenu.ordersPath); Orders.resetFilters(); - Orders.searchByParameter('PO number', number); + Orders.searchByParameter('PO number', `${number}-1`); Orders.selectFromResultsList(number); OrderView.openPolDetails(title); OrderLines.openReceiving(); @@ -334,16 +335,15 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(specialJobProfile); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfProfiles[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfProfiles[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfProfiles[1].actionProfile.name, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfProfiles[2].actionProfile.name, 4); NewJobProfile.saveAndClose(); // upload .mrc file cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.checkIsLandingPageOpened(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); diff --git a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js index 26f6364dc2..6ece082cfa 100644 --- a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js @@ -2,7 +2,6 @@ import uuid from 'uuid'; import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; -import Helper from '../../../support/fragments/finance/financeHelper'; import TopMenu from '../../../support/fragments/topMenu'; import Logs from '../../../support/fragments/data_import/logs/logs'; import MatchOnVRN from '../../../support/fragments/data_import/matchOnVRN'; @@ -53,15 +52,15 @@ describe('ui-data-import', () => { let user = null; let orderNumber; - const instanceMappingProfileName = `C350591 Update Instance by VRN match ${Helper.getRandomBarcode()}`; - const holdingsMappingProfileName = `C350591 Update Holdings by VRN match ${Helper.getRandomBarcode()}`; - const itemMappingProfileName = `C350591 Update Item by VRN match ${Helper.getRandomBarcode()}`; - const instanceActionProfileName = `C350591 Action for Instance ${Helper.getRandomBarcode()}`; - const holdingsActionProfileName = `C350591 Action for Holdings ${Helper.getRandomBarcode()}`; - const itemActionProfileName = `C350591 Action for Item ${Helper.getRandomBarcode()}`; - const instanceMatchProfileName = `C350591 Match for Instance ${Helper.getRandomBarcode()}`; - const holdingsMatchProfileName = `C350591 Match for Holdings ${Helper.getRandomBarcode()}`; - const itemMatchProfileName = `C350591 Match for Item ${Helper.getRandomBarcode()}`; + const instanceMappingProfileName = `C350591 Update Instance by VRN match ${getRandomPostfix()}`; + const holdingsMappingProfileName = `C350591 Update Holdings by VRN match ${getRandomPostfix()}`; + const itemMappingProfileName = `C350591 Update Item by VRN match ${getRandomPostfix()}`; + const instanceActionProfileName = `C350591 Action for Instance ${getRandomPostfix()}`; + const holdingsActionProfileName = `C350591 Action for Holdings ${getRandomPostfix()}`; + const itemActionProfileName = `C350591 Action for Item ${getRandomPostfix()}`; + const instanceMatchProfileName = `C350591 Match for Instance ${getRandomPostfix()}`; + const holdingsMatchProfileName = `C350591 Match for Holdings ${getRandomPostfix()}`; + const itemMatchProfileName = `C350591 Match for Item ${getRandomPostfix()}`; const editedMarcFileName = `marcFileForC350591.${getRandomPostfix()}.mrc`; const matchProfiles = [ @@ -80,7 +79,7 @@ describe('ui-data-import', () => { ]; const jobProfilesData = { - name: `C350591 Job profile ${Helper.getRandomBarcode()}`, + name: `C350591 Job profile ${getRandomPostfix()}`, dataType: ACCEPTED_DATA_TYPE_NAMES.MARC, matches: [ { @@ -240,7 +239,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.checkIsLandingPageOpened(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfilesData.name); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js index 07fc3a6c7e..497d8958e4 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-create-items.cy.js @@ -130,7 +130,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', fileName); JobProfiles.searchJobProfileForImport(specialJobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js index 2891fe4bb9..7c9f549675 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-modify-marcBib-record.cy.js @@ -84,8 +84,7 @@ describe('ui-data-import', () => { MatchProfiles.deleteMatchProfile(matchProfile.profileName); ActionProfiles.deleteActionProfile(actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(mappingProfileFieldsForModify.name); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); Users.deleteViaApi(user.userId); @@ -98,7 +97,6 @@ describe('ui-data-import', () => { it('C345423 Verify the possibility to modify MARC Bibliographic record (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // upload a marc file for creating of the new instance, holding and item DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -157,7 +155,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(nameMarcFileForUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js index abf0d56970..da4aa297a1 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js @@ -338,8 +338,7 @@ describe('ui-data-import', () => { FieldMappingProfiles.deleteFieldMappingProfile(nameInstanceMappingProfile); FieldMappingProfiles.deleteFieldMappingProfile(nameHoldingsMappingProfile); FieldMappingProfiles.deleteFieldMappingProfile(nameItemMappingProfile); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForImportUpdate}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHRID}"` }) @@ -385,7 +384,6 @@ describe('ui-data-import', () => { it('C343335 MARC file upload with the update of instance, holding, and items (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // upload a marc file for creating of the new instance, holding and item DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); @@ -451,16 +449,15 @@ describe('ui-data-import', () => { // create Job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfMappingAndActionProfiles[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfiles[1].actionProfile.name, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfMappingAndActionProfiles[2].actionProfile.name, 4); NewJobProfile.saveAndClose(); // upload the exported marc file cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(nameMarcFileForImportUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js index b7808ee101..352ed81879 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js @@ -83,7 +83,6 @@ describe('ui-data-import', () => { it('C17044: MARC-MARC matching for 001 field (folijet)', { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // upload a marc file for export DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -133,7 +132,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(nameForExportedMarcFile); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js b/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js index 9e25bd5a3f..5316328753 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-with-matching-999ff.cy.js @@ -109,7 +109,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameForMarcFile); JobProfiles.searchJobProfileForImport(jobProfileForExport.profileName); JobProfiles.runImportFile(); @@ -161,7 +160,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(nameForExportedMarcFile); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/e2e/view-all-filter.cy.js b/cypress/e2e/data-import/e2e/view-all-filter.cy.js index eb9fcd669c..a6d2cc99bc 100644 --- a/cypress/e2e/data-import/e2e/view-all-filter.cy.js +++ b/cypress/e2e/data-import/e2e/view-all-filter.cy.js @@ -34,14 +34,11 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // Upload files // runs with errors cy.uploadFileWithDefaultJobProfile(fileNameForFailedImport); - cy.reload(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // runs successfully cy.uploadFileWithDefaultJobProfile(fileNameForSuccessfulImport); diff --git a/cypress/e2e/data-import/e2e/view-all.cy.js b/cypress/e2e/data-import/e2e/view-all.cy.js index 1f9cc4a7d5..7f0da2fc25 100644 --- a/cypress/e2e/data-import/e2e/view-all.cy.js +++ b/cypress/e2e/data-import/e2e/view-all.cy.js @@ -22,7 +22,6 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // remove generated test file from fixtures after uploading cy.uploadFileWithDefaultJobProfile(uniqueFileName); FileManager.deleteFile(`cypress/fixtures/${uniqueFileName}`); diff --git a/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js index 77162b544b..e989da9eeb 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/import-marc-authority-records-with-999-ff-field-and-without.cy.js @@ -34,7 +34,7 @@ describe('ui-data-import', () => { it('C359207 Checking the import to Create MARC Authority records, when incoming records do and do not have 999 ff field (folijet)', { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete reload after fix https://issues.folio.org/browse/MODDATAIMP-691 - cy.reload(); + DataImport.verifyUploadState(); // upload the first .mrc file DataImport.uploadFile('marcAuthFileC359207.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js index d23be5dc3e..23e8b64eb5 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/001-003-005-handling-for-new-and-update-srs-record.cy.js @@ -13,7 +13,6 @@ import Logs from '../../../support/fragments/data_import/logs/logs'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; @@ -43,7 +42,7 @@ describe('ui-data-import', () => { const fileNameAfterUpload = `C17039 uploadedFile.${getRandomPostfix()}.mrc`; const matchProfile = { - profileName: `C17039 match profile ${Helper.getRandomBarcode()}`, + profileName: `C17039 match profile ${getRandomPostfix()}`, incomingRecordFields: { field: '999', in1: 'f', @@ -56,18 +55,18 @@ describe('ui-data-import', () => { }; const mappingProfile = { - name: `C17039 mapping profile ${Helper.getRandomBarcode()}`, + name: `C17039 mapping profile ${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17039 action profile ${Helper.getRandomBarcode()}`, + name: `C17039 action profile ${getRandomPostfix()}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const jobProfile = { - profileName: `C17039 job profile ${Helper.getRandomBarcode()}`, + profileName: `C17039 job profile ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -80,7 +79,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -100,8 +98,7 @@ describe('ui-data-import', () => { MatchProfiles.deleteMatchProfile(matchProfile.profileName); ActionProfiles.deleteActionProfile(actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(mappingProfile.name); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) @@ -119,7 +116,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFilrForC17039.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -188,7 +184,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, fileNameAfterUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -229,7 +224,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(exportedFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js index 03e2420294..166b346836 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/3-successive-update-actions-for-holdings-proceed-without-errors.cy.js @@ -127,8 +127,7 @@ describe('ui-data-import', () => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${editedMarcFileName}`); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) .then((instance) => { @@ -163,7 +162,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreate, marcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -248,7 +246,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js index 90b94d533d..9e7b9f3a34 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/action-and-field-mapping-create-instance.cy.js @@ -90,7 +90,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js index aee43e8300..e60933bafc 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/create-holdings-and-item-when-job-profile-not-create-instance.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { @@ -13,7 +14,6 @@ import { } from '../../../support/constants'; import TopMenu from '../../../support/fragments/topMenu'; import DataImport from '../../../support/fragments/data_import/dataImport'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; @@ -37,27 +37,27 @@ describe('ui-data-import', () => { let instanceHrid; let exportedFileName; const quantityOfItems = '1'; - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix()}`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368009 Testing item for SRS MARC bib ${Helper.getRandomBarcode()}`, + name: `C368009 Testing item for SRS MARC bib ${getRandomPostfix()}`, materialType: `"${MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE}"`, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368009 Testing holding for SRS MARC bib ${Helper.getRandomBarcode()}` } + name: `C368009 Testing holding for SRS MARC bib ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368009 Testing holding for SRS MARC bib ${Helper.getRandomBarcode()}`, + name: `C368009 Testing holding for SRS MARC bib ${getRandomPostfix()}`, permanentLocation: `"${LOCATION_NAMES.ANNEX}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368009 Testing holding for SRS MARC bib ${Helper.getRandomBarcode()}` } + name: `C368009 Testing holding for SRS MARC bib ${getRandomPostfix()}` } } ]; const matchProfile = { - profileName: `C368009 001 to Instance HRID ${Helper.getRandomBarcode()}`, + profileName: `C368009 001 to Instance HRID ${getRandomPostfix()}`, incomingRecordFields: { field: '001' }, @@ -66,7 +66,7 @@ describe('ui-data-import', () => { instanceOption: NewMatchProfile.optionsList.instanceHrid }; const jobProfile = { - profileName: `C368009 Testing SRS MARC bib ${Helper.getRandomBarcode()}`, + profileName: `C368009 Testing SRS MARC bib ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -104,8 +104,7 @@ describe('ui-data-import', () => { FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); Users.deleteViaApi(user.userId); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) .then((instance) => { @@ -182,7 +181,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(exportedFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js index 94d726231e..3d78201830 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/error-records-not-processed-for-invalid-marc-bibs.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import DevTeams from '../../../support/dictionary/devTeams'; import TestTypes from '../../../support/dictionary/testTypes'; import DataImport from '../../../support/fragments/data_import/dataImport'; @@ -6,7 +7,6 @@ import TopMenu from '../../../support/fragments/topMenu'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../../support/fragments/data_import/logs/logs'; import Users from '../../../support/fragments/users/users'; -import Helper from '../../../support/fragments/finance/financeHelper'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import { JOB_STATUS_NAMES } from '../../../support/constants'; @@ -14,7 +14,7 @@ describe('ui-data-import', () => { let user; // eslint-disable-next-line const error = '{\"errors\":[{\"name\":\"io.vertx.core.json.DecodeException\",\"message\":\"Failed to decode:Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in name\\n at [Source: (String)\\\"{\\\"leader\\\":\\\"01621cas a2200445 a 4500\\\",\\\"fields\\\":[{\\\"001\\\":\\\"in00000012507\\\"},{\\\"003\\\":\\\"OCoLC\\\"},{\\\"008\\\":\\\"06d0504c20069999txufr pso 0 a0eng c\\\"},{\\\"015\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\";\\\",\\\"ind2\\\":\\\"A\\\"}},{\\\"00\\\\u0009\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\" \\\",\\\"ind2\\\":\\\" \\\"}},{\\\"0==\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\"d\\\",\\\"ind2\\\":\\\"s\\\"}},{\\\"\\\\u0009\\\\A\\\":{\\\"subfields\\\":[],\\\"ind1\\\":\\\"5\\\",\\\"ind2\\\":\\\"8\\\"}},{\\\"022\\\":{\\\"subfields\\\":[{\\\"a\\\":\\\"1 931-7603\\\"},{\\\"l\\\":\\\"1931-7603\\\"},{\\\"2\\\":\\\"1\\\"}],\\\"ind1\\\":\\\"0\\\",\\\"ind2\\\":\\\" \\\"}},{\\\"035\\\":{\\\"subfields\\\":[{\\\"a\\\":\\\"(OCoLC)68188263\\\"},{\\\"z\\\":\\\"(OCoLC)1058285745\\\"}],\\\"ind1\\\":\\\"\\\"[truncated 2505 chars]; line: 1, column: 192]\"}]}'; - const nameMarcFileForImportCreate = `C350750autotestFile.${Helper.getRandomBarcode()}.mrc`; + const nameMarcFileForImportCreate = `C350750autotestFile.${getRandomPostfix()}.mrc`; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; before('login', () => { @@ -40,7 +40,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC350750.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js index 87b3b5f45b..119a6ef972 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/export-from-inventory-edit-file-and-reimport-to-update-items.cy.js @@ -226,7 +226,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('mrcFileForC11123.mrc', marcFileForCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -244,7 +243,6 @@ describe('ui-data-import', () => { }); after('delete test data', () => { - FileManager.deleteFolder(Cypress.config('downloadsFolder')); FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpload}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); @@ -325,7 +323,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, nameMarcFileForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js index ba6622b1e5..93a8d99502 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/field-protection-modification.cy.js @@ -1,8 +1,8 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import MarcFieldProtection from '../../../support/fragments/settings/dataImport/marcFieldProtection'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; @@ -25,20 +25,20 @@ describe('ui-data-import', () => { const fieldsForDelete = ['977', '978', '979']; const fieldsForDeleteIds = []; // unique file name to upload - const fileName = `C350678autotestFileProtection.${Helper.getRandomBarcode()}.mrc`; + const fileName = `C350678autotestFileProtection.${getRandomPostfix}.mrc`; - const mappingProfile = { name: `C350678 Remove extraneous MARC fields ${Helper.getRandomBarcode()}`, + const mappingProfile = { name: `C350678 Remove extraneous MARC fields ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C350678 Remove extraneous MARC fields ${Helper.getRandomBarcode()}`, + name: `C350678 Remove extraneous MARC fields ${getRandomPostfix}`, action: 'Modify (MARC Bibliographic record type only)' }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C350678 Create bib and instance, but remove some MARC fields first ${Helper.getRandomBarcode()}`, + profileName: `C350678 Create bib and instance, but remove some MARC fields first ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -127,7 +127,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC350678.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js index 05e8d1da31..71a94bc550 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-a-bunch-of-marc-files-at-once.cy.js @@ -34,7 +34,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadBunchOfFiles(filePathForUpload, upload.quantityOfFiles, upload.fileName); DataImport.waitFileIsUploaded(); JobProfiles.searchJobProfileForImport(jobProfileToRun); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js index fc86e6dc02..17b5294b62 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-additional-files-without-handling-after-stopping-running-job-and-deleting-it.cy.js @@ -41,7 +41,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneThousandMarcBib.mrc', bigFileName); // TODO wait until file will be uploaded cy.wait(5000); @@ -61,7 +60,6 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', smallFileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.selectJobProfile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js index 955d6b7e01..2343d8443b 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-of-orders-with-pending-status.cy.js @@ -159,7 +159,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js index a24d4e0fe9..183450ab74 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-electronic-resource-with-no-inventory.cy.js @@ -96,7 +96,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js index 97ed736da5..f6f9205153 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-other-with-instance-holdings.cy.js @@ -134,7 +134,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js index c6f79c79bc..f672d80d4c 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js @@ -156,7 +156,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js index b7ba5dab6d..4fab9edb5b 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/importing-ebook-orders-with-open-status.cy.js @@ -118,7 +118,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC375989.mrc', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js index ee28f01fac..14e04424d7 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js @@ -1,4 +1,5 @@ /* eslint-disable cypress/no-unnecessary-waiting */ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import permissions from '../../../support/dictionary/permissions'; @@ -10,7 +11,6 @@ import { MATERIAL_TYPE_NAMES, EXISTING_RECORDS_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -46,42 +46,42 @@ describe('ui-data-import', () => { 'Language, borders and identity / edited by Dominic Watt and Carmen Llamas.' ]; const itemNote = 'THIS WAS UPDATED!'; - const jobProfileNameForExport = `C357552 Bibs with Item HRIDs ${Helper.getRandomBarcode()}`; + const jobProfileNameForExport = `C357552 Bibs with Item HRIDs ${getRandomPostfix}`; // file names - const nameMarcFileForImportCreate = `C357552autotestFile.${Helper.getRandomBarcode()}.mrc`; - const nameForCSVFile = `C357552autotestFile${Helper.getRandomBarcode()}.csv`; - const nameMarcFileForUpdate = `C357552autotestFile${Helper.getRandomBarcode()}.mrc`; + const nameMarcFileForImportCreate = `C357552autotestFile.${getRandomPostfix}.mrc`; + const nameForCSVFile = `C357552autotestFile${getRandomPostfix}.csv`; + const nameMarcFileForUpdate = `C357552autotestFile${getRandomPostfix}.mrc`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C357552 Create simple holdings ${Helper.getRandomBarcode()}`, + name: `C357552 Create simple holdings ${getRandomPostfix}`, permanentLocation: LOCATION_NAMES.ONLINE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C357552 Create simple holdings ${Helper.getRandomBarcode()}` } + name: `C357552 Create simple holdings ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Create simple items ${Helper.getRandomBarcode()}`, + name: `C357552 Create simple items ${getRandomPostfix}`, status: ITEM_STATUS_NAMES.AVAILABLE, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Create simple items ${Helper.getRandomBarcode()}` } + name: `C357552 Create simple items ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Update Item by POL match ${Helper.getRandomBarcode()}`, + name: `C357552 Update Item by POL match ${getRandomPostfix}`, status: ITEM_STATUS_NAMES.AVAILABLE, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C357552 Update simple items ${Helper.getRandomBarcode()}`, + name: `C357552 Update simple items ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } ]; const matchProfileItemHrid = { - profileName: `C357552 Match 902$a to Item HRID ${Helper.getRandomBarcode()}`, + profileName: `C357552 Match 902$a to Item HRID ${getRandomPostfix}`, incomingRecordFields: { field: '902', in1: '*', @@ -94,7 +94,7 @@ describe('ui-data-import', () => { }; const matchProfileItemStatus = { - profileName: `C357552 Item status = Available ${Helper.getRandomBarcode()}`, + profileName: `C357552 Item status = Available ${getRandomPostfix}`, incomingStaticValue: 'Available', matchCriterion: 'Exactly matches', existingRecordType: EXISTING_RECORDS_NAMES.ITEM, @@ -103,16 +103,16 @@ describe('ui-data-import', () => { const createJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C357552 Create simple instance, holdings, items ${Helper.getRandomBarcode()}`, + profileName: `C357552 Create simple instance, holdings, items ${getRandomPostfix}`, }; const updateJobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C357552 Update item based on HRID and Status ${Helper.getRandomBarcode()}`, + profileName: `C357552 Update item based on HRID and Status ${getRandomPostfix}`, }; const exportMappingProfile = { - name: `C357552 Item HRID ${Helper.getRandomBarcode()}`, + name: `C357552 Item HRID ${getRandomPostfix}`, }; before('create test data', () => { @@ -153,8 +153,7 @@ describe('ui-data-import', () => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${nameMarcFileForUpdate}`); FileManager.deleteFile(`cypress/fixtures/${nameForCSVFile}`); }); @@ -236,7 +235,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC357552.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(createJobProfile.profileName); JobProfiles.runImportFile(); @@ -291,7 +289,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(nameMarcFileForUpdate); JobProfiles.searchJobProfileForImport(updateJobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js index 380987cdda..8e988e9935 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mapping-for-item-notes-and-check-in-out-notes-from-marc-field.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { @@ -10,7 +11,6 @@ import { ACCEPTED_DATA_TYPE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import SettingsMenu from '../../../support/fragments/settingsMenu'; @@ -29,7 +29,7 @@ describe('ui-data-import', () => { let user; const rowNumbers = [0, 1]; const instanceHrids = []; - const marcFileName = `C368005 autotestFile.${Helper.getRandomBarcode()}.mrc`; + const marcFileName = `C368005 autotestFile.${getRandomPostfix}.mrc`; const itemNotes = { note: 'This is a plain note', checkInNoteForFirstItem: 'This is a check in note', @@ -42,21 +42,21 @@ describe('ui-data-import', () => { const collectionOfProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C368005 Create instance for mapping notes ${Helper.getRandomBarcode()}`, + name: `C368005 Create instance for mapping notes ${getRandomPostfix}`, catalogingDate: '###TODAY###' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C368005 Create instance for mapping notes ${Helper.getRandomBarcode()}` } + name: `C368005 Create instance for mapping notes ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368005 Create holdings for mapping notes ${Helper.getRandomBarcode()}`, + name: `C368005 Create holdings for mapping notes ${getRandomPostfix}`, permanetLocation: `"${LOCATION_NAMES.ANNEX}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C368005 Create holdings for mapping notes ${Helper.getRandomBarcode()}` } + name: `C368005 Create holdings for mapping notes ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368005 Create item for mapping notes ${Helper.getRandomBarcode()}`, + name: `C368005 Create item for mapping notes ${getRandomPostfix}`, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`, noteType: '876$t', note: '876$n', @@ -67,11 +67,11 @@ describe('ui-data-import', () => { permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C368005 Create items for mapping notes ${Helper.getRandomBarcode()}` } + name: `C368005 Create items for mapping notes ${getRandomPostfix}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C368005 Create mappings for item notes ${Helper.getRandomBarcode()}`, + profileName: `C368005 Create mappings for item notes ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; before('create test data', () => { @@ -153,7 +153,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC368005.mrc', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js index fa8ba6ace8..86dd69419c 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/marc-update-select-fields-works-properly.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE, @@ -5,7 +6,6 @@ import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES, EXISTING_RECORDS_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import TopMenu from '../../../support/fragments/topMenu'; import DataImport from '../../../support/fragments/data_import/dataImport'; import Logs from '../../../support/fragments/data_import/logs/logs'; @@ -26,33 +26,33 @@ describe('ui-data-import', () => { let instanceHrid; const quantityOfItems = '1'; // unique file names - const marcFileForCreate = `C17019 oneMarcBib.mrc${Helper.getRandomBarcode()}`; - const editedMarcFileName = `C17019 editedMarcFile.${Helper.getRandomBarcode()}.mrc`; - const fileNameForUpdate = `C17019 marcFileForUpdate.${Helper.getRandomBarcode()}.mrc`; + const marcFileForCreate = `C17019 oneMarcBib.mrc${getRandomPostfix}`; + const editedMarcFileName = `C17019 editedMarcFile.${getRandomPostfix}.mrc`; + const fileNameForUpdate = `C17019 marcFileForUpdate.${getRandomPostfix}.mrc`; // profiles for updating instance const instanceMappingProfile = { - name: `C17019 autotest instance mapping profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest instance mapping profile.${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE, statisticalCode: 'ARL (Collection stats): books - Book, print (books)', statisticalCodeUI: 'Book, print (books)', instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED }; const marcBibMappingProfile = { - name: `C17019 autotest marc bib mapping profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest marc bib mapping profile.${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC }; const instanceActionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C17019 autotest instance action profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest instance action profile.${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const marcBibActionProfile = { typeValue: FOLIO_RECORD_TYPE.MARCBIBLIOGRAPHIC, - name: `C17019 autotest marc bib action profile.${Helper.getRandomBarcode()}`, + name: `C17019 autotest marc bib action profile.${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const matchProfile = { - profileName: `C17019 autotest match profile.${Helper.getRandomBarcode()}`, + profileName: `C17019 autotest match profile.${getRandomPostfix}`, incomingRecordFields: { field: '001' }, @@ -64,7 +64,7 @@ describe('ui-data-import', () => { }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C17019 autotest job profile.${Helper.getRandomBarcode()}`, + profileName: `C17019 autotest job profile.${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -143,7 +143,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js index 388ca3e93b..a072a00193 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen3.cy.js @@ -124,7 +124,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateInstance, fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -164,7 +163,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForUpdateInstance, fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js index 9ac01a2440..f04eeaa8c3 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-instance-identifier-scen4.cy.js @@ -131,7 +131,6 @@ describe('ui-data-import', () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreateInstance); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -173,7 +172,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdateInstance); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js index e02e8d1a89..54b92d6e3a 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-location.cy.js @@ -234,7 +234,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC17027.mrc', marcFileForCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -344,7 +343,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, fileNameAfterUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js index 078e693af4..64648c6348 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/match-on-oclc-and-update-instance.cy.js @@ -144,7 +144,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[0].jobProfile.profileName); JobProfiles.runImportFile(); @@ -203,7 +202,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC11109.mrc', nameMarcFileForUpdate); JobProfiles.searchJobProfileForImport(collectionOfJobProfiles[1].jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js index 99f74bab04..2335dc8ac9 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js @@ -1,5 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE, @@ -32,13 +32,13 @@ describe('ui-data-import', () => { let firstInstanceHrid; let secondInstanceHrid; // unique file names - const fileForCreateFirstName = `C358138 firstAutotestFileForCreate.${Helper.getRandomBarcode()}.mrc`; - const fileForCreateSecondName = `C358138 secondAutotestFileForCreate.${Helper.getRandomBarcode()}.mrc`; - const fileForUpdateFirstName = `C358138 firstAutotestFileForUpdate.${Helper.getRandomBarcode()}.mrc`; - const fileForUpdateSecondName = `C358138 secondAutotestFileForUpdate.${Helper.getRandomBarcode()}.mrc`; + const fileForCreateFirstName = `C358138 firstAutotestFileForCreate.${getRandomPostfix}.mrc`; + const fileForCreateSecondName = `C358138 secondAutotestFileForCreate.${getRandomPostfix}.mrc`; + const fileForUpdateFirstName = `C358138 firstAutotestFileForUpdate.${getRandomPostfix}.mrc`; + const fileForUpdateSecondName = `C358138 secondAutotestFileForUpdate.${getRandomPostfix}.mrc`; const matchProfile = { - profileName: `C358138 Match on newly-created 035 ${Helper.getRandomBarcode()}`, + profileName: `C358138 Match on newly-created 035 ${getRandomPostfix}`, incomingRecordFields: { field: '035', in1: '*', @@ -51,18 +51,18 @@ describe('ui-data-import', () => { }; const mappingProfile = { - name: `C358138 Update instance via 035 ${Helper.getRandomBarcode()}`, + name: `C358138 Update instance via 035 ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C358138 Update instance via 035 ${Helper.getRandomBarcode()}`, + name: `C358138 Update instance via 035 ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' }; const jobProfile = { - profileName: `C358138 Update instance via 035 ${Helper.getRandomBarcode()}`, + profileName: `C358138 Update instance via 035 ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -121,7 +121,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // upload a marc file for creating of the new instance DataImport.uploadFile('marcFileForC358138.mrc', fileForCreateFirstName); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -176,7 +175,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC358138_rev.mrc', fileForUpdateFirstName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -200,7 +198,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC358138_with_035.mrc', fileForCreateSecondName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -230,7 +227,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC358138_with_035_rev.mrc', fileForUpdateSecondName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js index 7367aaabe1..86b57fe0ee 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-create-open-order-pe-mix-with-instance-holdings-items.cy.js @@ -152,7 +152,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js index c37cf908da..0468af30f8 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js @@ -40,7 +40,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC359012.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js index 15a9be9878..df767a4aaf 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js @@ -169,7 +169,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathToUpload, marcFileNameForCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -199,8 +198,7 @@ describe('ui-data-import', () => { }); after('delete test data', () => { - // delete downloads folder and created files in fixtures - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + // delete created files in fixtures FileManager.deleteFile(`cypress/fixtures/${exportedFileName}`); JobProfiles.deleteJobProfile(jobProfileForCreate.profile.name); JobProfiles.deleteJobProfile(jobProfileForUpdate.profileName); @@ -280,7 +278,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(exportedFileName); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js index efa037f156..dfeaf42d37 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/overlaying-with-single-record-import-creates-does-not-duplicate-control-fields.cy.js @@ -63,7 +63,6 @@ describe('ui-data-import', () => { InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { instanceHrid = initialInstanceHrId; - cy.reload(); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); InventoryInstance.startOverlaySourceBibRecord(); InventoryInstance.importWithOclc(oclcNumber); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js index b5131b7a93..1f1f2b11f4 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/protected-fields-in-incoming-records-not-deleted-scen1.cy.js @@ -49,7 +49,6 @@ describe('ui-data-import', () => { Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC358968.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js index 212b4deadf..c522e41493 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/single-record-import-with-running-large-job.cy.js @@ -66,7 +66,6 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneThousandMarcBib.mrc', fileName); // wait until file will be uploaded cy.wait(10000); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js index 17186979dc..989ff41c1a 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/test-any-versus-all-for-marc-indicators-in-match-profiles.cy.js @@ -184,7 +184,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -248,7 +247,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileNameForFirstUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithFail.profileName); JobProfiles.runImportFile(); @@ -266,7 +264,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileNameForSecondUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdateWithSucceed.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js index 34d366178e..6a3933ffaa 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js @@ -207,7 +207,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(marcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -280,8 +279,8 @@ describe('ui-data-import', () => { // create Job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 1); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfilesForUpdate[1].actionProfile.name, 2); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfileForUpdate.profileName); @@ -289,7 +288,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js index 2fc82b84bb..34f453190f 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js @@ -195,7 +195,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -275,7 +274,6 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js index b56778d38a..86e5df30dc 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js @@ -87,7 +87,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); // upload the first .mrc file DataImport.uploadFile('marcFileForC358998ForCreate_1.mrc', firstMarcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); @@ -147,7 +146,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(firstMarcFileNameForUpdate, firstFileNameAfterUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js index 03f533d5a6..46ea866a6c 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updating-record-via-035-match-without-taking-incorrect-records-into-account.cy.js @@ -133,7 +133,6 @@ describe('ui-data-import', () => { // upload a marc file // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathToUpload, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -157,7 +156,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathToUpload, fileNameForMatch); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -195,7 +193,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathToUpload, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js b/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js index 053cf97934..064f01f279 100644 --- a/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-holdings-files/mrc-import-create-holdings-when-some-records-do-or-do-not-have-999-field.cy.js @@ -1,8 +1,8 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import TopMenu from '../../../support/fragments/topMenu'; -import Helper from '../../../support/fragments/finance/financeHelper'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import DataImport from '../../../support/fragments/data_import/dataImport'; import Logs from '../../../support/fragments/data_import/logs/logs'; @@ -14,8 +14,8 @@ import FileManager from '../../../support/utils/fileManager'; describe('ui-data-import', () => { let user; let instanceHrid; - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; - const editedMarcFileName = `C359209 editedMarcFile.${Helper.getRandomBarcode()}.mrc`; + const fileName = `oneMarcBib.mrc${getRandomPostfix}`; + const editedMarcFileName = `C359209 editedMarcFile.${getRandomPostfix}.mrc`; const error = '{"error":"A new MARC-Holding was not created because the incoming record already contained a 999ff$s or 999ff$i field"}'; before('create test data', () => { @@ -57,7 +57,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport('Default - Create Holdings and SRS MARC Holdings'); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js b/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js index b434f78ed6..66fe9b4eaf 100644 --- a/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js +++ b/cypress/e2e/data-import/log-details/delete-logs-from-view-all.cy.js @@ -1,4 +1,5 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import DevTeams from '../../../support/dictionary/devTeams'; import TestTypes from '../../../support/dictionary/testTypes'; import DataImport from '../../../support/fragments/data_import/dataImport'; @@ -7,7 +8,6 @@ import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll import DeleteDataImportLogsModal from '../../../support/fragments/data_import/logs/deleteDataImportLogsModal'; import Logs from '../../../support/fragments/data_import/logs/logs'; import Users from '../../../support/fragments/users/users'; -import Helper from '../../../support/fragments/finance/financeHelper'; let user; const maxLogsQuantityOnPage = 100; @@ -21,7 +21,7 @@ describe('ui-data-import', () => { user = userProperties; for (let i = 0; i < 101; i++) { - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix}`; DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName); } diff --git a/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js b/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js index 2d6ebcf618..bd1675e09b 100644 --- a/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js +++ b/cypress/e2e/data-import/log-details/filter-in-summary-table-create-discarded-error-actions-for-invoice.cy.js @@ -90,7 +90,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('ediFileForC357018.edi', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js index 90fe596f2b..be7609030e 100644 --- a/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js +++ b/cypress/e2e/data-import/log-details/import-holdings-and-instance-using-marc-to-marc-submatch.cy.js @@ -205,7 +205,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -261,7 +260,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); @@ -335,7 +333,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -385,7 +382,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); @@ -486,7 +482,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForCreate, fileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileForCreate.profileName); JobProfiles.runImportFile(); @@ -554,7 +549,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileNameForUpdate, fileNameForUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js index 5790082fda..7334c3f077 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-for-creating-actions.cy.js @@ -1,9 +1,9 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; @@ -26,44 +26,35 @@ describe('ui-data-import', () => { let instanceHrid; const quantityOfItems = '1'; 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)'; - const nameMarcFile = `C356801autotestFile.${Helper.getRandomBarcode()}.mrc`; - // unique profile names - const instanceMappingProfileName = `C356801 instance mapping profile ${Helper.getRandomBarcode()}`; - const holdingsMappingProfileName = `C356801 holdings mapping profile ${Helper.getRandomBarcode()}`; - const itemMappingProfileName = `C356801 item mapping profile ${Helper.getRandomBarcode()}`; - const instanceActionProfileName = `C356801 instance action profile ${Helper.getRandomBarcode()}`; - const holdingsActionProfileName = `C356801 holdings action profile ${Helper.getRandomBarcode()}`; - const itemActionProfileName = `C356801 item action profile ${Helper.getRandomBarcode()}`; - const jobProfileName = `C356801 job profile ${Helper.getRandomBarcode()}`; - + const nameMarcFile = `C356801autotestFile.${getRandomPostfix}.mrc`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: instanceMappingProfileName }, + name: `C356801 instance mapping profile ${getRandomPostfix}` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: instanceActionProfileName } + name: `C356801 instance action profile ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: holdingsMappingProfileName, + name: `C356801 holdings mapping profile ${getRandomPostfix}`, pernanentLocation: `"${LOCATION_NAMES.ONLINE}"`, pernanentLocationUI: LOCATION_NAMES.ONLINE_UI }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: holdingsActionProfileName } + name: `C356801 holdings action profile ${getRandomPostfix}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: itemMappingProfileName, + name: `C356801 item mapping profile ${getRandomPostfix}`, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: itemActionProfileName } + name: `C356801 item action profile ${getRandomPostfix}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: jobProfileName + profileName: `C356801 job profile ${getRandomPostfix}` }; before('create test data', () => { @@ -80,7 +71,7 @@ describe('ui-data-import', () => { }); after('delete test data', () => { - JobProfiles.deleteJobProfile(jobProfileName); + JobProfiles.deleteJobProfile(jobProfile.profileName); collectionOfMappingAndActionProfiles.forEach(profile => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); @@ -100,13 +91,13 @@ describe('ui-data-import', () => { FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(instanceMappingProfileName); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[0].mappingProfile.name); FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile); NewFieldMappingProfile.fillPermanentLocation(collectionOfMappingAndActionProfiles[1].mappingProfile.pernanentLocation); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(holdingsMappingProfileName); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[1].mappingProfile.name); FieldMappingProfiles.openNewMappingProfileForm(); NewFieldMappingProfile.fillSummaryInMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile); @@ -114,7 +105,7 @@ describe('ui-data-import', () => { NewFieldMappingProfile.fillPermanentLoanType(collectionOfMappingAndActionProfiles[2].mappingProfile.permanentLoanType); NewFieldMappingProfile.fillStatus(collectionOfMappingAndActionProfiles[2].mappingProfile.status); FieldMappingProfiles.saveProfile(); - FieldMappingProfiles.closeViewModeForMappingProfile(itemMappingProfileName); + FieldMappingProfiles.closeViewModeForMappingProfile(collectionOfMappingAndActionProfiles[2].mappingProfile.name); // create action profiles collectionOfMappingAndActionProfiles.forEach(profile => { @@ -130,15 +121,14 @@ describe('ui-data-import', () => { NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[1].actionProfile); NewJobProfile.linkActionProfile(collectionOfMappingAndActionProfiles[2].actionProfile); NewJobProfile.saveAndClose(); - JobProfiles.checkJobProfilePresented(jobProfileName); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); // upload a marc file for creating of the new instance, holding and item cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameMarcFile); - JobProfiles.searchJobProfileForImport(jobProfileName); + JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); JobProfiles.waitFileIsImported(nameMarcFile); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); diff --git a/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js index cd48f194de..a423f65246 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js @@ -310,7 +310,6 @@ describe('ui-data-import', () => { ExportFile.uploadFile(nameForCSVFile); ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); ExportFile.downloadExportedMarcFile(exportedFileName); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); // edit marc file to add one record DataImport.editMarcFileAddNewRecords(exportedFileName, fileNameWithUpdatedContent, filePathWithUpdatedContent); @@ -362,11 +361,11 @@ describe('ui-data-import', () => { // create job profile for updating cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfProfilesForUpdate[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfProfilesForUpdate[0].actionProfile.name); NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[1].actionProfile.name); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfProfilesForUpdate[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfProfilesForUpdate[1].actionProfile.name, 2); NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[2].actionProfile.name, 3); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfProfilesForUpdate[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 4); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfProfilesForUpdate[2].actionProfile.name, 4); NewJobProfile.linkProfileForNonMatches(collectionOfProfilesForCreate[3].actionProfile.name, 5); NewJobProfile.saveAndClose(); diff --git a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js index 778449d0d4..13c0923510 100644 --- a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { LOAN_TYPE_NAMES, @@ -16,7 +17,6 @@ import { LOAN_TYPE_NAMES, import DateTools from '../../../support/utils/dateTools'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsJobProfiles from '../../../support/fragments/settings/dataImport/settingsJobProfiles'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import TopMenu from '../../../support/fragments/topMenu'; @@ -46,15 +46,15 @@ describe('ui-data-import', () => { const quantityOfItems = '1'; 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)'; // file names - const nameMarcFileForImportCreate = `C356802autotestFile.${Helper.getRandomBarcode()}.mrc`; - const nameForCSVFile = `C356802autotestFile${Helper.getRandomBarcode()}.csv`; - const nameMarcFileForImportUpdate = `C356802autotestFile${Helper.getRandomBarcode()}.mrc`; - const jobProfileNameForExport = `C356802 job profile.${Helper.getRandomBarcode()}`; + const nameMarcFileForImportCreate = `C356802autotestFile.${getRandomPostfix}.mrc`; + const nameForCSVFile = `C356802autotestFile${getRandomPostfix}.csv`; + const nameMarcFileForImportUpdate = `C356802autotestFile${getRandomPostfix}.mrc`; + const jobProfileNameForExport = `C356802 job profile.${getRandomPostfix}`; // profiles for creating instance, holdings, item const marcBibMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create marcBib mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create marcBib mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC, mappingDetails: { name: 'holdings', @@ -79,7 +79,7 @@ describe('ui-data-import', () => { const instanceMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create instance mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create instance mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.INSTANCE, } @@ -87,7 +87,7 @@ describe('ui-data-import', () => { const holdingsMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create holdings mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create holdings mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.HOLDINGS, mappingDetails: { name: 'holdings', @@ -102,7 +102,7 @@ describe('ui-data-import', () => { const itemMappingProfileForCreate = { profile:{ id: '', - name: `C356802 create item mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 create item mapping profile ${getRandomPostfix}`, incomingRecordType: recordType, existingRecordType: EXISTING_RECORDS_NAMES.ITEM, mappingDetails: { name: 'item', @@ -127,7 +127,7 @@ describe('ui-data-import', () => { const marcBibActionProfileForCreate = { profile: { id: '', - name: `C356802 create marcBib action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create marcBib action profile ${getRandomPostfix}`, action: 'MODIFY', folioRecord: recordType }, @@ -143,7 +143,7 @@ describe('ui-data-import', () => { const instanceActionProfileForCreate = { profile: { id: '', - name: `C356802 create instance action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create instance action profile ${getRandomPostfix}`, action: 'CREATE', folioRecord: 'INSTANCE' }, @@ -160,7 +160,7 @@ describe('ui-data-import', () => { const holdingsActionProfileForCreate = { profile: { id: '', - name: `C356802 create holdings action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create holdings action profile ${getRandomPostfix}`, action: 'CREATE', folioRecord: 'HOLDINGS' }, @@ -177,7 +177,7 @@ describe('ui-data-import', () => { const itemActionProfileForCreate = { profile: { id: '', - name: `C356802 create item action profile ${Helper.getRandomBarcode()}`, + name: `C356802 create item action profile ${getRandomPostfix}`, action: 'CREATE', folioRecord: 'ITEM' }, @@ -193,7 +193,7 @@ describe('ui-data-import', () => { }; const jobProfileForCreate = { profile: { - name: `C356802 create job profile ${Helper.getRandomBarcode()}`, + name: `C356802 create job profile ${getRandomPostfix}`, dataType: ACCEPTED_DATA_TYPE_NAMES.MARC }, addedRelations: [], @@ -212,7 +212,7 @@ describe('ui-data-import', () => { ]; // create Field mapping profile for export const exportMappingProfile = { - name: `C356802 mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 mapping profile ${getRandomPostfix}`, holdingsTransformation: EXPORT_TRANSFORMATION_NAMES.HOLDINGS_HRID, holdingsMarcField: '901', subfieldForHoldings:'$h', @@ -224,19 +224,19 @@ describe('ui-data-import', () => { const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356802 update instance mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 update instance mapping profile ${getRandomPostfix}`, catalogedDate: '###TODAY###', catalogedDateUi: DateTools.getFormattedDate({ date: new Date() }), instanceStatus: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, statisticalCode: 'ARL (Collection stats): books - Book, print (books)', statisticalCodeUI: 'Book, print (books)' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C356802 update instance action profile ${Helper.getRandomBarcode()}`, + name: `C356802 update instance action profile ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356802 update holdings mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 update holdings mapping profile ${getRandomPostfix}`, holdingsType: HOLDINGS_TYPE_NAMES.ELECTRONIC, permanentLocation: `"${LOCATION_NAMES.ONLINE}"`, permanentLocationUI: LOCATION_NAMES.ONLINE_UI, @@ -245,12 +245,12 @@ describe('ui-data-import', () => { relationship: '"Resource"', uri: '856$u' }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356802 update holdings action profile ${Helper.getRandomBarcode()}`, + name: `C356802 update holdings action profile ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356802 update item mapping profile ${Helper.getRandomBarcode()}`, + name: `C356802 update item mapping profile ${getRandomPostfix}`, materialType: MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE, noteType: '"Electronic bookplate"', note: '"Smith Family Foundation"', @@ -259,13 +259,13 @@ describe('ui-data-import', () => { permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356802 update item action profile ${Helper.getRandomBarcode()}`, + name: `C356802 update item action profile ${getRandomPostfix}`, action: 'Update (all record types except Orders, Invoices, or MARC Holdings)' } } ]; const collectionOfMatchProfiles = [ { - matchProfile: { profileName: `C356802 MARC-to-MARC 001 to 001 match profile ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C356802 MARC-to-MARC 001 to 001 match profile ${getRandomPostfix}`, incomingRecordFields: { field: '001' }, @@ -276,7 +276,7 @@ describe('ui-data-import', () => { existingRecordType: EXISTING_RECORDS_NAMES.MARC_BIBLIOGRAPHIC } }, { - matchProfile: { profileName: `C356802 MARC-to-Holdings 901h to Holdings HRID match profile ${Helper.getRandomBarcode()}`, + matchProfile: { profileName: `C356802 MARC-to-Holdings 901h to Holdings HRID match profile ${getRandomPostfix}`, incomingRecordFields: { field: '901', subfield: 'h' @@ -287,7 +287,7 @@ describe('ui-data-import', () => { }, { matchProfile: { - profileName: `C356802 MARC-to-Item 902i to Item HRID match profile ${Helper.getRandomBarcode()}`, + profileName: `C356802 MARC-to-Item 902i to Item HRID match profile ${getRandomPostfix}`, incomingRecordFields: { field: '902', subfield: 'i' @@ -300,7 +300,7 @@ describe('ui-data-import', () => { ]; const jobProfileForUpdate = { ...NewJobProfile.defaultJobProfile, - profileName: `C356802 update job profile ${Helper.getRandomBarcode()}`, + profileName: `C356802 update job profile ${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; @@ -357,7 +357,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameMarcFileForImportCreate); JobProfiles.searchJobProfileForImport(testData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -391,7 +390,6 @@ describe('ui-data-import', () => { ExportFile.uploadFile(nameForCSVFile); ExportFile.exportWithCreatedJobProfile(nameForCSVFile, jobProfileNameForExport); ExportFile.downloadExportedMarcFile(nameMarcFileForImportUpdate); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); // create mapping profiles cy.visit(SettingsMenu.mappingProfilePath); @@ -443,16 +441,15 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfileWithLinkingProfilesForUpdate(jobProfileForUpdate); - NewJobProfile.linkMatchAndActionProfilesForInstance(collectionOfMappingAndActionProfiles[0].actionProfile.name, collectionOfMatchProfiles[0].matchProfile.profileName, 0); - NewJobProfile.linkMatchAndActionProfilesForHoldings(collectionOfMappingAndActionProfiles[1].actionProfile.name, collectionOfMatchProfiles[1].matchProfile.profileName, 1); - NewJobProfile.linkMatchAndActionProfilesForItem(collectionOfMappingAndActionProfiles[2].actionProfile.name, collectionOfMatchProfiles[2].matchProfile.profileName, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[0].matchProfile.profileName, collectionOfMappingAndActionProfiles[0].actionProfile.name); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[1].matchProfile.profileName, collectionOfMappingAndActionProfiles[1].actionProfile.name, 2); + NewJobProfile.linkMatchAndActionProfiles(collectionOfMatchProfiles[2].matchProfile.profileName, collectionOfMappingAndActionProfiles[2].actionProfile.name, 4); NewJobProfile.saveAndClose(); // upload the exported marc file cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(nameMarcFileForImportUpdate); JobProfiles.searchJobProfileForImport(jobProfileForUpdate.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js b/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js index f75b4e81ba..b24416ad87 100644 --- a/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js +++ b/cypress/e2e/data-import/log-details/importing-of-orders-with-pending-status.cy.js @@ -135,7 +135,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js b/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js index a572fa8192..697e3f4266 100644 --- a/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js +++ b/cypress/e2e/data-import/log-details/log-details-for-created-imported-order-records.cy.js @@ -129,7 +129,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js index 079526191a..62a7431bc1 100644 --- a/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js +++ b/cypress/e2e/data-import/log-details/log-summary-counts-for-inventory-records-created-after-not-matching.cy.js @@ -178,7 +178,6 @@ describe('ui-data-import', () => { DataImport.checkIsLandingPageOpened(); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC378901.mrc', marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js b/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js index 375e15732f..58804c2097 100644 --- a/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js +++ b/cypress/e2e/data-import/log-details/number-of-updated-instances-in-log-does-not-exceed-number-of-records-in-file.cy.js @@ -159,7 +159,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC367966_BeforeOverride.mrc', marcFileNameForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -186,7 +185,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, marcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js index c4d6e517be..30ac9ec386 100644 --- a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js +++ b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items.cy.js @@ -218,7 +218,6 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreateFirstRecord); JobProfiles.searchJobProfileForImport(firstTestData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -247,7 +246,6 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', marcFileForCreateSecondRecord); JobProfiles.searchJobProfileForImport(secondTestData.jobProfileForCreate.profile.name); JobProfiles.runImportFile(); @@ -395,7 +393,6 @@ describe.skip('ui-data-import', () => { InventorySearchAndFilter.searchInstanceByHRID(instanceHrids[0]); InventorySearchAndFilter.saveUUIDs(); ExportFile.downloadCSVFile(csvFileNameForFirstRecord, 'SearchInstanceUUIDs*'); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); // download exported marc file cy.visit(TopMenu.dataExportPath); @@ -407,7 +404,6 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(marcFileNameForUpdateFirstRecord); JobProfiles.searchJobProfileForImport(jobProfileWithMatch.profileName); JobProfiles.runImportFile(); @@ -448,7 +444,6 @@ describe.skip('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadExportedFile(marcFileNameForUpdateSecondRecord); JobProfiles.searchJobProfileForImport(jobProfileWithoutMatch.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js b/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js index b9f95697e6..c3e0fb7d53 100644 --- a/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js +++ b/cypress/e2e/data-import/permissions/can-view-only-permission.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; @@ -9,12 +10,11 @@ import LogsViewAll from '../../../support/fragments/data_import/logs/logsViewAll import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import Users from '../../../support/fragments/users/users'; -import Helper from '../../../support/fragments/finance/financeHelper'; describe('ui-data-import', () => { let user; let instanceHrid; - const fileName = `oneMarcBib.mrc${Helper.getRandomBarcode()}`; + const fileName = `oneMarcBib.mrc${getRandomPostfix}`; before('create test data', () => { cy.getAdminToken() diff --git a/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js b/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js index fededa6593..b54ff47eb8 100644 --- a/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js +++ b/cypress/e2e/data-import/permissions/user-cannot-delete-import-logs.cy.js @@ -1,8 +1,8 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import TopMenu from '../../../support/fragments/topMenu'; -import Helper from '../../../support/fragments/finance/financeHelper'; import DataImport from '../../../support/fragments/data_import/dataImport'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; import Logs from '../../../support/fragments/data_import/logs/logs'; @@ -16,7 +16,7 @@ describe('ui-data-import', () => { let user; let instanceHrid; const jobProfileToRun = 'Default - Create instance and SRS MARC Bib'; - const fileName = `C353641 autotestFile.${Helper.getRandomBarcode()}.mrc`; + const fileName = `C353641 autotestFile.${getRandomPostfix}.mrc`; before('create test data', () => { cy.createTempUser([ @@ -40,7 +40,6 @@ describe('ui-data-import', () => { { tags: [TestTypes.criticalPath, DevTeams.folijet] }, () => { // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', fileName); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js b/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js index b62af029a6..b1b3a83433 100644 --- a/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js +++ b/cypress/e2e/data-import/permissions/user-with-limited-permissions-can-import-file.cy.js @@ -1,3 +1,4 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; @@ -9,7 +10,6 @@ import { LOAN_TYPE_NAMES, JOB_STATUS_NAMES } from '../../../support/constants'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; -import Helper from '../../../support/fragments/finance/financeHelper'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; @@ -21,35 +21,33 @@ import DataImport from '../../../support/fragments/data_import/dataImport'; import Logs from '../../../support/fragments/data_import/logs/logs'; import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import Users from '../../../support/fragments/users/users'; -import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; describe('ui-data-import', () => { let firstUser; let secondUser; - let instanceHrid; const quantityOfItems = '1'; - const nameMarcFile = `C356841autotestFile.${Helper.getRandomBarcode()}.mrc`; + const nameMarcFile = `C356841autotestFile.${getRandomPostfix()}.mrc`; const collectionOfMappingAndActionProfiles = [ { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356841 holdings mapping profile ${Helper.getRandomBarcode()}`, + name: `C356841 holdings mapping profile ${getRandomPostfix()}}`, pernanentLocation: `"${LOCATION_NAMES.ONLINE}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.HOLDINGS, - name: `C356841 holdings action profile ${Helper.getRandomBarcode()}` } + name: `C356841 holdings action profile ${getRandomPostfix()}` } }, { mappingProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356841 item mapping profile ${Helper.getRandomBarcode()}`, + name: `C356841 item mapping profile ${getRandomPostfix()}`, permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE, status: ITEM_STATUS_NAMES.AVAILABLE, materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"` }, actionProfile: { typeValue: FOLIO_RECORD_TYPE.ITEM, - name: `C356841 item action profile ${Helper.getRandomBarcode()}` } + name: `C356841 item action profile ${getRandomPostfix()}` } } ]; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C356841 job profile ${Helper.getRandomBarcode()}` + profileName: `C356841 job profile ${getRandomPostfix()}}` }; before('create test data', () => { @@ -80,12 +78,6 @@ describe('ui-data-import', () => { ActionProfiles.deleteActionProfile(profile.actionProfile.name); FieldMappingProfiles.deleteFieldMappingProfile(profile.mappingProfile.name); }); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }) - .then((instance) => { - cy.deleteItemViaApi(instance.items[0].id); - cy.deleteHoldingRecordViaApi(instance.holdings[0].id); - InventoryInstance.deleteInstanceViaApi(instance.id); - }); }); it('C356841 Confirm a user with limited Data Import permissions can import a file (folijet)', @@ -142,7 +134,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('oneMarcBib.mrc', nameMarcFile); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -157,11 +148,5 @@ describe('ui-data-import', () => { FileDetails.checkStatusInColumn(FileDetails.status.created, columnName); }); FileDetails.checkItemQuantityInSummaryTable(quantityOfItems); - - // open Instance to get hrid - FileDetails.openInstanceInInventory('Created'); - InventoryInstance.getAssignedHRID().then(initialInstanceHrId => { - instanceHrid = initialInstanceHrId; - }); }); }); diff --git a/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js b/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js index c3b88b520c..ae920cab56 100644 --- a/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js +++ b/cypress/e2e/data-import/settings/attach-remove-mapping-profile-to-action-profile.cy.js @@ -1,7 +1,7 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -13,12 +13,12 @@ import ConfirmRemoval from '../../../support/fragments/data_import/action_profil describe('ui-data-import', () => { const mappingProfile = { - name: `C11115 autotest mapping profile ${Helper.getRandomBarcode()}`, + name: `C11115 autotest mapping profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { - name: `C11115 autotest action profile ${Helper.getRandomBarcode()}`, + name: `C11115 autotest action profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; diff --git a/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js index a25936dfcd..1aa657646c 100644 --- a/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-action-profile-with-associated-job-profile.cy.js @@ -1,8 +1,8 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; -import permissions from '../../../support/dictionary/permissions'; import { FOLIO_RECORD_TYPE, ACCEPTED_DATA_TYPE_NAMES } from '../../../support/constants'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -17,15 +17,15 @@ import ConfirmChanges from '../../../support/fragments/data_import/action_profil describe('ui-data-import', () => { let user; const mappingProfile = { - name: `C367994 autotest mapping profile ${Helper.getRandomBarcode()}`, + name: `C367994 autotest mapping profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C367994 autotest action profile ${Helper.getRandomBarcode()}` + name: `C367994 autotest action profile ${getRandomPostfix}` }; const jobProfile = { ...NewJobProfile.defaultJobProfile, - profileName: `C367994 autotest job profile${Helper.getRandomBarcode()}`, + profileName: `C367994 autotest job profile${getRandomPostfix}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC }; before('create user', () => { diff --git a/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js index 5d868ea9ed..5f14543a54 100644 --- a/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-action-profile.cy.js @@ -1,8 +1,8 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE } from '../../../support/constants'; -import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; import InteractorsTools from '../../../support/utils/interactorsTools'; @@ -14,7 +14,7 @@ describe('ui-data-import', () => { let user; const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C2348 autotest action profile ${Helper.getRandomBarcode()}` + name: `C2348 autotest action profile ${getRandomPostfix}` }; before('create user', () => { diff --git a/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js index bc5fca802b..7644d62c9f 100644 --- a/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-mapping-profile.cy.js @@ -1,8 +1,8 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import { FOLIO_RECORD_TYPE } from '../../../support/constants'; -import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; @@ -14,7 +14,7 @@ import Users from '../../../support/fragments/users/users'; describe('ui-data-import', () => { let user; const mappingProfile = { - name: `C2351 autotest mapping profile ${Helper.getRandomBarcode()}`, + name: `C2351 autotest mapping profile ${getRandomPostfix}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE }; const instanceStatusTerm = '"Batch Loaded"'; diff --git a/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js b/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js index b88062d56d..be065f21b8 100644 --- a/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js +++ b/cypress/e2e/data-import/settings/edit-existing-match-profile.cy.js @@ -1,7 +1,7 @@ +import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; -import permissions from '../../../support/dictionary/permissions'; -import Helper from '../../../support/fragments/finance/financeHelper'; import SettingsMenu from '../../../support/fragments/settingsMenu'; import MatchProfiles from '../../../support/fragments/data_import/match_profiles/matchProfiles'; import NewMatchProfile from '../../../support/fragments/data_import/match_profiles/newMatchProfile'; @@ -14,7 +14,7 @@ import { EXISTING_RECORDS_NAMES } from '../../../support/constants'; describe('ui-data-import', () => { let user; const matchProfile = { - profileName: `C2339 autotest MatchProf${Helper.getRandomBarcode()}`, + profileName: `C2339 autotest MatchProf${getRandomPostfix}`, incomingRecordFields: { field: '001' }, diff --git a/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js b/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js index 38266e56bc..8c362b3bde 100644 --- a/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js +++ b/cypress/e2e/data-import/settings/fund-and-expense-class-mappings.cy.js @@ -150,7 +150,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, firstMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -188,7 +187,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, secondMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -218,7 +216,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, thirdMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); @@ -258,7 +255,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(filePathForCreateOrder, forthMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js b/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js index 2b107e236d..1084e55b2f 100644 --- a/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js +++ b/cypress/e2e/data-import/settings/make-fields-required-in-invoice-map-profile.cy.js @@ -1,16 +1,16 @@ import permissions from '../../../support/dictionary/permissions'; +import getRandomPostfix from '../../../support/utils/stringTools'; import TestTypes from '../../../support/dictionary/testTypes'; import DevTeams from '../../../support/dictionary/devTeams'; import FieldMappingProfiles from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfiles'; import NewFieldMappingProfile from '../../../support/fragments/data_import/mapping_profiles/newFieldMappingProfile'; -import Helper from '../../../support/fragments/finance/financeHelper'; import Users from '../../../support/fragments/users/users'; import FieldMappingProfileView from '../../../support/fragments/data_import/mapping_profiles/fieldMappingProfileView'; import SettingsMenu from '../../../support/fragments/settingsMenu'; describe('ui-data-import', () => { let user = null; - const mappingProfileName = `C343284 invoice mapping profile ${Helper.getRandomBarcode()}`; + const mappingProfileName = `C343284 invoice mapping profile ${getRandomPostfix}`; before('login', () => { cy.createTempUser([ diff --git a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js index 926818f68d..837bb139fd 100644 --- a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js +++ b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-in-quickMarc.cy.js @@ -160,7 +160,7 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndActionProfilesForInstance(actionProfile.name, matchProfile.profileName); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); @@ -201,7 +201,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile(editedMarcFileName, nameMarcFileForUpload); JobProfiles.searchJobProfileForImport(jobProfile.profileName); JobProfiles.runImportFile(); diff --git a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js index d0f319c3fa..1221e18014 100644 --- a/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js +++ b/cypress/e2e/data-import/settings/mrc-import-for-update-instance-with-protected-fields-after-editing-marc-bib-outside.cy.js @@ -148,7 +148,7 @@ describe('ui-data-import', () => { // create job profile cy.visit(SettingsMenu.jobProfilePath); JobProfiles.createJobProfile(jobProfile); - NewJobProfile.linkMatchAndActionProfilesForInstance(actionProfile.name, matchProfile.profileName); + NewJobProfile.linkMatchAndActionProfiles(matchProfile.profileName, actionProfile.name); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); @@ -156,7 +156,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.uploadFile('marcFileForC356830.mrc', nameMarcFileForCreate); JobProfiles.searchJobProfileForImport(jobProfileToRun); JobProfiles.runImportFile(); @@ -191,7 +190,6 @@ describe('ui-data-import', () => { cy.visit(TopMenu.dataImportPath); // TODO delete function after fix https://issues.folio.org/browse/MODDATAIMP-691 DataImport.verifyUploadState(); - cy.reload(); DataImport.checkIsLandingPageOpened(); DataImport.uploadFile(editedMarcFileName); JobProfiles.searchJobProfileForImport(jobProfile.profileName); diff --git a/cypress/e2e/inventory/keyboard-shortcuts.cy.js b/cypress/e2e/inventory/keyboard-shortcuts.cy.js index 7002f27f24..71b4cb3314 100644 --- a/cypress/e2e/inventory/keyboard-shortcuts.cy.js +++ b/cypress/e2e/inventory/keyboard-shortcuts.cy.js @@ -34,7 +34,7 @@ describe('ui-inventory: keyboard shortcut', () => { Users.deleteViaApi(userId); }); - it('C345297 Keyboard Shortcut. Access to drop down menu (folijet)', { tags: [testTypes.smoke, devTeams.folijet] }, () => { + it('C345297 Keyboard Shortcut. Access to drop down menu (folijet)', { tags: [testTypes.smoke, devTeams.thunderjet] }, () => { InventoryKeyboardShortcuts.verifyInventoryDropdownIsShown('false'); InventoryKeyboardShortcuts.openInventoryMenu(); diff --git a/cypress/e2e/requests/edit-request.cy.js b/cypress/e2e/requests/edit-request.cy.js index ee29021ce6..584e1796d5 100644 --- a/cypress/e2e/requests/edit-request.cy.js +++ b/cypress/e2e/requests/edit-request.cy.js @@ -47,7 +47,7 @@ describe('ui-requests: Request: Edit requests. Make sure that edits are being sa }); it('C556 Request: Edit requests. Make sure that edits are being saved. (vega)', - { tags: [TestTypes.smoke, DevTeams.folijet] }, () => { + { tags: [TestTypes.smoke, DevTeams.vega] }, () => { cy.visit(TopMenu.requestsPath); Object.values(EditRequest.requestStatuses).forEach(status => { EditRequest.checkIsEditsBeingSaved(requestData, instanceData, status); diff --git a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js index 32ef5db91f..f2713682f1 100644 --- a/cypress/support/fragments/data_import/job_profiles/newJobProfile.js +++ b/cypress/support/fragments/data_import/job_profiles/newJobProfile.js @@ -108,6 +108,7 @@ export default { linkMatchAndActionProfilesForSubMatches(matchProfileName, actionProfileName, forMatchesOrder = 0) { linkMatchProfileForMatches(matchProfileName); + cy.wait(3000); cy.get('[id*="type-selector-dropdown-ROOT-MATCH"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(actionProfileName); @@ -117,7 +118,9 @@ export default { linkMatchAndTwoActionProfilesForSubMatches(matchProfileName, firstActionProfileName, secondActionProfileName) { linkMatchProfileForSubMatches(matchProfileName); + cy.wait(3000); linkActionProfileForSubMatches(firstActionProfileName); + cy.wait(3000); linkActionProfileForSubMatches(secondActionProfileName); }, @@ -128,6 +131,7 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); + cy.wait(3000); // link action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); @@ -136,53 +140,6 @@ export default { cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); }, - linkMatchAndActionProfilesForInstance(actionProfileName, matchProfileName, buttonIndex = 0) { - // link match profile to job profile - cy.get('[id="type-selector-dropdown-linker-root"]').click(); - cy.do(matchButton.click()); - ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); - ModalSelectProfile.selectProfile(matchProfileName, 'match'); - cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); - // link action profile to match profile - cy.get('[id*="type-selector-dropdown-ROOT"]').eq(buttonIndex).click(); - cy.do(actionsButton.click()); - ModalSelectProfile.searchProfileByName(actionProfileName); - ModalSelectProfile.selectProfile(actionProfileName); - cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); - }, - - linkMatchAndActionProfilesForHoldings(actionProfileName, matchProfileName, buttonIndex = 2) { - // link match profile to job profile - cy.get('[id="type-selector-dropdown-linker-root"]').click(); - cy.do(matchButton.click()); - ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); - ModalSelectProfile.selectProfile(matchProfileName, 'match'); - cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); - cy.wait(8000); - // link action profile to match profile - cy.get('[id*="type-selector-dropdown-ROOT"]').eq(buttonIndex).click(); - cy.do(actionsButton.click()); - ModalSelectProfile.searchProfileByName(actionProfileName); - ModalSelectProfile.selectProfile(actionProfileName); - cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); - }, - - linkMatchAndActionProfilesForItem(actionProfileName, matchProfileName, buttonIndex = 4) { - // link match profile to job profile - cy.get('[id="type-selector-dropdown-linker-root"]').click(); - cy.do(matchButton.click()); - ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); - ModalSelectProfile.selectProfile(matchProfileName, 'match'); - cy.expect(Accordion('Overview').find(HTML(including(matchProfileName))).exists()); - cy.wait(8000); - // link action profile to match profile - cy.get('[id*="type-selector-dropdown-ROOT"]').eq(buttonIndex).click(); - cy.do(actionsButton.click()); - ModalSelectProfile.searchProfileByName(actionProfileName); - ModalSelectProfile.selectProfile(actionProfileName); - cy.expect(Accordion('Overview').find(HTML(including(actionProfileName))).exists()); - }, - linkMatchAndTwoActionProfiles(matchProfileName, firstActionProfileName, secondActionProfileName, forMatchesOrder = 0) { // link match profile to job profile cy.get('[id="type-selector-dropdown-linker-root"]').click(); @@ -190,12 +147,14 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(matchProfileName))).exists()); + cy.wait(3000); // link first action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(firstActionProfileName); ModalSelectProfile.selectProfile(firstActionProfileName); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(firstActionProfileName))).exists()); + cy.wait(3000); // link second action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); @@ -211,18 +170,21 @@ export default { ModalSelectProfile.searchProfileByName(matchProfileName, 'match'); ModalSelectProfile.selectProfile(matchProfileName, 'match'); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(matchProfileName))).exists()); + cy.wait(3000); // link first action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(firstActionProfileName); ModalSelectProfile.selectProfile(firstActionProfileName); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(firstActionProfileName))).exists()); + cy.wait(3000); // link second action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); ModalSelectProfile.searchProfileByName(secondActionProfileName); ModalSelectProfile.selectProfile(secondActionProfileName); cy.expect(Pane('New job profile').find(Accordion('Overview')).find(HTML(including(secondActionProfileName))).exists()); + cy.wait(3000); // link third action profile to match profile cy.get('[id*="type-selector-dropdown-ROOT"]').eq(forMatchesOrder).click(); cy.do(actionsButton.click()); diff --git a/cypress/support/fragments/data_import/logs/logs.js b/cypress/support/fragments/data_import/logs/logs.js index 6c8027aae1..88a5b8b4bd 100644 --- a/cypress/support/fragments/data_import/logs/logs.js +++ b/cypress/support/fragments/data_import/logs/logs.js @@ -50,7 +50,11 @@ export default { }, checkStatusOfJobProfile:(status = 'Completed') => cy.do(MultiColumnListCell({ row: 0, content: status }).exists()), - openFileDetails:(fileName) => cy.do(Link(fileName).click()), + openFileDetails:(fileName) => { + cy.do(Link(fileName).click()); + // TODO need to wait until page is uploaded + cy.wait(3500); + }, checkQuantityRecordsInFile:(quantityRecords) => cy.do(MultiColumnListCell({ row: 0, content: quantityRecords }).exists()), clickOnHotLink: (row = 0, columnIndex = 3, status = 'Created') => { diff --git a/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js b/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js index 621fae7227..678f3f9bea 100644 --- a/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js +++ b/cypress/support/fragments/data_import/mapping_profiles/fieldMappingProfiles.js @@ -25,7 +25,11 @@ const openNewMappingProfileForm = () => { }; const closeViewModeForMappingProfile = (profileName) => cy.do(Pane({ title: profileName }).find(iconButton).click()); -const saveProfile = () => cy.do(saveProfileButton.click()); +const saveProfile = () => { + // TODO need to wait until profile to be filled + cy.wait(1500); + cy.do(saveProfileButton.click()); +}; const mappingProfileForDuplicate = { gobi:'GOBI monograph invoice', diff --git a/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js b/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js index 43b3a81a8c..392c6bc65f 100644 --- a/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js +++ b/cypress/support/fragments/data_import/match_profiles/newMatchProfile.js @@ -54,7 +54,7 @@ function fillIncomingRecordFields(value = '', selector) { function fillName(profileName) { cy.do(TextField('Name*').fillIn(profileName)); // wait for data to be loaded - cy.wait(15000); + cy.wait(10000); } function selectExistingRecordType(existingRecordType) { @@ -163,6 +163,8 @@ export default { cy.do(criterionValueTypeButton.click()); cy.expect(criterionValueTypeList.exists()); cy.do(criterionValueTypeList.find(SelectionOption(instanceOption)).click()); + // TODO need to wait until profile will be filled + cy.wait(1500); } else if (existingRecordType === 'MARC_AUTHORITY') { selectExistingRecordType(existingRecordType); selectIncomingRecordType('MARC Authority'); @@ -190,6 +192,8 @@ export default { cy.do(criterionValueTypeButton.click()); cy.expect(criterionValueTypeList.exists()); cy.do(criterionValueTypeList.find(SelectionOption(holdingsOption)).click()); + // TODO need to wait until profile will be filled + cy.wait(1500); } else { cy.do(matchProfileDetailsAccordion.find(Button({ dataId:'ITEM' })).click()); fillIncomingRecordFields(incomingRecordFields.field, 'field'); @@ -202,11 +206,9 @@ export default { fillIncomingRecordFields(incomingRecordFields.subfield, 'subfield'); cy.do(criterionValueTypeButton.click()); cy.expect(criterionValueTypeList.exists()); - // wait for list will be loaded - cy.wait(2000); cy.do(criterionValueTypeList.find(SelectionOption(itemOption)).click()); - // wait for list will be loaded - cy.wait(2000); + // TODO need to wait until profile will be filled + cy.wait(1500); } }, diff --git a/cypress/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index 909d51562d..74527e0caf 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -143,7 +143,7 @@ export default { checkMarkAsSuppressedFromDiscoveryAbsent: () => cy.expect(root .find(HTML(including('Warning: Holdings is marked suppressed from discovery'))) .absent()), - checkElectronicAccess:(relationshipValue, uriValue, linkText = '', urlPublicNote = '') => { + checkElectronicAccess:(relationshipValue, uriValue, linkText = 'no value set', urlPublicNote = 'no value set') => { cy.expect(electronicAccessAccordion .find(MultiColumnListCell({ row: 0, columnIndex: 0, content: relationshipValue })) .exists()); diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index 9d2d85eca3..dba2f88db2 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -94,7 +94,7 @@ const verifyInstanceRecordViewOpened = () => { cy.expect(Pane({ id:'pane-instancedetails' }).exists()); }; -const verifyElectronicAccess = (uriValue, linkText = '', rowNumber = 0) => { +const verifyElectronicAccess = (uriValue, linkText = 'No value set-', rowNumber = 0) => { cy.expect(electronicAccessAccordion .find(MultiColumnListCell({ row: rowNumber, columnIndex: 1, content: uriValue })) .exists()); diff --git a/cypress/support/fragments/inventory/inventoryInstances.js b/cypress/support/fragments/inventory/inventoryInstances.js index a018ad5ebd..9bdc98f208 100644 --- a/cypress/support/fragments/inventory/inventoryInstances.js +++ b/cypress/support/fragments/inventory/inventoryInstances.js @@ -52,7 +52,7 @@ export default { cy.expect(or(inventoriesList.exists()), rootSection.find(HTML(including('No results found'))).exists()); // need to wait until list to be formed - cy.wait(2000); + cy.wait(2500); }, selectInstance: (rowNumber = 0) => { diff --git a/cypress/support/fragments/orders/orderLines.js b/cypress/support/fragments/orders/orderLines.js index 17555376c7..7b3502983c 100644 --- a/cypress/support/fragments/orders/orderLines.js +++ b/cypress/support/fragments/orders/orderLines.js @@ -944,6 +944,7 @@ export default { }, openLinkedInstance() { + cy.do(Accordion('Linked instance').clickHeader()); cy.do(Accordion('Linked instance') .find(Link({ href: including('/inventory/view') })) .click()); From 0c4f054035b42aede8166f307f05267e90734422 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Wed, 2 Aug 2023 17:33:40 +0300 Subject: [PATCH 31/55] set retry count to 0 (#1439) --- cypress.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index cdfb928e5c..11859bb4df 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -8,8 +8,8 @@ const allureWriter = require('@shelex/cypress-allure-plugin/writer'); module.exports = defineConfig({ retries: { - runMode: 1, - openMode: 1, + runMode: 0, + openMode: 0, }, viewportWidth: 1920, viewportHeight: 1080, From 621de28c97a3bbc38ab2cc1ccefdf6855c472e02 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 2 Aug 2023 19:40:32 +0500 Subject: [PATCH 32/55] FAT-6959/Fixed failed autotests (#1436) * Fixed failed autotests * added comment --- .../holdings-records-Instancesource-marc.cy.js | 3 +++ cypress/e2e/inventory/moving-items.cy.js | 3 +++ .../search/browse-call-number-with-space.cy.js | 4 ++-- cypress/e2e/quickmark/holding-quickmark.cy.js | 17 ++++++++++++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js b/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js index 36a912e36a..6ac35ef8e5 100644 --- a/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js +++ b/cypress/e2e/inventory/holdings/holdings-records-Instancesource-marc.cy.js @@ -32,6 +32,9 @@ describe('Manage holding records with MARC source', { retries: 2 }, () => { HoldingsRecordView.checkSource('MARC'); HoldingsRecordView.checkActionsMenuOptionsInMarcSource(); HoldingsRecordView.tryToDelete(); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.close(); HoldingsRecordView.editInQuickMarc(); diff --git a/cypress/e2e/inventory/moving-items.cy.js b/cypress/e2e/inventory/moving-items.cy.js index 44a7a2d35c..b4d11200ec 100644 --- a/cypress/e2e/inventory/moving-items.cy.js +++ b/cypress/e2e/inventory/moving-items.cy.js @@ -145,6 +145,9 @@ describe('ui-inventory: moving items', { retries: 2 }, () => { InventoryInstances.selectInstance(); InventoryInstance.openHoldingView(); HoldingsRecordView.checkHrId(holdingsRecordhrId); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(`004\t${initialInstanceHrId}`); }); diff --git a/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js b/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js index 18be11d1c2..11ec7b1a4e 100644 --- a/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js +++ b/cypress/e2e/inventory/search/browse-call-number-with-space.cy.js @@ -24,7 +24,7 @@ describe('Inventory -> Call Number Browse', () => { volume: 'v.1', enumeration: 'e.2', chronology: 'ch.3', - shelvingOrderValue: 'PRT 3718 _V 11 E 12 CH 13 C 14 SUF', + shelvingOrderValue: 'PRT 718 V.1 E.2 CH.3 C.4 SUF', }; const itemA1 = { @@ -134,7 +134,7 @@ describe('Inventory -> Call Number Browse', () => { BrowseCallNumber.checkExactSearchResult(itemA1.itemCallNumber); }); - it('C359593 Verify that clicking on "Call number" value execute search for "Instance" record by "Shelving order" value (spitfire)', { tags: [DevTeams.spitfire, TestTypes.criticalPath] }, () => { + it('C405529 Verify that clicking on "Call number" value execute search for "Instance" record by "Shelving order" value (spitfire)', { tags: [DevTeams.spitfire, TestTypes.criticalPath] }, () => { searchAndOpenInstance(testData.parameter, item.instanceName); InventoryInstance.addItem(); InventoryInstance.fillItemRequiredFields(); diff --git a/cypress/e2e/quickmark/holding-quickmark.cy.js b/cypress/e2e/quickmark/holding-quickmark.cy.js index 79033dd538..23fddddf3a 100644 --- a/cypress/e2e/quickmark/holding-quickmark.cy.js +++ b/cypress/e2e/quickmark/holding-quickmark.cy.js @@ -54,6 +54,9 @@ describe('MARC -> MARC Holdings', () => { cy.login(testData.user.username, testData.user.password, { path: TopMenu.inventoryPath, waiter: InventorySearchAndFilter.waitLoading }); InventorySearchAndFilter.searchInstanceByTitle(instanceID); InventorySearchAndFilter.selectViewHoldings(); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.editInQuickMarc(); }); @@ -77,16 +80,23 @@ describe('MARC -> MARC Holdings', () => { const expectedInSourceRow = QuickMarcEditor.fillAllAvailableValues(undefined, undefined, HoldingsRecordView.newHolding.rowsCountInQuickMarcEditor); QuickMarcEditor.pressSaveAndClose(); HoldingsRecordView.waitLoading(); - + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(expectedInSourceRow); }); it('C345398 Edit MARC 008 (spitfire)', { tags: [TestTypes.smoke, DevTeams.spitfire] }, () => { + //Wait until the page to be loaded fully. + cy.wait(1000); QuickMarcEditor.checkNotExpectedByteLabelsInTag008Holdings(); const changed008TagValue = QuickMarcEditor.updateAllDefaultValuesIn008TagInHoldings(); HoldingsRecordView.waitLoading(); + //TODO: Delete below two lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(changed008TagValue); InventoryViewSource.close(); @@ -110,6 +120,11 @@ describe('MARC -> MARC Holdings', () => { QuickMarcEditor.pressSaveAndClose(); InteractorsTools.checkCalloutMessage('Record cannot be saved. An 852 is required.', calloutTypes.error); QuickMarcEditor.closeWithoutSavingAfterChange(); + //TODO: Delete below four lines of code after Actions -> View source of Holding's view works as expected. + HoldingsRecordView.close(); + HoldingsRecordView.waitLoading(); + HoldingsRecordView.close(); + InventoryInstance.openHoldingView(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(QuickMarcEditor.getSourceContent(initialTagContent)); }); From 9e0d75f6de128dcb0dd968284bdcd5f7678e45e5 Mon Sep 17 00:00:00 2001 From: nayimovag Date: Wed, 2 Aug 2023 19:48:21 +0500 Subject: [PATCH 33/55] FAT-7208 (#1437) * FAT-7208 --- ...p-suppressed-holdings-true-items-not.cy.js | 126 ++++++++++++++++++ cypress/e2e/inventory/export-cql.cy.js | 90 +++++++++++++ cypress/e2e/inventory/export.cy.js | 17 +-- .../fragments/bulk-edit/bulk-edit-actions.js | 1 + 4 files changed, 218 insertions(+), 16 deletions(-) create mode 100644 cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-true-items-not.cy.js create mode 100644 cypress/e2e/inventory/export-cql.cy.js diff --git a/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-true-items-not.cy.js b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-true-items-not.cy.js new file mode 100644 index 0000000000..b567b15e23 --- /dev/null +++ b/cypress/e2e/bulk-edit/logs/in-app/bulk-edit-logs-in-app-suppressed-holdings-true-items-not.cy.js @@ -0,0 +1,126 @@ +import testTypes from '../../../../support/dictionary/testTypes'; +import devTeams from '../../../../support/dictionary/devTeams'; +import permissions from '../../../../support/dictionary/permissions'; +import BulkEditSearchPane from '../../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files'; +import TopMenu from '../../../../support/fragments/topMenu'; +import FileManager from '../../../../support/utils/fileManager'; +import getRandomPostfix from '../../../../support/utils/stringTools'; +import Users from '../../../../support/fragments/users/users'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; +import HoldingsRecordView from '../../../../support/fragments/inventory/holdingsRecordView'; +import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; +import ItemRecordView from '../../../../support/fragments/inventory/item/itemRecordView'; +import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; +import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation'; + +// TO DO: remove ignoring errors. Now when you click on one of the buttons, some promise in the application returns false +Cypress.on('uncaught:exception', () => false); + +let user; +const instanceHRIDFileName = `instanceHRID_${getRandomPostfix()}.csv`; +const item = { + instanceName: `testBulkEdit_${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; +const matchedRecordsFileName = `Matched-Records-${instanceHRIDFileName}`; +const previewOfProposedChangesFileName = `*-Updates-Preview-${instanceHRIDFileName}`; +const updatedRecordsFileName = `*-Changed-Records*-${instanceHRIDFileName}`; + +describe('Bulk Edit - Logs', () => { + before('create test data', () => { + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.bulkEditLogsView.gui + ]) + .then(userProperties => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading + }); + + item.instanceId = InventoryInstances.createInstanceViaApi(item.instanceName, item.itemBarcode); + cy.getHoldings({ limit: 1, expandAll: true, query: `"instanceId"="${item.instanceId}"` }).then(holdings => { + item.holdingsHRID = holdings[0].hrid; + cy.updateHoldingRecord(holdings[0].id, { + ...holdings[0], + discoverySuppress: true, + permanentLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87', + temporaryLocationId: 'b241764c-1466-4e1d-a028-1a3684a5da87' + }); + }); + cy.getInstance({ limit: 1, expandAll: true, query: `"id"=="${item.instanceId}"` }) + .then(instance => { + item.instanceHRID = instance.hrid; + FileManager.createFile(`cypress/fixtures/${instanceHRIDFileName}`, item.instanceHRID); + }); + }); + }); + + after('delete test data', () => { + Users.deleteViaApi(user.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); + FileManager.deleteFile(`cypress/fixtures/${instanceHRIDFileName}`); + FileManager.deleteFileFromDownloadsByMask(instanceHRIDFileName, `*${matchedRecordsFileName}`, previewOfProposedChangesFileName, updatedRecordsFileName); + }); + + it('C402321 Verify "Suppress from discovery" option is set True in when Holdings are suppressed and associated Items are not (firebird)', { tags: [testTypes.criticalPath, devTeams.firebird] }, () => { + BulkEditSearchPane.checkHoldingsRadio(); + BulkEditSearchPane.selectRecordIdentifier('Instance HRIDs'); + BulkEditSearchPane.uploadFile(instanceHRIDFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(item.holdingsHRID); + + const suppressFromDiscovery = true; + const newLocation = 'Main Library'; + BulkEditActions.openActions(); + BulkEditSearchPane.changeShowColumnCheckbox('Suppressed from discovery'); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditActions.editHoldingsSuppressFromDiscovery(suppressFromDiscovery); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.replacePermanentLocation(newLocation, 'holdings', 1); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.replaceTemporaryLocation(newLocation, 'holdings', 2); + BulkEditActions.confirmChanges(); + BulkEditActions.commitChanges(); + + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyChangesUnderColumns('Suppressed from discovery', suppressFromDiscovery); + + BulkEditSearchPane.openLogsSearch(); + BulkEditSearchPane.checkHoldingsCheckbox(); + BulkEditSearchPane.clickActionsRunBy(user.username); + + BulkEditSearchPane.downloadFileUsedToTrigger(); + BulkEditFiles.verifyCSVFileRows(instanceHRIDFileName, [item.instanceHRID]); + + BulkEditSearchPane.downloadFileWithMatchingRecords(); + BulkEditFiles.verifyMatchedResultFileContent(`*${matchedRecordsFileName}`, [item.instanceHRID], 'instanceHrid', true); + + BulkEditSearchPane.downloadFileWithProposedChanges(); + BulkEditFiles.verifyMatchedResultFileContent(previewOfProposedChangesFileName, [item.instanceHRID], 'instanceHrid', true); + + BulkEditSearchPane.downloadFileWithUpdatedRecords(); + BulkEditFiles.verifyMatchedResultFileContent(updatedRecordsFileName, [item.instanceHRID], 'instanceHrid', true); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.closeDetailView(); + InventorySearchAndFilter.selectViewHoldings(); + InventoryInstance.verifyHoldingsPermanentLocation(newLocation); + InventoryInstance.verifyHoldingsTemporaryLocation(newLocation); + HoldingsRecordView.checkMarkAsSuppressedFromDiscovery(); + + TopMenuNavigation.navigateToApp('Inventory'); + InventorySearchAndFilter.switchToItem(); + InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); + ItemRecordView.waitLoading(); + ItemRecordView.suppressedAsDiscoveryIsPresent(); + }); +}); diff --git a/cypress/e2e/inventory/export-cql.cy.js b/cypress/e2e/inventory/export-cql.cy.js new file mode 100644 index 0000000000..13351a2d34 --- /dev/null +++ b/cypress/e2e/inventory/export-cql.cy.js @@ -0,0 +1,90 @@ +import TopMenu from '../../support/fragments/topMenu'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryActions from '../../support/fragments/inventory/inventoryActions'; +import FileManager from '../../support/utils/fileManager'; +import testTypes from '../../support/dictionary/testTypes'; +import permissions from '../../support/dictionary/permissions'; +import getRandomPostfix from '../../support/utils/stringTools'; +import devTeams from '../../support/dictionary/devTeams'; +import Users from '../../support/fragments/users/users'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import InventoryHoldings from '../../support/fragments/inventory/holdings/inventoryHoldings'; +import { ITEM_STATUS_NAMES } from '../../support/constants'; + +let userId; +const instanceTitle = `Inventory export test ${Number(new Date())}`; +const itemBarcode = `testItem_${getRandomPostfix()}`; +let locationName = ''; + +describe('ui-inventory: exports', () => { + before('navigates to Inventory', () => { + let source; + + cy.createTempUser([ + permissions.inventoryAll.gui, + permissions.dataExportAll.gui, + permissions.dataExportEnableModule.gui, + ]) + .then(userProperties => { + userId = userProperties.userId; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading + }); + cy.getAdminToken() + .then(() => { + cy.getLoanTypes({ limit: 1 }); + cy.getMaterialTypes({ limit: 1 }); + cy.getInstanceTypes({ limit: 1 }); + cy.getLocations({ limit: 1 }); + cy.getHoldingTypes({ limit: 1 }); + source = InventoryHoldings.getHoldingSources({ limit: 1 }); + }) + .then(() => { + locationName = Cypress.env('locations')[0].name; + cy.createInstance({ + instance: { + instanceTypeId: Cypress.env('instanceTypes')[0].id, + title: instanceTitle, + languages: ['eng'] + }, + holdings: [{ + holdingsTypeId: Cypress.env('holdingsTypes')[0].id, + permanentLocationId: Cypress.env('locations')[0].id, + sourceId: source.id, + }], + items: [ + [{ + barcode: itemBarcode, + missingPieces: '3', + numberOfMissingPieces: '3', + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: Cypress.env('loanTypes')[0].id }, + materialType: { id: Cypress.env('materialTypes')[0].id }, + }], + ], + }); + }); + }); + }); + + after('delete test data', () => { + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + Users.deleteViaApi(userId); + FileManager.deleteFileFromDownloadsByMask('SearchInstanceCQLQuery*'); + }); + + it('C9287 Export CQL query (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { + InventorySearchAndFilter.byLanguage(); + InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); + InventorySearchAndFilter.byEffectiveLocation(locationName); + InventorySearchAndFilter.saveCQLQuery(); + + FileManager.verifyFile( + InventoryActions.verifySaveCQLQueryFileName, + 'SearchInstanceCQLQuery*', + InventoryActions.verifySaveCQLQuery, + [instanceTitle] + ); + }); +}); diff --git a/cypress/e2e/inventory/export.cy.js b/cypress/e2e/inventory/export.cy.js index e3aa3d0ea0..b8274ae32e 100644 --- a/cypress/e2e/inventory/export.cy.js +++ b/cypress/e2e/inventory/export.cy.js @@ -16,7 +16,6 @@ import { ITEM_STATUS_NAMES } from '../../support/constants'; let userId; const instanceTitle = `Inventory export test ${Number(new Date())}`; -let locationName = ''; describe('ui-inventory: exports', () => { before('navigates to Inventory', () => { @@ -83,7 +82,7 @@ describe('ui-inventory: exports', () => { InventoryInstance.deleteInstanceViaApi(instance.id); }); Users.deleteViaApi(userId); - FileManager.deleteFolder(Cypress.config('downloadsFolder')); + FileManager.deleteFileFromDownloadsByMask('QuickInstanceExport*', 'SearchInstanceUUIDs*'); }); it('C9284 Export small number of Instance UUIDs (30 or fewer) (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { @@ -104,20 +103,6 @@ describe('ui-inventory: exports', () => { }); }); - it('C9287 Export CQL query (firebird)', { tags: [testTypes.smoke, devTeams.firebird] }, () => { - InventorySearchAndFilter.byLanguage(); - InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); - InventorySearchAndFilter.byEffectiveLocation(locationName); - InventorySearchAndFilter.saveCQLQuery(); - - FileManager.verifyFile( - InventoryActions.verifySaveCQLQueryFileName, - 'SearchInstanceCQLQuery*', - InventoryActions.verifySaveCQLQuery, - [instanceTitle] - ); - }); - it('C196757 Export selected records (MARC) (firebird)', { tags: [testTypes.smoke, devTeams.firebird, testTypes.broken] }, () => { InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); cy.do(InventorySearchAndFilter.getSearchResult().find(Checkbox()).click()); diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index 5e6265e76f..d3a45f1d31 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -174,6 +174,7 @@ export default { addNewBulkEditFilterString() { cy.do(plusBtn.click()); + cy.wait(1000); }, fillPatronGroup(group = 'staff (Staff Member)', rowIndex = 0) { From dc95656bb7d5f875d23ca11e4633953b40ed667f Mon Sep 17 00:00:00 2001 From: pavithradasari <139527611+pavithradasari@users.noreply.github.com> Date: Wed, 2 Aug 2023 20:24:26 +0530 Subject: [PATCH 34/55] eholdingsExports/pavithraideyalabs (#1383) * eholdingsExports/pavithraideyalab --- cypress/e2e/ideyalabs/eHoldingsExports.cy.js | 114 +++++ .../support/fragments/ideyalabs/exportJobs.js | 126 ++++++ .../support/fragments/invoices/invoices.js | 410 ++++++++++++------ cypress/support/fragments/loans/loansPage.js | 3 + cypress/support/fragments/topMenu.js | 7 +- 5 files changed, 532 insertions(+), 128 deletions(-) create mode 100644 cypress/e2e/ideyalabs/eHoldingsExports.cy.js create mode 100644 cypress/support/fragments/ideyalabs/exportJobs.js diff --git a/cypress/e2e/ideyalabs/eHoldingsExports.cy.js b/cypress/e2e/ideyalabs/eHoldingsExports.cy.js new file mode 100644 index 0000000000..663e8f78fe --- /dev/null +++ b/cypress/e2e/ideyalabs/eHoldingsExports.cy.js @@ -0,0 +1,114 @@ +import exportJobs from '../../support/fragments/ideyalabs/exportJobs'; +import testTypes from '../../support/dictionary/testTypes'; +import eHoldingsPackages from '../../support/fragments/eholdings/eHoldingsPackages'; +import eHoldingsPackagesSearch from '../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import eHoldingsSearch from '../../support/fragments/eholdings/eHoldingsSearch'; +import invoices from '../../support/fragments/invoices/invoices'; +import loansPage from '../../support/fragments/loans/loansPage'; +import topMenu from '../../support/fragments/topMenu'; +import fileManager from '../../support/utils/fileManager'; + +const testData = { + batchGroup: 'FOLIO', + packageOptions: 'Holdings status', + selectionStatus: 'Selected', + searchOption: 'BRITISH MEDICAL JOURNAL', + fileNameMask: '*package*', + data: { + packageName: 'VLeBooks', + title: 'ebook', + }, + packageFields: { + packageOne: 'Holdings status', + packageTwo: 'Agreements', + }, + titleFields: { + titleOne: 'Agreements', + titleTwo: 'Access status type', + }, +}; + +describe('Eholdings - exports', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + it( + 'C356417 Export of selected ""Package"" without titles. User chooses ""Package"" fields to export. (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsPackagesSearch.byName(testData.searchOption); + eHoldingsPackagesSearch.bySelectionStatus(testData.selectionStatus); + eHoldingsPackages.openPackage(); + exportJobs.exportsPackageCSVClick(); + exportJobs.packageFieldsToExportRadio(); + exportJobs.packageFieldsToExportDropdown(testData.packageOptions); + exportJobs.titleFieldsToExportRadio(); + exportJobs.clickExportButton(); + exportJobs.verifyJobIDRecord(); + fileManager.verifyFile( + loansPage.verifyFileName, + testData.fileNameMask, + loansPage.verifyContentOfExportFileName, + ['Package Holdings Status', 'Selected'] + ); + } + ); + + it( + 'C367972 Export button must be disabled when user tries to export Package record with more than 10k of Title records (spitfire)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.eholdingsPath); + eHoldingsSearch.switchToPackages(); + eHoldingsPackagesSearch.byName(testData.data.packageName); + eHoldingsPackages.openPackage(); + exportJobs.exportsPackageCSVClick(); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageOne + ); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageTwo + ); + exportJobs.allPackageFieldsToExportRadioButton(); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleOne); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleTwo); + exportJobs.allTitleFieldsToExportRadioButton(); + exportJobs.clickCancelButton(); + exportJobs.filterTitles(testData.data.title); + exportJobs.exportsPackageCSVClick(); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageOne + ); + exportJobs.packageFieldsSelectFromExportDropdown( + testData.packageFields.packageTwo + ); + exportJobs.allPackageFieldsToExportRadioButton(); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleOne); + exportJobs.titleFieldsToExportDropDown(testData.titleFields.titleTwo); + exportJobs.allTitleFieldsToExportRadioButton(); + exportJobs.clickExportButton(); + exportJobs.verifyJobIDRecord(); + fileManager.verifyFile( + loansPage.verifyFileName, + testData.fileNameMask, + loansPage.verifyContentOfExportFileName, + ['Package Holdings Status', 'Selected'] + ); + } + ); + + it( + 'C353217 Download batch export files from full screen view with Voucher export permission (FTP/JSON) - upload to server (thunderjet)', + { tags: [testTypes.ideaLabsTests] }, + () => { + cy.visit(topMenu.invoicesPath); + invoices.selectFolio(); + invoices.voucherExportManualExport(testData.batchGroup); + invoices.verifyDownloadButtonAndClick(); + // In Voucher Export screen, when performing Run Manual Export Voucher, Export record status = 'Error' due to that download button is not visible. + } + ); +}); diff --git a/cypress/support/fragments/ideyalabs/exportJobs.js b/cypress/support/fragments/ideyalabs/exportJobs.js new file mode 100644 index 0000000000..1026b949a9 --- /dev/null +++ b/cypress/support/fragments/ideyalabs/exportJobs.js @@ -0,0 +1,126 @@ +import { + Button, + Callout, + KeyValue, + Modal, + MultiSelect, + MultiSelectMenu, + MultiSelectOption, + PaneHeader, + RadioButton, + Section, + TextField, +} from '../../../../interactors'; +import exportManagerSearchPane from '../exportManager/exportManagerSearchPane'; +import topMenu from '../topMenu'; + +const actionsButton = Button('Actions'); +const radioPackageFieldsToExport = RadioButton({ + id: 'selected-package-fields', +}); +const radioTitleFieldsToExport = RadioButton({ id: 'selected-title-fields' }); +const allPackageRadioButton = RadioButton({ + ariaLabel: 'Export all fields', + name: 'packageFields', +}); +const allTitleRadioButton = RadioButton({ + ariaLabel: 'Export all fields', + name: 'titleFields', +}); +const exportButton = Button('Export'); +const exportSettingsModal = Modal({ id: 'eholdings-export-modal' }); +const cancelButton = Button('Cancel'); +const titlesSection = Section({ id: 'packageShowTitles' }); +const searchIcon = Button({ icon: 'search' }); +const filterTitlesModal = Modal({ id: 'eholdings-details-view-search-modal' }); +const titlesSearchField = TextField({ id: 'eholdings-search' }); +const selectionStatusButton = Button('Selection status'); +const notSelectedRadioButton = RadioButton('Not selected'); +const searchButton = Button('Search'); + +export default { + exportsPackageCSVClick: () => { + cy.do(actionsButton.click()); + cy.do(Button('Export package (CSV)').click()); + }, + + filterTitles: (title) => { + cy.do([ + titlesSection.find(searchIcon).click(), + filterTitlesModal.find(titlesSearchField).fillIn(title), + filterTitlesModal.find(selectionStatusButton).click(), + filterTitlesModal.find(notSelectedRadioButton).click(), + filterTitlesModal.find(searchButton).click(), + ]); + }, + + packageFieldsToExportRadio: () => { + cy.do(radioPackageFieldsToExport.click()); + }, + + allPackageFieldsToExportRadioButton: () => { + cy.do(allPackageRadioButton.click()); + }, + + packageFieldsSelectFromExportDropdown: (options) => { + cy.do([ + radioPackageFieldsToExport.click(), + MultiSelect({ ariaLabelledby: 'selected-package-fields' }).toggle(), + MultiSelectMenu().find(MultiSelectOption(options)).click(), + ]); + }, + + packageFieldsToExportDropdown: (options) => { + cy.do([ + radioPackageFieldsToExport.click(), + MultiSelect({ ariaLabelledby: 'selected-package-fields' }).toggle(), + MultiSelectMenu().find(MultiSelectOption(options)).click(), + ]); + }, + + allTitleFieldsToExportRadioButton: () => { + cy.do(allTitleRadioButton.click()); + }, + + titleFieldsToExportRadio: () => { + cy.do(radioTitleFieldsToExport.click()); + }, + + titleFieldsToExportDropDown: (options) => { + cy.do([ + MultiSelect({ ariaLabelledby: 'selected-title-fields' }).toggle(), + MultiSelectMenu().find(MultiSelectOption(options)).click(), + ]); + }, + + clickExportButton: () => { + cy.do(exportSettingsModal.find(exportButton).click()); + }, + + clickCancelButton: () => { + cy.do(exportSettingsModal.find(cancelButton).click()); + }, + + verifyJobIDRecord() { + cy.expect(Callout({ type: 'success' }).exists()); + cy.wrap(Callout({ type: 'success' }).text()).as('message'); + cy.get('@message').then((val) => { + const message = val.slice(31, 37); + cy.visit(topMenu.exportManagerPath); + exportManagerSearchPane.searchBySuccessful(); + exportManagerSearchPane.downloadLastCreatedJob(message); + }); + }, + + getFileName: () => cy.then(() => KeyValue('File name').value()), + + verifyFileName(fileName) { + this.getFileName().then((val) => { + expect(val).to.include(fileName); + }); + }, + + verifyThirdPaneExportJobExist() { + cy.expect(PaneHeader('Export jobs').exists()); + }, +}; diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index a3f9ea6132..33d333fced 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -1,35 +1,34 @@ import { + Accordion, Button, - TextField, - Selection, - SelectionList, - SearchField, + Checkbox, KeyValue, - Accordion, - Pane, - PaneHeader, - MultiColumnListCell, + Link, Modal, - Checkbox, MultiColumnList, + MultiColumnListCell, MultiColumnListRow, - Select, + Pane, + PaneHeader, + SearchField, Section, - Link, - SelectionOption + Select, + Selection, + SelectionList, + SelectionOption, + TextField } from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; import Helper from '../finance/financeHelper'; - const buttonNew = Button('New'); const saveAndClose = Button('Save & close'); const invoiceStates = { invoiceCreatedMessage: 'Invoice has been saved', invoiceLineCreatedMessage: 'Invoice line has been saved', - InvoiceApprovedMessage: 'Invoice has been approved successfully', - InvoicePaidMessage: 'Invoice has been paid successfully', - InvoiceDeletedMessage: 'Invoice has been deleted' + invoiceApprovedMessage: 'Invoice has been approved successfully', + invoicePaidMessage: 'Invoice has been paid successfully', + invoiceDeletedMessage: 'Invoice has been deleted', }; const vendorDetailsAccordionId = 'vendorDetails'; const invoiceLinesAccordionId = 'invoiceLines'; @@ -37,12 +36,15 @@ const actionsButton = Button('Actions'); const submitButton = Button('Submit'); const searchButton = Button('Search'); const invoiceDetailsPaneId = 'paneHeaderpane-invoiceDetails'; -const searhInputId = 'input-record-search'; -const numberOfSearchResultsHeader = '//*[@id="paneHeaderinvoice-results-pane-subtitle"]/span'; +const searchInputId = 'input-record-search'; +const numberOfSearchResultsHeader = + '//*[@id="paneHeaderinvoice-results-pane-subtitle"]/span'; const zeroResultsFoundText = '0 records found'; const searchForm = SearchField({ id: 'input-record-search' }); const resetButton = Button({ id: 'reset-invoice-filters' }); -const invoiceLineDetailsPane = PaneHeader({ id: 'paneHeaderpane-invoiceLineDetails' }); +const invoiceLineDetailsPane = PaneHeader({ + id: 'paneHeaderpane-invoiceLineDetails', +}); const deleteButton = Button('Delete'); const invoiceFiltersSection = Section({ id: 'invoice-filters-pane' }); const batchGroupFilterSection = Section({ id: 'batchGroupId' }); @@ -52,6 +54,16 @@ const invoiceDateFilterSection = Section({ id: 'invoiceDate' }); const approvalDateFilterSection = Section({ id: 'approvalDate' }); export default { + selectFolio() { + cy.do([ + Button({ id: 'accordion-toggle-button-status' }).click(), + Checkbox({ id: 'clickable-filter-status-paid' }).click(), + Checkbox({ id: 'clickable-filter-status-approved' }).click(), + Button({ id: 'accordion-toggle-button-batchGroupId' }).click(), + Button({ id: 'batchGroupId-selection' }).click(), + SelectionList().select('FOLIO'), + ]); + }, checkZeroSearchResultsHeader: () => { cy.xpath(numberOfSearchResultsHeader) @@ -99,7 +111,7 @@ export default { Selection('Batch group*').open(), SelectionList().select('FOLIO'), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').checked(false) + Checkbox('Export to accounting').checked(false), ]); cy.do(saveAndClose.click()); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); @@ -122,7 +134,7 @@ export default { Selection('Batch group*').open(), SelectionList().select(invoice.batchGroup), Select({ id: 'invoice-payment-method' }).choose('Cash'), - Checkbox('Export to accounting').click() + Checkbox('Export to accounting').click(), ]); cy.do(saveAndClose.click()); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); @@ -131,8 +143,8 @@ export default { selectVendorOnUi: (organizationName) => { cy.do([ Button('Organization look-up').click(), - SearchField({ id: searhInputId }).fillIn(organizationName), - searchButton.click() + SearchField({ id: searchInputId }).fillIn(organizationName), + searchButton.click(), ]); Helper.selectFromResultsList(); }, @@ -153,9 +165,21 @@ export default { checkCreatedInvoice(invoice, vendorPrimaryAddress) { this.checkVendorPrimaryAddress(vendorPrimaryAddress); cy.expect(Pane({ id: 'pane-invoiceDetails' }).exists()); - cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.invoiceNumber })).exists()); - cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.vendorName })).exists()); - cy.expect(Accordion({ id: vendorDetailsAccordionId }).find(KeyValue({ value: invoice.accountingCode })).exists()); + cy.expect( + Accordion({ id: vendorDetailsAccordionId }) + .find(KeyValue({ value: invoice.invoiceNumber })) + .exists() + ); + cy.expect( + Accordion({ id: vendorDetailsAccordionId }) + .find(KeyValue({ value: invoice.vendorName })) + .exists() + ); + cy.expect( + Accordion({ id: vendorDetailsAccordionId }) + .find(KeyValue({ value: invoice.accountingCode })) + .exists() + ); }, deleteInvoiceViaActions() { @@ -169,39 +193,55 @@ export default { cy.do([ invoiceLineDetailsPane.find(actionsButton).click(), deleteButton.click(), - Modal({ id: 'delete-invoice-line-confirmation' }).find(deleteButton).click() + Modal({ id: 'delete-invoice-line-confirmation' }) + .find(deleteButton) + .click(), ]); }, confirmInvoiceDeletion: () => { - cy.do(Button('Delete', { id: 'clickable-delete-invoice-confirmation-confirm' }).click()); + cy.do( + Button('Delete', { + id: 'clickable-delete-invoice-confirmation-confirm', + }).click() + ); InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceDeletedMessage); }, createInvoiceLine: (invoiceLine) => { - cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); + cy.do( + Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click() + ); cy.do(Button('New blank line').click()); // TODO: update using interactors once we will be able to pass negative value into text field cy.xpath('//*[@id="subTotal"]').type(invoiceLine.subTotal); cy.do([ TextField('Description*').fillIn(invoiceLine.description), TextField('Quantity*').fillIn(invoiceLine.quantity.toString()), - saveAndClose.click() + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, createInvoiceLinePOLLookUp: (orderNumber) => { - cy.do(Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click()); + cy.do( + Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click() + ); cy.do(Button('New blank line').click()); cy.do([ Button('POL look-up').click(), - Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(orderNumber), - searchButton.click() + Modal('Select order lines') + .find(SearchField({ id: searchInputId })) + .fillIn(orderNumber), + searchButton.click(), ]); Helper.selectFromResultsList(); cy.do(saveAndClose.click()); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, addLineFromPol: (orderNumber) => { @@ -209,77 +249,103 @@ export default { Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), Button('Add line from POL').click(), Modal('Select order lines').find(SearchField()).fillIn(orderNumber), - MultiColumnListRow({ index: rowNumber = 0 }).click() + MultiColumnListRow({ index: (rowNumber = 0) }).click(), ]); }, createInvoiceLineFromPol: (orderNumber, rowNumber = 0) => { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), - Button('Add line from POL').click() + Button('Add line from POL').click(), ]); cy.expect(Modal('Select order lines').exists()); cy.do([ - Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(orderNumber), + Modal('Select order lines') + .find(SearchField({ id: searchInputId })) + .fillIn(orderNumber), Modal('Select order lines').find(searchButton).click(), Checkbox({ ariaLabel: `record ${rowNumber} checkbox` }).clickInput(), - Button('Save').click() + Button('Save').click(), ]); }, checkInvoiceLine: (invoiceLine, currency = '$') => { cy.expect(Accordion({ id: invoiceLinesAccordionId }).exists()); - cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.description })).exists()); - cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.quantity.toString() })).exists()); - cy.expect(Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: currency.concat(invoiceLine.subTotal.toFixed(2)) })).exists()); + cy.expect( + Accordion({ id: invoiceLinesAccordionId }) + .find(MultiColumnListCell({ content: invoiceLine.description })) + .exists() + ); + cy.expect( + Accordion({ id: invoiceLinesAccordionId }) + .find(MultiColumnListCell({ content: invoiceLine.quantity.toString() })) + .exists() + ); + cy.expect( + Accordion({ id: invoiceLinesAccordionId }) + .find( + MultiColumnListCell({ + content: currency.concat(invoiceLine.subTotal.toFixed(2)), + }) + ) + .exists() + ); }, addFundDistributionToLine: (invoiceLine, fund) => { cy.do([ - Accordion({ id: invoiceLinesAccordionId }).find(MultiColumnListCell({ content: invoiceLine.description })).click(), - invoiceLineDetailsPane - .find(actionsButton).click(), + Accordion({ id: invoiceLinesAccordionId }) + .find(MultiColumnListCell({ content: invoiceLine.description })) + .click(), + invoiceLineDetailsPane.find(actionsButton).click(), Button('Edit').click(), Button({ id: 'fundDistributions-add-button' }).click(), Selection('Fund ID*').open(), - SelectionList().select((fund.name).concat(' ', '(', fund.code, ')')), - saveAndClose.click() + SelectionList().select(fund.name.concat(' ', '(', fund.code, ')')), + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, addFundToLine: (fund) => { cy.do([ Button({ id: 'fundDistributions-add-button' }).click(), Selection('Fund ID*').open(), - SelectionList().select((fund.name).concat(' ', '(', fund.code, ')')), - saveAndClose.click() + SelectionList().select(fund.name.concat(' ', '(', fund.code, ')')), + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, deleteFundInInvoiceLine: () => { cy.do([ - Section({ id: 'invoiceLineForm-fundDistribution' }).find(Button({ icon: 'trash' })).click(), - saveAndClose.click() + Section({ id: 'invoiceLineForm-fundDistribution' }) + .find(Button({ icon: 'trash' })) + .click(), + saveAndClose.click(), ]); - InteractorsTools.checkCalloutMessage(invoiceStates.invoiceLineCreatedMessage); + InteractorsTools.checkCalloutMessage( + invoiceStates.invoiceLineCreatedMessage + ); }, approveInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Approve').click(), - submitButton.click() + submitButton.click(), ]); InteractorsTools.checkCalloutMessage(invoiceStates.InvoiceApprovedMessage); }, searchByNumber: (invoiceNumber) => { cy.do([ - SearchField({ id: searhInputId }).selectIndex('Vendor invoice number'), - SearchField({ id: searhInputId }).fillIn(invoiceNumber), + SearchField({ id: searchInputId }).selectIndex('Vendor invoice number'), + SearchField({ id: searchInputId }).fillIn(invoiceNumber), searchButton.click(), ]); }, @@ -294,22 +360,20 @@ export default { payInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Pay').click(), - submitButton.click() + submitButton.click(), ]); InteractorsTools.checkCalloutMessage(invoiceStates.InvoicePaidMessage); }, updateCurrency: (currency) => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Edit').click(), Selection('Currency*').open(), SelectionList().select(currency), - saveAndClose.click() + saveAndClose.click(), ]); InteractorsTools.checkCalloutMessage(invoiceStates.invoiceCreatedMessage); }, @@ -326,10 +390,18 @@ export default { switch (currencyShortName) { // TODO: add other currencies if needed case 'USD': - cy.expect(Accordion({ id: 'extendedInformation' }).find(KeyValue({ value: 'US Dollar' })).exists()); + cy.expect( + Accordion({ id: 'extendedInformation' }) + .find(KeyValue({ value: 'US Dollar' })) + .exists() + ); break; case 'EUR': - cy.expect(Accordion({ id: 'extendedInformation' }).find(KeyValue({ value: 'Euro' })).exists()); + cy.expect( + Accordion({ id: 'extendedInformation' }) + .find(KeyValue({ value: 'Euro' })) + .exists() + ); break; default: cy.log(`No such currency short name like ${currencyShortName}`); @@ -339,7 +411,7 @@ export default { openPolSearchPlugin: () => { cy.do([ Accordion({ id: invoiceLinesAccordionId }).find(actionsButton).click(), - Button('Add line from POL').click() + Button('Add line from POL').click(), ]); cy.expect(Modal('Select order lines').exists()); }, @@ -347,18 +419,22 @@ export default { checkSearchPolPlugin: (searchParamsMap, titleOrPackage) => { for (const [key, value] of searchParamsMap.entries()) { cy.do([ - Modal('Select order lines').find(SearchField({ id: searhInputId })).selectIndex(key), - Modal('Select order lines').find(SearchField({ id: searhInputId })).fillIn(value), - Modal('Select order lines').find(searchButton).click() + Modal('Select order lines') + .find(SearchField({ id: searchInputId })) + .selectIndex(key), + Modal('Select order lines') + .find(SearchField({ id: searchInputId })) + .fillIn(value), + Modal('Select order lines').find(searchButton).click(), ]); // verify that first row in the result list contains related order line title - cy.expect(MultiColumnList({ id: 'list-plugin-find-records' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 2 })) - .has({ content: titleOrPackage })); - cy.do([ - Button({ id: 'reset-find-records-filters' }).click() - ]); + cy.expect( + MultiColumnList({ id: 'list-plugin-find-records' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 2 })) + .has({ content: titleOrPackage }) + ); + cy.do([Button({ id: 'reset-find-records-filters' }).click()]); // TODO: remove waiter - currenty it's a workaround for incorrect selection from search list cy.wait(1000); } @@ -371,29 +447,69 @@ export default { voucherExport: (batchGroup) => { cy.do([ PaneHeader({ id: 'paneHeaderinvoice-results-pane' }) - .find(actionsButton).click(), + .find(actionsButton) + .click(), Button('Voucher export').click(), Select().choose(batchGroup), Button('Run manual export').click(), - Button({ id: 'clickable-run-manual-export-confirmation-confirm' }).click(), + Button({ + id: 'clickable-run-manual-export-confirmation-confirm', + }).click(), ]); cy.wait(2000); - cy.do(MultiColumnList({ id: 'batch-voucher-exports' }) + cy.do( + MultiColumnList({ id: 'batch-voucher-exports' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 3 })) + .find(Button({ icon: 'download' })) + .click() + ); + }, + + voucherExportManualExport: (batchGroup) => { + cy.do([ + PaneHeader({ id: 'paneHeaderinvoice-results-pane' }) + .find(actionsButton) + .click(), + Button('Voucher export').click(), + Select().choose(batchGroup), + Button('Run manual export').click(), + Button({ + id: 'clickable-run-manual-export-confirmation-confirm', + }).click(), + ]); + cy.wait(2000); + }, + + verifyDownloadButtonAndClick: () => { + cy.expect(MultiColumnList({ id: 'batch-voucher-exports' }) .find(MultiColumnListRow({ index: 0 })) .find(MultiColumnListCell({ columnIndex: 3 })) .find(Button({ icon: 'download' })) - .click()); + .exists()); + cy.do( + MultiColumnList({ id: 'batch-voucher-exports' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 3 })) + .find(Button({ icon: 'download' })) + .click() + ); }, + getSearchParamsMap(orderNumber, orderLine) { const searchParamsMap = new Map(); - searchParamsMap.set('Keyword', orderNumber) + searchParamsMap + .set('Keyword', orderNumber) .set('Contributor', orderLine.contributors[0].contributor) .set('PO line number', orderNumber.toString().concat('-1')) .set('Requester', orderLine.requester) .set('Title or package name', orderLine.titleOrPackage) .set('Publisher', orderLine.publisher) .set('Vendor account', orderLine.vendorDetail.vendorAccount) - .set('Vendor reference number', orderLine.vendorDetail.referenceNumbers[0].refNumber) + .set( + 'Vendor reference number', + orderLine.vendorDetail.referenceNumbers[0].refNumber + ) .set('Donor', orderLine.donor) .set('Selector', orderLine.selector) .set('Volumes', orderLine.physical.volumes[0]) @@ -402,32 +518,39 @@ export default { return searchParamsMap; }, - waitLoading : () => { + waitLoading: () => { cy.expect(Pane({ id: 'invoice-results-pane' }).exists()); }, selectInvoiceLine: () => { - cy.do(Section({ id: 'invoiceLines' }) - .find(MultiColumnListRow({ index: 0 })) - .find(MultiColumnListCell({ columnIndex: 0 })) - .click()); + cy.do( + Section({ id: 'invoiceLines' }) + .find(MultiColumnListRow({ index: 0 })) + .find(MultiColumnListCell({ columnIndex: 0 })) + .click() + ); }, cancelInvoice: () => { cy.do([ - PaneHeader({ id: invoiceDetailsPaneId }) - .find(actionsButton).click(), + PaneHeader({ id: invoiceDetailsPaneId }).find(actionsButton).click(), Button('Cancel').click(), - submitButton.click() + submitButton.click(), ]); }, - selectInvoice:(invoiceNumber) => { - cy.do(Pane({ id: 'invoice-results-pane' }).find(Link(invoiceNumber)).click()); + selectInvoice: (invoiceNumber) => { + cy.do( + Pane({ id: 'invoice-results-pane' }).find(Link(invoiceNumber)).click() + ); }, - closeInvoiceDetailsPane:() => { - cy.do(Pane({ id: 'pane-invoiceDetails' }).find(Button({ icon: 'times' })).click()); + closeInvoiceDetailsPane: () => { + cy.do( + Pane({ id: 'pane-invoiceDetails' }) + .find(Button({ icon: 'times' })) + .click() + ); }, resetFilters: () => { @@ -435,83 +558,126 @@ export default { cy.expect(resetButton.is({ disabled: true })); }, - editInvoiceLine:() => { + editInvoiceLine: () => { cy.do([ Section({ id: 'pane-invoiceLineDetails' }).find(actionsButton).click(), Button('Edit').click(), ]); }, - addAdjustment:(descriptionInput, valueInput, typeToggle, realtioToTotal) => { + addAdjustment: (descriptionInput, valueInput, typeToggle, realtioToTotal) => { cy.do([ Button({ id: 'adjustments-add-button' }).click(), - TextField({ name: 'adjustments[0].description' }).fillIn(descriptionInput), + TextField({ name: 'adjustments[0].description' }).fillIn( + descriptionInput + ), TextField({ name: 'adjustments[0].value' }).fillIn(valueInput), - Section({ id: 'invoiceLineForm-adjustments' }).find(Button(typeToggle)).click(), + Section({ id: 'invoiceLineForm-adjustments' }) + .find(Button(typeToggle)) + .click(), Select({ name: 'adjustments[0].relationToTotal' }).choose(realtioToTotal), saveAndClose.click(), ]); }, - checkFundInInvoiceLine:(fund) => { - cy.expect(Section({ id: 'invoiceLineFundDistribution' }).find(Link(`${fund.name}(${fund.code})`)).exists()); + checkFundInInvoiceLine: (fund) => { + cy.expect( + Section({ id: 'invoiceLineFundDistribution' }) + .find(Link(`${fund.name}(${fund.code})`)) + .exists() + ); }, - selectStatusFilter:(status) => { + selectStatusFilter: (status) => { cy.do([ - invoiceFiltersSection.find(Section({ id: 'status' })).find(Button({ ariaLabel: 'Status filter list' })).click(), + invoiceFiltersSection + .find(Section({ id: 'status' })) + .find(Button({ ariaLabel: 'Status filter list' })) + .click(), Checkbox(status).click(), ]); }, selectVendorFilter: (organization) => { cy.do([ - invoiceFiltersSection.find(Section({ id: 'vendorId' })).find(Button({ ariaLabel: 'Vendor name filter list' })).click(), + invoiceFiltersSection + .find(Section({ id: 'vendorId' })) + .find(Button({ ariaLabel: 'Vendor name filter list' })) + .click(), Button('Organization look-up').click(), - Modal('Select Organization').find(SearchField({ id: searhInputId })).fillIn(organization.name), + Modal('Select Organization') + .find(SearchField({ id: searchInputId })) + .fillIn(organization.name), searchButton.click(), ]); Helper.selectFromResultsList(); }, - selectApprovalDateFilter:(dateFrom, dateTo) => { + selectApprovalDateFilter: (dateFrom, dateTo) => { cy.do([ - invoiceFiltersSection.find(approvalDateFilterSection).find(Button({ ariaLabel: 'Approval date filter list' })).click(), - approvalDateFilterSection.find(TextField({ name: 'startDate' })).fillIn(dateFrom), - approvalDateFilterSection.find(TextField({ name: 'endDate' })).fillIn(dateTo), + invoiceFiltersSection + .find(approvalDateFilterSection) + .find(Button({ ariaLabel: 'Approval date filter list' })) + .click(), + approvalDateFilterSection + .find(TextField({ name: 'startDate' })) + .fillIn(dateFrom), + approvalDateFilterSection + .find(TextField({ name: 'endDate' })) + .fillIn(dateTo), approvalDateFilterSection.find(Button('Apply')).click(), ]); }, - selectInvoiceDateFilter:(dateFrom, dateTo) => { + selectInvoiceDateFilter: (dateFrom, dateTo) => { cy.do([ - invoiceFiltersSection.find(invoiceDateFilterSection).find(Button({ ariaLabel: 'Invoice date filter list' })).click(), - invoiceDateFilterSection.find(TextField({ name: 'startDate' })).fillIn(dateFrom), - invoiceDateFilterSection.find(TextField({ name: 'endDate' })).fillIn(dateTo), + invoiceFiltersSection + .find(invoiceDateFilterSection) + .find(Button({ ariaLabel: 'Invoice date filter list' })) + .click(), + invoiceDateFilterSection + .find(TextField({ name: 'startDate' })) + .fillIn(dateFrom), + invoiceDateFilterSection + .find(TextField({ name: 'endDate' })) + .fillIn(dateTo), invoiceDateFilterSection.find(Button('Apply')).click(), ]); }, - selectFundCodeFilter:(fundCode) => { + selectFundCodeFilter: (fundCode) => { cy.do([ - invoiceFiltersSection.find(fundCodeFilterSection).find(Button({ ariaLabel: 'Fund code filter list' })).click(), + invoiceFiltersSection + .find(fundCodeFilterSection) + .find(Button({ ariaLabel: 'Fund code filter list' })) + .click(), fundCodeFilterSection.find(Button({ id: 'fundCode-selection' })).click(), fundCodeFilterSection.find(SelectionOption(fundCode)).click(), ]); }, - selectFiscalYearFilter:(fiscalYear) => { + selectFiscalYearFilter: (fiscalYear) => { cy.do([ - invoiceFiltersSection.find(fiscalYearFilterSection).find(Button({ ariaLabel: 'Fiscal year filter list' })).click(), - fiscalYearFilterSection.find(Button({ id: 'fiscalYearId-selection' })).click(), + invoiceFiltersSection + .find(fiscalYearFilterSection) + .find(Button({ ariaLabel: 'Fiscal year filter list' })) + .click(), + fiscalYearFilterSection + .find(Button({ id: 'fiscalYearId-selection' })) + .click(), fiscalYearFilterSection.find(SelectionOption(fiscalYear)).click(), ]); }, - selectButchGroupFilter:(batchGroup) => { + selectButchGroupFilter: (batchGroup) => { cy.do([ - invoiceFiltersSection.find(batchGroupFilterSection).find(Button({ ariaLabel: 'Batch group filter list' })).click(), - batchGroupFilterSection.find(Button({ id: 'batchGroupId-selection' })).click(), + invoiceFiltersSection + .find(batchGroupFilterSection) + .find(Button({ ariaLabel: 'Batch group filter list' })) + .click(), + batchGroupFilterSection + .find(Button({ id: 'batchGroupId-selection' })) + .click(), batchGroupFilterSection.find(SelectionOption(batchGroup)).click(), ]); }, diff --git a/cypress/support/fragments/loans/loansPage.js b/cypress/support/fragments/loans/loansPage.js index fe9e7b46c5..bb3c7dc0f4 100644 --- a/cypress/support/fragments/loans/loansPage.js +++ b/cypress/support/fragments/loans/loansPage.js @@ -21,6 +21,9 @@ export default { waitLoading: () => { cy.expect(PaneHeader({ id: 'paneHeaderpane-loandetails' }).exists()); }, + verifyFileName(actualName) { + expect(actualName).to.match(/^cypress\/downloads\/\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}_\d+_\d+-\d+_package\.csv$/); + }, checkAll() { cy.do(CheckboxInTable({ name: 'check-all' }).click()); }, diff --git a/cypress/support/fragments/topMenu.js b/cypress/support/fragments/topMenu.js index ce88380216..ee97996dfe 100644 --- a/cypress/support/fragments/topMenu.js +++ b/cypress/support/fragments/topMenu.js @@ -31,7 +31,7 @@ const exportManagerOrganizationsPath = 'export-manager/edi-jobs'; const customFieldsPath = '/settings/users/custom-fields'; const notesPath = '/settings/notes/general'; const permissionSetPath = '/settings/users/perms?layer=add'; -const customLabel = '/settings/eholdings' +const customLabel = '/settings/eholdings'; export default { @@ -65,13 +65,8 @@ export default { exportManagerPath, exportManagerOrganizationsPath, customFieldsPath, -<<<<<<< HEAD - notesPath, - permissionSetPath, -======= notesPath, permissionSetPath, ->>>>>>> 76c257975c27c71657983e014ff4a062a81d3219 customLabel, openCheckInApp:() => { cy.do(Link({ href: including('/checkin') }).click()); From 62b5714aa050566824a6baeab078ef427059ddd6 Mon Sep 17 00:00:00 2001 From: pavithradasari <139527611+pavithradasari@users.noreply.github.com> Date: Wed, 2 Aug 2023 20:43:23 +0530 Subject: [PATCH 35/55] inventoryNewMARCBIb/pavithradasari (#1394) * inventoryNewMARCBIb/pavithradasari --- .../e2e/ideyalabs/inventory_newMarcBib.cy.js | 273 ++++++++++++++++++ cypress/support/ideyalabs/marc.js | 223 ++++++++++++++ 2 files changed, 496 insertions(+) create mode 100644 cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js create mode 100644 cypress/support/ideyalabs/marc.js diff --git a/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js new file mode 100644 index 0000000000..42af3dec04 --- /dev/null +++ b/cypress/e2e/ideyalabs/inventory_newMarcBib.cy.js @@ -0,0 +1,273 @@ +import marc from '../../support/ideyalabs/marc'; +import eHoldingsPackage from '../../support/fragments/eholdings/eHoldingsPackage'; +import holdingsRecordView from '../../support/fragments/inventory/holdingsRecordView'; +import inventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import inventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import browseContributors from '../../support/fragments/inventory/search/browseContributors'; +import marcAuthorities from '../../support/fragments/marcAuthority/marcAuthorities'; +import marcAuthority from '../../support/fragments/marcAuthority/marcAuthority'; +import quickMarcEditor from '../../support/fragments/quickMarcEditor'; +import settingsMenu from '../../support/fragments/settingsMenu'; +import topMenu from '../../support/fragments/topMenu'; +import testTypes from '../../support/dictionary/testTypes'; +import devTeams from '../../support/dictionary/devTeams'; + +const testData = { + source: 'MARC', + tag100Content: { + secondBoxValue: "''", + thirdBoxValue: "''", + fourthBoxValue: '$a María de Jesús, $c de Agreda, sister, $d 1602-1665', + fifthBoxValue: '', + sixthBoxValue: '$0 id.loc.gov/authorities/childrensSubjects/sj2018050004', + seventhBoxValue: '', + }, + tag700Content: { + secondBoxValue: "''", + thirdBoxValue: "''", + fourthBoxValue: '$a TestPersonalName', + fifthBoxValue: '', + sixthBoxValue: '$0 id.loc.gov/authorities/names/n00000911', + seventhBoxValue: '', + }, + search: { + searchOption: 'Keyword', + value: 'personal', + }, + search240: { + searchOption: 'Keyword', + value: 'personal', + }, + search730: { + searchOption: 'Keyword', + value: 'Iroquois people', + }, + + rowIndex: { + row100: 5, + row700: 6, + }, + tags: { + tag100: '100', + tag700: '700', + tag245: '245', + tagLDR: 'LDR', + tag240: '240', + tag730: '730', + tag650: '650', + tag852: '852', + tag866: '866', + }, + fieldContents: { + tag100Content: 'Author, Person', + tag700Content: ' ', + tag245Content: 'The most important book', + tagLDRContent: '00000naa\\a2200000uu\\4500', + tag240Content: 'test 123', + tag730Content: 'test 123', + tag852Content: 'KU/CC/DI/A', + tag866Content: 'Test', + tag100$0Content: '3052328889 $0 3052044 $0 971255', + tag650Content: 'sh85095299', + tag035Content: '(OCoLC)ocn607TST001', + }, + accordions: { + contributor: 'Contributor', + subject: 'Subject', + titleData: 'Title data', + }, + contributor: { + name: 'María de Jesús, de Agreda, sister, 1602-1665', + }, + sourceValues: { + folio: 'ADMINISTRATOR, DIKU', + }, +}; + +describe('New Marc Bib Record and new MARC Holdings record', () => { + before('Login', () => { + cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); + }); + + after('Delete created MARC Holdings record', () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultItem(); + marc.openCreatedHoldingView(); + marc.deleteHolding(); + }); + + it('C9236 Settings: Add/Edit a custom label (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(settingsMenu.eHoldingsPath); + eHoldingsPackage.customLabel({ + labelOne: 'AutomatingTheFolioApplicationAndTestingApplication', + labelTwo: 'Test :', + }); + eHoldingsPackage.verifyCustomLabel(); + }); + + it('C380726 Link ""Contributor"" fields when creating ""MARC Bibliographic"" record (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + quickMarcEditor.updateExistingField( + testData.tags.tagLDR, + testData.fieldContents.tagLDRContent + ); + marcAuthority.addNewField( + 6, + testData.tags.tag100, + `$a ${testData.fieldContents.tag100Content}` + ); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag100); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search.searchOption, + testData.search.value + ); + marcAuthorities.clickLinkButton(); + marcAuthority.addNewField( + 7, + testData.tags.tag700, + `$a ${testData.fieldContents.tag700Content}` + ); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag700); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search.searchOption, + testData.search.value + ); + marcAuthorities.clickLinkButton(); + marc.saveAndClose(); + inventoryInstance.editMarcBibliographicRecord(); + marc.crossIcon(); + inventoryInstance.viewSource(); + marc.crossIcon(); + inventorySearchAndFilter.switchToBrowseTab(); + browseContributors.select(); + browseContributors.browse(testData.contributor.name); + browseContributors.checkSearchResultRecord(testData.contributor.name); + }); + + it('C350646 Create a new MARC Holdings record for existing ""Instance"" record (Spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventorySearchAndFilter.switchToHoldings(); + inventorySearchAndFilter.bySource(testData.source); + inventorySearchAndFilter.selectSearchResultItem(); + inventoryInstance.goToMarcHoldingRecordAdding(); + quickMarcEditor.updateExistingField( + testData.tags.tag852, + `$b ${testData.fieldContents.tag852Content}` + ); + marcAuthority.addNewField( + 5, + testData.tags.tag866, + `$a ${testData.fieldContents.tag866Content}` + ); + marc.saveAndClose(); + cy.wait(5000); // Wait Needed: need to wait until the View Source Button will be enabled + marc.crossIcon(); + marc.openCreatedHoldingView(); + holdingsRecordView.viewSource(); + marc.crossIcon(); + marc.recordLastUpdated(); + marc.checkFieldContentMatch(); + }); + + it('C380747 Add non-controllable subfields to a linked field when creating ""MARC Bibliographic"" record (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.checkReadOnlyTags(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + quickMarcEditor.updateExistingField( + testData.tags.tagLDR, + testData.fieldContents.tagLDRContent + ); + marcAuthority.addNewField( + 4, + testData.tags.tag240, + `$a ${testData.fieldContents.tag240Content}` + ); + marcAuthority.addNewField( + 5, + testData.tags.tag730, + `$a ${testData.fieldContents.tag730Content}` + ); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag240); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search240.searchOption, + testData.search240.value + ); + marcAuthorities.clickLinkButton(); + inventoryInstance.verifyAndClickLinkIcon(testData.tags.tag730); + marcAuthorities.switchToSearch(); + inventoryInstance.verifySearchOptions(); + marcAuthorities.searchBy( + testData.search730.searchOption, + testData.search730.value + ); + marcAuthorities.clickLinkButton(); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag240); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag730); + marc.saveAndClose(); + inventoryInstance.editMarcBibliographicRecord(); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag240); + inventoryInstance.verifyUnlinkIcon(testData.tags.tag730); + }); + + it('C389495 Auto-linking fields with multiple ""$0"" when creating new ""MARC Bib"" record (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + marcAuthority.addNewField( + 4, + testData.tags.tag100, + `$0 ${testData.fieldContents.tag100$0Content}` + ); + marcAuthority.addNewField( + 5, + testData.tags.tag650, + `$0 ${testData.fieldContents.tag650Content}` + ); + // Not able to save linking issue + marcAuthorities.clickLinkButton(); + marc.saveAndClose(); + inventoryInstance.viewSource(); + }); + + it('C380736 Search created ""MARC bib"" record by Title, OCLC number (spitfire)', { tags: [testTypes.ideaLabsTests, devTeams.ideaLabsTests] }, () => { + cy.visit(topMenu.inventoryPath); + inventoryInstance.newMarcBibRecord(); + quickMarcEditor.updateExistingField( + testData.tags.tag245, + `$a ${testData.fieldContents.tag245Content}` + ); + marc.create006Tag(); + marc.create007Tag(); + marcAuthority.addNewField( + 4, + testData.tags.tag035, + `$0 ${testData.fieldContents.tag035Content}` + ); + }); +}); diff --git a/cypress/support/ideyalabs/marc.js b/cypress/support/ideyalabs/marc.js new file mode 100644 index 0000000000..644c4aea73 --- /dev/null +++ b/cypress/support/ideyalabs/marc.js @@ -0,0 +1,223 @@ +import { + Accordion, + Button, + PaneHeader, + Section, + Spinner, + TextField, + including, + Accordion, + Button, + Checkbox, + KeyValue, + Modal, + Section, + Select, + Spinner, + TextField, + including, + SearchField, + QuickMarcEditorRow, + Callout +} from "../../../interactors"; +import holdingsRecordView from "../fragments/inventory/holdingsRecordView"; + +const rootSection = Section({ id: "marc-view-pane" }); +const filterSection = Section({ id: "pane-filter" }); +const saveAndCloseBtn = Button("Save & close"); +const closeButton = Button({ + ariaLabel: "Close The !!!Kung of Nyae Nyae / Lorna Marshall.", +}); +const buttonLink = Button({ icon: 'unlink' }); +const editorSection = Section({ id: 'quick-marc-editor-pane' }); +const linkHeadingsButton = Button("Link headings"); +const searchButton = Button({ type: "submit" }); +const actionsButton = Button("Actions"); +const deleteButton = Button("Delete"); +const deleteButtonInConfirmation = Button({ + id: "clickable-delete-confirmation-modal-confirm", +}); +const availableProxies = ['Inherited - None', 'FOLIO-Bugfest', 'EZProxy']; +const proxySelect = Select({ id: 'eholdings-proxy-id' }); +const customLabelButton = Button('Custom labels'); +const displayLabel = TextField({ name: 'customLabel1.displayLabel' }); +const displayLabelOne = TextField({ name: 'customLabel2.displayLabel' }); +const fullTextFinderCheckbox = Checkbox({ + name: 'customLabel2.displayOnFullTextFinder', +}); +const saveButton = Button('Save'); +const verifyCustomLabel = Section({ id: 'resourceShowCustomLabels' }); +const RandomValue = Math.floor(Math.random() * 2); +cy.intercept(`eholdings/packages/${packageId}/resources?**`).as( + 'getTitles' +); + +export default { + openCreatedHoldingView: () => { + cy.get('[class^="button-"][id^="clickable-view-holdings-"]').last().click(); + }, + + deleteHolding: () => { + cy.do([ + actionsButton.click(), + deleteButton.click(), + deleteButtonInConfirmation.click(), + ]); + }, + + clickLinkHeadings: () => { + cy.do(linkHeadingsButton.click()); + }, + + printButton: () => { + cy.do(rootSection.find(Button("Actions")).click()); + cy.do(Button("Print").click()); + }, + + searchByValue: (value) => { + cy.do( + filterSection + .find(TextField({ id: "input-inventory-search" })) + .fillIn(value) + ); + searchButton.click(); + }, + + saveAndClose() { + cy.do(saveAndCloseBtn.click()); + }, + + closeMark: () => { + cy.do(closeButton.click()); + }, + + popupUnlinkButton: () => { + cy.do(Button("Unlink").click()); + }, + + keepLinkingButton: () => { + cy.do(Button("Keep linking").click()); + }, + + closeEditMarc: () => { + cy.do(Button({ icon: "times" }).click()); + }, + + crossIcon: () => { + cy.do(Button({ icon: "times" }).click()); + }, + + create006Tag: () => { + cy.get(".quickMarcEditorAddField:last").click(); + cy.get('[class*="quickMarcEditorRow--"]:last-child') + .find("input") + .then(([tag]) => { + cy.wrap(tag).type("006"); + }); + cy.get('[class*="quickMarcEditorRow--"]:last-child').contains("Type"); + cy.get('[class*="quickMarcEditorRow--"]:last-child select').select("a"); + }, + + create007Tag: () => { + cy.get(".quickMarcEditorAddField:last").click(); + cy.get('[class*="quickMarcEditorRow--"]:last-child') + .find("input") + .then(([tag]) => { + cy.wrap(tag).type("007"); + }); + cy.get('[class*="quickMarcEditorRow--"]:last-child').contains("Type"); + cy.get('[class*="quickMarcEditorRow--"]:last-child select').select("a"); + }, + + recordLastUpdated: () => { + cy.expect(Spinner().absent()); + cy.do( + Accordion("Administrative data") + .find(Button(including("Record last updated"))) + .click() + ); + }, + + checkFieldContentMatch() { + cy.wrap(Accordion({ headline: "Update information" }).text()).as("message"); + cy.get("@message").then((val) => { + const sourceRegex = /Source: [^\n]*/; + const sourceLineMatch = val.match(sourceRegex); + const sourceText = sourceLineMatch ? sourceLineMatch[0].slice(8) : ""; + const words = sourceText.split(", "); + const swappedString = words.join(", "); + holdingsRecordView.editInQuickMarc(); + cy.expect( + PaneHeader({ id: "paneHeaderquick-marc-editor-pane" }).has({ + text: including(`Source: ${swappedString}`), + }) + ); + }); + }, + + customLabel(name) { + cy.do([ + customLabelButton.click(), + displayLabel.fillIn(name.labelOne), + displayLabelOne.fillIn(name.labelTwo), + fullTextFinderCheckbox.click(), + saveButton.click(), + ]); + cy.visit('/eholdings/resources/58-473-185972'); + }, + + verifyCustomLabel: () => { + cy.expect(verifyCustomLabel.exists()); + }, + + checkEmptyTitlesList: () => { + cy.expect(titlesSection.find(KeyValue('Records found', { value: '0' }))); + }, + + editactions: () => { + cy.wait(2000); + cy.do(actionsButton.click()); + cy.wait(2000); + cy.do(editButton.click()); + }, + + changeProxy: () => { + cy.get('select#eholdings-proxy-id option:selected') + .invoke('text') + .then((text) => { + const options = availableProxies.filter((option) => option !== text); + cy.do(proxySelect.choose(options[RandomValue])); + }); + }, + + saveAndClose: () => { + cy.do(Button('Save & close').click()); + }, + + selectSearchResultByRowIndex(indexRow) { + cy.do(this.getSearchResult(indexRow, 0).click()); + // must wait page render + cy.wait(2000); + }, + + searchBeats(value) { + cy.do((SearchField({ id: 'textarea-authorities-search' })).fillIn(value)); + cy.do((Button({ id: 'submit-authorities-search' })).click()); + }, + checkFieldTagExists: () => { + cy.expect([ + editorSection.exists(), + QuickMarcEditorRow({ tagValue: '625' }).exists() + ]); + }, + + checkLinkingAuthority650: () => { + cy.expect(buttonLink.exists()); + cy.expect(Callout('Field 650 has been linked to a MARC authority record.').exists()); + }, + + checkLinkingAuthority700: () => { + cy.expect(buttonLink.exists()); + cy.expect(Callout('Field 700 has been linked to a MARC authority record.').exists()); + }, +}; From 1d27afae6c0dc1141e384ec1b5e6373f53aa880f Mon Sep 17 00:00:00 2001 From: Vineethasakhamuri <117971735+Vineethasakhamuri@users.noreply.github.com> Date: Wed, 2 Aug 2023 21:08:25 +0530 Subject: [PATCH 36/55] settings-permisssions/vineethaideyalabs (#1425) * settings-permisssions/vineethaideyalabs --- cypress/e2e/ideyalabs/settings.cy.js | 65 +++++++++++++++++++++++ cypress/support/dictionary/permissions.js | 4 ++ 2 files changed, 69 insertions(+) create mode 100644 cypress/e2e/ideyalabs/settings.cy.js diff --git a/cypress/e2e/ideyalabs/settings.cy.js b/cypress/e2e/ideyalabs/settings.cy.js new file mode 100644 index 0000000000..2eb9bfd90e --- /dev/null +++ b/cypress/e2e/ideyalabs/settings.cy.js @@ -0,0 +1,65 @@ +import uuid from 'uuid'; +import TestTypes from '../../support/dictionary/testTypes'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; +import permissions from '../../support/dictionary/permissions'; +import UserEdit from '../../support/fragments/users/userEdit'; +import Users from '../../support/fragments/users/users'; +import eHoldingsPackage from '../../support/fragments/eholdings/eHoldingsPackage'; +import settingsMenu from '../../support/fragments/settingsMenu'; + +describe('Creating custom labels', () => { + const userData = {}; + const testData = { + servicePointS: ServicePoints.getDefaultServicePointWithPickUpLocation( + 'S', + uuid() + ), + }; + before('Preconditions', () => { + cy.getAdminToken().then(() => { + ServicePoints.createViaApi(testData.servicePointS); + testData.defaultLocation = Location.getDefaultLocation( + testData.servicePointS.id + ); + }); + cy.createTempUser([ + permissions.uiSettingseholdingsViewEditCreateDelete.gui, + permissions.uieHoldingsTitlesPackagesCreateDelete.gui, + ]) + .then((userProperties) => { + userData.username = userProperties.username; + userData.password = userProperties.password; + userData.userId = userProperties.userId; + }) + .then(() => { + UserEdit.addServicePointsViaApi( + [testData.servicePointS.id], + userData.userId, + testData.servicePointS.id + ); + cy.login(userData.username, userData.password); + }); + }); + + after('Deleting created entities', () => { + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [ + testData.servicePointS.id, + ]); + ServicePoints.deleteViaApi(testData.servicePointS.id); + Users.deleteViaApi(userData.userId); + }); + it( + 'C9236 Settings: Add/Edit a custom label(spitfire)', + { tags: [TestTypes.ideaLabsTests] }, + () => { + cy.visit(settingsMenu.eHoldingsPath); + eHoldingsPackage.customLabel({ + labelOne: 'AutomatingTheFolioApplicationAndTestingApplication', + labelTwo: 'Test :', + }); + cy.visit('/eholdings/resources/58-473-185972'); + eHoldingsPackage.verifyCustomLabel(); + } + ); +}); diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 9fbcdd89e4..1540f18774 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -228,6 +228,10 @@ export default { settingsDataImportCanViewOnly:{ internal:'ui-data-import.settings.readOnly', gui:'Settings (Data import): Can view only' }, settingsTenantViewLocation:{ internal:'ui - tenant - settings.settings.location.view', gui:'Settings (Tenant): View locations' }, settingsUsersCRUD: { internal: 'ui-users.settings.transfers.all', gui: 'Settings (Users): Can create, edit and remove transfer accounts' }, + // Added the below permissions for custom label creation + + uiSettingseholdingsViewEditCreateDelete:{ internal: 'ui-eholdings.settings.all', gui: 'Settings (eholdings): Can create, edit, view, and delete custom labels' }, + // Timers okapiTimersPatch: { internal: 'okapi.proxy.self.timers.patch', gui: 'Okapi - patch timer for current tenant' }, // Export manager From 48918199217bf7b21f603d515bf154222b4c7771 Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 7 Aug 2023 10:35:42 -0500 Subject: [PATCH 37/55] Added Duke and Cornell test files and updated helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 47 +++++++++++++++++++ ...-transfer-criteria-example-test-duke.cy.js | 0 .../fragments/users/transferFeeFine.js | 42 +++++++++++++++-- 3 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js create mode 100644 cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js new file mode 100644 index 0000000000..1c152916bf --- /dev/null +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -0,0 +1,47 @@ +import TestTypes from "../../../../support/dictionary/testTypes"; +import DevTeams from "../../../../support/dictionary/devTeams"; +import settingsMenu from "../../../../support/fragments/settingsMenu"; +import TransferFeeFine from "../../../../support/fragments/users/transferFeeFine"; + +describe("Build the Cornell bursar transfer file", () => { + before(() => { + cy.loginAsAdmin({ + path: settingsMenu.usersTransferCriteria, + waiter: TransferFeeFine.waitLoadingTransferCriteria, + }); + }); + + // Criteria: No criteria(always run) + it("should be able to set no criteria", () => { + TransferFeeFine.setCriteria(false); + + }); + + it("should be able to set scheduling", () => { + TransferFeeFine.setTransferCriteriaScheduling( + "Weeks", + "1", + "11:00 PM", + "Monday" + ); + }); + + // Aggregate by patron: Box unchecked + + // Header Format + it("should be able to set header format", () => { + TransferFeeFine.setDataFormatSection(); + }); + + // Account Data Format + + // Footer Format + + // Preview + + // Transfer Account to + + // Run manually/ save and run + + // Verify that the transfer was successful +}); diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 5af15bdd90..b32c9396ba 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,4 +1,5 @@ -import { Button, Modal, TextField, Select, Pane } from '../../../../interactors'; +import { el } from 'date-fns/locale'; +import { Button, Modal, TextField, Select, Pane, MultiSelect } from '../../../../interactors'; const rootModal = Modal({ id: 'transfer-modal' }); const amountTextfield = rootModal.find(TextField({ id: 'amount' })); @@ -7,7 +8,7 @@ const transferAccountSelect = rootModal.find(Select({ name: 'method' })); const transferButton = rootModal.find(Button({ id: 'submit-button' })); const confirmModal = Modal('Confirm fee/fine transfer'); const confirmButton = confirmModal.find(Button('Confirm')); -const transferPane = Pane('Transfer criteria'); +const transferPane = Pane('Transfer configuration'); export default { waitLoading: () => { @@ -18,8 +19,28 @@ export default { cy.expect(transferPane.exists()); }, - selectTransferCriteriaSchedulePeriod(period = 'Days') { - cy.do(Select({ name: 'schedulePeriod' }).choose(period)); + setTransferCriteriaScheduling(frequency, interval, time, weekDays) { + cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); + + if (frequency === 'Weeks') { + cy.do([ + TextField({ name: 'scheduling.time' }).fillIn(time) + ]); + cy.do([ + TextField({ name: 'scheduling.interval' }).fillIn(interval) + ]); + cy.do([ + Select({ name: 'scheduling.weekDays' }).choose(weekDays) + ]); + } + else if (frequency === 'Days') { + cy.do([ + Select({ name: 'scheduling.interval' }).choose(interval) + ]); + } + else if (frequency === 'Hours') { + } + else return; }, typeScheduleTime(time) { @@ -35,6 +56,19 @@ export default { cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); }, + // All three of our acceptance tests use no criteria for the Criteria field + setCriteria(criteria) { + if (!criteria) { + cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); + } + }, + + // sectionName: string like 'Header', 'Account Data', 'Footer' + // dataFormat will be a list of options we config + setDataFormatSection(sectionName, dataFormat) { + + }, + setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), setOwner: (owner) => cy.do(ownerSelect.choose(owner)), setTransferAccount: (account) => cy.do(transferAccountSelect.choose(account)), From fc83873c3f517ed833b3b6cc809b7b3193f93cc3 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 8 Aug 2023 10:48:22 -0500 Subject: [PATCH 38/55] Added run manully function --- ...ansfer-criteria-example-test-cornell.cy.js | 20 ++++++++++-------- .../fragments/users/transferFeeFine.js | 21 ++++++++++++++++++- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 1c152916bf..bc609c24a8 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -11,12 +11,6 @@ describe("Build the Cornell bursar transfer file", () => { }); }); - // Criteria: No criteria(always run) - it("should be able to set no criteria", () => { - TransferFeeFine.setCriteria(false); - - }); - it("should be able to set scheduling", () => { TransferFeeFine.setTransferCriteriaScheduling( "Weeks", @@ -26,7 +20,15 @@ describe("Build the Cornell bursar transfer file", () => { ); }); + it("should be able to set no criteria", () => { + TransferFeeFine.setCriteria(false); + + }); + // Aggregate by patron: Box unchecked + it("should be able to set aggregate by patron", () => { + TransferFeeFine.setAggregateByPatron(false); + }); // Header Format it("should be able to set header format", () => { @@ -37,11 +39,11 @@ describe("Build the Cornell bursar transfer file", () => { // Footer Format - // Preview - // Transfer Account to - // Run manually/ save and run + it("should be able to run manually", () => { + TransferFeeFine.runManually(); + }); // Verify that the transfer was successful }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index b32c9396ba..fd28ff11c4 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -30,7 +30,9 @@ export default { TextField({ name: 'scheduling.interval' }).fillIn(interval) ]); cy.do([ - Select({ name: 'scheduling.weekDays' }).choose(weekDays) + // get the multi-select element, then choose the weekday buttons + MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDays) + ]); } else if (frequency === 'Days') { @@ -43,6 +45,23 @@ export default { else return; }, + setAggregateByPatron(aggregate) { + if (!aggregate) { + // check if the box is already unchecked + cy.expect(Button({ text: 'Group data by patron' }).exists()); + // uncheck the box + cy.do([ + Button({ text: 'Group data by patron' }).click() + ]); + } + }, + + runManually() { + cy.do([ + Button({ text: 'Run manually' }).click(), + ]); + }, + typeScheduleTime(time) { // time: string like 9:15 AM cy.do([ From 0addf36ccfa153c1788678e767b32c738acc5ba0 Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 10 Aug 2023 09:31:11 -0500 Subject: [PATCH 39/55] Added openAccordion, aggregateByPatron, basic format functions --- ...ansfer-criteria-example-test-cornell.cy.js | 16 +++++++-- .../fragments/users/transferFeeFine.js | 36 ++++++++++--------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index bc609c24a8..1be80f2ff3 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -11,6 +11,10 @@ describe("Build the Cornell bursar transfer file", () => { }); }); + it("should be able to open all the panes", () => { + TransferFeeFine.openAllPanes(); + }); + it("should be able to set scheduling", () => { TransferFeeFine.setTransferCriteriaScheduling( "Weeks", @@ -22,7 +26,6 @@ describe("Build the Cornell bursar transfer file", () => { it("should be able to set no criteria", () => { TransferFeeFine.setCriteria(false); - }); // Aggregate by patron: Box unchecked @@ -32,7 +35,15 @@ describe("Build the Cornell bursar transfer file", () => { // Header Format it("should be able to set header format", () => { - TransferFeeFine.setDataFormatSection(); + // get the parent element that contains text 'Header Format', then loop through its children and press the trash icon for each + cy.get('.dropdown-menu:has("Header format")').parent().within(() => { + cy.get("button[class^='iconButton']").each((el) => { + cy.wrap(el).click(); + }); + } + ); + + }); // Account Data Format @@ -45,5 +56,4 @@ describe("Build the Cornell bursar transfer file", () => { TransferFeeFine.runManually(); }); - // Verify that the transfer was successful }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index fd28ff11c4..fbe3ed3ff0 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -29,11 +29,6 @@ export default { cy.do([ TextField({ name: 'scheduling.interval' }).fillIn(interval) ]); - cy.do([ - // get the multi-select element, then choose the weekday buttons - MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDays) - - ]); } else if (frequency === 'Days') { cy.do([ @@ -47,12 +42,10 @@ export default { setAggregateByPatron(aggregate) { if (!aggregate) { - // check if the box is already unchecked - cy.expect(Button({ text: 'Group data by patron' }).exists()); - // uncheck the box - cy.do([ - Button({ text: 'Group data by patron' }).click() - ]); + // it is an input checkbox wiht name aggregate + cy.get('input[name="aggregate"]').uncheck( + { force: true } + ); } }, @@ -60,6 +53,7 @@ export default { cy.do([ Button({ text: 'Run manually' }).click(), ]); + cy.get('@alert').should('have.been.calledOnceWith', 'Job has been scheduled') }, typeScheduleTime(time) { @@ -75,17 +69,27 @@ export default { cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); }, - // All three of our acceptance tests use no criteria for the Criteria field setCriteria(criteria) { if (!criteria) { cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); } }, - - // sectionName: string like 'Header', 'Account Data', 'Footer' - // dataFormat will be a list of options we config - setDataFormatSection(sectionName, dataFormat) { + openAllPanes() { + // see if you can find a button that says "Collapse all" + if (Button({ text: 'Collapse all' }).exists()) { + // if you can find it, click it then click the new button "Expand all" + cy.do([ + Button({ text: 'Collapse all' }).click(), + Button({ text: 'Expand all' }).click() + ]); + } + else { + // if you can't find it, click the button "Expand all" + cy.do([ + Button({ text: 'Expand all' }).click() + ]); + } }, setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), From d85599ef53500018cb4b7823a4a9a9462da7cf93 Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 10 Aug 2023 09:32:53 -0500 Subject: [PATCH 40/55] Cleaned up helper functions --- cypress/support/fragments/users/transferFeeFine.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index fbe3ed3ff0..761d405642 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -42,11 +42,11 @@ export default { setAggregateByPatron(aggregate) { if (!aggregate) { - // it is an input checkbox wiht name aggregate cy.get('input[name="aggregate"]').uncheck( { force: true } ); } + // Currently don't have any test cases for aggregate by patron }, runManually() { @@ -73,19 +73,11 @@ export default { if (!criteria) { cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); } + // Currently don't have any test cases for criteria }, openAllPanes() { - // see if you can find a button that says "Collapse all" - if (Button({ text: 'Collapse all' }).exists()) { - // if you can find it, click it then click the new button "Expand all" - cy.do([ - Button({ text: 'Collapse all' }).click(), - Button({ text: 'Expand all' }).click() - ]); - } - else { - // if you can't find it, click the button "Expand all" + if (!Button({ text: 'Collapse all' }).exists()) { cy.do([ Button({ text: 'Expand all' }).click() ]); From 3644efbf771dfd477e5d2d2392b33b64649caa38 Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 10 Aug 2023 11:40:39 -0500 Subject: [PATCH 41/55] Added transfer account helper function --- ...ansfer-criteria-example-test-cornell.cy.js | 26 +++++++++++-------- .../fragments/users/transferFeeFine.js | 8 +++++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 1be80f2ff3..fb4ad24130 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -33,27 +33,31 @@ describe("Build the Cornell bursar transfer file", () => { TransferFeeFine.setAggregateByPatron(false); }); + it("should be able to set transfer account data to", () => { + TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + }); + // Header Format it("should be able to set header format", () => { - // get the parent element that contains text 'Header Format', then loop through its children and press the trash icon for each - cy.get('.dropdown-menu:has("Header format")').parent().within(() => { - cy.get("button[class^='iconButton']").each((el) => { - cy.wrap(el).click(); - }); - } - ); - - + // remove all current header options + cy.do([ + Button({ icon: "trash" }).click(), + Button({ icon: "trash" }).click(), + Button({ icon: "trash" }).click(), + ]); }); // Account Data Format // Footer Format - + // Transer account data to + it("should be able to set transfer account data to", () => { + TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + }); it("should be able to run manually", () => { - TransferFeeFine.runManually(); + //TransferFeeFine.runManually(); }); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 761d405642..03a8a1226a 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -76,6 +76,13 @@ export default { // Currently don't have any test cases for criteria }, + setTransferAccount(feeFineOwner, transferAccount) { + cy.do([ + Select({ name: 'transferInfo.else.owner' }).choose(feeFineOwner), + Select({ name: 'transferInfo.else.account' }).choose(transferAccount) + ]); + }, + openAllPanes() { if (!Button({ text: 'Collapse all' }).exists()) { cy.do([ @@ -86,7 +93,6 @@ export default { setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), setOwner: (owner) => cy.do(ownerSelect.choose(owner)), - setTransferAccount: (account) => cy.do(transferAccountSelect.choose(account)), transferAndConfirm: () => { cy.do([ transferButton.click(), From dcfd63648825efc6c64150bf1f851d9322c8e1dc Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 14 Aug 2023 07:56:26 -0500 Subject: [PATCH 42/55] Added verify expect statementes for each section --- ...ansfer-criteria-example-test-cornell.cy.js | 21 +-- .../fragments/users/transferFeeFine.js | 156 +++++++++++------- 2 files changed, 107 insertions(+), 70 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index fb4ad24130..6fa0d96d25 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -13,6 +13,7 @@ describe("Build the Cornell bursar transfer file", () => { it("should be able to open all the panes", () => { TransferFeeFine.openAllPanes(); + TransferFeeFine.verifyOpenAllPanes(); }); it("should be able to set scheduling", () => { @@ -22,29 +23,28 @@ describe("Build the Cornell bursar transfer file", () => { "11:00 PM", "Monday" ); + TransferFeeFine.verifyTransferCriteriaScheduling( + "Weeks", + "1", + "11:00 PM", + "Monday" + ); }); it("should be able to set no criteria", () => { TransferFeeFine.setCriteria(false); + TransferFeeFine.verifyCriteria(false); }); // Aggregate by patron: Box unchecked it("should be able to set aggregate by patron", () => { TransferFeeFine.setAggregateByPatron(false); - }); - - it("should be able to set transfer account data to", () => { - TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + TransferFeeFine.verifyAggregateByPatron(false); }); // Header Format it("should be able to set header format", () => { - // remove all current header options - cy.do([ - Button({ icon: "trash" }).click(), - Button({ icon: "trash" }).click(), - Button({ icon: "trash" }).click(), - ]); + TransferFeeFine.removeHeaderFormat(); }); // Account Data Format @@ -54,6 +54,7 @@ describe("Build the Cornell bursar transfer file", () => { // Transer account data to it("should be able to set transfer account data to", () => { TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + TransferFeeFine.verifyTransferAccount("Lost Item Fine Office", "acct"); }); it("should be able to run manually", () => { diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 03a8a1226a..27fbeee5a1 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,14 +1,21 @@ -import { el } from 'date-fns/locale'; -import { Button, Modal, TextField, Select, Pane, MultiSelect } from '../../../../interactors'; - -const rootModal = Modal({ id: 'transfer-modal' }); -const amountTextfield = rootModal.find(TextField({ id: 'amount' })); -const ownerSelect = rootModal.find(Select({ id: 'ownerId' })); -const transferAccountSelect = rootModal.find(Select({ name: 'method' })); -const transferButton = rootModal.find(Button({ id: 'submit-button' })); -const confirmModal = Modal('Confirm fee/fine transfer'); -const confirmButton = confirmModal.find(Button('Confirm')); -const transferPane = Pane('Transfer configuration'); +import { el } from "date-fns/locale"; +import { + Button, + Modal, + TextField, + Select, + Pane, + MultiSelect, +} from "../../../../interactors"; + +const rootModal = Modal({ id: "transfer-modal" }); +const amountTextfield = rootModal.find(TextField({ id: "amount" })); +const ownerSelect = rootModal.find(Select({ id: "ownerId" })); +const transferAccountSelect = rootModal.find(Select({ name: "method" })); +const transferButton = rootModal.find(Button({ id: "submit-button" })); +const confirmModal = Modal("Confirm fee/fine transfer"); +const confirmButton = confirmModal.find(Button("Confirm")); +const transferPane = Pane("Transfer configuration"); export default { waitLoading: () => { @@ -20,90 +27,119 @@ export default { }, setTransferCriteriaScheduling(frequency, interval, time, weekDays) { - cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); - - if (frequency === 'Weeks') { - cy.do([ - TextField({ name: 'scheduling.time' }).fillIn(time) - ]); - cy.do([ - TextField({ name: 'scheduling.interval' }).fillIn(interval) - ]); - } - else if (frequency === 'Days') { - cy.do([ - Select({ name: 'scheduling.interval' }).choose(interval) - ]); - } - else if (frequency === 'Hours') { - } - else return; + cy.do(Select({ name: "scheduling.frequency" }).choose(frequency)); + + if (frequency === "Weeks") { + cy.do([TextField({ name: "scheduling.time" }).fillIn(time)]); + cy.do([TextField({ name: "scheduling.interval" }).fillIn(interval)]); + } else if (frequency === "Days") { + cy.do([Select({ name: "scheduling.interval" }).choose(interval)]); + } else if (frequency === "Hours") { + } else return; }, setAggregateByPatron(aggregate) { if (!aggregate) { - cy.get('input[name="aggregate"]').uncheck( - { force: true } - ); + cy.get('input[name="aggregate"]').uncheck({ force: true }); } // Currently don't have any test cases for aggregate by patron }, runManually() { - cy.do([ - Button({ text: 'Run manually' }).click(), - ]); - cy.get('@alert').should('have.been.calledOnceWith', 'Job has been scheduled') + cy.do([Button({ text: "Run manually" }).click()]); + cy.get("@alert").should( + "have.been.calledOnceWith", + "Job has been scheduled" + ); }, typeScheduleTime(time) { // time: string like 9:15 AM cy.do([ - TextField({ name: 'scheduleTime' }).fillIn(time), - Button({ icon: 'clock' }).click(), - Button('Set time').click() + TextField({ name: "scheduleTime" }).fillIn(time), + Button({ icon: "clock" }).click(), + Button("Set time").click(), ]); }, verifyScheduleTime(time) { - cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); + cy.expect(TextField({ name: "scheduleTime", value: time }).exists()); }, setCriteria(criteria) { if (!criteria) { - cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); + cy.do( + Select({ name: "criteria.type" }).choose("No criteria (always run)") + ); } // Currently don't have any test cases for criteria }, setTransferAccount(feeFineOwner, transferAccount) { cy.do([ - Select({ name: 'transferInfo.else.owner' }).choose(feeFineOwner), - Select({ name: 'transferInfo.else.account' }).choose(transferAccount) + Select({ name: "transferInfo.else.owner" }).choose(feeFineOwner), + Select({ name: "transferInfo.else.account" }).choose(transferAccount), ]); }, openAllPanes() { - if (!Button({ text: 'Collapse all' }).exists()) { - cy.do([ - Button({ text: 'Expand all' }).click() - ]); + if (!Button({ text: "Collapse all" }).exists()) { + cy.do([Button({ text: "Expand all" }).click()]); } }, - setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), - setOwner: (owner) => cy.do(ownerSelect.choose(owner)), - transferAndConfirm: () => { - cy.do([ - transferButton.click(), - confirmButton.click(), - ]); + verifyOpenAllPanes() { + cy.expect(Button({ text: "Collapse all" }).exists()); + }, + + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { + if (frequency === "Weeks") { + cy.expect(TextField({ name: "scheduling.time", value: time }).exists()); + cy.expect( + TextField({ name: "scheduling.interval", value: interval }).exists() + ); + } else if (frequency === "Days") { + cy.expect( + Select({ name: "scheduling.interval", value: interval }).exists() + ); + } else if (frequency === "Hours") { + } else return; + }, + + verifyCriteria(criteria) { + if (!criteria) { + cy.expect( + Select({ + name: "criteria.type", + value: "No criteria (always run)", + }).exists() + ); + } + // Currently don't have any test cases for criteria + }, + + verifyTransferAccount(feeFineOwner, transferAccount) { + cy.expect( + Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + ); + cy.expect( + Select({ + name: "transferInfo.else.account", + value: transferAccount, + }).exists() + ); + }, + + verifyTransferAccount(feeFineOwner, transferAccount) { + cy.expect( + Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + ); + cy.expect( + Select({ + name: "transferInfo.else.account", + value: transferAccount, + }).exists() + ); }, - transferFeeFineViaApi:(apiBody, feeFineId) => cy.okapiRequest({ - method: 'POST', - path: `accounts/${feeFineId}/transfer`, - body: apiBody, - isDefaultSearchParamsRequired: false - }), }; From e01db805c17466af18654be0606bbd0d5f875a72 Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 14 Aug 2023 12:53:25 -0500 Subject: [PATCH 43/55] Change all double quotes to single quotes --- ...ansfer-criteria-example-test-cornell.cy.js | 44 ++++---- .../fragments/users/transferFeeFine.js | 100 +++++++++--------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 6fa0d96d25..2a3d664964 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -1,9 +1,9 @@ -import TestTypes from "../../../../support/dictionary/testTypes"; -import DevTeams from "../../../../support/dictionary/devTeams"; -import settingsMenu from "../../../../support/fragments/settingsMenu"; -import TransferFeeFine from "../../../../support/fragments/users/transferFeeFine"; +import TestTypes from '../../../../support/dictionary/testTypes'; +import DevTeams from '../../../../support/dictionary/devTeams'; +import settingsMenu from '../../../../support/fragments/settingsMenu'; +import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; -describe("Build the Cornell bursar transfer file", () => { +describe('Build the Cornell bursar transfer file', () => { before(() => { cy.loginAsAdmin({ path: settingsMenu.usersTransferCriteria, @@ -11,39 +11,39 @@ describe("Build the Cornell bursar transfer file", () => { }); }); - it("should be able to open all the panes", () => { + it('should be able to open all the panes', () => { TransferFeeFine.openAllPanes(); TransferFeeFine.verifyOpenAllPanes(); }); - it("should be able to set scheduling", () => { + it('should be able to set scheduling', () => { TransferFeeFine.setTransferCriteriaScheduling( - "Weeks", - "1", - "11:00 PM", - "Monday" + 'Weeks', + '1', + '11:00 PM', + 'Monday' ); TransferFeeFine.verifyTransferCriteriaScheduling( - "Weeks", - "1", - "11:00 PM", - "Monday" + 'Weeks', + '1', + '11:00 PM', + 'Monday' ); }); - it("should be able to set no criteria", () => { + it('should be able to set no criteria', () => { TransferFeeFine.setCriteria(false); TransferFeeFine.verifyCriteria(false); }); // Aggregate by patron: Box unchecked - it("should be able to set aggregate by patron", () => { + it('should be able to set aggregate by patron', () => { TransferFeeFine.setAggregateByPatron(false); TransferFeeFine.verifyAggregateByPatron(false); }); // Header Format - it("should be able to set header format", () => { + it('should be able to set header format', () => { TransferFeeFine.removeHeaderFormat(); }); @@ -52,12 +52,12 @@ describe("Build the Cornell bursar transfer file", () => { // Footer Format // Transer account data to - it("should be able to set transfer account data to", () => { - TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); - TransferFeeFine.verifyTransferAccount("Lost Item Fine Office", "acct"); + it('should be able to set transfer account data to', () => { + TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('Lost Item Fine Office', 'acct'); }); - it("should be able to run manually", () => { + it('should be able to run manually', () => { //TransferFeeFine.runManually(); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 27fbeee5a1..f3f6b42a5c 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,4 +1,4 @@ -import { el } from "date-fns/locale"; +import { el } from 'date-fns/locale'; import { Button, Modal, @@ -6,16 +6,16 @@ import { Select, Pane, MultiSelect, -} from "../../../../interactors"; +} from '../../../../interactors'; -const rootModal = Modal({ id: "transfer-modal" }); -const amountTextfield = rootModal.find(TextField({ id: "amount" })); -const ownerSelect = rootModal.find(Select({ id: "ownerId" })); -const transferAccountSelect = rootModal.find(Select({ name: "method" })); -const transferButton = rootModal.find(Button({ id: "submit-button" })); -const confirmModal = Modal("Confirm fee/fine transfer"); -const confirmButton = confirmModal.find(Button("Confirm")); -const transferPane = Pane("Transfer configuration"); +const rootModal = Modal({ id: 'transfer-modal' }); +const amountTextfield = rootModal.find(TextField({ id: 'amount' })); +const ownerSelect = rootModal.find(Select({ id: 'ownerId' })); +const transferAccountSelect = rootModal.find(Select({ name: 'method' })); +const transferButton = rootModal.find(Button({ id: 'submit-button' })); +const confirmModal = Modal('Confirm fee/fine transfer'); +const confirmButton = confirmModal.find(Button('Confirm')); +const transferPane = Pane('Transfer configuration'); export default { waitLoading: () => { @@ -27,14 +27,14 @@ export default { }, setTransferCriteriaScheduling(frequency, interval, time, weekDays) { - cy.do(Select({ name: "scheduling.frequency" }).choose(frequency)); - - if (frequency === "Weeks") { - cy.do([TextField({ name: "scheduling.time" }).fillIn(time)]); - cy.do([TextField({ name: "scheduling.interval" }).fillIn(interval)]); - } else if (frequency === "Days") { - cy.do([Select({ name: "scheduling.interval" }).choose(interval)]); - } else if (frequency === "Hours") { + cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); + + if (frequency === 'Weeks') { + cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); + cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + } else if (frequency === 'Days') { + cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); + } else if (frequency === 'Hours') { } else return; }, @@ -46,30 +46,30 @@ export default { }, runManually() { - cy.do([Button({ text: "Run manually" }).click()]); - cy.get("@alert").should( - "have.been.calledOnceWith", - "Job has been scheduled" + cy.do([Button({ text: 'Run manually' }).click()]); + cy.get('@alert').should( + 'have.been.calledOnceWith', + 'Job has been scheduled' ); }, typeScheduleTime(time) { // time: string like 9:15 AM cy.do([ - TextField({ name: "scheduleTime" }).fillIn(time), - Button({ icon: "clock" }).click(), - Button("Set time").click(), + TextField({ name: 'scheduleTime' }).fillIn(time), + Button({ icon: 'clock' }).click(), + Button('Set time').click(), ]); }, verifyScheduleTime(time) { - cy.expect(TextField({ name: "scheduleTime", value: time }).exists()); + cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); }, setCriteria(criteria) { if (!criteria) { cy.do( - Select({ name: "criteria.type" }).choose("No criteria (always run)") + Select({ name: 'criteria.type' }).choose('No criteria (always run)') ); } // Currently don't have any test cases for criteria @@ -77,32 +77,33 @@ export default { setTransferAccount(feeFineOwner, transferAccount) { cy.do([ - Select({ name: "transferInfo.else.owner" }).choose(feeFineOwner), - Select({ name: "transferInfo.else.account" }).choose(transferAccount), + Select({ name: 'transferInfo.else.owner' }).choose(feeFineOwner), + Select({ name: 'transferInfo.else.account' }).choose(transferAccount), ]); }, openAllPanes() { - if (!Button({ text: "Collapse all" }).exists()) { - cy.do([Button({ text: "Expand all" }).click()]); + if (!Button({ text: 'Collapse all' }).exists()) { + cy.do([Button({ text: 'Expand all' }).click()]); } }, verifyOpenAllPanes() { - cy.expect(Button({ text: "Collapse all" }).exists()); + cy.expect(Button({ text: 'Collapse all' }).exists()); }, - + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { - if (frequency === "Weeks") { - cy.expect(TextField({ name: "scheduling.time", value: time }).exists()); - cy.expect( - TextField({ name: "scheduling.interval", value: interval }).exists() - ); - } else if (frequency === "Days") { - cy.expect( - Select({ name: "scheduling.interval", value: interval }).exists() - ); - } else if (frequency === "Hours") { + // should equal + cy.expect(Select({ name: 'scheduling.frequency'}).value()).to.equal(frequency); + return; + if (frequency === 'Weeks') { + cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + } else if (frequency === 'Days') { + cy.expect( + Select({ name: 'scheduling.interval', value: interval }).exists() + ); + } else if (frequency === 'Hours') { } else return; }, @@ -110,8 +111,8 @@ export default { if (!criteria) { cy.expect( Select({ - name: "criteria.type", - value: "No criteria (always run)", + name: 'criteria.type', + value: 'No criteria (always run)', }).exists() ); } @@ -120,11 +121,11 @@ export default { verifyTransferAccount(feeFineOwner, transferAccount) { cy.expect( - Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + Select({ name: 'transferInfo.else.owner', value: feeFineOwner }).exists() ); cy.expect( Select({ - name: "transferInfo.else.account", + name: 'transferInfo.else.account', value: transferAccount, }).exists() ); @@ -132,14 +133,13 @@ export default { verifyTransferAccount(feeFineOwner, transferAccount) { cy.expect( - Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + Select({ name: 'transferInfo.else.owner', value: feeFineOwner }).exists() ); cy.expect( Select({ - name: "transferInfo.else.account", + name: 'transferInfo.else.account', value: transferAccount, }).exists() ); }, - }; From fa69414d8f3538a12ef5b7d7f03dabf9185071ac Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 10:11:41 -0500 Subject: [PATCH 44/55] Updated verify helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 5 ++- .../fragments/users/transferFeeFine.js | 43 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 2a3d664964..315ac467e0 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -20,11 +20,11 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.setTransferCriteriaScheduling( 'Weeks', '1', - '11:00 PM', + '11:00 P', 'Monday' ); TransferFeeFine.verifyTransferCriteriaScheduling( - 'Weeks', + 'WEEK', '1', '11:00 PM', 'Monday' @@ -59,6 +59,7 @@ describe('Build the Cornell bursar transfer file', () => { it('should be able to run manually', () => { //TransferFeeFine.runManually(); + TransferFeeFine.verifyRunManually(); }); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index f3f6b42a5c..cc60438f5b 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -68,9 +68,7 @@ export default { setCriteria(criteria) { if (!criteria) { - cy.do( - Select({ name: 'criteria.type' }).choose('No criteria (always run)') - ); + cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); } // Currently don't have any test cases for criteria }, @@ -93,30 +91,17 @@ export default { }, verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { - // should equal - cy.expect(Select({ name: 'scheduling.frequency'}).value()).to.equal(frequency); - return; - if (frequency === 'Weeks') { - cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); - cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); - } else if (frequency === 'Days') { - cy.expect( - Select({ name: 'scheduling.interval', value: interval }).exists() - ); - } else if (frequency === 'Hours') { - } else return; + cy.expect(Select({ name: 'scheduling.frequency', value: frequency }).exists()); + if (frequency === 'WEEK') { + cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + } }, verifyCriteria(criteria) { if (!criteria) { - cy.expect( - Select({ - name: 'criteria.type', - value: 'No criteria (always run)', - }).exists() - ); + cy.expect(Select({ name: 'criteria.type', value: 'Pass' }).exists()); } - // Currently don't have any test cases for criteria }, verifyTransferAccount(feeFineOwner, transferAccount) { @@ -142,4 +127,18 @@ export default { }).exists() ); }, + + verifyRunManually() { + cy.get('@alert').should( + 'have.been.calledOnceWith', + 'Job has been scheduled' + ); + }, + + verifyAggregateByPatron(aggregate) { + if (!aggregate) { + // get checkbox value and verify it is unchecked + cy.get('input[name="aggregate"]').should('not.be.checked'); + } + } }; From 41cfeb4316101d20e323c9debf2db8831d33897c Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 10:31:10 -0500 Subject: [PATCH 45/55] Updated verify helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 9 +++-- .../fragments/users/transferFeeFine.js | 35 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 315ac467e0..35f619899a 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -44,21 +44,24 @@ describe('Build the Cornell bursar transfer file', () => { // Header Format it('should be able to set header format', () => { - TransferFeeFine.removeHeaderFormat(); }); // Account Data Format + it('should be able to set account data format', () => { + }); // Footer Format + it('should be able to set footer format', () => { + }); // Transer account data to it('should be able to set transfer account data to', () => { TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); - TransferFeeFine.verifyTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('b25fd8e7-a0e7-4690-ab0b-94039739c0db', '90c1820f-60bf-4b9a-99f5-d677ea78ddca'); }); it('should be able to run manually', () => { - //TransferFeeFine.runManually(); + TransferFeeFine.runManually(); TransferFeeFine.verifyRunManually(); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index cc60438f5b..961e032a88 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -47,10 +47,6 @@ export default { runManually() { cy.do([Button({ text: 'Run manually' }).click()]); - cy.get('@alert').should( - 'have.been.calledOnceWith', - 'Job has been scheduled' - ); }, typeScheduleTime(time) { @@ -68,7 +64,9 @@ export default { setCriteria(criteria) { if (!criteria) { - cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); + cy.do( + Select({ name: 'criteria.type' }).choose('No criteria (always run)') + ); } // Currently don't have any test cases for criteria }, @@ -89,12 +87,16 @@ export default { verifyOpenAllPanes() { cy.expect(Button({ text: 'Collapse all' }).exists()); }, - + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { - cy.expect(Select({ name: 'scheduling.frequency', value: frequency }).exists()); + cy.expect( + Select({ name: 'scheduling.frequency', value: frequency }).exists() + ); if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); - cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + cy.expect( + TextField({ name: 'scheduling.interval', value: interval }).exists() + ); } }, @@ -129,16 +131,15 @@ export default { }, verifyRunManually() { - cy.get('@alert').should( - 'have.been.calledOnceWith', - 'Job has been scheduled' + cy.on('window:alert', (str) => { + expect(str).to.equal('Job has been scheduled'); + } ); - }, + }, - verifyAggregateByPatron(aggregate) { - if (!aggregate) { - // get checkbox value and verify it is unchecked - cy.get('input[name="aggregate"]').should('not.be.checked'); - } + verifyAggregateByPatron(aggregate) { + if (!aggregate) { + cy.get('input[name="aggregate"]').should('not.be.checked'); } + }, }; From a158a2ad6fcf788ae267f5278c0c00e663972e60 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 12:05:35 -0500 Subject: [PATCH 46/55] Added format clear helper function --- ...ansfer-criteria-example-test-cornell.cy.js | 3 ++ .../fragments/users/transferFeeFine.js | 33 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 35f619899a..bce55cceac 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -44,14 +44,17 @@ describe('Build the Cornell bursar transfer file', () => { // Header Format it('should be able to set header format', () => { + TransferFeeFine.clearFormat('header'); }); // Account Data Format it('should be able to set account data format', () => { + TransferFeeFine.clearFormat('data'); }); // Footer Format it('should be able to set footer format', () => { + TransferFeeFine.clearFormat('footer'); }); // Transer account data to diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 961e032a88..f7ec7f96bf 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -84,6 +84,34 @@ export default { } }, + clearFormat(format) { + let sectionName = ''; + if (format == 'header') { + sectionName = 'section[id="accordion_10"]'; + } else if (format == 'data') { + sectionName = 'section[id="accordion_11"]'; + } else { + sectionName = 'section[id="accordion_12"]'; + } + + // if section is empty, skip + cy.get(sectionName).then(($section) => { + // check for button trash icon + if ($section.find('button[icon="trash"]').length == 0) { + return; + } + else { + cy.get(sectionName).within(() => { + cy.get('button[icon="trash"]').then(($btn) => { + for (let i = 0; i < $btn.length; i++) { + cy.get('button[icon="trash"]').eq(0).click(); + } + }); + }); + } + }); + }, + verifyOpenAllPanes() { cy.expect(Button({ text: 'Collapse all' }).exists()); }, @@ -132,9 +160,8 @@ export default { verifyRunManually() { cy.on('window:alert', (str) => { - expect(str).to.equal('Job has been scheduled'); - } - ); + expect(str).to.equal('Job has been scheduled'); + }); }, verifyAggregateByPatron(aggregate) { From ad9b927bc63136aae70df8b6e6a546f16ac03c38 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 12:27:53 -0500 Subject: [PATCH 47/55] Added ESLint code fixes --- ...ansfer-criteria-example-test-cornell.cy.js | 4 +- .../fragments/users/transferFeeFine.js | 40 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index bce55cceac..65817b2b7c 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -45,16 +45,19 @@ describe('Build the Cornell bursar transfer file', () => { // Header Format it('should be able to set header format', () => { TransferFeeFine.clearFormat('header'); + TransferFeeFine.verifyClearFormat('header'); }); // Account Data Format it('should be able to set account data format', () => { TransferFeeFine.clearFormat('data'); + TransferFeeFine.verifyClearFormat('data'); }); // Footer Format it('should be able to set footer format', () => { TransferFeeFine.clearFormat('footer'); + TransferFeeFine.verifyClearFormat('footer'); }); // Transer account data to @@ -67,5 +70,4 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.runManually(); TransferFeeFine.verifyRunManually(); }); - }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index f7ec7f96bf..b2c971feaf 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -34,8 +34,7 @@ export default { cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); } else if (frequency === 'Days') { cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); - } else if (frequency === 'Hours') { - } else return; + } }, setAggregateByPatron(aggregate) { @@ -86,9 +85,9 @@ export default { clearFormat(format) { let sectionName = ''; - if (format == 'header') { + if (format === 'header') { sectionName = 'section[id="accordion_10"]'; - } else if (format == 'data') { + } else if (format === 'data') { sectionName = 'section[id="accordion_11"]'; } else { sectionName = 'section[id="accordion_12"]'; @@ -96,11 +95,7 @@ export default { // if section is empty, skip cy.get(sectionName).then(($section) => { - // check for button trash icon - if ($section.find('button[icon="trash"]').length == 0) { - return; - } - else { + if ($section.find('button[icon="trash"]').length !== 0) { cy.get(sectionName).within(() => { cy.get('button[icon="trash"]').then(($btn) => { for (let i = 0; i < $btn.length; i++) { @@ -112,6 +107,21 @@ export default { }); }, + verifyClearFormat(format) { + let sectionName = ''; + if (format === 'header') { + sectionName = 'section[id="accordion_10"]'; + } else if (format === 'data') { + sectionName = 'section[id="accordion_11"]'; + } else { + sectionName = 'section[id="accordion_12"]'; + } + + cy.get(sectionName).then(($section) => { + cy.expect($section.find('button[icon="trash"]').length).to.equal(0); + }); + }, + verifyOpenAllPanes() { cy.expect(Button({ text: 'Collapse all' }).exists()); }, @@ -146,18 +156,6 @@ export default { ); }, - verifyTransferAccount(feeFineOwner, transferAccount) { - cy.expect( - Select({ name: 'transferInfo.else.owner', value: feeFineOwner }).exists() - ); - cy.expect( - Select({ - name: 'transferInfo.else.account', - value: transferAccount, - }).exists() - ); - }, - verifyRunManually() { cy.on('window:alert', (str) => { expect(str).to.equal('Job has been scheduled'); From 2b751e8ae3ec974b181530ab05a8e1abfafcc021 Mon Sep 17 00:00:00 2001 From: nhanaa Date: Tue, 15 Aug 2023 12:59:40 -0500 Subject: [PATCH 48/55] Completed scheduling helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 4 ++-- .../fragments/users/transferFeeFine.js | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 65817b2b7c..89141c55d8 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -21,13 +21,13 @@ describe('Build the Cornell bursar transfer file', () => { 'Weeks', '1', '11:00 P', - 'Monday' + ['Monday'] ); TransferFeeFine.verifyTransferCriteriaScheduling( 'WEEK', '1', '11:00 PM', - 'Monday' + ['Monday'] ); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index b2c971feaf..25e7f75388 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -32,9 +32,14 @@ export default { if (frequency === 'Weeks') { cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + weekDays.map((weekDay) => cy.do([ + MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay), + ])); } else if (frequency === 'Days') { cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); - } + } else if (frequency === 'Hours') { + cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + } else ; }, setAggregateByPatron(aggregate) { @@ -126,16 +131,24 @@ export default { cy.expect(Button({ text: 'Collapse all' }).exists()); }, + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { + // should equal cy.expect( Select({ name: 'scheduling.frequency', value: frequency }).exists() ); + cy.expect(Select({ name: 'scheduling.frequency' }).value()).to.equal(frequency); if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); + } else if (frequency === 'DAY') { cy.expect( - TextField({ name: 'scheduling.interval', value: interval }).exists() + Select({ name: 'scheduling.interval', value: interval }).exists() ); - } + } else if (frequency === 'HOUR') { + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + } else; }, verifyCriteria(criteria) { From 7ed872e5be69ff05519f33b64127e7299fc9ebe4 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 13:41:12 -0500 Subject: [PATCH 49/55] Added Cornell format helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 2 + .../fragments/users/transferFeeFine.js | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 65817b2b7c..064d10e535 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -46,12 +46,14 @@ describe('Build the Cornell bursar transfer file', () => { it('should be able to set header format', () => { TransferFeeFine.clearFormat('header'); TransferFeeFine.verifyClearFormat('header'); + TransferFeeFine.addCornellHeaderFormat(); }); // Account Data Format it('should be able to set account data format', () => { TransferFeeFine.clearFormat('data'); TransferFeeFine.verifyClearFormat('data'); + TransferFeeFine.addCornellDataFormat(); }); // Footer Format diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index b2c971feaf..16bef32162 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -167,4 +167,52 @@ export default { cy.get('input[name="aggregate"]').should('not.be.checked'); } }, + + addCornellHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + const numItems = 2; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + + cy.do(Select({ name: 'header[0].type' }).choose('Text')); + cy.do(TextField({ name: 'header[0].text' }).fillIn('LIB02')); + + cy.do(Select({ name: 'header[1].type' }).choose('Newline (LF)')); + }); + }, + + addCornellDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + const numItems = 8; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + }); + + cy.do(Select({ name: 'data[0].type' }).choose('User info')); + cy.do(Select({ name: 'data[0].userAttribute' }).choose('First name')); + cy.do(TextField({ name: 'data[0].placeholder' }).fillIn('No name')); + + cy.do(Select({ name: 'data[1].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[2].type' }).choose('Account amount')); + cy.get('input[name="data[2].decimal"]').check(); + + cy.do(Select({ name: 'data[3].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[4].type' }).choose('Account date')); + cy.do(Select({ name: 'data[4].dateProperty' }).choose('Creation date')); + cy.do(Select({ name: 'data[4].format' }).choose('Year (4-digit)')); + // There is two America/New_York in the list, so we need to find out the second one + // cy.do(Select({ name: 'data[4].timezone' }).choose('America/New_York')); + cy.do(TextField({ name: 'data[4].placeholder' }).fillIn('')); + + cy.do(Select({ name: 'data[5].type' }).choose('Newline (LF)')); + + cy.do(Select({ name: 'data[6].type' }).choose('Fee/fine type')); + cy.do(Select({ name: 'data[6].feeFineAttribute' }).choose('Type ID')); + + cy.do(Select({ name: 'data[7].type' }).choose('Newline (LF)')); + } }; From b8838d16a1d5074158516d96444866a76f8e99bd Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 15:11:13 -0500 Subject: [PATCH 50/55] Added Header Format and Account Data Format verify helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 2 + .../fragments/users/transferFeeFine.js | 45 ++++++++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 35589cfec3..f8fa3a690f 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -47,6 +47,7 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.clearFormat('header'); TransferFeeFine.verifyClearFormat('header'); TransferFeeFine.addCornellHeaderFormat(); + TransferFeeFine.verifyAddCornellHeaderFormat(); }); // Account Data Format @@ -54,6 +55,7 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.clearFormat('data'); TransferFeeFine.verifyClearFormat('data'); TransferFeeFine.addCornellDataFormat(); + TransferFeeFine.verifyAddCornellDataFormat(); }); // Footer Format diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 6e84d38da2..4abd677152 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -32,9 +32,7 @@ export default { if (frequency === 'Weeks') { cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); - weekDays.map((weekDay) => cy.do([ - MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay), - ])); + // weekDays.map((weekDay) => cy.do([MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay)])); } else if (frequency === 'Days') { cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); } else if (frequency === 'Hours') { @@ -137,11 +135,11 @@ export default { cy.expect( Select({ name: 'scheduling.frequency', value: frequency }).exists() ); - cy.expect(Select({ name: 'scheduling.frequency' }).value()).to.equal(frequency); + if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); - weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); + // weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); } else if (frequency === 'DAY') { cy.expect( Select({ name: 'scheduling.interval', value: interval }).exists() @@ -227,5 +225,42 @@ export default { cy.do(Select({ name: 'data[6].feeFineAttribute' }).choose('Type ID')); cy.do(Select({ name: 'data[7].type' }).choose('Newline (LF)')); + }, + + verifyAddCornellHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + cy.expect(Select({ name: 'header[0].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[0].text', value: 'LIB02' }).exists()); + + cy.expect(Select({ name: 'header[1].type', value: 'Newline' }).exists()); + }); + }, + + verifyAddCornellDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + cy.expect(Select({ name: 'data[0].type', value: 'UserData' }).exists()); + cy.expect(Select({ name: 'data[0].userAttribute', value: 'FIRST_NAME' }).exists()); + cy.expect(TextField({ name: 'data[0].placeholder', value: 'No name' }).exists()); + + cy.expect(Select({ name: 'data[1].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[2].type', value: 'FeeAmount' }).exists()); + cy.get('input[name="data[2].decimal"]').should('be.checked'); + + cy.expect(Select({ name: 'data[3].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[4].type', value: 'FeeDate' }).exists()); + cy.expect(Select({ name: 'data[4].dateProperty', value: 'CREATED' }).exists()); + cy.expect(Select({ name: 'data[4].format', value: 'YEAR_LONG' }).exists()); + // cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); + cy.expect(TextField({ name: 'data[4].placeholder', value: '' }).exists()); + + cy.expect(Select({ name: 'data[5].type', value: 'Newline' }).exists()); + + cy.expect(Select({ name: 'data[6].type', value: 'FeeFineMetadata' }).exists()); + cy.expect(Select({ name: 'data[6].feeFineAttribute', value: 'FEE_FINE_TYPE_ID' }).exists()); + + cy.expect(Select({ name: 'data[7].type', value: 'Newline' }).exists()); + }); } }; From d4fdb5fe0a2c8d0178c738f9c2ed462ca72b3363 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 15:30:50 -0500 Subject: [PATCH 51/55] Added basic outline for Duke bursar file --- ...ansfer-criteria-example-test-cornell.cy.js | 2 - ...-transfer-criteria-example-test-duke.cy.js | 61 +++++++++++++++++++ .../fragments/users/transferFeeFine.js | 14 ++++- 3 files changed, 74 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index f8fa3a690f..d53fe8c65c 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -1,5 +1,3 @@ -import TestTypes from '../../../../support/dictionary/testTypes'; -import DevTeams from '../../../../support/dictionary/devTeams'; import settingsMenu from '../../../../support/fragments/settingsMenu'; import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js index e69de29bb2..cde50cc84d 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js @@ -0,0 +1,61 @@ +import settingsMenu from '../../../../support/fragments/settingsMenu'; +import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; + +describe('Build the Duke bursar transfer file', () => { + before(() => { + cy.loginAsAdmin({ + path: settingsMenu.usersTransferCriteria, + waiter: TransferFeeFine.waitLoadingTransferCriteria, + }); + }); + + it('should be able to open all the panes', () => { + TransferFeeFine.openAllPanes(); + TransferFeeFine.verifyOpenAllPanes(); + }); + + it('should be able to set scheduling', () => { + }); + + it('should be able to set no criteria', () => { + TransferFeeFine.setCriteria(false); + TransferFeeFine.verifyCriteria(false); + }); + + // Aggregate by patron: Box unchecked + it('should be able to set aggregate by patron', () => { + TransferFeeFine.setAggregateByPatron(false); + TransferFeeFine.verifyAggregateByPatron(false); + }); + + // Header Format + it('should be able to set header format', () => { + TransferFeeFine.clearFormat('header'); + TransferFeeFine.verifyClearFormat('header'); + TransferFeeFine.addDukeHeaderFormat(); + TransferFeeFine.verifyAddDukeHeaderFormat(); + }); + + // Account Data Format + it('should be able to set account data format', () => { + TransferFeeFine.clearFormat('data'); + TransferFeeFine.verifyClearFormat('data'); + TransferFeeFine.addDukeDataFormat(); + TransferFeeFine.verifyAddDukeDataFormat(); + }); + + // Footer Format + it('should be able to set footer format', () => { + TransferFeeFine.clearFormat('footer'); + TransferFeeFine.verifyClearFormat('footer'); + }); + + // Transer account data to + it('should be able to set transfer account data to', () => { + }); + + it('should be able to run manually', () => { + TransferFeeFine.runManually(); + TransferFeeFine.verifyRunManually(); + }); +}); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 4abd677152..094996254d 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -179,6 +179,8 @@ export default { } }, + // Cornell format Helper functions + addCornellHeaderFormat() { cy.get('section[id="accordion_10"]').within(() => { const numItems = 2; @@ -262,5 +264,15 @@ export default { cy.expect(Select({ name: 'data[7].type', value: 'Newline' }).exists()); }); - } + }, + + // Duke format Helper functions + + addDukeHeaderFormat() {}, + + addDukeDataFormat() {}, + + verifyAddDukeHeaderFormat() {}, + + verifyAddDukeDataFormat() {}, }; From 3726329c02429c8e462be992960e4008c20c83f3 Mon Sep 17 00:00:00 2001 From: danetsao Date: Wed, 16 Aug 2023 11:01:14 -0500 Subject: [PATCH 52/55] Added Duke body and header function --- ...-transfer-criteria-example-test-duke.cy.js | 14 +++ .../fragments/users/transferFeeFine.js | 94 ++++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js index cde50cc84d..abbbafba8b 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js @@ -15,6 +15,18 @@ describe('Build the Duke bursar transfer file', () => { }); it('should be able to set scheduling', () => { + TransferFeeFine.setTransferCriteriaScheduling( + 'Weeks', + '0', + '3:30 P', + ['Monday'] + ); + TransferFeeFine.verifyTransferCriteriaScheduling( + 'WEEK', + '0', + '3:30 PM', + ['Monday'] + ); }); it('should be able to set no criteria', () => { @@ -52,6 +64,8 @@ describe('Build the Duke bursar transfer file', () => { // Transer account data to it('should be able to set transfer account data to', () => { + TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('b25fd8e7-a0e7-4690-ab0b-94039739c0db', '90c1820f-60bf-4b9a-99f5-d677ea78ddca'); }); it('should be able to run manually', () => { diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 094996254d..19be837a20 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -268,9 +268,99 @@ export default { // Duke format Helper functions - addDukeHeaderFormat() {}, + addDukeHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + const numItems = 11; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + + cy.do(Select({ name: 'header[0].type' }).choose('Text')); + cy.do(TextField({ name: 'header[0].text' }).fillIn('Batch')); + + cy.do(Select({ name: 'header[1].type' }).choose('Whitespace')); + // fill text in the input named header[1].repeat + cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + + cy.do(Select({ name: 'header[2].type' }).choose('Current date')); + cy.do(Select({ name: 'header[2].format' }).choose('YYYYMMDD')); + // cy.do(Select({ name: 'header[2].timezone' }).choose('America/New_York')); + + cy.do(Select({ name: 'header[3].type' }).choose('Whitespace')); + cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + + cy.do(Select({ name: 'header[4].type' }).choose('Text')); + cy.do(TextField({ name: 'header[4].text' }).fillIn('DU LIBRARY')); + + cy.do(Select({ name: 'header[5].type' }).choose('Whitespace')); + cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + - addDukeDataFormat() {}, + cy.do(Select({ name: 'header[6].type' }).choose('Current date')); + cy.do(Select({ name: 'header[6].format' }).choose('Quarter')); + // cy.do(Select({ name: 'header[6].timezone' }).choose('America/New_York')); + + cy.do(Select({ name: 'header[7].type' }).choose('Total amount')); + cy.get('input[name="header[7].decimal"]').check(); + + cy.do(Select({ name: 'header[8].type' }).choose('Text')); + cy.do(TextField({ name: 'header[8].text' }).fillIn('TXT_CNT')); + + cy.do(Select({ name: 'header[9].type' }).choose('Text')); + cy.do(TextField({ name: 'header[9].text' }).fillIn('DU LIBRARIES DEBITS')); + + cy.do(Select({ name: 'header[10].type' }).choose('Newline (LF)')); + }); + }, + + addDukeDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + const numItems = 14; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + }); + + cy.do(Select({ name: 'data[0].type' }).choose('User info')); + cy.do(Select({ name: 'data[0].userAttribute' }).choose('External ID')); + + cy.do(Select({ name: 'data[1].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[2].type' }).choose('User info')); + cy.do(Select({ name: 'data[2].userAttribute' }).choose('Username')); + // click on gear icon within data[2] section + + cy.do(Select({ name: 'data[3].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[4].type' }).choose('Account date')); + cy.do(Select({ name: 'data[4].dateProperty' }).choose('Item due date')); + cy.do(Select({ name: 'data[4].format' }).choose('YYYYMMDD')); + // There is two America/New_York in the list, so we need to find out the second one + // cy.do(Select({ name: 'data[4].timezone' }).choose('America/New_York')); + + cy.do(Select({ name: 'data[5].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[6].type' }).choose('Current date')); + cy.do(Select({ name: 'data[6].format' }).choose('Quarter')); + + cy.do(Select({ name: 'data[7].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[8].type' }).choose('Fee/fine type')); + cy.do(Select({ name: 'data[8].feeFineAttribute' }).choose('Type name')); + // gear icon + + cy.do(Select({ name: 'data[9].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[10].type' }).choose('Account amount')); + cy.get('input[name="data[10].decimal"]').check({ force: true }); + + cy.do(Select({ name: 'data[11].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[12].type' }).choose('Fee/fine type')); + cy.do(Select({ name: 'data[12].feeFineAttribute' }).choose('Type ID')); + + cy.do(Select({ name: 'data[13].type' }).choose('Newline (LF)')); + }, verifyAddDukeHeaderFormat() {}, From d59afcd3afe49e7998265e57151d3a958f42790b Mon Sep 17 00:00:00 2001 From: nhanaa Date: Fri, 18 Aug 2023 13:22:41 -0500 Subject: [PATCH 53/55] Fix problem with scheduling weekdays multiselect --- .../support/fragments/users/transferFeeFine.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 19be837a20..ed4b75035f 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -30,13 +30,19 @@ export default { cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); if (frequency === 'Weeks') { - cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); - cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); - // weekDays.map((weekDay) => cy.do([MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay)])); + cy.do(TextField({ name: 'scheduling.time' }).fillIn(time)); + cy.do(TextField({ name: 'scheduling.interval' }).fillIn(interval)); + + // clear all the options + cy.get('li[id$=_multiselect_selected]').each(($li) => { + cy.wrap($li).find('button').click(); + }); + + cy.do(MultiSelect({ label: 'Run on weekdays*' }).select(weekDays)); } else if (frequency === 'Days') { - cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); + cy.do(Select({ name: 'scheduling.interval' }).choose(interval)); } else if (frequency === 'Hours') { - cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + cy.do(TextField({ name: 'scheduling.interval' }).fillIn(interval)); } else ; }, @@ -139,7 +145,7 @@ export default { if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); - // weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); + cy.expect(MultiSelect({ label: 'Run on weekdays*', selected: weekDays }).exists()); } else if (frequency === 'DAY') { cy.expect( Select({ name: 'scheduling.interval', value: interval }).exists() From 00dd91efdc234df1e5fd797792fdc0ebcab7d0f9 Mon Sep 17 00:00:00 2001 From: danetsao Date: Fri, 18 Aug 2023 14:48:52 -0500 Subject: [PATCH 54/55] Added Duke verify functions, header and body --- .../fragments/users/transferFeeFine.js | 85 ++++++++++++++++++- 1 file changed, 81 insertions(+), 4 deletions(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index ed4b75035f..0de79fbeba 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -293,13 +293,13 @@ export default { // cy.do(Select({ name: 'header[2].timezone' }).choose('America/New_York')); cy.do(Select({ name: 'header[3].type' }).choose('Whitespace')); - cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + cy.do(TextField({ name: 'header[3].repeat' }).fillIn('1')); cy.do(Select({ name: 'header[4].type' }).choose('Text')); cy.do(TextField({ name: 'header[4].text' }).fillIn('DU LIBRARY')); cy.do(Select({ name: 'header[5].type' }).choose('Whitespace')); - cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + cy.do(TextField({ name: 'header[5].repeat' }).fillIn('1')); cy.do(Select({ name: 'header[6].type' }).choose('Current date')); @@ -319,6 +319,45 @@ export default { }); }, + verifyAddDukeHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + cy.expect(Select({ name: 'header[0].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[0].text', value: 'Batch' }).exists()); + + cy.expect(Select({ name: 'header[1].type', value: 'Space' }).exists()); + cy.expect(TextField({ name: 'header[1].repeat', value: '1' }).exists()); + + cy.expect(Select({ name: 'header[2].type', value: 'CurrentDate' }).exists()); + cy.expect(Select({ name: 'header[2].format', value: 'YYYYMMDD' }).exists()); + // cy.expect(Select({ name: 'header[2].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'header[3].type', value: 'Space' }).exists()); + cy.expect(TextField({ name: 'header[3].repeat', value: '1' }).exists()); + + cy.expect(Select({ name: 'header[4].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[4].text', value: 'DU LIBRARY' }).exists()); + + cy.expect(Select({ name: 'header[5].type', value: 'Space' }).exists()); + cy.expect(TextField({ name: 'header[5].repeat', value: '1' }).exists()); + + cy.expect(Select({ name: 'header[6].type', value: 'CurrentDate' }).exists()); + cy.expect(Select({ name: 'header[6].format', value: 'QUARTER' }).exists()); + // cy.expect(Select({ name: 'header[6].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'header[7].type', value: 'AggregateTotal' }).exists()); + cy.get('input[name="header[7].decimal"]').should('be.checked'); + + cy.expect(Select({ name: 'header[8].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[8].text', value: 'TXT_CNT' }).exists()); + + cy.expect(Select({ name: 'header[9].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[9].text', value: 'DU LIBRARIES DEBITS' }).exists()); + + cy.expect(Select({ name: 'header[10].type', value: 'Newline' }).exists()); + }); + }, + + addDukeDataFormat() { cy.get('section[id="accordion_11"]').within(() => { const numItems = 14; @@ -368,7 +407,45 @@ export default { cy.do(Select({ name: 'data[13].type' }).choose('Newline (LF)')); }, - verifyAddDukeHeaderFormat() {}, + verifyAddDukeDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + cy.expect(Select({ name: 'data[0].type', value: 'UserData' }).exists()); + cy.expect(Select({ name: 'data[0].userAttribute', value: 'EXTERNAL_SYSTEM_ID' }).exists()); + + cy.expect(Select({ name: 'data[1].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[2].type', value: 'UserData' }).exists()); + cy.expect(Select({ name: 'data[2].userAttribute', value: 'USERNAME' }).exists()); + + cy.expect(Select({ name: 'data[3].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[4].type', value: 'FeeDate' }).exists()); + cy.expect(Select({ name: 'data[4].dateProperty', value: 'DUE' }).exists()); + cy.expect(Select({ name: 'data[4].format', value: 'YYYYMMDD' }).exists()); + // cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'data[5].type', value: 'Tab' }).exists()); - verifyAddDukeDataFormat() {}, + cy.expect(Select({ name: 'data[6].type', value: 'CurrentDate' }).exists()); + cy.expect(Select({ name: 'data[6].format', value: 'QUARTER' }).exists()); + // cy.expect(Select({ name: 'data[6].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'data[7].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[8].type', value: 'FeeFineMetadata' }).exists()); + cy.expect(Select({ name: 'data[8].feeFineAttribute', value: 'FEE_FINE_TYPE_NAME' }).exists()); + + cy.expect(Select({ name: 'data[9].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[10].type', value: 'FeeAmount' }).exists()); + cy.get('input[name="data[10].decimal"]').should('be.checked'); + + cy.expect(Select({ name: 'data[11].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[12].type', value: 'FeeFineMetadata' }).exists()); + cy.expect(Select({ name: 'data[12].feeFineAttribute', value: 'FEE_FINE_TYPE_ID' }).exists()); + + cy.expect(Select({ name: 'data[13].type', value: 'Newline' }).exists()); + }); + }, }; From 3478bde0db52e44f5fab0707dc6af56b717240c1 Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 28 Aug 2023 15:41:34 -0500 Subject: [PATCH 55/55] Added Alabama file --- .../configure.transfer-criteria-example-test-alabama.cy.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js diff --git a/cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js b/cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js new file mode 100644 index 0000000000..e69de29bb2