From c0e0bd1ebbcea19157cb7859439a6af9bd83a36f Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Thu, 9 May 2024 14:37:20 +0500 Subject: [PATCH] Move files uploads to upload via API (#3599) --- ...-local-instances-by-title-all-member.cy.js | 46 +++++-------- .../marc-authority-edit-central.cy.js | 27 +++----- .../marc-authority-shared-edit-member.cy.js | 27 +++----- ...facet-when-search-executed-in-member.cy.js | 42 ++++-------- ...h-found-in-marcAuth-app-from-central.cy.js | 48 +++++--------- ...th-found-in-marcAuth-app-from-member.cy.js | 64 ++++++++----------- ...ate-local-linked-marc-auth-in-member.cy.js | 36 +++++------ ...ared-marcBib-and-marcAuth-on-central.cy.js | 24 +++---- ...derive-from-local-marc-bib-in-member.cy.js | 26 +++----- ...rive-from-shared-marc-bib-in-central.cy.js | 23 +++---- ...erive-from-shared-marc-bib-in-member.cy.js | 23 +++---- ...rcBib-from-shadow-instance-in-member.cy.js | 51 ++++++--------- ...-subfields-shared-marc-bib-in-member.cy.js | 26 +++----- ...arcBib-with-local-marcAuth-in-member.cy.js | 40 +++++------- ...rcBib-with-shared-marcAuth-in-member.cy.js | 56 +++++++--------- ...cBib-with-shared-marcAuth-in-central.cy.js | 25 ++++---- ...rcBib-with-shared-marcAuth-in-member.cy.js | 29 ++++----- .../marc-bib-edit-in-central.cy.js | 36 +++++------ ...er-can-edit-local-marc-bib-in-member.cy.js | 33 ++++------ ...r-can-edit-shared-marc-bib-in-member.cy.js | 26 +++----- .../marc-bib-shared-link-shared-central.cy.js | 28 ++++---- .../marc-bib-shared-link-shared-member.cy.js | 25 ++++---- 22 files changed, 293 insertions(+), 468 deletions(-) diff --git a/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-instances-by-title-all-member.cy.js b/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-instances-by-title-all-member.cy.js index 04e70c4d48..2e57773da2 100644 --- a/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-instances-by-title-all-member.cy.js +++ b/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-instances-by-title-all-member.cy.js @@ -9,9 +9,7 @@ import InventoryInstance from '../../../../support/fragments/inventory/inventory import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; 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'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; import Location from '../../../../support/fragments/settings/tenant/locations/newLocation'; import InventoryHoldings from '../../../../support/fragments/inventory/holdings/inventoryHoldings'; @@ -213,33 +211,23 @@ describe('Inventory', () => { // 1 Local "Instance" record with source = "MARC" and filled alternative title fields should exist on Member 1 tenant. // 1 Local "Instance" record with source = "MARC" and filled alternative title fields should exist on Member 2 tenant. - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then( - () => { - marcFiles.forEach((marcFile, index) => { - if (marcFile.tenant !== tenantNames.central) { - ConsortiumManager.switchActiveAffiliation( - marcFiles[index - 1].tenant, - marcFile.tenant, - ); - DataImport.waitLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(marcFile.tenant); - } - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileName); - Logs.checkJobStatus(marcFile.fileName, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileName); - for (let i = 0; i < marcFile.numOfRecords; i++) { - Logs.getCreatedItemsID(i).then((link) => { - marcFile.createdRecordsId.push(link.split('/')[5]); - }); - } + cy.resetTenant(); + marcFiles.forEach((marcFile) => { + if (marcFile.tenant === 'College') { + cy.setTenant(Affiliations.College); + } else if (marcFile.tenant === 'University') { + cy.setTenant(Affiliations.University); + } + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + marcFile.createdRecordsId.push(record.instance.id); }); - }, - ); + }); + }); }) .then(() => { // 1 Shared "Instance" record with source = "MARC" diff --git a/cypress/e2e/consortia/marc/marc-authority/marc-authority-edit-central.cy.js b/cypress/e2e/consortia/marc/marc-authority/marc-authority-edit-central.cy.js index 1538e4663b..465fe0e70e 100644 --- a/cypress/e2e/consortia/marc/marc-authority/marc-authority-edit-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/marc-authority-edit-central.cy.js @@ -5,9 +5,7 @@ import Users from '../../../../support/fragments/users/users'; import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities'; import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority'; 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 { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; @@ -42,22 +40,15 @@ describe('MARC', () => { let createdAuthorityID; before('Create test data', () => { + cy.resetTenant(); cy.getAdminToken(); - cy.loginAsAdmin({ - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading, - }).then(() => { - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); - JobProfiles.waitFileIsUploaded(); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFile.fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileName); - Logs.getCreatedItemsID().then((link) => { - createdAuthorityID = link.split('/')[5]; + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdAuthorityID = record.authority.id; }); }); diff --git a/cypress/e2e/consortia/marc/marc-authority/marc-authority-shared-edit-member.cy.js b/cypress/e2e/consortia/marc/marc-authority/marc-authority-shared-edit-member.cy.js index 1efb058b87..3552ee537f 100644 --- a/cypress/e2e/consortia/marc/marc-authority/marc-authority-shared-edit-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/marc-authority-shared-edit-member.cy.js @@ -5,9 +5,7 @@ import Users from '../../../../support/fragments/users/users'; import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities'; import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority'; 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 { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; @@ -43,22 +41,15 @@ describe('MARC', () => { let createdAuthorityID; before('Create test data', () => { + cy.resetTenant(); cy.getAdminToken(); - cy.loginAsAdmin({ - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading, - }).then(() => { - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); - JobProfiles.waitFileIsUploaded(); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFile.fileName); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileName); - Logs.getCreatedItemsID().then((link) => { - createdAuthorityID = link.split('/')[5]; + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdAuthorityID = record.authority.id; }); }); diff --git a/cypress/e2e/consortia/marc/marc-authority/search/apply-shared-facet-when-search-executed-in-member.cy.js b/cypress/e2e/consortia/marc/marc-authority/search/apply-shared-facet-when-search-executed-in-member.cy.js index 45ca399f71..e42dfce7e8 100644 --- a/cypress/e2e/consortia/marc/marc-authority/search/apply-shared-facet-when-search-executed-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/search/apply-shared-facet-when-search-executed-in-member.cy.js @@ -4,14 +4,11 @@ import Users from '../../../../../support/fragments/users/users'; import TopMenu from '../../../../../support/fragments/topMenu'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import { - JOB_STATUS_NAMES, MARC_AUTHORITY_SEARCH_OPTIONS, DEFAULT_JOB_PROFILE_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'; import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities'; import MarcAuthoritiesSearch from '../../../../../support/fragments/marcAuthority/marcAuthoritiesSearch'; @@ -104,32 +101,21 @@ describe('MARC', () => { ]); }) .then(() => { - cy.loginAsAdmin({ - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading, - }); - }) - .then(() => { - marcFiles.forEach((marcFile, index) => { - if (marcFile.tenant !== tenantNames.central) { - ConsortiumManager.switchActiveAffiliation( - marcFiles[index - 1].tenant, - marcFile.tenant, - ); - DataImport.waitLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(marcFile.tenant); + cy.resetTenant(); + marcFiles.forEach((marcFile) => { + if (marcFile.tenant === 'College') { + cy.setTenant(Affiliations.College); + } else if (marcFile.tenant === 'University') { + cy.setTenant(Affiliations.University); } - - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileName); - Logs.checkJobStatus(marcFile.fileName, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileName); - Logs.getCreatedItemsID().then((link) => { - marcFile.createdAuthorityID = link.split('/')[5]; + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + marcFile.createdAuthorityID = record.authority.id; + }); }); }); }) diff --git a/cypress/e2e/consortia/marc/marc-authority/search/only-shared-marcAuth-found-in-marcAuth-app-from-central.cy.js b/cypress/e2e/consortia/marc/marc-authority/search/only-shared-marcAuth-found-in-marcAuth-app-from-central.cy.js index dd0f012352..4d1765436f 100644 --- a/cypress/e2e/consortia/marc/marc-authority/search/only-shared-marcAuth-found-in-marcAuth-app-from-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/search/only-shared-marcAuth-found-in-marcAuth-app-from-central.cy.js @@ -1,13 +1,10 @@ import Permissions from '../../../../../support/dictionary/permissions'; -import Affiliations, { tenantNames } from '../../../../../support/dictionary/affiliations'; +import Affiliations from '../../../../../support/dictionary/affiliations'; import Users from '../../../../../support/fragments/users/users'; import TopMenu from '../../../../../support/fragments/topMenu'; -import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; +import { DEFAULT_JOB_PROFILE_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'; import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities'; import InventorySearchAndFilter from '../../../../../support/fragments/inventory/inventorySearchAndFilter'; @@ -59,34 +56,23 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - if (marcFile.tenant === 'College') { - ConsortiumManager.switchActiveAffiliation( - tenantNames.central, - tenantNames.college, - ); - DataImport.waitLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); - } - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkJobStatus(marcFile.fileNameImported, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + marcFiles.forEach((marcFile) => { + if (marcFile.tenant === 'College') { + cy.setTenant(Affiliations.College); + } + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record.authority.id); }); }); - - cy.login(users.userProperties.username, users.userProperties.password, { - path: TopMenu.marcAuthorities, - waiter: MarcAuthorities.waitLoading, - }); + }); + cy.login(users.userProperties.username, users.userProperties.password, { + path: TopMenu.marcAuthorities, + waiter: MarcAuthorities.waitLoading, }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js b/cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js index 984212f788..af9879c38d 100644 --- a/cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/search/shared-and-local-marcAuth-found-in-marcAuth-app-from-member.cy.js @@ -3,11 +3,9 @@ import Affiliations, { tenantNames } from '../../../../../support/dictionary/aff import Users from '../../../../../support/fragments/users/users'; import TopMenu from '../../../../../support/fragments/topMenu'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; +import { DEFAULT_JOB_PROFILE_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'; import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities'; @@ -83,44 +81,34 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - if (marcFile.tenant === 'University') { - ConsortiumManager.switchActiveAffiliation( - tenantNames.central, - tenantNames.university, - ); - } else if (marcFile.tenant === 'College') { - ConsortiumManager.switchActiveAffiliation( - tenantNames.university, - tenantNames.college, - ); - } - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkJobStatus(marcFile.fileNameImported, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + marcFiles.forEach((marcFile) => { + if (marcFile.tenant === 'University') { + cy.setTenant(Affiliations.University); + } else if (marcFile.tenant === 'College') { + cy.setTenant(Affiliations.College); + } + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record.authority.id); }); }); + }); - cy.login(users.userProperties.username, users.userProperties.password, { - path: TopMenu.marcAuthorities, - waiter: MarcAuthorities.waitLoading, - }).then(() => { - ConsortiumManager.switchActiveAffiliation( - tenantNames.central, - tenantNames.university, - ); - MarcAuthorities.waitLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university); - }); + cy.login(users.userProperties.username, users.userProperties.password, { + path: TopMenu.marcAuthorities, + waiter: MarcAuthorities.waitLoading, + }).then(() => { + ConsortiumManager.switchActiveAffiliation( + tenantNames.central, + tenantNames.university, + ); + MarcAuthorities.waitLoading(); + ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-authority/update-local-linked-marc-auth-in-member.cy.js b/cypress/e2e/consortia/marc/marc-authority/update-local-linked-marc-auth-in-member.cy.js index e49834a661..a9a4e0c6f1 100644 --- a/cypress/e2e/consortia/marc/marc-authority/update-local-linked-marc-auth-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/update-local-linked-marc-auth-in-member.cy.js @@ -6,9 +6,7 @@ import InventoryInstances from '../../../../support/fragments/inventory/inventor import getRandomPostfix from '../../../../support/utils/stringTools'; import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; import DataImport from '../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; -import JobProfiles from '../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants'; import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority'; @@ -45,11 +43,13 @@ describe('MARC', () => { { marc: 'marcBibFileForC407654.mrc', fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, { marc: 'marcAuthFileForC407654.mrc', fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, }, ]; @@ -94,7 +94,18 @@ describe('MARC', () => { ]); }) .then(() => { - cy.resetTenant(); + cy.setTenant(Affiliations.University); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); cy.login(users.userProperties.username, users.userProperties.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading, @@ -105,23 +116,6 @@ describe('MARC', () => { ); InventoryInstances.waitContentLoading(); ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university); - }); - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); - }); - }); - - cy.visit(TopMenu.inventoryPath).then(() => { InventoryInstances.waitContentLoading(); InventoryInstances.searchByTitle(createdRecordIDs[0]); InventoryInstances.selectInstance(); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/manual-linking/link-shared-marcBib-and-marcAuth-on-central.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/manual-linking/link-shared-marcBib-and-marcAuth-on-central.cy.js index 610bf9ef60..a2e3083e75 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/manual-linking/link-shared-marcBib-and-marcAuth-on-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/manual-linking/link-shared-marcBib-and-marcAuth-on-central.cy.js @@ -12,8 +12,6 @@ import MarcAuthorities from '../../../../../../support/fragments/marcAuthority/m import MarcAuthorityBrowse from '../../../../../../support/fragments/marcAuthority/MarcAuthorityBrowse'; import getRandomPostfix from '../../../../../../support/utils/stringTools'; 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 { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; describe('MARC', () => { @@ -87,25 +85,21 @@ describe('MARC', () => { ]); }) .then(() => { - cy.resetTenant(); cy.login(users.userAProperties.username, users.userAProperties.password, { path: TopMenu.dataImportPath, waiter: DataImport.waitLoading, }); + cy.resetTenant(); marcFiles.forEach((marcFile) => { - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); - JobProfiles.waitLoadingList(); - JobProfiles.search(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) => { - createdRecordsID.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordsID.push(record.authority.id); }); - } + }); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-local-marc-bib-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-local-marc-bib-in-member.cy.js index 74395ac78b..5a6cf002fb 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-local-marc-bib-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-local-marc-bib-in-member.cy.js @@ -8,9 +8,7 @@ import InventoryViewSource from '../../../../../support/fragments/inventory/inve import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import getRandomPostfix from '../../../../../support/utils/stringTools'; import InventorySearchAndFilter from '../../../../../support/fragments/inventory/inventorySearchAndFilter'; @@ -71,19 +69,15 @@ describe('MARC', () => { ]); }) .then(() => { - cy.loginAsCollegeAdmin().then(() => { - cy.visit(TopMenu.dataImportPath); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdInstanceIDs.push(link.split('/')[5]); + cy.setTenant(Affiliations.College); + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdInstanceIDs.push(record.instance.id); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-central.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-central.cy.js index c1d4357591..c934a44cf2 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-central.cy.js @@ -1,9 +1,7 @@ -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import Affiliations, { tenantNames } from '../../../../../support/dictionary/affiliations'; import Permissions from '../../../../../support/dictionary/permissions'; 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 InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; @@ -58,18 +56,13 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdInstanceIDs.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdInstanceIDs.push(record.instance.id); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-member.cy.js index 5c8c067f27..26dda90ec5 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-from-shared-marc-bib-in-member.cy.js @@ -8,9 +8,7 @@ import InventoryViewSource from '../../../../../support/fragments/inventory/inve import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import getRandomPostfix from '../../../../../support/utils/stringTools'; import InventorySearchAndFilter from '../../../../../support/fragments/inventory/inventorySearchAndFilter'; @@ -70,18 +68,13 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdInstanceIDs.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdInstanceIDs.push(record.instance.id); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-new-local-marcBib-from-shadow-instance-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-new-local-marcBib-from-shadow-instance-in-member.cy.js index 62563aff48..4f491005fe 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-new-local-marcBib-from-shadow-instance-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/derive-marcBib/derive-new-local-marcBib-from-shadow-instance-in-member.cy.js @@ -6,9 +6,7 @@ import InventoryInstances from '../../../../../support/fragments/inventory/inven import getRandomPostfix from '../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; @@ -48,24 +46,28 @@ describe('MARC', () => { { marc: 'marcBibFileForC410775.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, tenant: 'Central Office', }, { marc: 'marcAuthFileForC410775-Shared.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, tenant: 'Central Office', }, { marc: 'marcAuthFileForC410775-Local-M1.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, tenant: 'University', }, { marc: 'marcAuthFileForC410775-Local-M2.mrc', fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, tenant: 'College', }, @@ -129,36 +131,25 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - if (marcFile.tenant === 'University') { - ConsortiumManager.switchActiveAffiliation( - tenantNames.central, - tenantNames.university, - ); - } else if (marcFile.tenant === 'College') { - ConsortiumManager.switchActiveAffiliation( - tenantNames.university, - tenantNames.college, - ); - } - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileName); - Logs.checkJobStatus(marcFile.fileName, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileName); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + marcFiles.forEach((marcFile) => { + if (marcFile.tenant === 'University') { + cy.setTenant(Affiliations.University); + } else if (marcFile.tenant === 'College') { + cy.setTenant(Affiliations.College); + } + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); }); }); + }); - linkableFields.forEach((tag) => { - QuickMarcEditor.setRulesForField(tag, true); - }); + linkableFields.forEach((tag) => { + QuickMarcEditor.setRulesForField(tag, true); }); }) .then(() => { diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/edit-subfields-shared-marc-bib-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/edit-subfields-shared-marc-bib-in-member.cy.js index 9702b219cb..b046d2942c 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/edit-subfields-shared-marc-bib-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/edit-subfields-shared-marc-bib-in-member.cy.js @@ -7,9 +7,7 @@ import getRandomPostfix, { randomFourDigitNumber } from '../../../../../support/ import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import InventorySearchAndFilter from '../../../../../support/fragments/inventory/inventorySearchAndFilter'; @@ -79,20 +77,14 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record.instance.id); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-local-marcAuth-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-local-marcAuth-in-member.cy.js index 984bde0925..dd17f71edb 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-local-marcAuth-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-local-marcAuth-in-member.cy.js @@ -6,9 +6,7 @@ import InventoryInstances from '../../../../../../support/fragments/inventory/in import getRandomPostfix from '../../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../../support/fragments/inventory/inventoryInstance'; import DataImport from '../../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; -import JobProfiles from '../../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; import QuickMarcEditor from '../../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../../../support/fragments/marcAuthority/marcAuthority'; @@ -41,15 +39,17 @@ describe('MARC', () => { const users = {}; - const marcFilesFor = [ + const marcFiles = [ { marc: 'marcBibFileForC405560.mrc', - fileNameImported: `C405560 testMarcFile${getRandomPostfix()}.mrc`, + fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, { marc: 'marcAuthFileForC405560.mrc', - fileNameImported: `C405560 testMarcFile${getRandomPostfix()}.mrc`, + fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, }, ]; @@ -85,25 +85,15 @@ describe('MARC', () => { ]); }) .then(() => { - cy.resetTenant(); - cy.loginAsAdmin().then(() => { - ConsortiumManager.switchActiveAffiliation( - tenantNames.central, - tenantNames.university, - ); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university); - marcFilesFor.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFile(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + cy.setTenant(Affiliations.University); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-shared-marcAuth-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-shared-marcAuth-in-member.cy.js index c6f921ba14..b379f207e0 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-shared-marcAuth-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-local-marcBib-with-shared-marcAuth-in-member.cy.js @@ -6,9 +6,7 @@ import InventoryInstances from '../../../../../../support/fragments/inventory/in import getRandomPostfix from '../../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../../support/fragments/inventory/inventoryInstance'; import DataImport from '../../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; -import JobProfiles from '../../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; import QuickMarcEditor from '../../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../../../support/fragments/marcAuthority/marcAuthority'; @@ -43,12 +41,14 @@ describe('MARC', () => { const marcFilesForCentral = [ { marc: 'marcBibFileForC405559_1.mrc', - fileNameImported: `C405559 testMarcFile${getRandomPostfix()}.mrc`, + fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, { marc: 'marcAuthFileForC405559.mrc', - fileNameImported: `C405559 testMarcFile${getRandomPostfix()}.mrc`, + fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, }, ]; @@ -57,6 +57,7 @@ describe('MARC', () => { { marc: 'marcBibFileForC405559_2.mrc', fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, ]; @@ -97,17 +98,14 @@ describe('MARC', () => { cy.resetTenant(); cy.loginAsAdmin().then(() => { marcFilesForCentral.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); }); }); @@ -131,24 +129,16 @@ describe('MARC', () => { QuickMarcEditor.checkAfterSaveAndClose(); }); - ConsortiumManager.switchActiveAffiliation( - tenantNames.central, - tenantNames.university, - ); - InventoryInstances.waitContentLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university); + cy.setTenant(Affiliations.University); marcFilesForMember.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-central.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-central.cy.js index 20fcaaee0a..620db6fe89 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-central.cy.js @@ -6,9 +6,7 @@ import InventoryInstances from '../../../../../../support/fragments/inventory/in import getRandomPostfix from '../../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../../support/fragments/inventory/inventoryInstance'; import DataImport from '../../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; -import JobProfiles from '../../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; import QuickMarcEditor from '../../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../../../support/fragments/marcAuthority/marcAuthority'; @@ -57,11 +55,13 @@ describe('MARC', () => { { marc: 'marcBibFileForC410814.mrc', fileNameImported: `testMarcFileC410814.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, { marc: 'marcAuthFileForC410814.mrc', fileNameImported: `testMarcFileC410814.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, }, ]; @@ -92,17 +92,14 @@ describe('MARC', () => { cy.resetTenant(); cy.loginAsAdmin().then(() => { marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFile(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-member.cy.js index 943dc5f28d..9695c66710 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/manual-linking/link-shared-marcBib-with-shared-marcAuth-in-member.cy.js @@ -6,9 +6,7 @@ import InventoryInstances from '../../../../../../support/fragments/inventory/in import getRandomPostfix from '../../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../../support/fragments/inventory/inventoryInstance'; import DataImport from '../../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; -import JobProfiles from '../../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../../support/constants'; import QuickMarcEditor from '../../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../../../support/fragments/marcAuthority/marcAuthority'; @@ -57,12 +55,14 @@ describe('MARC', () => { const marcFiles = [ { marc: 'marcBibFileForC410819.mrc', - fileNameImported: `C410819 testMarcFile${getRandomPostfix()}.mrc`, + fileNameImported: `testMarcFileC410819.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, { marc: 'marcAuthFileForC410819.mrc', - fileNameImported: `C410819 testMarcFile${getRandomPostfix()}.mrc`, + fileNameImported: `testMarcFileC410819.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, }, ]; @@ -103,17 +103,14 @@ describe('MARC', () => { cy.resetTenant(); cy.loginAsAdmin().then(() => { marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFile(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/marc-bib-edit-in-central.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/marc-bib-edit-in-central.cy.js index 32a7c268c1..ca0bb30fbd 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/marc-bib-edit-in-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/marc-bib-edit-in-central.cy.js @@ -1,9 +1,7 @@ -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import Affiliations, { tenantNames } from '../../../../../support/dictionary/affiliations'; import Permissions from '../../../../../support/dictionary/permissions'; 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 InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import InventoryInstances from '../../../../../support/fragments/inventory/inventoryInstances'; import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; @@ -63,24 +61,20 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then( - () => { - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdInstanceID = link.split('/')[5]; - }); - cy.login(users.userAProperties.username, users.userAProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }, - ); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdInstanceID = record.instance.id; + }); + }); + + cy.login(users.userAProperties.username, users.userAProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-local-marc-bib-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-local-marc-bib-in-member.cy.js index b8dd238d89..1eb92c0e8d 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-local-marc-bib-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-local-marc-bib-in-member.cy.js @@ -7,9 +7,7 @@ import getRandomPostfix from '../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import InventorySearchAndFilter from '../../../../../support/fragments/inventory/inventorySearchAndFilter'; @@ -32,6 +30,7 @@ describe('MARC', () => { { marc: 'marcBibFileForC405549.mrc', fileNameImported: `testMarcFileC405549.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, ]; @@ -66,25 +65,15 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - ConsortiumManager.switchActiveAffiliation( - tenantNames.central, - tenantNames.university, - ); - DataImport.waitLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkJobStatus(marcFile.fileNameImported, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + cy.setTenant(Affiliations.University); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-shared-marc-bib-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-shared-marc-bib-in-member.cy.js index d6ce50c5b8..dc73136afe 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-shared-marc-bib-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/user-can-edit-shared-marc-bib-in-member.cy.js @@ -7,9 +7,7 @@ import getRandomPostfix from '../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; @@ -31,6 +29,7 @@ describe('MARC', () => { { marc: 'marcBibFileForC405507.mrc', fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, ]; @@ -74,19 +73,14 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-central.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-central.cy.js index 8ab94e1be3..077857afeb 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-central.cy.js @@ -6,9 +6,7 @@ import InventoryInstances from '../../../../../support/fragments/inventory/inven import getRandomPostfix from '../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; @@ -45,11 +43,13 @@ describe('MARC', () => { { marc: 'marcBibFileC397392.mrc', fileNameImported: `testMarcFileC397392.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, { marc: 'marcAuthFileC397392.mrc', fileNameImported: `testMarcFileC397392.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, }, ]; @@ -78,19 +78,15 @@ describe('MARC', () => { }) .then(() => { cy.resetTenant(); - cy.loginAsAdmin().then(() => { - marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-member.cy.js index 98e7ee857b..d75c9bb283 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/manual-linking/marc-bib-shared-link-shared-member.cy.js @@ -7,9 +7,7 @@ import getRandomPostfix from '../../../../../support/utils/stringTools'; import InventoryInstance from '../../../../../support/fragments/inventory/inventoryInstance'; import InventoryViewSource from '../../../../../support/fragments/inventory/inventoryViewSource'; import DataImport from '../../../../../support/fragments/data_import/dataImport'; -import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; -import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles'; -import Logs from '../../../../../support/fragments/data_import/logs/logs'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../../support/constants'; import QuickMarcEditor from '../../../../../support/fragments/quickMarcEditor'; import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager'; import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority'; @@ -50,11 +48,13 @@ describe('MARC', () => { { marc: 'marcBibFileC397343.mrc', fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'instance', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, }, { marc: 'marcAuthFileC397343.mrc', fileNameImported: `testMarcFileC397343.${getRandomPostfix()}.mrc`, + propertyName: 'authority', jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, }, ]; @@ -95,17 +95,14 @@ describe('MARC', () => { cy.resetTenant(); cy.loginAsAdmin().then(() => { marcFiles.forEach((marcFile) => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileNameImported); - JobProfiles.waitLoadingList(); - JobProfiles.search(marcFile.jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFile.fileNameImported); - Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFile.fileNameImported); - Logs.getCreatedItemsID().then((link) => { - createdRecordIDs.push(link.split('/')[5]); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileNameImported, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); }); });