Skip to content

Commit

Permalink
Merge branch 'quesnelia' of https://github.com/folio-org/stripes-testing
Browse files Browse the repository at this point in the history
 into FAT-13361
  • Loading branch information
TetianaParanich committed May 9, 2024
2 parents 02a7c3a + c0e0bd1 commit 7dfde3f
Show file tree
Hide file tree
Showing 47 changed files with 373 additions and 580 deletions.
Expand Up @@ -57,7 +57,7 @@ describe('bulk-edit', () => {

BulkEditActions.selectOption('Temporary item location');
BulkEditSearchPane.verifyInputLabel('Temporary item location');
BulkEditActions.selectAction('Replace with', 0);
BulkEditActions.selectSecondAction('Replace with', 0);
BulkEditActions.locationLookupExists();
BulkEditSearchPane.verifyInputLabel('Replace with');

Expand Down
Expand Up @@ -19,7 +19,8 @@ for (let i = 0; i < 5; i++) {
const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`;
let fileContent = '';

describe('bulk-edit', () => {
// Test cannot be automated after test case update
describe.skip('bulk-edit', () => {
describe('in-app approach', () => {
before('create test data', () => {
cy.createTempUser([
Expand Down
Expand Up @@ -21,7 +21,8 @@ const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`;
const matchedRecordsFileName = `*Matched-Records-${itemBarcodesFileName}`;
const errorsFromMatchingFileName = `*-Matching-Records-Errors-${itemBarcodesFileName}`;

describe('bulk-edit', () => {
// Test cannot be automated after test case update
describe.skip('bulk-edit', () => {
describe('in-app approach', () => {
before('create test data', () => {
cy.createTempUser([
Expand Down
Expand Up @@ -19,7 +19,8 @@ for (let i = 0; i < 5; i++) {
const itemBarcodesFileName = `itemBarcodes_${getRandomPostfix()}.csv`;
let fileContent = '';

describe('bulk-edit', () => {
// Test cannot be automated after test case update
describe.skip('bulk-edit', () => {
describe('in-app approach', () => {
before('create test data', () => {
cy.createTempUser([
Expand Down
Expand Up @@ -91,7 +91,7 @@ describe('bulk-edit', () => {
// Select "Temporary item location" from "Options" dropdown and "Replace with" option from "Select option" dropdown;
const newLocation1 = 'Online';
BulkEditActions.selectOption('Temporary item location');
BulkEditActions.selectAction('Replace with', 0);
BulkEditActions.selectSecondAction('Replace with', 0);
BulkEditActions.locationLookupExists();
BulkEditActions.selectLocation(newLocation1, 0);
// Click on the "Plus" icon
Expand All @@ -100,7 +100,7 @@ describe('bulk-edit', () => {
// Select "Item status" from "Options" dropdown and select item status in "Select item status" dropdown
const newLocation2 = 'Online';
BulkEditActions.selectOption('Permanent item location', 1);
BulkEditActions.selectAction('Replace with', 1);
BulkEditActions.selectSecondAction('Replace with', 1);
BulkEditActions.selectLocation(newLocation2, 1);
BulkEditActions.locationLookupExists();
BulkEditActions.clickLocationLookup(1);
Expand Down
Expand Up @@ -142,7 +142,7 @@ describe('bulk-edit', () => {

const newLocation = 'Annex';
BulkEditActions.selectOption('Temporary holdings location');
BulkEditActions.selectAction('Replace with', 0);
BulkEditActions.selectSecondAction('Replace with', 0);
BulkEditActions.clickSelectedLocation('Select location', newLocation);
BulkEditActions.confirmChanges();
BulkEditActions.verifyAreYouSureForm(2, newLocation);
Expand Down
Expand Up @@ -50,7 +50,7 @@ describe('bulk-edit', () => {
});

it(
'C365617 Verify that In app bulk edit form for holdings records contains "Select option" placeholder for Options dropdown (firebird) (TaaS)',
'C365617 Verify that In app bulk edit form for holdings records contains "Select option" placeholder for Options dropdown (firebird) (TaaS)',
{ tags: ['extendedPath', 'firebird'] },
() => {
BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Holdings', 'Item barcodes');
Expand All @@ -66,7 +66,7 @@ describe('bulk-edit', () => {
BulkEditActions.isSelectActionAbsent();

BulkEditActions.selectOption('Temporary holdings location');
BulkEditActions.selectAction('Clear field', 0);
BulkEditActions.selectSecondAction('Clear field', 0);
BulkEditActions.addNewBulkEditFilterString();
BulkEditSearchPane.isConfirmButtonDisabled(true);
BulkEditActions.verifyNewBulkEditRow();
Expand Down
Expand Up @@ -88,7 +88,7 @@ describe('bulk-edit', () => {
BulkEditActions.verifyItemOptions();

BulkEditActions.verifyItemAdminstrativeNoteActions(0);
BulkEditActions.selectAction('Remove all', 0);
BulkEditActions.selectSecondAction('Remove all', 0);
BulkEditSearchPane.isConfirmButtonDisabled(false);
cy.wait(1000);
function performBulkEditOptionActions(option) {
Expand All @@ -98,7 +98,7 @@ describe('bulk-edit', () => {
BulkEditActions.isDisabledRowIcons(false);
// Click "Select option" dropdown on the added row
BulkEditActions.verifyTheOptionsAfterSelectedOption(option[i], i);
BulkEditActions.selectAction('Mark as staff only', i);
BulkEditActions.selectSecondAction('Mark as staff only', i);
BulkEditSearchPane.isConfirmButtonDisabled(false);
}
removeItem(options);
Expand Down
Expand Up @@ -54,7 +54,7 @@ describe('bulk-edit', () => {

const newLocation = 'Annex';
BulkEditActions.selectOption('Permanent item location');
BulkEditActions.selectAction('Replace with', 0);
BulkEditActions.selectSecondAction('Replace with', 0);
BulkEditActions.selectLocation(newLocation, 0);

BulkEditActions.clickSelectedLocation(newLocation, 'Select location');
Expand Down
Expand Up @@ -8,6 +8,7 @@ import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-a
import DateTools from '../../../../support/utils/dateTools';
import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files';
import UsersSearchPane from '../../../../support/fragments/users/usersSearchPane';
import ExportFile from '../../../../support/fragments/data-export/exportFile';

let user;
const afterThreeMonthsDate = DateTools.getAfterThreeMonthsDateObj();
Expand Down Expand Up @@ -89,32 +90,16 @@ describe('Bulk Edit - Logs', () => {
);

BulkEditSearchPane.downloadFileWithProposedChanges();
BulkEditFiles.verifyMatchedResultFileContent(
previewOfProposedChangesFileName,
['graduate'],
'patronGroup',
true,
);
BulkEditFiles.verifyMatchedResultFileContent(
previewOfProposedChangesFileName,
[newExpirationDate.dateWithDashes],
'expirationDate',
true,
);
ExportFile.verifyFileIncludes(previewOfProposedChangesFileName, [
'graduate',
newExpirationDate.dateWithDashes,
]);

BulkEditSearchPane.downloadFileWithUpdatedRecords();
BulkEditFiles.verifyMatchedResultFileContent(
updatedRecordsFileName,
['graduate'],
'patronGroup',
true,
);
BulkEditFiles.verifyMatchedResultFileContent(
updatedRecordsFileName,
[newExpirationDate.dateWithDashes],
'expirationDate',
true,
);
ExportFile.verifyFileIncludes(updatedRecordsFileName, [
'graduate',
newExpirationDate.dateWithDashes,
]);

cy.visit(TopMenu.usersPath);
UsersSearchPane.searchByUsername(user.username);
Expand Down
Expand Up @@ -70,7 +70,6 @@ describe('bulk-edit', () => {
BulkEditSearchPane.isDragAndDropAreaDisabled(true);
BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Instances', 'Instance HRIDs');
BulkEditSearchPane.uploadFile(instanceHRIDFileName);
BulkEditSearchPane.checkForUploading(instanceHRIDFileName);
BulkEditSearchPane.verifyMatchedResults(item.instanceHRID);
BulkEditSearchPane.verifyPaneRecordsCount(1);
BulkEditActions.openActions();
Expand Down
Expand Up @@ -9,9 +9,7 @@ import InventoryInstance from '../../../../support/fragments/inventory/inventory
import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager';
import getRandomPostfix from '../../../../support/utils/stringTools';
import DataImport from '../../../../support/fragments/data_import/dataImport';
import JobProfiles from '../../../../support/fragments/data_import/job_profiles/jobProfiles';
import Logs from '../../../../support/fragments/data_import/logs/logs';
import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter';
import Location from '../../../../support/fragments/settings/tenant/locations/newLocation';
import InventoryHoldings from '../../../../support/fragments/inventory/holdings/inventoryHoldings';
Expand Down Expand Up @@ -213,33 +211,23 @@ describe('Inventory', () => {
// 1 Local "Instance" record with source = "MARC" and filled alternative title fields should exist on Member 1 tenant.
// 1 Local "Instance" record with source = "MARC" and filled alternative title fields should exist on Member 2 tenant.

cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then(
() => {
marcFiles.forEach((marcFile, index) => {
if (marcFile.tenant !== tenantNames.central) {
ConsortiumManager.switchActiveAffiliation(
marcFiles[index - 1].tenant,
marcFile.tenant,
);
DataImport.waitLoading();
ConsortiumManager.checkCurrentTenantInTopMenu(marcFile.tenant);
}
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName);
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
Logs.waitFileIsImported(marcFile.fileName);
Logs.checkJobStatus(marcFile.fileName, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileName);
for (let i = 0; i < marcFile.numOfRecords; i++) {
Logs.getCreatedItemsID(i).then((link) => {
marcFile.createdRecordsId.push(link.split('/')[5]);
});
}
cy.resetTenant();
marcFiles.forEach((marcFile) => {
if (marcFile.tenant === 'College') {
cy.setTenant(Affiliations.College);
} else if (marcFile.tenant === 'University') {
cy.setTenant(Affiliations.University);
}
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
marcFile.jobProfileToRun,
).then((response) => {
response.forEach((record) => {
marcFile.createdRecordsId.push(record.instance.id);
});
},
);
});
});
})
.then(() => {
// 1 Shared "Instance" record with source = "MARC"
Expand Down
Expand Up @@ -5,9 +5,7 @@ import Users from '../../../../support/fragments/users/users';
import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities';
import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority';
import DataImport from '../../../../support/fragments/data_import/dataImport';
import JobProfiles from '../../../../support/fragments/data_import/job_profiles/jobProfiles';
import Logs from '../../../../support/fragments/data_import/logs/logs';
import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor';
import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations';
import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager';
Expand Down Expand Up @@ -42,22 +40,15 @@ describe('MARC', () => {
let createdAuthorityID;

before('Create test data', () => {
cy.resetTenant();
cy.getAdminToken();
cy.loginAsAdmin({
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
}).then(() => {
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileName);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileName);
Logs.getCreatedItemsID().then((link) => {
createdAuthorityID = link.split('/')[5];
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
marcFile.jobProfileToRun,
).then((response) => {
response.forEach((record) => {
createdAuthorityID = record.authority.id;
});
});

Expand Down
Expand Up @@ -5,9 +5,7 @@ import Users from '../../../../support/fragments/users/users';
import MarcAuthorities from '../../../../support/fragments/marcAuthority/marcAuthorities';
import MarcAuthority from '../../../../support/fragments/marcAuthority/marcAuthority';
import DataImport from '../../../../support/fragments/data_import/dataImport';
import JobProfiles from '../../../../support/fragments/data_import/job_profiles/jobProfiles';
import Logs from '../../../../support/fragments/data_import/logs/logs';
import { JOB_STATUS_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import { DEFAULT_JOB_PROFILE_NAMES } from '../../../../support/constants';
import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor';
import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations';
import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager';
Expand Down Expand Up @@ -43,22 +41,15 @@ describe('MARC', () => {
let createdAuthorityID;

before('Create test data', () => {
cy.resetTenant();
cy.getAdminToken();
cy.loginAsAdmin({
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
}).then(() => {
DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFile.fileName);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileName);
Logs.getCreatedItemsID().then((link) => {
createdAuthorityID = link.split('/')[5];
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
marcFile.jobProfileToRun,
).then((response) => {
response.forEach((record) => {
createdAuthorityID = record.authority.id;
});
});

Expand Down
Expand Up @@ -4,14 +4,11 @@ import Users from '../../../../../support/fragments/users/users';
import TopMenu from '../../../../../support/fragments/topMenu';
import ConsortiumManager from '../../../../../support/fragments/settings/consortium-manager/consortium-manager';
import {
JOB_STATUS_NAMES,
MARC_AUTHORITY_SEARCH_OPTIONS,
DEFAULT_JOB_PROFILE_NAMES,
} from '../../../../../support/constants';
import getRandomPostfix from '../../../../../support/utils/stringTools';
import DataImport from '../../../../../support/fragments/data_import/dataImport';
import JobProfiles from '../../../../../support/fragments/data_import/job_profiles/jobProfiles';
import Logs from '../../../../../support/fragments/data_import/logs/logs';
import MarcAuthority from '../../../../../support/fragments/marcAuthority/marcAuthority';
import MarcAuthorities from '../../../../../support/fragments/marcAuthority/marcAuthorities';
import MarcAuthoritiesSearch from '../../../../../support/fragments/marcAuthority/marcAuthoritiesSearch';
Expand Down Expand Up @@ -104,32 +101,21 @@ describe('MARC', () => {
]);
})
.then(() => {
cy.loginAsAdmin({
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
});
})
.then(() => {
marcFiles.forEach((marcFile, index) => {
if (marcFile.tenant !== tenantNames.central) {
ConsortiumManager.switchActiveAffiliation(
marcFiles[index - 1].tenant,
marcFile.tenant,
);
DataImport.waitLoading();
ConsortiumManager.checkCurrentTenantInTopMenu(marcFile.tenant);
cy.resetTenant();
marcFiles.forEach((marcFile) => {
if (marcFile.tenant === 'College') {
cy.setTenant(Affiliations.College);
} else if (marcFile.tenant === 'University') {
cy.setTenant(Affiliations.University);
}

DataImport.verifyUploadState();
DataImport.uploadFileAndRetry(marcFile.marc, marcFile.fileName);
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
Logs.waitFileIsImported(marcFile.fileName);
Logs.checkJobStatus(marcFile.fileName, JOB_STATUS_NAMES.COMPLETED);
Logs.openFileDetails(marcFile.fileName);
Logs.getCreatedItemsID().then((link) => {
marcFile.createdAuthorityID = link.split('/')[5];
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
marcFile.jobProfileToRun,
).then((response) => {
response.forEach((record) => {
marcFile.createdAuthorityID = record.authority.id;
});
});
});
})
Expand Down

0 comments on commit 7dfde3f

Please sign in to comment.