Skip to content

Commit

Permalink
test fixes for eureka ecs pt1 (#4558)
Browse files Browse the repository at this point in the history
  • Loading branch information
eremv authored Dec 16, 2024
1 parent 3dcabb7 commit af3ece3
Show file tree
Hide file tree
Showing 15 changed files with 111 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ describe('Data Import', () => {
];
const linkingTagAndValues = [
{
rowIndex: 21,
rowIndex: 20,
value: 'C411802 Marvel comics',
tag: '630',
content:
'$a C411802 Marvel comics $t Comiket $v Periodicals. $z United States $w 830 $0 800269554076962001 $2 fast',
},
{
rowIndex: 22,
rowIndex: 21,
value: 'C411802 Speaking Oratory',
tag: '650',
content: '$a C411802 Speaking Oratory $b debating $2 fast',
},
{
rowIndex: 27,
rowIndex: 26,
value: 'C411802 Radio "Vaticana".',
tag: '710',
boxFourth: '$a C411802 Radio "Vaticana". $b Hrvatski program',
Expand Down Expand Up @@ -213,6 +213,8 @@ describe('Data Import', () => {
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex);
});
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
})
.then(() => {
Expand Down Expand Up @@ -243,11 +245,15 @@ describe('Data Import', () => {
}).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((holdingSources) => {
InventoryHoldings.createHoldingRecordViaApi({
instanceId: createdAuthorityIDs[0],
permanentLocationId: testData.collegeLocation.id,
sourceId: holdingSources.id,
}).then((holding) => {
testData.collegeHoldings.push(holding);
});
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
APPLICATION_NAMES,
DEFAULT_JOB_PROFILE_NAMES,
EXISTING_RECORD_NAMES,
FOLIO_RECORD_TYPE,
Expand Down Expand Up @@ -31,6 +32,7 @@ import TopMenu from '../../../../support/fragments/topMenu';
import Users from '../../../../support/fragments/users/users';
import FileManager from '../../../../support/utils/fileManager';
import getRandomPostfix from '../../../../support/utils/stringTools';
import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation';

describe('Data Import', () => {
describe('Importing MARC Bib files', () => {
Expand Down Expand Up @@ -212,6 +214,8 @@ describe('Data Import', () => {
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex);
});
QuickMarcEditor.pressSaveAndClose();
cy.wait(2000);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
})
.then(() => {
Expand Down Expand Up @@ -274,7 +278,9 @@ describe('Data Import', () => {
InventorySearchAndFilter.saveUUIDs();
ExportFile.downloadCSVFile(nameForCSVFile, 'SearchInstanceUUIDs*');
FileManager.deleteFolder(Cypress.config('downloadsFolder'));
cy.visit(TopMenu.dataExportPath);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.DATA_EXPORT);
ExportFile.waitLoading();

// download exported marc file
ExportFile.uploadFile(nameForCSVFile);
ExportFile.exportWithDefaultJobProfile(nameForCSVFile);
Expand All @@ -290,7 +296,8 @@ describe('Data Import', () => {
);

// upload the exported marc file with 999.f.f.s fields
cy.visit(TopMenu.dataImportPath);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.DATA_IMPORT);
DataImport.waitLoading();
DataImport.verifyUploadState();
DataImport.uploadFile(nameForUpdatedMarcFile, nameForUpdatedMarcFile);
JobProfiles.waitLoadingList();
Expand All @@ -301,7 +308,8 @@ describe('Data Import', () => {
Logs.openFileDetails(nameForUpdatedMarcFile);

ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.central);
cy.visit(TopMenu.inventoryPath);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY);
InventoryInstances.waitLoading();
InventorySearchAndFilter.verifyPanesExist();
InventoryInstances.searchByTitle(createdAuthorityIDs[0]);
InventoryInstance.waitInstanceRecordViewOpened(testData.instanceTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ describe('MARC', () => {
startWithNumber: '1',
searchOption: 'Keyword',
marcValue: 'Create a new Shared MARC authority record with Local authority file test',
marcValueShared:
'Shared\nCreate a new Shared MARC authority record with Local authority file test',
headerText: 'Create a new shared MARC authority record',
AUTHORIZED: 'Authorized',
sharedIcon: 'Shared',
Expand Down Expand Up @@ -78,9 +80,9 @@ describe('MARC', () => {
cy.resetTenant();
cy.getAdminToken();
Users.deleteViaApi(users.userProperties.userId);
MarcAuthority.deleteViaAPI(testData.authorityId);
MarcAuthority.deleteViaAPI(testData.authorityId, true);
ManageAuthorityFiles.unsetAllDefaultFOLIOFilesAsActiveViaAPI();
cy.deleteAuthoritySourceFileViaAPI(testData.authSourceID);
cy.deleteAuthoritySourceFileViaAPI(testData.authSourceID, true);
});

it(
Expand All @@ -95,7 +97,9 @@ describe('MARC', () => {
QuickMarcEditor.verifyAuthorityFileSelected(testData.sourceName);
QuickMarcEditor.clickSaveAndCloseInModal();
QuickMarcEditor.checkContentByTag('001', `${testData.prefix}${testData.startWithNumber}`);
MarcAuthority.addNewField(4, newField.tag, newField.content);
MarcAuthority.addNewField(3, newField.tag, newField.content);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
MarcAuthority.verifyAfterSaveAndClose();
QuickMarcEditor.verifyPaneheaderWithContentAbsent(testData.headerText);
Expand All @@ -114,7 +118,7 @@ describe('MARC', () => {

MarcAuthorities.chooseAuthoritySourceOption(testData.sourceName);
MarcAuthorities.checkResultsSelectedByAuthoritySource([testData.sourceName]);
MarcAuthorities.selectTitle(testData.marcValue);
MarcAuthorities.selectTitle(testData.marcValueShared);
MarcAuthorities.checkAfterSearch(
testData.AUTHORIZED,
`${testData.sharedIcon}${testData.marcValue}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import InventoryInstances from '../../../../support/fragments/inventory/inventor
import getRandomPostfix from '../../../../support/utils/stringTools';
import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance';
import DataImport from '../../../../support/fragments/data_import/dataImport';
import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import { DEFAULT_JOB_PROFILE_NAMES, APPLICATION_NAMES } from '../../../../support/constants';
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor';
import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager';
import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority';
import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities';
import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter';
import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation';

describe('MARC', () => {
describe('MARC Authority', () => {
Expand Down Expand Up @@ -129,6 +130,8 @@ describe('MARC', () => {
linkingTagAndValues.rowIndex,
);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
});
});
Expand All @@ -147,7 +150,8 @@ describe('MARC', () => {
'C407654 Update local linked "MARC Authority" record in member tenant (consortia) (spitfire)',
{ tags: ['criticalPathECS', 'spitfire', 'C407654'] },
() => {
cy.visit(TopMenu.marcAuthorities);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.MARC_AUTHORITY);
MarcAuthorities.waitLoading();
MarcAuthorities.searchBy(testData.authoritySearchOption, testData.authorityTitle);
MarcAuthorities.selectTitle(testData.authorityTitle);
MarcAuthority.edit();
Expand All @@ -157,9 +161,12 @@ describe('MARC', () => {
// if clicked too fast, delete modal might not appear
cy.wait(1000);
QuickMarcEditor.pressSaveAndClose();
cy.wait(2000);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.verifyUpdateLinkedBibsKeepEditingModal(1);
QuickMarcEditor.confirmUpdateLinkedBibsKeepEditing(1);
cy.visit(TopMenu.inventoryPath);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY);
InventoryInstances.waitLoading();
InventoryInstances.searchByTitle(createdRecordIDs[0]);
InventoryInstances.selectInstance();
InventoryInstance.editMarcBibliographicRecord();
Expand All @@ -185,13 +192,15 @@ describe('MARC', () => {
InventoryInstance.verifyNoResultFoundMessage(
`No results found for "${testData.instanceTitle}". Please check your spelling and filters.`,
);
cy.visit(TopMenu.marcAuthorities);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.MARC_AUTHORITY);
MarcAuthorities.waitLoading();
MarcAuthorities.searchBy(testData.authoritySearchOption, testData.updated100FieldValue);
MarcAuthorities.checkNoResultsMessage(
`No results found for "${testData.updated100FieldValue}". Please check your spelling and filters.`,
);

cy.visit(TopMenu.inventoryPath);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY);
InventoryInstances.waitLoading();
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
InventoryInstances.waitContentLoading();
InventorySearchAndFilter.searchByParameter(
Expand All @@ -201,7 +210,8 @@ describe('MARC', () => {
InventoryInstance.verifyNoResultFoundMessage(
`No results found for "${testData.instanceTitle}". Please check your spelling and filters.`,
);
cy.visit(TopMenu.marcAuthorities);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.MARC_AUTHORITY);
MarcAuthorities.waitLoading();
MarcAuthorities.searchBy(testData.authoritySearchOption, testData.updated100FieldValue);
MarcAuthorities.checkNoResultsMessage(
`No results found for "${testData.updated100FieldValue}". Please check your spelling and filters.`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ describe('MARC', () => {

before('Create users, data', () => {
cy.getAdminToken();
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C405927');

cy.createTempUser([
Permissions.inventoryAll.gui,
Expand Down Expand Up @@ -154,6 +155,7 @@ describe('MARC', () => {
});
})
.then(() => {
cy.resetTenant();
cy.loginAsAdmin({
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
Expand All @@ -177,6 +179,8 @@ describe('MARC', () => {
linkingTagAndValues.rowIndex,
);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import InventoryInstances from '../../../../support/fragments/inventory/inventor
import getRandomPostfix from '../../../../support/utils/stringTools';
import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance';
import DataImport from '../../../../support/fragments/data_import/dataImport';
import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import { DEFAULT_JOB_PROFILE_NAMES, APPLICATION_NAMES } from '../../../../support/constants';
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor';
import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager';
import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority';
import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities';
import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation';

describe('MARC', () => {
describe('MARC Authority', () => {
Expand Down Expand Up @@ -125,7 +126,6 @@ describe('MARC', () => {
})
.then(() => {
cy.assignAffiliationToUser(Affiliations.University, users.userProperties.userId);
cy.assignAffiliationToUser(Affiliations.College, users.userProperties.userId);
cy.setTenant(Affiliations.University);
cy.assignPermissionsToExistingUser(users.userProperties.userId, [
Permissions.inventoryAll.gui,
Expand All @@ -134,8 +134,10 @@ describe('MARC', () => {
Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui,
]);
cy.resetTenant();
})
.then(() => {
cy.assignAffiliationToUser(Affiliations.College, users.userProperties.userId);
cy.setTenant(Affiliations.College);
cy.assignPermissionsToExistingUser(users.userProperties.userId, [
Permissions.inventoryAll.gui,
Expand Down Expand Up @@ -165,28 +167,36 @@ describe('MARC', () => {
})
.then(() => {
cy.resetTenant();
cy.loginAsAdmin();
cy.visit(TopMenu.inventoryPath);
linkingInTenants.forEach((tenants) => {
ConsortiumManager.switchActiveAffiliation(tenants.currentTeant, tenants.openingTenat);
InventoryInstances.waitContentLoading();
tenants.linkingInstances.forEach((instance) => {
InventoryInstances.searchByTitle(instance);
InventoryInstances.selectInstanceByTitle(instance);
cy.wait(2000);
InventoryInstance.editMarcBibliographicRecord();
QuickMarcEditor.clickLinkIconInTagField(linkingTagAndValues.rowIndex);
MarcAuthorities.switchToSearch();
InventoryInstance.verifySelectMarcAuthorityModal();
InventoryInstance.verifySearchOptions();
InventoryInstance.searchResults(linkingTagAndValues.value);
InventoryInstance.clickLinkButton();
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(
linkingTagAndValues.tag,
linkingTagAndValues.rowIndex,
cy.loginAsAdmin({
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitLoading,
}).then(() => {
linkingInTenants.forEach((tenants) => {
ConsortiumManager.switchActiveAffiliation(
tenants.currentTeant,
tenants.openingTenat,
);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstances.waitContentLoading();
tenants.linkingInstances.forEach((instance) => {
InventoryInstances.searchByTitle(instance);
InventoryInstances.selectInstanceByTitle(instance);
cy.wait(2000);
InventoryInstance.editMarcBibliographicRecord();
QuickMarcEditor.clickLinkIconInTagField(linkingTagAndValues.rowIndex);
MarcAuthorities.switchToSearch();
InventoryInstance.verifySelectMarcAuthorityModal();
InventoryInstance.verifySearchOptions();
InventoryInstance.searchResults(linkingTagAndValues.value);
InventoryInstance.clickLinkButton();
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(
linkingTagAndValues.tag,
linkingTagAndValues.rowIndex,
);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
});
});
});
});
Expand Down Expand Up @@ -227,9 +237,12 @@ describe('MARC', () => {
// if clicked too fast, delete modal might not appear
cy.wait(1000);
QuickMarcEditor.pressSaveAndClose();
cy.wait(2000);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.verifyUpdateLinkedBibsKeepEditingModal(4);
QuickMarcEditor.confirmUpdateLinkedBibsKeepEditing(4);
cy.visit(TopMenu.inventoryPath);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY);
InventoryInstances.waitLoading();
instancesToCheckInM1.forEach((instance) => {
InventoryInstances.searchByTitle(instance);
InventoryInstances.selectInstanceByTitle(instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ describe('MARC', () => {
'$e writer',
);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.getId().then((id) => {
createdRecordsID.push(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ describe('MARC', () => {
QuickMarcEditor.verifyTagFieldAfterLinking(...linked700Field);
QuickMarcEditor.verifyTagFieldAfterUnlinking(...notLinked710Field);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndCloseDerive();
InventoryInstance.checkPresentedText(testData.instanceEditedTitle);
InventoryInstance.checkSharedTextInDetailView(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ describe('MARC', () => {
linkingTagAndValues.seventhBox,
);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkPresentedText(testData.updatedInstanceTitle);
InventoryInstance.verifyRecordAndMarcAuthIcon(
Expand Down
Loading

0 comments on commit af3ece3

Please sign in to comment.