From 9f0d9c8e9f433b2a0840aa96aef9e55107ff6db6 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Fri, 24 Jan 2025 19:33:47 +0300 Subject: [PATCH 1/3] Spitfire ECS BF fixes 1/24 (#4669) * spitfire-ecs-bf-fixes-1-24 * Linter fixes --- ...egardless-permission-and-affiliation.cy.js | 15 +-- ...egardless-permission-and-affiliation.cy.js | 7 -- ...egardless-permission-and-affiliation.cy.js | 2 - ...egardless-permission-and-affiliation.cy.js | 2 - ...-fileds-of-shared-marcBib-in-central.cy.js | 36 +++--- ...d-fileds-of-shared-marcBib-in-member.cy.js | 2 + .../contributor-browse-member-no-shared.cy.js | 111 ++++++++++-------- ...-local-instances-by-title-all-member.cy.js | 82 +++++++------ ...al-records-by-title-all-from-central.cy.js | 55 +++++---- .../subject-browse-member-no-shared.cy.js | 81 +++++++------ ...d-with-selected-auth-file-at-central.cy.js | 7 +- .../marc-authority-shared-edit-member.cy.js | 2 + ...ate-local-linked-marc-auth-in-member.cy.js | 4 + ...ed-linked-marc-auth-record-in-member.cy.js | 4 + .../create-local-marc-bib-in-member.cy.js | 2 + .../create-shared-marc-bib-in-central.cy.js | 2 + ...ared-marcBib-and-marcAuth-on-central.cy.js | 5 +- ...-on-central-shadow-marcBib-in-member.cy.js | 26 ++-- ...-subfields-shared-marc-bib-in-member.cy.js | 2 + ...arcBib-with-local-marcAuth-in-member.cy.js | 3 + ...rcBib-with-shared-marcAuth-in-member.cy.js | 4 + ...rcBib-with-shared-marcAuth-in-member.cy.js | 59 ++++++---- .../marc-bib-edit-in-central.cy.js | 2 + 23 files changed, 292 insertions(+), 223 deletions(-) diff --git a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-alternative-title-types/alternative-title-types-can-be-shared-regardless-permission-and-affiliation.cy.js b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-alternative-title-types/alternative-title-types-can-be-shared-regardless-permission-and-affiliation.cy.js index 73d7fcc9b7..14b6b68d0e 100644 --- a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-alternative-title-types/alternative-title-types-can-be-shared-regardless-permission-and-affiliation.cy.js +++ b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-alternative-title-types/alternative-title-types-can-be-shared-regardless-permission-and-affiliation.cy.js @@ -1,4 +1,3 @@ -import moment from 'moment'; import { calloutTypes } from '../../../../../../interactors'; import { getTestEntityValue } from '../../../../../support/utils/stringTools'; import ConsortiumManagerApp, { @@ -120,12 +119,6 @@ describe('Consortia', () => { name: alternativeTitleTypes4.name, }); ConsortiaControlledVocabularyPaneset.clickSave(); - const rowDataToCheck = [ - alternativeTitleTypes4.name, - 'consortium', - moment().format('l'), - 'All', - ]; ConfirmShare.waitLoadingConfirmShareToAll(alternativeTitleTypes4.name); ConfirmShare.clickConfirm(); @@ -135,10 +128,10 @@ describe('Consortia', () => { messages.noPermission(tenantNames.college), calloutTypes.error, ); - ConsortiaControlledVocabularyPaneset.verifyRecordInTheList(alternativeTitleTypes4.name, [ - 'edit', - 'trash', - ]); + ConsortiaControlledVocabularyPaneset.verifyRecordInTheList( + alternativeTitleTypes4.name, + ['edit', 'trash'], + ); ConsortiaControlledVocabularyPaneset.createViaUi(true, alternativeTitleTypes5); ConsortiaControlledVocabularyPaneset.clickSave(); diff --git a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-classification-identifier-types/classification-identifier-type-can-be-shared-regardless-permission-and-affiliation.cy.js b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-classification-identifier-types/classification-identifier-type-can-be-shared-regardless-permission-and-affiliation.cy.js index d560844311..880b2e2be6 100644 --- a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-classification-identifier-types/classification-identifier-type-can-be-shared-regardless-permission-and-affiliation.cy.js +++ b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-classification-identifier-types/classification-identifier-type-can-be-shared-regardless-permission-and-affiliation.cy.js @@ -1,4 +1,3 @@ -import moment from 'moment'; import { calloutTypes } from '../../../../../../interactors'; import { getTestEntityValue } from '../../../../../support/utils/stringTools'; import ConsortiumManagerApp, { @@ -123,12 +122,6 @@ describe('Consortia', () => { name: classificationType4.name, }); ConsortiaControlledVocabularyPaneset.clickSave(); - const createdCIT = [ - classificationType4.name, - 'consortium', - moment().format('l'), - 'All', - ]; ConfirmShare.waitLoadingConfirmShareToAll(classificationType4.name); ConfirmShare.clickConfirm(); diff --git a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-instance-note-types/instance-note-types-can-be-shared-regardless-permission-and-affiliation.cy.js b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-instance-note-types/instance-note-types-can-be-shared-regardless-permission-and-affiliation.cy.js index 2ad483e363..0f8a880fbe 100644 --- a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-instance-note-types/instance-note-types-can-be-shared-regardless-permission-and-affiliation.cy.js +++ b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-instance-note-types/instance-note-types-can-be-shared-regardless-permission-and-affiliation.cy.js @@ -1,4 +1,3 @@ -import moment from 'moment'; import { calloutTypes } from '../../../../../../interactors'; import { getTestEntityValue } from '../../../../../support/utils/stringTools'; import ConsortiumManagerApp, { @@ -115,7 +114,6 @@ describe('Consortia', () => { name: instanceNote4.name, }); ConsortiaControlledVocabularyPaneset.clickSave(); - const createdCIT = [instanceNote4.name, 'consortium', moment().format('l'), 'All']; ConfirmShare.waitLoadingConfirmShareToAll(instanceNote4.name); ConfirmShare.clickConfirm(); diff --git a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-modes-of-issuance/modes-of-issuance-can-be-shared-regardless-permission-and-affiliation.cy.js b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-modes-of-issuance/modes-of-issuance-can-be-shared-regardless-permission-and-affiliation.cy.js index af8349c65c..9b49f214a6 100644 --- a/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-modes-of-issuance/modes-of-issuance-can-be-shared-regardless-permission-and-affiliation.cy.js +++ b/cypress/e2e/consortia/consortium-manager/manage-shared-settings/manage-shared-modes-of-issuance/modes-of-issuance-can-be-shared-regardless-permission-and-affiliation.cy.js @@ -1,4 +1,3 @@ -import moment from 'moment'; import { calloutTypes } from '../../../../../../interactors'; import { getTestEntityValue } from '../../../../../support/utils/stringTools'; import ConsortiumManagerApp, { @@ -115,7 +114,6 @@ describe('Consortia', () => { name: modesIssuance4.name, }); ConsortiaControlledVocabularyPaneset.clickSave(); - const createdCIT = [modesIssuance4.name, 'consortium', moment().format('l'), 'All']; ConfirmShare.waitLoadingConfirmShareToAll(modesIssuance4.name); ConfirmShare.clickConfirm(); diff --git a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js index 71e9bc1069..4aead26251 100644 --- a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js +++ b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js @@ -210,6 +210,8 @@ describe('Data Import', () => { QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex); }); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }) .then(() => { @@ -235,23 +237,27 @@ describe('Data Import', () => { .then(() => { // adding Holdings in College for shared Instance cy.setTenant(Affiliations.College); - const collegeLocationData = Locations.getDefaultLocation({ - servicePointId: ServicePoints.getDefaultServicePoint().id, - }).location; - Locations.createViaApi(collegeLocationData).then((location) => { - testData.collegeLocation = location; - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: createdAuthorityIDs[0], - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - testData.collegeHoldings.push(holding); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const universityHoldingsSourceId = folioSource.id; + const collegeLocationData = Locations.getDefaultLocation({ + servicePointId: ServicePoints.getDefaultServicePoint().id, + }).location; + Locations.createViaApi(collegeLocationData).then((location) => { + testData.collegeLocation = location; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: createdAuthorityIDs[0], + permanentLocationId: testData.collegeLocation.id, + sourceId: universityHoldingsSourceId, + }).then((holding) => { + testData.collegeHoldings.push(holding); + }); }); - }); - cy.resetTenant(); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, + cy.resetTenant(); + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); }); diff --git a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js index 047b64de27..6b0eaf1fae 100644 --- a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js +++ b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js @@ -212,6 +212,8 @@ describe('Data Import', () => { QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex); }); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }) .then(() => { diff --git a/cypress/e2e/consortia/inventory/contributor-browse/contributor-browse-member-no-shared.cy.js b/cypress/e2e/consortia/inventory/contributor-browse/contributor-browse-member-no-shared.cy.js index c88811330c..ccce852466 100644 --- a/cypress/e2e/consortia/inventory/contributor-browse/contributor-browse-member-no-shared.cy.js +++ b/cypress/e2e/consortia/inventory/contributor-browse/contributor-browse-member-no-shared.cy.js @@ -72,50 +72,55 @@ describe('Inventory', () => { testData.contributorTypeName = contributorTypes[0].name; cy.setTenant(Affiliations.College); - InventoryInstance.createInstanceViaApi({ - instanceTitle: testData.localInstanceTitle, - }).then((body) => { - cy.getInstanceById(body.instanceData.instanceId).then((body2) => { - const requestBodyLocal = body2; - requestBodyLocal.contributors = [ - { - name: `${contributorPrefix} 1`, - contributorNameTypeId: contributorNameTypes[0].id, - contributorTypeId: contributorTypes[0].id, - contributorTypeText: '', - primary: false, - }, - { - name: `${contributorPrefix} 2`, - contributorNameTypeId: contributorNameTypes[0].id, - contributorTypeId: contributorTypes[0].id, - contributorTypeText: '', - primary: false, - }, - ]; - cy.updateInstance(requestBodyLocal); - }); - testData.localInstanceId = body.instanceData.instanceId; - - // adding Holdings in College for shared Instance - cy.setTenant(Affiliations.College); - const collegeLocationData = Locations.getDefaultLocation({ - servicePointId: ServicePoints.getDefaultServicePoint().id, - }).location; - Locations.createViaApi(collegeLocationData).then((location) => { - testData.collegeLocation = location; - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: testData.sharedInstanceId, - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - testData.collegeHoldings.push(holding); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const collegeHoldingsSourceId = folioSource.id; + InventoryInstance.createInstanceViaApi({ + instanceTitle: testData.localInstanceTitle, + }).then((body) => { + cy.getInstanceById(body.instanceData.instanceId).then((body2) => { + const requestBodyLocal = body2; + requestBodyLocal.contributors = [ + { + name: `${contributorPrefix} 1`, + contributorNameTypeId: contributorNameTypes[0].id, + contributorTypeId: contributorTypes[0].id, + contributorTypeText: '', + primary: false, + }, + { + name: `${contributorPrefix} 2`, + contributorNameTypeId: contributorNameTypes[0].id, + contributorTypeId: contributorTypes[0].id, + contributorTypeText: '', + primary: false, + }, + ]; + cy.updateInstance(requestBodyLocal); + }); + testData.localInstanceId = body.instanceData.instanceId; - // adding Holdings in College for local Instance + // adding Holdings in College for shared Instance + cy.setTenant(Affiliations.College); + const collegeLocationData = Locations.getDefaultLocation({ + servicePointId: ServicePoints.getDefaultServicePoint().id, + }).location; + Locations.createViaApi(collegeLocationData).then((location) => { + testData.collegeLocation = location; InventoryHoldings.createHoldingRecordViaApi({ - instanceId: testData.localInstanceId, + instanceId: testData.sharedInstanceId, permanentLocationId: testData.collegeLocation.id, - }).then((holding2) => { - testData.collegeHoldings.push(holding2); + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + testData.collegeHoldings.push(holding); + + // adding Holdings in College for local Instance + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: testData.localInstanceId, + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding2) => { + testData.collegeHoldings.push(holding2); + }); }); }); }); @@ -123,16 +128,20 @@ describe('Inventory', () => { // adding Holdings in University for shared Instance cy.setTenant(Affiliations.University); - const universityLocationData = Locations.getDefaultLocation({ - servicePointId: ServicePoints.getDefaultServicePoint().id, - }).location; - Locations.createViaApi(universityLocationData).then((location) => { - testData.universityLocation = location; - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: testData.sharedInstanceId, - permanentLocationId: location.id, - }).then((holding) => { - testData.universityHoldings.push(holding); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const universityHoldingsSourceId = folioSource.id; + const universityLocationData = Locations.getDefaultLocation({ + servicePointId: ServicePoints.getDefaultServicePoint().id, + }).location; + Locations.createViaApi(universityLocationData).then((location) => { + testData.universityLocation = location; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: testData.sharedInstanceId, + permanentLocationId: location.id, + sourceId: universityHoldingsSourceId, + }).then((holding) => { + testData.universityHoldings.push(holding); + }); }); }); }); 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 c89f319a43..54a91a955c 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 @@ -235,24 +235,29 @@ describe('Inventory', () => { // 1 Local "Instance" record with source = "MARC" should have "Holdings" records created on Member 1 tenant cy.setTenant(Affiliations.College); - - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId, - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - createdHoldingsCollege.push(holding.id); - }); - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: marcFiles[0].createdRecordsId[1], - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - createdHoldingsCollege.push(holding.id); - }); - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: marcFiles[1].createdRecordsId[0], - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - createdHoldingsCollege.push(holding.id); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const collegeHoldingsSourceId = folioSource.id; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId, + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + createdHoldingsCollege.push(holding.id); + }); + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: marcFiles[0].createdRecordsId[1], + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + createdHoldingsCollege.push(holding.id); + }); + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: marcFiles[1].createdRecordsId[0], + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + createdHoldingsCollege.push(holding.id); + }); }); }) .then(() => { @@ -261,24 +266,29 @@ describe('Inventory', () => { // 1 Local "Instance" record with source = "MARC" should have "Holdings" records created on Member 2 tenant cy.setTenant(Affiliations.University); - - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: sharedFOLIOInstancesFromCentral[2].testInstanceId, - permanentLocationId: testData.universityLocation.id, - }).then((holding) => { - createdHoldingsUniversity.push(holding.id); - }); - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: marcFiles[0].createdRecordsId[2], - permanentLocationId: testData.universityLocation.id, - }).then((holding) => { - createdHoldingsUniversity.push(holding.id); - }); - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: marcFiles[2].createdRecordsId[0], - permanentLocationId: testData.universityLocation.id, - }).then((holding) => { - createdHoldingsUniversity.push(holding.id); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const universityHoldingsSourceId = folioSource.id; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: sharedFOLIOInstancesFromCentral[2].testInstanceId, + permanentLocationId: testData.universityLocation.id, + sourceId: universityHoldingsSourceId, + }).then((holding) => { + createdHoldingsUniversity.push(holding.id); + }); + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: marcFiles[0].createdRecordsId[2], + permanentLocationId: testData.universityLocation.id, + sourceId: universityHoldingsSourceId, + }).then((holding) => { + createdHoldingsUniversity.push(holding.id); + }); + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: marcFiles[2].createdRecordsId[0], + permanentLocationId: testData.universityLocation.id, + sourceId: universityHoldingsSourceId, + }).then((holding) => { + createdHoldingsUniversity.push(holding.id); + }); }); }); diff --git a/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-records-by-title-all-from-central.cy.js b/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-records-by-title-all-from-central.cy.js index db262d551a..6609dfafc4 100644 --- a/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-records-by-title-all-from-central.cy.js +++ b/cypress/e2e/consortia/inventory/search-in-inventory/search-shared-local-records-by-title-all-from-central.cy.js @@ -164,32 +164,37 @@ describe('Inventory', () => { .then(() => { cy.setTenant(Affiliations.College); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const collegeHoldingsSourceId = folioSource.id; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId, + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + createdHoldingsCollege.push(holding.id); + }); + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: marcFiles[0].createdRecordsId[1], + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + createdHoldingsCollege.push(holding.id); + }); + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: marcFiles[1].createdRecordsId[0], + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + createdHoldingsCollege.push(holding.id); + }); - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId, - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - createdHoldingsCollege.push(holding.id); - }); - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: marcFiles[0].createdRecordsId[1], - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - createdHoldingsCollege.push(holding.id); - }); - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: marcFiles[1].createdRecordsId[0], - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - createdHoldingsCollege.push(holding.id); - }); - - cy.login(users.userProperties.username, users.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }).then(() => { - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); - InventorySearchAndFilter.instanceTabIsDefault(); + cy.login(users.userProperties.username, users.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }).then(() => { + ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); + InventorySearchAndFilter.instanceTabIsDefault(); + }); }); }); }); diff --git a/cypress/e2e/consortia/inventory/subject-browse/subject-browse-member-no-shared.cy.js b/cypress/e2e/consortia/inventory/subject-browse/subject-browse-member-no-shared.cy.js index 0ea515ce24..25ef701422 100644 --- a/cypress/e2e/consortia/inventory/subject-browse/subject-browse-member-no-shared.cy.js +++ b/cypress/e2e/consortia/inventory/subject-browse/subject-browse-member-no-shared.cy.js @@ -58,50 +58,59 @@ describe('Inventory', () => { // adding Holdings in College for shared Instance cy.setTenant(Affiliations.College); - const collegeLocationData = Locations.getDefaultLocation({ - servicePointId: ServicePoints.getDefaultServicePoint().id, - }).location; - Locations.createViaApi(collegeLocationData).then((location) => { - testData.collegeLocation = location; - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: testData.sharedInstance.id, - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - testData.collegeHoldings.push(holding); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const collegeHoldingsSourceId = folioSource.id; + const collegeLocationData = Locations.getDefaultLocation({ + servicePointId: ServicePoints.getDefaultServicePoint().id, + }).location; + Locations.createViaApi(collegeLocationData).then((location) => { + testData.collegeLocation = location; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: testData.sharedInstance.id, + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + testData.collegeHoldings.push(holding); + }); }); - }); - InventoryInstance.createInstanceViaApi({ - instanceTitle: testData.localInstance.title, - }).then((instanceDataLocal) => { - testData.localInstance.id = instanceDataLocal.instanceData.instanceId; - cy.getInstanceById(testData.localInstance.id).then((body) => { - const requestBodyLocal = body; - requestBodyLocal.subjects = testData.localInstance.subjects; - cy.updateInstance(requestBodyLocal); - }); + InventoryInstance.createInstanceViaApi({ + instanceTitle: testData.localInstance.title, + }).then((instanceDataLocal) => { + testData.localInstance.id = instanceDataLocal.instanceData.instanceId; + cy.getInstanceById(testData.localInstance.id).then((body) => { + const requestBodyLocal = body; + requestBodyLocal.subjects = testData.localInstance.subjects; + cy.updateInstance(requestBodyLocal); + }); - // adding Holdings in College for local Instance - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: testData.localInstance.id, - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - testData.collegeHoldings.push(holding); + // adding Holdings in College for local Instance + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: testData.localInstance.id, + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + testData.collegeHoldings.push(holding); + }); }); }); // adding Holdings in University for shared Instance cy.setTenant(Affiliations.University); - const universityLocationData = Locations.getDefaultLocation({ - servicePointId: ServicePoints.getDefaultServicePoint().id, - }).location; - Locations.createViaApi(universityLocationData).then((location) => { - testData.universityLocation = location; - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: testData.sharedInstance.id, - permanentLocationId: location.id, - }).then((holding) => { - testData.universityHoldings.push(holding); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const universityHoldingsSourceId = folioSource.id; + const universityLocationData = Locations.getDefaultLocation({ + servicePointId: ServicePoints.getDefaultServicePoint().id, + }).location; + Locations.createViaApi(universityLocationData).then((location) => { + testData.universityLocation = location; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: testData.sharedInstance.id, + permanentLocationId: location.id, + sourceId: universityHoldingsSourceId, + }).then((holding) => { + testData.universityHoldings.push(holding); + }); }); }); }); diff --git a/cypress/e2e/consortia/marc/marc-authority/create-marc-authority/create-shared-auth-record-with-selected-auth-file-at-central.cy.js b/cypress/e2e/consortia/marc/marc-authority/create-marc-authority/create-shared-auth-record-with-selected-auth-file-at-central.cy.js index 40166b58d2..019f437ff9 100644 --- a/cypress/e2e/consortia/marc/marc-authority/create-marc-authority/create-shared-auth-record-with-selected-auth-file-at-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/create-marc-authority/create-shared-auth-record-with-selected-auth-file-at-central.cy.js @@ -80,6 +80,7 @@ describe('MARC', () => { Users.deleteViaApi(users.userProperties.userId); MarcAuthority.deleteViaAPI(testData.authorityId); ManageAuthorityFiles.unsetAllDefaultFOLIOFilesAsActiveViaAPI(); + cy.wait(5000); cy.deleteAuthoritySourceFileViaAPI(testData.authSourceID); }); @@ -95,7 +96,9 @@ describe('MARC', () => { QuickMarcEditor.verifyAuthorityFileSelected(testData.sourceName); QuickMarcEditor.clickSaveAndCloseInModal(); QuickMarcEditor.checkContentByTag('001', `${testData.prefix}${testData.startWithNumber}`); - MarcAuthority.addNewField(4, newField.tag, newField.content); + MarcAuthority.addNewFieldAfterExistingByTag('008', newField.tag, newField.content); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); MarcAuthority.verifyAfterSaveAndClose(); QuickMarcEditor.verifyPaneheaderWithContentAbsent(testData.headerText); @@ -114,7 +117,7 @@ describe('MARC', () => { MarcAuthorities.chooseAuthoritySourceOption(testData.sourceName); MarcAuthorities.checkResultsSelectedByAuthoritySource([testData.sourceName]); - MarcAuthorities.selectTitle(testData.marcValue); + MarcAuthorities.selectIncludingTitle(testData.marcValue); MarcAuthorities.checkAfterSearch( testData.AUTHORIZED, `${testData.sharedIcon}${testData.marcValue}`, 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 3a1cdbad9a..23bf17cf00 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 @@ -125,6 +125,8 @@ describe('MARC', () => { QuickMarcEditor.clickArrowDownButton(4); QuickMarcEditor.verifyTagValue(5, testData.tag010); MarcAuthority.clickSaveAndCloseButton(); + cy.wait(1500); + MarcAuthority.clickSaveAndCloseButton(); QuickMarcEditor.checkDeleteModal(1); MarcAuthority.continueWithSaveAndCheck(); MarcAuthority.contains(testData.updatedTag100Value); 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 29c1244407..db500e9f76 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 @@ -129,6 +129,8 @@ describe('MARC', () => { linkingTagAndValues.rowIndex, ); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }); }); @@ -157,6 +159,8 @@ describe('MARC', () => { // if clicked too fast, delete modal might not appear cy.wait(1000); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyUpdateLinkedBibsKeepEditingModal(1); QuickMarcEditor.confirmUpdateLinkedBibsKeepEditing(1); cy.visit(TopMenu.inventoryPath); diff --git a/cypress/e2e/consortia/marc/marc-authority/update-shared-linked-marc-auth-record-in-member.cy.js b/cypress/e2e/consortia/marc/marc-authority/update-shared-linked-marc-auth-record-in-member.cy.js index 1e35ca7db6..7c7941e433 100644 --- a/cypress/e2e/consortia/marc/marc-authority/update-shared-linked-marc-auth-record-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-authority/update-shared-linked-marc-auth-record-in-member.cy.js @@ -185,6 +185,8 @@ describe('MARC', () => { linkingTagAndValues.rowIndex, ); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }); }); @@ -226,6 +228,8 @@ describe('MARC', () => { // if clicked too fast, delete modal might not appear cy.wait(1000); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyUpdateLinkedBibsKeepEditingModal(4); QuickMarcEditor.confirmUpdateLinkedBibsKeepEditing(4); cy.visit(TopMenu.inventoryPath); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-local-marc-bib-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-local-marc-bib-in-member.cy.js index dc8356a2dd..6b188a7dd9 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-local-marc-bib-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-local-marc-bib-in-member.cy.js @@ -86,6 +86,8 @@ describe('MARC', () => { QuickMarcEditor.updateIndicatorValue(newField.tag, '2', 0); QuickMarcEditor.updateIndicatorValue(newField.tag, '0', 1); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { createdInstanceID.push(id); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-shared-marc-bib-in-central.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-shared-marc-bib-in-central.cy.js index 146eb8a04d..c7784e8472 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-shared-marc-bib-in-central.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/create-new-marcBib/create-shared-marc-bib-in-central.cy.js @@ -88,6 +88,8 @@ describe('MARC', () => { QuickMarcEditor.updateIndicatorValue(newField.tag, '2', 0); QuickMarcEditor.updateIndicatorValue(newField.tag, '0', 1); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { createdInstanceID.push(id); 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 98c56dbb0b..f9451431b0 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 @@ -23,7 +23,7 @@ describe('MARC', () => { tag245: '245', }, fieldContents: { - tag245Content: 'C422141 Created Shared Instance with linked field', + tag245Content: `C422141 Created Shared Instance with linked field ${getRandomPostfix()}`, }, authorityTitle: 'C422141 Dante Alighieri, 1265-1321', searchOption: 'Personal name', @@ -57,6 +57,7 @@ describe('MARC', () => { before('Create users, data', () => { cy.getAdminToken(); + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C422141'); cy.createTempUser([ Permissions.uiInventoryViewInstances.gui, @@ -161,6 +162,8 @@ describe('MARC', () => { '$e writer', ); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { createdRecordsID.push(id); diff --git a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/automated-linking/auto-linking-shared-marcBib-with-shared-marcAuth-on-central-shadow-marcBib-in-member.cy.js b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/automated-linking/auto-linking-shared-marcBib-with-shared-marcAuth-on-central-shadow-marcBib-in-member.cy.js index f531a1ea5d..069702a58b 100644 --- a/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/automated-linking/auto-linking-shared-marcBib-with-shared-marcAuth-on-central-shadow-marcBib-in-member.cy.js +++ b/cypress/e2e/consortia/marc/marc-bibliographic/edit-marc-bib/automated-linking/auto-linking-shared-marcBib-with-shared-marcAuth-on-central-shadow-marcBib-in-member.cy.js @@ -155,16 +155,20 @@ describe('MARC', () => { .then(() => { // adding Holdings in College for shared Instance cy.setTenant(Affiliations.College); - const collegeLocationData = Locations.getDefaultLocation({ - servicePointId: ServicePoints.getDefaultServicePoint().id, - }).location; - Locations.createViaApi(collegeLocationData).then((location) => { - testData.collegeLocation = location; - InventoryHoldings.createHoldingRecordViaApi({ - instanceId: createdRecordIDs[0], - permanentLocationId: testData.collegeLocation.id, - }).then((holding) => { - testData.collegeHoldings.push(holding); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const collegeHoldingsSourceId = folioSource.id; + const collegeLocationData = Locations.getDefaultLocation({ + servicePointId: ServicePoints.getDefaultServicePoint().id, + }).location; + Locations.createViaApi(collegeLocationData).then((location) => { + testData.collegeLocation = location; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: createdRecordIDs[0], + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + testData.collegeHoldings.push(holding); + }); }); }); @@ -214,6 +218,8 @@ describe('MARC', () => { QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked650Field); QuickMarcEditor.verifyTagFieldAfterUnlinking(...testData.notLinked710Field); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.checkExpectedMARCSource(); 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 a9da937be3..6a5742ec9d 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 @@ -132,6 +132,8 @@ describe('MARC', () => { QuickMarcEditor.updateExistingField(testData.tag100, testData.tag100UpdatedContent); QuickMarcEditor.checkContentByTag(testData.tag100, testData.tag100UpdatedContent); QuickMarcEditor.clickSaveAndKeepEditingButton(); + cy.wait(1500); + QuickMarcEditor.clickSaveAndKeepEditingButton(); QuickMarcEditor.confirmDeletingFields(); QuickMarcEditor.checkAfterSaveAndKeepEditing(); QuickMarcEditor.checkContentByTag(testData.tag100, testData.tag100UpdatedContent); 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 7c1676f461..9e1222b682 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 @@ -79,6 +79,7 @@ describe('MARC', () => { cy.resetTenant(); cy.assignAffiliationToUser(Affiliations.College, users.userProperties.userId); cy.setTenant(Affiliations.College); + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C405560'); cy.assignPermissionsToExistingUser(users.userProperties.userId, [ Permissions.inventoryAll.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, @@ -153,6 +154,8 @@ describe('MARC', () => { linkingTagAndValues.seventhBox, ); QuickMarcEditor.clickSaveAndKeepEditing(); + cy.wait(1500); + QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.openLinkingAuthorityByIndex(16); MarcAuthorities.checkFieldAndContentExistence( linkingTagAndValues.tag, 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 c55239845c..e8ba3a7397 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 @@ -131,6 +131,8 @@ describe('MARC', () => { linkingTagAndValues.rowIndex, ); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }); @@ -200,6 +202,8 @@ describe('MARC', () => { linkingTagAndValues.seventhBox, ); QuickMarcEditor.clickSaveAndKeepEditing(); + cy.wait(1500); + QuickMarcEditor.clickSaveAndKeepEditing(); QuickMarcEditor.openLinkingAuthorityByIndex(16); MarcAuthorities.checkFieldAndContentExistence( linkingTagAndValues.tag, 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 10565f603a..0154bbfa4b 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 @@ -16,9 +16,10 @@ import BrowseContributors from '../../../../../../support/fragments/inventory/se import BrowseSubjects from '../../../../../../support/fragments/inventory/search/browseSubjects'; import MarcAuthorityBrowse from '../../../../../../support/fragments/marcAuthority/MarcAuthorityBrowse'; import MarcAuthoritiesSearch from '../../../../../../support/fragments/marcAuthority/marcAuthoritiesSearch'; -import HoldingsRecordEdit from '../../../../../../support/fragments/inventory/holdingsRecordEdit'; -import HoldingsRecordView from '../../../../../../support/fragments/inventory/holdingsRecordView'; import InventoryViewSource from '../../../../../../support/fragments/inventory/inventoryViewSource'; +import InventoryHoldings from '../../../../../../support/fragments/inventory/holdings/inventoryHoldings'; +import ServicePoints from '../../../../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import { Locations } from '../../../../../../support/fragments/settings/tenant/location-setup'; describe('MARC', () => { describe('MARC Bibliographic', () => { @@ -112,35 +113,43 @@ describe('MARC', () => { }); }) .then(() => { - cy.loginAsAdmin({ - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.pressAddHoldingsButton(); - HoldingsRecordEdit.changePermanentLocation('Migration (Migration) '); - HoldingsRecordEdit.saveAndClose(); - InventoryInstance.openHoldingView(); - HoldingsRecordView.getHoldingsIDInDetailView().then((holdingsID) => { - createdRecordIDs.push(holdingsID); - }); + cy.setTenant(Affiliations.College); + const collegeLocationData = Locations.getDefaultLocation({ + servicePointId: ServicePoints.getDefaultServicePoint().id, + }).location; + Locations.createViaApi(collegeLocationData).then((location) => { + testData.collegeLocation = location; + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + const collegeHoldingsSourceId = folioSource.id; + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: createdRecordIDs[0], + permanentLocationId: testData.collegeLocation.id, + sourceId: collegeHoldingsSourceId, + }).then((holding) => { + createdRecordIDs.push(holding.id); + }); - cy.login(users.userProperties.username, users.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }).then(() => { - ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); - InventoryInstances.waitContentLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); + cy.login(users.userProperties.username, users.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }).then(() => { + ConsortiumManager.switchActiveAffiliation( + tenantNames.central, + tenantNames.college, + ); + InventoryInstances.waitContentLoading(); + }); + }); }); }); }); after('Delete users, data', () => { + cy.resetTenant(); + cy.getAdminToken(); cy.setTenant(Affiliations.College); cy.deleteHoldingRecordViaApi(createdRecordIDs[2]); + Locations.deleteViaApi(testData.collegeLocation); cy.resetTenant(); cy.getAdminToken(); Users.deleteViaApi(users.userProperties.userId); @@ -185,6 +194,8 @@ describe('MARC', () => { linkingTagAndValues.seventhBox, ); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.checkPresentedText(testData.updatedInstanceTitle); InventoryInstance.verifyRecordAndMarcAuthIcon( @@ -194,7 +205,6 @@ describe('MARC', () => { ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.central); InventoryInstances.waitContentLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); cy.visit(TopMenu.marcAuthorities); MarcAuthorities.searchBy( testData.authoritySearchOption, @@ -215,7 +225,6 @@ describe('MARC', () => { ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.university); InventoryInstances.waitContentLoading(); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.university); InventorySearchAndFilter.switchToBrowseTab(); InventorySearchAndFilter.verifyKeywordsAsDefault(); BrowseContributors.select(); 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 c465e77cea..3e0d03bcb8 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 @@ -99,6 +99,8 @@ describe('MARC', () => { QuickMarcEditor.updateExistingField(testData.tag500, testData.tag500UpdatedValue); QuickMarcEditor.moveFieldUp(17); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.checkInstanceTitle(testData.updatedTitle); InventoryInstance.verifyLastUpdatedSource( From 81d3ab26175c66104377a87bf678759b7619adbc Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Mon, 27 Jan 2025 13:47:59 +0500 Subject: [PATCH 2/3] C405507 fix --- .../edit-marc-bib/user-can-edit-shared-marc-bib-in-member.cy.js | 2 ++ 1 file changed, 2 insertions(+) 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 c949955ff7..131c797323 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 @@ -115,6 +115,8 @@ describe('MARC', () => { QuickMarcEditor.updateExistingField(testData.tag500, `$a ${testData.tag500Content}`); QuickMarcEditor.moveFieldUp(17); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.checkInstanceTitle(testData.tag245Content); InventoryInstance.verifyLastUpdatedSource( From 95fe1199ddea9023bc929bc7d6cef3c0e0b28803 Mon Sep 17 00:00:00 2001 From: Vadim Eremichev Date: Mon, 27 Jan 2025 12:30:48 +0200 Subject: [PATCH 3/3] adjustments for ramsons tests (#4671) --- cypress/e2e/checkout/checkout.notes.cy.js | 2 -- ...ue-which-controls-2-marc-bib-records.cy.js | 3 ++- ...-fields-using-update-marcbib-profile.cy.js | 8 +++--- .../browse-in-inventory.cy.js | 1 + ...ance-by-contributor-case-insensitive.cy.js | 12 ++------- .../browse-subjects-linked.cy.js | 2 ++ .../marc-authority-delete.cy.js | 1 + ...uth-record-with-local-authority-file.cy.js | 1 + ...e-two-marc-bib-linked-marc-authority.cy.js | 4 +-- .../marc-authority/marc-authority-sort.cy.js | 1 + ...ify-marc-auth-record-of-deleted-user.cy.js | 3 ++- ...marc-bib-record-by-title-OCLC-number.cy.js | 1 + .../inventory/search/browseContributors.js | 25 +++++++++++++++++++ 13 files changed, 44 insertions(+), 20 deletions(-) diff --git a/cypress/e2e/checkout/checkout.notes.cy.js b/cypress/e2e/checkout/checkout.notes.cy.js index 001f386baf..bb47f9ba4c 100644 --- a/cypress/e2e/checkout/checkout.notes.cy.js +++ b/cypress/e2e/checkout/checkout.notes.cy.js @@ -81,7 +81,6 @@ describe('Check out', () => { Users.deleteViaApi(testData.userId); }); - // May be failing because of this bug (https://issues.folio.org/browse/STSMACOM-783) it( 'C356781 Verify that all notes assigned to user pop up when user scan patron card (“Delete” option) (Spitfire) (TaaS)', { tags: ['criticalPath', 'spitfire', 'C356781'] }, @@ -108,7 +107,6 @@ describe('Check out', () => { }, ); - // May be failing because of this bug (https://issues.folio.org/browse/STSMACOM-783) it( 'C380512 Verify that all notes assigned to user pop up when user scan patron card (“Close” option) (Spitfire) (TaaS)', { tags: ['extendedPath', 'spitfire', 'C380512'] }, diff --git a/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js index 75462d55e7..93f72e1c88 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js @@ -126,7 +126,8 @@ describe('Data Import', () => { before('Create test data and login', () => { cy.getAdminToken(); // make sure there are no duplicate authority records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C374167*'); + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C374167'); + InventoryInstances.deleteInstanceByTitleViaApi('C374167'); // create Match profile NewMatchProfile.createMatchProfileWithIncomingAndExistingRecordsViaApi(matchProfile) diff --git a/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js index e5c6d56971..580540f869 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js @@ -93,7 +93,7 @@ describe('Data Import', () => { const linkingTagAndValues = [ { rowIndex: 16, - value: 'C380511 Ludwig one, Beethoven, 1770-1827.', + value: 'C380511 Ludwig v. Beethoven, 1770-1827.', tag: '100', }, { @@ -312,7 +312,7 @@ describe('Data Import', () => { '100', '1', '\\', - '$a C380511 Ludwig van, Beethoven, $d 1770-1827', + '$a C380511 Ludwig v., Beethoven, $d 1770-1827', '$e composer.', '$0 http://id.loc.gov/authorities/names/n79107741', '', @@ -348,7 +348,7 @@ describe('Data Import', () => { '', ); QuickMarcEditor.verifyTagFieldAfterLinking( - 50, + 51, '700', '1', '2', @@ -358,7 +358,7 @@ describe('Data Import', () => { '', ); QuickMarcEditor.verifyTagFieldAfterUnlinking( - 51, + 50, '700', '1', '\\', diff --git a/cypress/e2e/inventory/contributors-browse/browse-in-inventory.cy.js b/cypress/e2e/inventory/contributors-browse/browse-in-inventory.cy.js index 072f0853dd..d7100ccaff 100644 --- a/cypress/e2e/inventory/contributors-browse/browse-in-inventory.cy.js +++ b/cypress/e2e/inventory/contributors-browse/browse-in-inventory.cy.js @@ -112,6 +112,7 @@ describe('Inventory', () => { InventorySearchAndFilter.switchToBrowseTab(); InventorySearchAndFilter.verifyKeywordsAsDefault(); BrowseContributors.select(); + BrowseContributors.waitForContributorToAppear(testData.contributorName); BrowseContributors.browse(testData.contributorName); BrowseContributors.checkAuthorityIconAndValueDisplayed(testData.contributorName); }, diff --git a/cypress/e2e/inventory/search-in-inventory/search-for-instance-by-contributor-case-insensitive.cy.js b/cypress/e2e/inventory/search-in-inventory/search-for-instance-by-contributor-case-insensitive.cy.js index 6fb324534c..cf76280a87 100644 --- a/cypress/e2e/inventory/search-in-inventory/search-for-instance-by-contributor-case-insensitive.cy.js +++ b/cypress/e2e/inventory/search-in-inventory/search-for-instance-by-contributor-case-insensitive.cy.js @@ -67,17 +67,9 @@ describe('Inventory', () => { describe('Case-insensitive checks', () => { before('Create test data, login', () => { cy.getAdminToken(); - InventoryInstances.getInstancesViaApi({ - limit: 100, - query: 'title="C464068 MSEARCH-696 Instance"', - }).then((instances) => { - if (instances) { - instances.forEach(({ id }) => { - InventoryInstance.deleteInstanceViaApi(id); - }); - } + ['C464068', 'C380454 '].forEach((instanceTitle) => { + InventoryInstances.deleteInstanceByTitleViaApi(instanceTitle); }); - cy.createTempUser([Permissions.uiInventoryViewInstances.gui]).then((userProperties) => { testData.user = userProperties; diff --git a/cypress/e2e/inventory/subject-browse/browse-subjects-linked.cy.js b/cypress/e2e/inventory/subject-browse/browse-subjects-linked.cy.js index a34b03e565..1c4c150424 100644 --- a/cypress/e2e/inventory/subject-browse/browse-subjects-linked.cy.js +++ b/cypress/e2e/inventory/subject-browse/browse-subjects-linked.cy.js @@ -41,6 +41,8 @@ describe('Inventory', () => { const createdRecordIDs = []; before('Creating data', () => { + InventoryInstances.deleteInstanceByTitleViaApi('C375163'); + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C375163'); cy.createTempUser([ Permissions.inventoryAll.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, diff --git a/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority-delete.cy.js b/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority-delete.cy.js index c97f5ce9a1..70e49e79b1 100644 --- a/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority-delete.cy.js +++ b/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority-delete.cy.js @@ -26,6 +26,7 @@ describe('MARC', () => { }; before('Creating data', () => { + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C357549'); cy.createTempUser([ Permissions.settingsDataImportView.gui, Permissions.moduleDataImportEnabled.gui, diff --git a/cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-local-authority-file.cy.js b/cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-local-authority-file.cy.js index 874859f365..287ce8478a 100644 --- a/cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-local-authority-file.cy.js +++ b/cypress/e2e/marc/marc-authority/create-marc-authority/create-new-marcAuth-record-with-local-authority-file.cy.js @@ -31,6 +31,7 @@ describe('MARC', () => { before('Create users, data', () => { cy.getAdminToken(); + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C423528'); cy.createTempUser([ Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityCreate.gui, diff --git a/cypress/e2e/marc/marc-authority/delete-two-marc-bib-linked-marc-authority.cy.js b/cypress/e2e/marc/marc-authority/delete-two-marc-bib-linked-marc-authority.cy.js index 6ba3400891..9aa422d0a1 100644 --- a/cypress/e2e/marc/marc-authority/delete-two-marc-bib-linked-marc-authority.cy.js +++ b/cypress/e2e/marc/marc-authority/delete-two-marc-bib-linked-marc-authority.cy.js @@ -80,8 +80,8 @@ describe('MARC', () => { before('Creating user', () => { cy.getAdminToken(); // make sure there are no duplicate authority records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('*C369084'); - InventoryInstances.deleteInstanceByTitleViaApi('C369084Crossfire*'); + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C369084'); + InventoryInstances.deleteInstanceByTitleViaApi('C369084'); cy.createTempUser([ Permissions.inventoryAll.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, diff --git a/cypress/e2e/marc/marc-authority/marc-authority-sort.cy.js b/cypress/e2e/marc/marc-authority/marc-authority-sort.cy.js index 0912f9d8b5..98a1052666 100644 --- a/cypress/e2e/marc/marc-authority/marc-authority-sort.cy.js +++ b/cypress/e2e/marc/marc-authority/marc-authority-sort.cy.js @@ -72,6 +72,7 @@ describe('MARC', () => { }; before(() => { + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('Type of heading test'); cy.createTempUser([Permissions.uiMarcAuthoritiesAuthorityRecordView.gui]).then( (createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/marc/marc-authority/modify-marc-auth-record-of-deleted-user.cy.js b/cypress/e2e/marc/marc-authority/modify-marc-auth-record-of-deleted-user.cy.js index 8da5d9f355..d13081294d 100644 --- a/cypress/e2e/marc/marc-authority/modify-marc-auth-record-of-deleted-user.cy.js +++ b/cypress/e2e/marc/marc-authority/modify-marc-auth-record-of-deleted-user.cy.js @@ -28,7 +28,7 @@ describe('MARC', () => { const marcFiles = [ { marc: 'marcAuthFileForC358994.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `C358994testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, numOfRecords: 1, }, @@ -37,6 +37,7 @@ describe('MARC', () => { const createdAuthorityIDs = []; before('Creating user', () => { + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C358994'); cy.createTempUser([ Permissions.moduleDataImportEnabled.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/search-created-marc-bib-record-by-title-OCLC-number.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/search-created-marc-bib-record-by-title-OCLC-number.cy.js index 59d4c47dd4..3b645ca21d 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/search-created-marc-bib-record-by-title-OCLC-number.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/search-created-marc-bib-record-by-title-OCLC-number.cy.js @@ -23,6 +23,7 @@ describe('MARC', () => { describe('MARC Bibliographic', () => { describe('Create new MARC bib', () => { before(() => { + InventoryInstances.deleteInstanceByTitleViaApi(testData.instanceTitle); cy.createTempUser([ Permissions.inventoryAll.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorCreate.gui, diff --git a/cypress/support/fragments/inventory/search/browseContributors.js b/cypress/support/fragments/inventory/search/browseContributors.js index ec5733572a..19877faf73 100644 --- a/cypress/support/fragments/inventory/search/browseContributors.js +++ b/cypress/support/fragments/inventory/search/browseContributors.js @@ -290,6 +290,31 @@ export default { }); }, + waitForContributorToAppear(contributorName, isPresent = true) { + return cy.recurse( + () => { + return cy.okapiRequest({ + method: 'GET', + path: 'browse/contributors/instances', + searchParams: { + query: `(name>="${contributorName}")`, + }, + isDefaultSearchParamsRequired: false, + }); + }, + (response) => { + const foundContributors = response.body.items.filter((item) => { + return item.name === contributorName; + }); + return isPresent ? foundContributors.length > 0 : foundContributors.length === 0; + }, + { + limit: 10, + delay: 5000, + }, + ); + }, + openInstance(contributor) { cy.do(MultiColumnListCell(contributor.name).hrefClick()); },