Skip to content

Commit

Permalink
eureka ecs critical path tests fixes pt.3
Browse files Browse the repository at this point in the history
  • Loading branch information
eremv committed Dec 19, 2024
1 parent d5101ec commit 65cd98c
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ describe('Data Import', () => {
Permissions.moduleDataImportEnabled.gui,
]);
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C405522');
cy.resetTenant();
cy.assignAffiliationToUser(Affiliations.College, users.userProperties.userId);
cy.setTenant(Affiliations.College);
cy.assignPermissionsToExistingUser(users.userProperties.userId, [
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Permissions.moduleDataImportEnabled.gui,
]);
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C405522');
cy.resetTenant();
})
.then(() => {
cy.login(users.userProperties.username, users.userProperties.password, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ describe('Data Import', () => {

before('Create test data and login', () => {
cy.getAdminToken();
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C405144');
// create user A
cy.createTempUser([
Permissions.moduleDataImportEnabled.gui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,7 @@ describe('Data Import', () => {

before('Create test data', () => {
cy.getAdminToken();
MarcAuthorities.getMarcAuthoritiesViaApi({
limit: 100,
query: 'keyword="C407696" and (authRefType==("Authorized" or "Auth/Ref"))',
}).then((authorities) => {
if (authorities) {
authorities.forEach(({ id }) => {
MarcAuthority.deleteViaAPI(id, true);
});
}
});
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C407696');
cy.createTempUser([
Permissions.inventoryAll.gui,
Permissions.moduleDataImportEnabled.gui,
Expand Down Expand Up @@ -309,7 +300,7 @@ describe('Data Import', () => {

ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.central);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY);
InventoryInstances.waitLoading();
InventoryInstances.waitContentLoading();
InventorySearchAndFilter.verifyPanesExist();
InventoryInstances.searchByTitle(createdAuthorityIDs[0]);
InventoryInstance.waitInstanceRecordViewOpened(testData.instanceTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation';
import UserEdit from '../../../../support/fragments/users/userEdit';
import Users from '../../../../support/fragments/users/users';
import getRandomPostfix from '../../../../support/utils/stringTools';
import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances';

function createFOLIOAndUploadMARCInstanceViaApi(titlesFOLIOInstance, marcFile, createdRecordsIds) {
titlesFOLIOInstance.forEach((title) => {
Expand Down Expand Up @@ -97,6 +98,10 @@ describe('Inventory', () => {

before('Create user, data', () => {
cy.getAdminToken();
InventoryInstances.deleteInstanceByTitleViaApi('C410702');
cy.setTenant(Affiliations.University);
InventoryInstances.deleteInstanceByTitleViaApi('C410702');
cy.resetTenant();
cy.createTempUser([
Permissions.uiInventoryViewInstances.gui,
Permissions.uiRequestsCreate.gui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('MARC', () => {
before('Create test data', () => {
cy.resetTenant();
cy.getAdminToken();
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C405142');
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
Expand Down Expand Up @@ -125,6 +126,8 @@ describe('MARC', () => {

ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
MarcAuthorities.waitLoading();
cy.reload();
MarcAuthorities.waitLoading();
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college);
MarcAuthorities.searchBeats(testData.updatedTitle);
MarcAuthorities.select(createdAuthorityID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ describe('MARC', () => {
QuickMarcEditor.clickArrowDownButton(4);
QuickMarcEditor.verifyTagValue(5, testData.tag010);
MarcAuthority.clickSaveAndCloseButton();
cy.wait(2000);
MarcAuthority.clickSaveAndCloseButton();
QuickMarcEditor.checkDeleteModal(1);
MarcAuthority.continueWithSaveAndCheck();
MarcAuthority.contains(testData.updatedTag100Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ describe('MARC', () => {

before('Create users, data', () => {
cy.getAdminToken();
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C407654');
cy.setTenant(Affiliations.University);
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C407654');
cy.resetTenant();
cy.createTempUser([
Permissions.inventoryAll.gui,
Expand Down Expand Up @@ -109,6 +112,8 @@ describe('MARC', () => {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
}).then(() => {
cy.reload();
InventoryInstances.waitContentLoading();
ConsortiumManager.switchActiveAffiliation(
tenantNames.central,
tenantNames.university,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ describe('MARC', () => {
before('Create users, data', () => {
cy.getAdminToken();
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C405927');
InventoryInstances.deleteInstanceByTitleViaApi('C405927');
cy.setTenant(Affiliations.University);
InventoryInstances.deleteInstanceByTitleViaApi('C405927');
cy.setTenant(Affiliations.College);
InventoryInstances.deleteInstanceByTitleViaApi('C405927');
cy.resetTenant();

cy.createTempUser([
Permissions.inventoryAll.gui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,12 @@ describe('MARC', () => {

before('Create users, data', () => {
cy.getAdminToken();
MarcAuthorities.getMarcAuthoritiesViaApi({
limit: 100,
query: 'keyword="C407633" and (authRefType==("Authorized" or "Auth/Ref"))',
}).then((authorities) => {
if (authorities) {
authorities.forEach(({ id }) => {
MarcAuthority.deleteViaAPI(id, true);
});
}
});
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C407633');
InventoryInstances.deleteInstanceByTitleViaApi('C407633');
cy.setTenant(Affiliations.University);
InventoryInstances.deleteInstanceByTitleViaApi('C407633');
cy.resetTenant();

cy.createTempUser([
Permissions.inventoryAll.gui,
Permissions.uiMarcAuthoritiesAuthorityRecordView.gui,
Expand Down Expand Up @@ -169,7 +165,7 @@ describe('MARC', () => {
cy.resetTenant();
cy.loginAsAdmin({
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitLoading,
waiter: InventoryInstances.waitContentLoading,
}).then(() => {
linkingInTenants.forEach((tenants) => {
ConsortiumManager.switchActiveAffiliation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ describe('MARC', () => {

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

MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C422141');

InventoryInstances.deleteInstanceByTitleViaApi('C422141');
cy.createTempUser([
Permissions.uiInventoryViewInstances.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorCreate.gui,
Expand All @@ -70,7 +69,6 @@ describe('MARC', () => {
]).then((userProperties) => {
users.userAProperties = userProperties;
});

cy.createTempUser([
Permissions.uiInventoryViewInstances.gui,
Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui,
Expand All @@ -91,6 +89,8 @@ describe('MARC', () => {
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
});
cy.reload();
DataImport.waitLoading();
cy.resetTenant();
marcFiles.forEach((marcFile) => {
DataImport.uploadFileViaApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ describe('MARC', () => {
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central);
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
InventoryInstances.waitContentLoading();
cy.reload();
InventoryInstances.waitContentLoading();
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,8 @@ describe('MARC', () => {

before('Create users, data', () => {
cy.getAdminToken();
MarcAuthorities.getMarcAuthoritiesViaApi({
limit: 100,
query: 'keyword="C410818" and (authRefType==("Authorized" or "Auth/Ref"))',
}).then((authorities) => {
if (authorities) {
authorities.forEach(({ id }) => {
MarcAuthority.deleteViaAPI(id, true);
});
}
['C410818', 'C410755', 'C410749'].forEach((title) => {
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI(title);
});

cy.createTempUser([
Expand Down Expand Up @@ -220,9 +213,11 @@ describe('MARC', () => {
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked600Field_2);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked650Field);
QuickMarcEditor.verifyTagFieldAfterUnlinking(...testData.notLinked710Field);
QuickMarcEditor.deleteField(4);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1000);
cy.wait(2000);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.confirmDelete();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkExpectedMARCSource();

Expand All @@ -234,6 +229,7 @@ describe('MARC', () => {
InventoryInstance.checkExpectedMARCSource();
InventoryInstance.editMarcBibliographicRecord();
QuickMarcEditor.checkPaneheaderContains(testData.editSharedRecordText);
QuickMarcEditor.addEmptyFields(4);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked100Field);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked600Field_1);
QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked600Field_2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ describe('MARC', () => {
QuickMarcEditor.updateExistingField(testData.tag100, testData.tag100UpdatedContent);
QuickMarcEditor.checkContentByTag(testData.tag100, testData.tag100UpdatedContent);
QuickMarcEditor.clickSaveAndKeepEditingButton();
QuickMarcEditor.clickSaveAndKeepEditingButton();
QuickMarcEditor.confirmDeletingFields();
QuickMarcEditor.checkAfterSaveAndKeepEditing();
QuickMarcEditor.checkContentByTag(testData.tag100, testData.tag100UpdatedContent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ describe('MARC', () => {
linkingTagAndValues.tag,
linkingTagAndValues.rowIndex,
);
QuickMarcEditor.deleteField(4);
QuickMarcEditor.pressSaveAndClose();
cy.wait(2000);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.confirmDelete();
QuickMarcEditor.checkAfterSaveAndClose();
});

Expand Down Expand Up @@ -199,7 +203,9 @@ describe('MARC', () => {
linkingTagAndValues.zeroSubfield,
linkingTagAndValues.seventhBox,
);
QuickMarcEditor.clickSaveAndKeepEditingButton();
QuickMarcEditor.clickSaveAndKeepEditing();

QuickMarcEditor.openLinkingAuthorityByIndex(16);
MarcAuthorities.checkFieldAndContentExistence(
linkingTagAndValues.tag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ describe('MARC', () => {
linkingTagAndValues.zeroSubfield,
linkingTagAndValues.seventhBox,
);
QuickMarcEditor.deleteField(4);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.confirmDelete();
cy.wait(2000);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkPresentedText(testData.updatedInstanceTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ describe('MARC', () => {
QuickMarcEditor.updateExistingField(testData.tag500, testData.tag500UpdatedValue);
QuickMarcEditor.moveFieldUp(18);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkInstanceTitle(testData.updatedTitle);
InventoryInstance.verifyLastUpdatedSource(
Expand All @@ -111,6 +113,9 @@ describe('MARC', () => {
waiter: InventoryInstances.waitContentLoading,
});
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
InventoryInstances.waitContentLoading();
cy.reload();
InventoryInstances.waitContentLoading();
InventoryInstances.searchByTitle(createdInstanceID);
InventoryInstances.selectInstance();
InventoryInstance.checkInstanceTitle(testData.updatedTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ describe('MARC', () => {

before('Create users, data', () => {
cy.getAdminToken();
cy.setTenant(Affiliations.University);
InventoryInstances.deleteInstanceByTitleViaApi('C405549');
cy.resetTenant();
cy.createTempUser([
Permissions.inventoryAll.gui,
Expand Down Expand Up @@ -105,6 +107,8 @@ describe('MARC', () => {
QuickMarcEditor.updateExistingField(testData.tag245, `$a ${testData.tag245Content}`);
QuickMarcEditor.updateExistingField(testData.tag500, `$a ${testData.tag500Content}`);
QuickMarcEditor.pressSaveAndClose();
cy.wait(1200);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
InventoryInstance.checkInstanceTitle(testData.tag245Content);
InventoryInstance.viewSource();
Expand Down

0 comments on commit 65cd98c

Please sign in to comment.