Skip to content

Commit

Permalink
Merge branch 'eureka-test-rbugfest' of https://github.com/folio-org/s…
Browse files Browse the repository at this point in the history
…tripes-testing into FAT-17760
  • Loading branch information
TetianaParanich committed Dec 20, 2024
2 parents 550c8d3 + 3c7d6c8 commit d42deb5
Show file tree
Hide file tree
Showing 58 changed files with 419 additions and 308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ describe('Consortia', () => {
TopMenuNavigation.navigateToApp('Consortium manager');
ConsortiumManager.verifyStatusOfConsortiumManager();
ConsortiumManager.verifyMembersSelected();
ConsortiumManager.verifyPaneIncludesSettings(settingsList.sort());
ConsortiumManager.verifyPaneIncludesSettings(settingsList);
const randomSetting = Arrays.getRandomElement(settingsList);
chooseSettingItem(randomSetting, 1);
cy.wait(4000);
ConsortiumManager.clickSelectMembers();
SelectMembers.changeSelectAllCheckbox('check');
SelectMembers.verifyStatusOfSelectMembersModal(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ describe('Consortia', () => {

ConsortiumManagerApp.chooseSettingsItem(settingsItems.inventory);
AlternativeTitleTypesConsortiumManager.choose();

ConsortiaControlledVocabularyPaneset.createViaUi(true, alternativeTitleTypes3);
ConsortiaControlledVocabularyPaneset.clickSave();

let rowDataToCheck = [
alternativeTitleTypes3.name,
'consortium',
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('Consortia', () => {

SelectMembers.saveAndClose();
ConsortiumManagerApp.verifyListIsEmpty();
ConsortiaControlledVocabularyPaneset.verifyNewButtonDisabled();
ConsortiaControlledVocabularyPaneset.verifyNewButtonAbsent();

cy.visit(SettingsMenu.alternativeTitleTypes);
ConsortiaControlledVocabularyPaneset.verifyRecordInTheList(rowDataToCheck.slice(0, -1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('Consortia', () => {
const rowDataToCheck = [...Object.values(sharedPatronGroups1), moment().format('l'), 'All'];

before('Create users data', () => {
cy.clearCookies({ domain: null });
cy.getAdminToken()
.then(() => {
cy.createTempUser([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('Consortium manager', () => {
describe('View settings', () => {
describe('View Request cancellation reasons', () => {
before('create test data', () => {
cy.clearCookies({ domain: null });
cy.getAdminToken();
RequestCancellationReasonsConsortiumManager.createViaApi(testData.centralSharedReason).then(
(newReason) => {
Expand Down Expand Up @@ -66,7 +67,7 @@ describe('Consortium manager', () => {
waiter: ConsortiumManagerApp.waitLoading,
});
SelectMembers.selectAllMembers();
ConsortiumManagerApp.verifyStatusOfConsortiumManager(7);
ConsortiumManagerApp.verifyStatusOfConsortiumManager(13);
ConsortiumManagerApp.chooseSettingsItem(settingsItems.circulation);
RequestCancellationReasonsConsortiumManager.choose();

Expand Down Expand Up @@ -118,7 +119,7 @@ describe('Consortium manager', () => {
cy.login(testData.user400666.username, testData.user400666.password);
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
cy.visit(SettingsMenu.circulationRequestCancellationReasonsPath);

cy.wait(4000);

Check failure on line 122 in cypress/e2e/consortia/consortium-manager/user-is-not-able-to-edit-and-delete-from-member-tenant-circulation.cy.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Expected indentation of 10 spaces but found 0

Check failure on line 122 in cypress/e2e/consortia/consortium-manager/user-is-not-able-to-edit-and-delete-from-member-tenant-circulation.cy.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Expected indentation of 10 spaces but found 0
CancellationReason.verifyReasonInTheList({
name: testData.centralSharedReason.payload.name,
});
Expand All @@ -127,10 +128,7 @@ describe('Consortium manager', () => {
name: testData.collegeLocalReason.name,
actions: ['edit', 'trash'],
});

CancellationReason.clickTrashButtonForReason({
name: testData.collegeLocalReason.name,
});
CancellationReason.clickTrashButtonForReason(testData.collegeLocalReason.name);

ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.university);
cy.visit(SettingsMenu.circulationRequestCancellationReasonsPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ describe('Consortium manager', () => {
name: testData.centralSharedHoldingsNoteTypes.payload.name,
source: 'consortium',
});

HoldingsNoteTypes.verifyLocalHoldingsNoteTypesInTheList({
name: testData.collegeLocalHoldingsNoteType.name,
actions: ['edit', 'trash'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Consortium manager', () => {
permissions.inventoryCRUDItemNoteTypes.gui,
permissions.uiCreateEditDeleteLoanTypes.gui,
]);
ItemNoteTypes.createNoteTypeViaApi(testData.collegeLocalItemNoteTypes);
ItemNoteTypes.createItemNoteTypeViaApi(testData.collegeLocalItemNoteTypes);
LoanTypes.createLoanTypesViaApi(testData.collegeLocalLoanTypes);
cy.resetTenant();
cy.getAdminToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ describe('Consortium manager', () => {
describe('View settings', () => {
describe('View Departments', () => {
before('create test data', () => {
cy.clearCookies({ domain: null });

cy.getAdminToken();
DepartmentsConsortiumManager.createViaApi(testData.centralSharedDepartment).then(
(newDepartment) => {
Expand Down
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 Expand Up @@ -203,7 +204,7 @@ describe('Data Import', () => {
MarcAuthorities.verifyAllCheckboxesAreUnchecked();
MarcAuthorities.verifyTextOfPaneHeaderMarcAuthority('1 record found');

TopMenuNavigation.openAppFromDropdown(APPLICATION_NAMES.DATA_EXPORT);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.DATA_EXPORT);
ExportFile.uploadFile(testData.csvFile);
ExportFile.exportWithDefaultJobProfile(testData.csvFile, 'authority', 'Authorities');
ExportFile.downloadExportedMarcFile(testData.exportedMarcFile);
Expand All @@ -215,7 +216,7 @@ describe('Data Import', () => {
testData.modifiedMarcFile,
);
// upload the exported marc file with 999.f.f.s fields
TopMenuNavigation.openAppFromDropdown(APPLICATION_NAMES.DATA_IMPORT);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.DATA_IMPORT);
DataImport.verifyUploadState();
DataImport.uploadFile(testData.modifiedMarcFile, testData.uploadModifiedMarcFile);
JobProfiles.waitLoadingList();
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 @@ -72,7 +72,7 @@ describe('Consortia', () => {
tenantErrors.code,
tenantErrors.name,
);
ConsortiumManager.cancelEditingTenantInformation(2);
ConsortiumManager.cancelEditingTenantInformation(6);
},
);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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,
]);

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();
},
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,23 +40,20 @@ describe('Inventory', () => {
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);
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(C402335testData.instanceId);
InventoryInstance.deleteInstanceViaApi(C402376testData.instance.instanceId);
InventoryInstance.deleteInstanceViaApi(testData.instanceId);
Users.deleteViaApi(user.userId);
});

Expand All @@ -74,32 +63,14 @@ describe('Inventory', () => {
() => {
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);
InventorySearchAndFilter.searchInstanceByTitle(testData.instanceId);
cy.wait('@/authn/refresh', { timeout: 5000 });
InventorySearchAndFilter.verifyInstanceDetailsView();
InstanceRecordView.verifyInstanceSource(C402376testData.instanceSource);
InstanceRecordView.verifyInstanceSource(testData.instanceSource);
InstanceRecordView.verifyEditInstanceButtonAbsent();
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('Inventory', () => {
);
InventoryInstance.openItemByBarcode(testData.itemBarcode);
ItemRecordView.verifyEffectiveLocationForItemInDetails(testData.locationName);
ItemRecordView.verifyHoldingsPermanentLocation(testData.locationName);
ItemRecordView.verifyHoldingsPermanentLocation(`${testData.locationName} (University)`);
ItemRecordView.verifyItemEffectiveLocation(testData.locationName);
},
);
Expand Down
Loading

0 comments on commit d42deb5

Please sign in to comment.