From c1197161f4ccf1d40debd6383519488ce2d9bc75 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:16:35 +0200 Subject: [PATCH] Fat 17700 (#4570) * deleted test * fixed C350590 * fixed tests --- ...-for-shared-folio-instance-on-member.cy.js | 70 +++++++++++++++++++ ...-for-shared-marc-instance-on-member.cy.js} | 45 +++--------- .../e2e/match-on-vrn-and-update-items.cy.js | 6 +- 3 files changed, 79 insertions(+), 42 deletions(-) create mode 100644 cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-folio-instance-on-member.cy.js rename cypress/e2e/consortia/inventory/instance/{limited-edit-permissions-for-shared-marc-folio-instance-on-member.cy.js => limited-edit-permissions-for-shared-marc-instance-on-member.cy.js} (61%) diff --git a/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-folio-instance-on-member.cy.js b/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-folio-instance-on-member.cy.js new file mode 100644 index 0000000000..d7bac6c30f --- /dev/null +++ b/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-folio-instance-on-member.cy.js @@ -0,0 +1,70 @@ +import { INSTANCE_SOURCE_NAMES } from '../../../../support/constants'; +import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; +import Permissions from '../../../../support/dictionary/permissions'; +import InstanceRecordView from '../../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; +import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; +import TopMenu from '../../../../support/fragments/topMenu'; +import Users from '../../../../support/fragments/users/users'; + +describe('Inventory', () => { + describe('Instance', () => { + let user; + const testData = { + instanceSource: INSTANCE_SOURCE_NAMES.FOLIO, + }; + + before('Create test data', () => { + cy.getAdminToken(); + InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { + testData.instance = instanceData; + }); + + cy.createTempUser([Permissions.uiInventoryViewInstances.gui]) + .then((userProperties) => { + user = userProperties; + }) + .then(() => { + cy.assignAffiliationToUser(Affiliations.College, user.userId); + cy.setTenant(Affiliations.College); + cy.assignPermissionsToExistingUser(user.userId, [ + Permissions.uiInventoryViewCreateEditInstances.gui, + ]); + }); + }); + + beforeEach('Login', () => { + cy.login(user.username, user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); + ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); + }); + + after('Delete test data', () => { + cy.resetTenant(); + cy.getAdminToken(); + InventoryInstance.deleteInstanceViaApi(testData.instance.instanceId); + Users.deleteViaApi(user.userId); + }); + + it( + 'C402376 (CONSORTIA) Verify limited Edit permissions for Shared FOLIO instance on Member tenant (consortia) (folijet)', + { tags: ['criticalPathECS', 'folijet', 'C402376'] }, + () => { + InventorySearchAndFilter.verifySearchAndFilterPane(); + InventorySearchAndFilter.bySource(testData.instanceSource); + cy.wait(1500); + InventorySearchAndFilter.byShared('Yes'); + cy.wait(1500); + InventorySearchAndFilter.searchInstanceByTitle(testData.instance.instanceId); + InventorySearchAndFilter.verifyInstanceDetailsView(); + InstanceRecordView.verifyInstanceSource(testData.instanceSource); + InstanceRecordView.verifyEditInstanceButtonAbsent(); + }, + ); + }); +}); diff --git a/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-folio-instance-on-member.cy.js b/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-instance-on-member.cy.js similarity index 61% rename from cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-folio-instance-on-member.cy.js rename to cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-instance-on-member.cy.js index 8dceefa57e..0508011a17 100644 --- a/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-folio-instance-on-member.cy.js +++ b/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-instance-on-member.cy.js @@ -14,30 +14,22 @@ import getRandomPostfix from '../../../../support/utils/stringTools'; describe('Inventory', () => { describe('Instance', () => { let user; - const C402335testData = { + const testData = { filePath: 'oneMarcBib.mrc', marcFileName: `C402335 autotestFileName${getRandomPostfix()}.mrc`, instanceSource: INSTANCE_SOURCE_NAMES.MARC, }; - const C402376testData = { - instanceSource: INSTANCE_SOURCE_NAMES.FOLIO, - }; before('Create test data', () => { cy.getAdminToken(); DataImport.uploadFileViaApi( - C402335testData.filePath, - C402335testData.marcFileName, + testData.filePath, + testData.marcFileName, DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, ).then((response) => { - C402335testData.instanceId = response[0].instance.id; - }); - InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { - C402376testData.instance = instanceData; + testData.instanceId = response[0].instance.id; }); - cy.resetTenant(); - cy.getAdminToken(); cy.createTempUser([Permissions.uiInventoryViewInstances.gui]) .then((userProperties) => { user = userProperties; @@ -63,8 +55,7 @@ describe('Inventory', () => { after('Delete test data', () => { cy.resetTenant(); cy.getAdminToken(); - InventoryInstance.deleteInstanceViaApi(C402335testData.instanceId); - InventoryInstance.deleteInstanceViaApi(C402376testData.instance.instanceId); + InventoryInstance.deleteInstanceViaApi(testData.instanceId); Users.deleteViaApi(user.userId); }); @@ -72,34 +63,14 @@ describe('Inventory', () => { 'C402335 (CONSORTIA) Verify limited Edit permissions for Shared MARC instance on Member tenant (consortia) (folijet)', { tags: ['criticalPathECS', 'folijet', 'C402335'] }, () => { - cy.intercept('POST', '/authn/refresh').as('/authn/refresh'); - InventorySearchAndFilter.verifySearchAndFilterPane(); - InventorySearchAndFilter.bySource(C402335testData.instanceSource); - cy.wait(1500); - InventorySearchAndFilter.byShared('Yes'); - cy.wait(1500); - InventorySearchAndFilter.searchInstanceByTitle(C402335testData.instanceId); - cy.wait('@/authn/refresh', { timeout: 5000 }); - InventorySearchAndFilter.verifyInstanceDetailsView(); - InstanceRecordView.verifyInstanceSource(C402335testData.instanceSource); - InstanceRecordView.verifyEditInstanceButtonAbsent(); - }, - ); - - it( - 'C402376 (CONSORTIA) Verify limited Edit permissions for Shared FOLIO instance on Member tenant (consortia) (folijet)', - { tags: ['criticalPathECS', 'folijet', 'C402376'] }, - () => { - cy.intercept('POST', '/authn/refresh').as('/authn/refresh'); InventorySearchAndFilter.verifySearchAndFilterPane(); - InventorySearchAndFilter.bySource(C402376testData.instanceSource); + InventorySearchAndFilter.bySource(testData.instanceSource); cy.wait(1500); InventorySearchAndFilter.byShared('Yes'); cy.wait(1500); - InventorySearchAndFilter.searchInstanceByTitle(C402376testData.instance.instanceId); - cy.wait('@/authn/refresh', { timeout: 5000 }); + InventorySearchAndFilter.searchInstanceByTitle(testData.instanceId); InventorySearchAndFilter.verifyInstanceDetailsView(); - InstanceRecordView.verifyInstanceSource(C402376testData.instanceSource); + InstanceRecordView.verifyInstanceSource(testData.instanceSource); InstanceRecordView.verifyEditInstanceButtonAbsent(); }, ); diff --git a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js index c0f96de355..4113e44b47 100644 --- a/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-vrn-and-update-items.cy.js @@ -231,11 +231,7 @@ describe('Data Import', () => { DataImport.editMarcFile( 'marcFileForC350591.mrc', editedMarcFileName, - [ - 'Agrarianism and capitalism in early Georgia, 1732-1743 /', - '14567-1', - 'xyzt124245271818912626262', - ], + ['Cornell University Graduate School records,', '14567-1', 'xyzt124245271818912626262'], [uniquePartOfInstanceTitle, item.vrn, itemBarcode], );