-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e437b92
commit 0116874
Showing
3 changed files
with
97 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...consortia/inventory/instance/duplicating-local-instance-on-member-with-source-folio.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
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 InventoryNewInstance from '../../../../support/fragments/inventory/inventoryNewInstance'; | ||
import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; | ||
import TopMenu from '../../../../support/fragments/topMenu'; | ||
import Users from '../../../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../../../support/utils/stringTools'; | ||
|
||
describe('Inventory', () => { | ||
describe('Instance', () => { | ||
const testData = { | ||
newResourceTitle: `C410923 instanceTitle${getRandomPostfix()}`, | ||
newResourceType: 'notated movement', | ||
source: INSTANCE_SOURCE_NAMES.FOLIO, | ||
}; | ||
|
||
before('Create test data', () => { | ||
cy.clearCookies({ domain: null }); | ||
cy.getAdminToken(); | ||
cy.setTenant(Affiliations.College); | ||
InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { | ||
testData.instance = instanceData; | ||
}); | ||
|
||
cy.resetTenant(); | ||
cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => { | ||
testData.user = userProperties; | ||
|
||
cy.assignAffiliationToUser(Affiliations.College, testData.user.userId); | ||
cy.setTenant(Affiliations.College); | ||
cy.assignPermissionsToExistingUser(testData.user.userId, [Permissions.inventoryAll.gui]); | ||
}); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.resetTenant(); | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.user.userId); | ||
cy.setTenant(Affiliations.College); | ||
InventoryInstance.deleteInstanceViaApi(testData.instance.instanceId); | ||
cy.getInstance({ | ||
limit: 1, | ||
expandAll: true, | ||
query: `"hrid"=="${testData.instanceHrid}"`, | ||
}).then((instance) => { | ||
InventoryInstance.deleteInstanceViaApi(instance.id); | ||
}); | ||
}); | ||
|
||
it( | ||
'C410923 (CONSORTIA) Duplicating local instance on Member tenant with Source FOLIO (folijet)', | ||
{ tags: ['extendedPathECS', 'folijet', 'C410923'] }, | ||
() => { | ||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.inventoryPath, | ||
waiter: InventoryInstances.waitContentLoading, | ||
}); | ||
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); | ||
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); | ||
InventoryInstances.searchByTitle(testData.instance.instanceId); | ||
InventoryInstances.selectInstance(); | ||
InventoryInstance.waitLoading(); | ||
InstanceRecordView.duplicate(); | ||
InventoryNewInstance.fillResourceTitle(testData.newResourceTitle); | ||
InventoryNewInstance.fillResourceType(testData.newResourceType); | ||
InventoryNewInstance.clickSaveAndCloseButton(); | ||
InventoryInstance.waitInstanceRecordViewOpened(testData.newResourceTitle); | ||
InventoryInstance.checkInstanceDetails({ | ||
instanceInformation: [{ key: 'Source', value: testData.source }], | ||
}); | ||
InventoryInstance.getAssignedHRID().then((initialInstanceHrId) => { | ||
testData.instanceHrid = initialInstanceHrId; | ||
}); | ||
}, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters