Skip to content

Commit

Permalink
Merge branch 'ramsons' into eureka-test-rbugfest
Browse files Browse the repository at this point in the history
  • Loading branch information
zentestuken committed Jan 27, 2025
2 parents dc123c9 + 95fe119 commit b860ac7
Show file tree
Hide file tree
Showing 27 changed files with 271 additions and 264 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,27 +240,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.getHoldingsFolioSource().then((holdingSources) => {
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: holdingSources.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,
});
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe('Data Import', () => {
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex);
});
QuickMarcEditor.pressSaveAndClose();
cy.wait(2000);
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,75 +72,76 @@ 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;
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 shared Instance
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) => {
testData.folioSourceId = folioSource.id;
})
.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: testData.sharedInstanceId,
permanentLocationId: testData.collegeLocation.id,
sourceId: collegeHoldingsSourceId,
}).then((holding) => {
testData.collegeHoldings.push(holding);

// adding Holdings in College for local Instance
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.sharedInstanceId,
instanceId: testData.localInstanceId,
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).then((holding) => {
testData.collegeHoldings.push(holding);
// adding Holdings in College for local Instance
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.localInstanceId,
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).then((holding2) => {
testData.collegeHoldings.push(holding2);
});
sourceId: collegeHoldingsSourceId,
}).then((holding2) => {
testData.collegeHoldings.push(holding2);
});
});
});
});
});

// 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,
sourceId: testData.folioSourceId,
}).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);
});
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,62 +243,60 @@ describe('Inventory', () => {
// 1 Local "Instance" record with source = "MARC" should have "Holdings" records created on Member 1 tenant

cy.setTenant(Affiliations.College);

InventoryHoldings.getHoldingsFolioSource()
.then((folioSource) => {
testData.folioSourceId = folioSource.id;
})
.then(() => {
InventoryHoldings.createHoldingRecordViaApi({
instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId,
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[0].createdRecordsId[1],
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[1].createdRecordsId[0],
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).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(() => {
// 1 Shared "Instance" record with source = "MARC" and 1 Shared "Instance" record with source = "FOLIO"
// should have "Holdings" records created on Member 2 tenant.
// 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,
sourceId: testData.folioSourceId,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[0].createdRecordsId[2],
permanentLocationId: testData.universityLocation.id,
sourceId: testData.folioSourceId,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[2].createdRecordsId[0],
permanentLocationId: testData.universityLocation.id,
sourceId: testData.folioSourceId,
}).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);
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,39 +164,37 @@ describe('Inventory', () => {

.then(() => {
cy.setTenant(Affiliations.College);
InventoryHoldings.getHoldingsFolioSource()
.then((folioSource) => {
testData.folioSourceId = folioSource.id;
})
.then(() => {
InventoryHoldings.createHoldingRecordViaApi({
instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId,
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[0].createdRecordsId[1],
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[1].createdRecordsId[0],
permanentLocationId: testData.collegeLocation.id,
sourceId: testData.folioSourceId,
}).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);
});

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();
});
});
});
Expand Down
Loading

0 comments on commit b860ac7

Please sign in to comment.