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/consortia/inventory/instance/share-local-instance-button-for-folio-instance.cy.js b/cypress/e2e/consortia/inventory/instance/share-local-instance-button-for-folio-instance.cy.js deleted file mode 100644 index 7f5276c677..0000000000 --- a/cypress/e2e/consortia/inventory/instance/share-local-instance-button-for-folio-instance.cy.js +++ /dev/null @@ -1,156 +0,0 @@ -import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; -import Permissions from '../../../../support/dictionary/permissions'; -import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; -import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; -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', () => { - const testData = {}; - - before('Create test data', () => { - cy.getAdminToken(); - cy.getConsortiaId().then((consortiaId) => { - testData.consortiaId = consortiaId; - }); - cy.setTenant(Affiliations.College); - InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { - testData.instance = instanceData; - InventoryInstance.shareInstanceViaApi( - testData.instance.instanceId, - testData.consortiaId, - Affiliations.College, - Affiliations.Consortia, - ); - }); - - cy.resetTenant(); - cy.getAdminToken(); - cy.createTempUser([ - Permissions.uiInventoryViewCreateInstances.gui, - Permissions.consortiaInventoryShareLocalInstance.gui, - ]).then((userProperties) => { - testData.user1 = userProperties; - }); - - cy.resetTenant(); - cy.getAdminToken(); - cy.createTempUser([Permissions.uiInventoryViewCreateInstances.gui]).then((userProperties) => { - testData.user2 = userProperties; - cy.assignAffiliationToUser(Affiliations.College, testData.user2.userId); - cy.setTenant(Affiliations.College); - cy.assignPermissionsToExistingUser(testData.user2.userId, [ - Permissions.uiInventoryViewCreateInstances.gui, - Permissions.consortiaInventoryShareLocalInstance.gui, - ]); - }); - - cy.resetTenant(); - cy.getAdminToken(); - cy.createTempUser([Permissions.uiInventoryViewCreateInstances.gui]).then((userProperties) => { - testData.user3 = userProperties; - }); - - cy.resetTenant(); - cy.getAdminToken(); - cy.createTempUser([Permissions.uiInventoryViewCreateInstances.gui]).then((userProperties) => { - testData.user4 = userProperties; - cy.assignAffiliationToUser(Affiliations.College, testData.user4.userId); - cy.setTenant(Affiliations.College); - cy.assignPermissionsToExistingUser(testData.user4.userId, [ - Permissions.uiInventoryViewCreateInstances.gui, - ]); - }); - }); - - after('Delete test data', () => { - cy.resetTenant(); - cy.getAdminToken(); - InventoryInstance.deleteInstanceViaApi(testData.instance.instanceId); - Users.deleteViaApi(testData.user1.userId); - Users.deleteViaApi(testData.user2.userId); - Users.deleteViaApi(testData.user3.userId); - Users.deleteViaApi(testData.user4.userId); - }); - - it( - 'C411343 (CONSORTIA) Check the "Share local instance" button on a Source = FOLIO Instance on Central tenant (consortia) (folijet)', - { tags: ['extendedPathECS', 'folijet', 'C411343'] }, - () => { - cy.login(testData.user1.username, testData.user1.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - - InventoryInstances.waitContentLoading(); - cy.intercept('POST', '/authn/refresh').as('/authn/refresh'); - InventoryInstances.searchByTitle(testData.instance.instanceTitle); - cy.wait('@/authn/refresh', { timeout: 5000 }); - InventoryInstances.selectInstance(); - - InventoryInstance.waitLoading(); - InventoryInstance.checkShareLocalInstanceButtonIsAbsent(); - }, - ); - - it( - 'C411329 (CONSORTIA) Check the "Share local instance" button on a shared Source = FOLIO Instance on Member tenant (consortia) (folijet)', - { tags: ['extendedPathECS', 'folijet', 'C411329'] }, - () => { - cy.login(testData.user2.username, testData.user2.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); - ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); - InventoryInstances.waitContentLoading(); - InventoryInstances.searchByTitle(testData.instance.instanceTitle); - InventoryInstances.selectInstance(); - InventoryInstance.waitLoading(); - InventoryInstance.checkShareLocalInstanceButtonIsAbsent(); - }, - ); - - it( - 'C411345 (CONSORTIA) Check the "Share local instance" button without permission on a Source = FOLIO Instance on Central tenant (consortia) (folijet)', - { tags: ['extendedPathECS', 'folijet', 'C411345'] }, - () => { - cy.login(testData.user3.username, testData.user3.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); - InventoryInstances.waitContentLoading(); - InventoryInstances.searchByTitle(testData.instance.instanceTitle); - InventoryInstances.selectInstance(); - InventoryInstance.waitLoading(); - InventoryInstance.checkShareLocalInstanceButtonIsAbsent(); - }, - ); - - it( - 'C411334 (CONSORTIA) Check the "Share local instance" button without permission on a local Source = FOLIO Instance on Member tenant (consortia) (folijet)', - { tags: ['extendedPathECS', 'folijet', 'C411334'] }, - () => { - cy.login(testData.user4.username, testData.user4.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); - ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); - ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); - InventoryInstances.waitContentLoading(); - InventoryInstances.searchByTitle(testData.instance.instanceTitle); - InventoryInstances.selectInstance(); - InventoryInstance.waitLoading(); - InventoryInstance.checkShareLocalInstanceButtonIsAbsent(); - }, - ); - }); -}); diff --git a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js index d255d1e47f..412a877517 100644 --- a/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-pol-and-update-items.cy.js @@ -174,7 +174,7 @@ describe('Data Import', () => { Permissions.uiOrdersEdit.gui, Permissions.uiInventoryViewCreateEditHoldings.gui, Permissions.uiInventoryViewCreateEditInstances.gui, - Permissions.uiInventoryViewCreateEditItems, + Permissions.uiInventoryViewCreateEditItems.gui, Permissions.settingsDataImportEnabled.gui, Permissions.moduleDataImportEnabled.gui, Permissions.uiReceivingViewEditCreate.gui, 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], ); diff --git a/cypress/support/fragments/lists/lists.js b/cypress/support/fragments/lists/lists.js index 146f592d7e..6dc31cd656 100644 --- a/cypress/support/fragments/lists/lists.js +++ b/cypress/support/fragments/lists/lists.js @@ -36,7 +36,7 @@ const editList = Button('Edit list'); const duplicateList = Button('Duplicate list'); const deleteList = Button('Delete list'); const exportList = Button('Export all columns (CSV)'); -const exportListVisibleColumns = Button('Export visible columns (CSV)'); +const exportListVisibleColumns = Button('Export selected columns (CSV)'); const testQuery = Button('Test query'); const runQueryAndSave = Button('Run query & save'); const filterPane = Pane('Filter');