Skip to content

Commit

Permalink
Poppy folijet fix (#3393)
Browse files Browse the repository at this point in the history
* added waiters

* fixed tests
  • Loading branch information
TetianaParanich committed Mar 28, 2024
1 parent 3dffac6 commit 06c2759
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ describe('data-import', () => {
DataImport.getLogsHrIdsFromUI(numberOfLogsToDelete).then((logsHrIdsToBeDeleted) => {
// verify that user can cancel deletion of logs
DataImport.selectAllLogs();
cy.wait(2000);
DataImport.verifyAllLogsCheckedStatus({ logsCount: numberOfLogsPerPage, checked: true });
DataImport.verifyLogsPaneSubtitleExist(numberOfLogsPerPage);
DataImport.openDeleteImportLogsModal();
DataImport.cancelDeleteImportLogs();
cy.wait(2000);
DataImport.verifyAllLogsCheckedStatus({ logsCount: numberOfLogsPerPage, checked: false });
cy.wait(2000);
DataImport.verifyLogsPaneSubtitleAbsent();
DataImport.verifyDeleteLogsButtonDisabled();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ describe('data-import', () => {
firstUser = userProperties;

const fileName = `C358136 fileName${getRandomPostfix()}.mrc`;
cy.login(firstUser.username, firstUser.password);
cy.login(firstUser.username, firstUser.password, {
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
});

DataImport.verifyUploadState();
DataImport.waitLoading();
DataImport.uploadFile('oneMarcBib.mrc', fileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.search('Default - Create instance and SRS MARC Bib');
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(fileName);
cy.logout();
});

cy.createTempUser([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@ describe('data-import', () => {
});

const openOrder = (number) => {
Orders.resetFilters();
Orders.clearSearchField();
Orders.searchByParameter('PO number', number);
Orders.selectFromResultsList(number);
Orders.openOrder();
};

const checkReceivedPiece = (number, title) => {
cy.visit(TopMenu.ordersPath);
Orders.resetFilters();
Orders.clearSearchField();
Orders.searchByParameter('PO number', number);
Orders.selectFromResultsList(number);
OrderDetails.openPolDetails(title);
Expand Down Expand Up @@ -309,6 +309,8 @@ describe('data-import', () => {

cy.wait(2000);
Orders.checkIsOrderCreated(firstOrderNumber);
Orders.resetFilters();
cy.wait(2000);
// open the first PO with POL
openOrder(firstOrderNumber);
Orders.selectStatusInSearch(ORDER_STATUSES.OPEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('data-import', () => {

Logs.openViewAllLogs();
LogsViewAll.viewAllIsOpened();
cy.wait(20000);
LogsViewAll.selectOption('Keyword (ID, File name)');
LogsViewAll.searchWithTerm(upload.fileName);
LogsViewAll.verifyQuantityOfLogs(upload.quantityOfFiles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ describe('data-import', () => {
};

before('login', () => {
cy.getAdminToken();
NewInstanceStatusType.createViaApi().then((initialInstanceStatusType) => {
testData.instanceStatusTypeId = initialInstanceStatusType.body.id;
});

cy.createTempUser([
Permissions.moduleDataImportEnabled.gui,
Permissions.settingsDataImportEnabled.gui,
Expand All @@ -101,9 +106,6 @@ describe('data-import', () => {
]).then((userProperties) => {
user = userProperties;

NewInstanceStatusType.createViaApi().then((initialInstanceStatusType) => {
testData.instanceStatusTypeId = initialInstanceStatusType.body.id;
});
cy.login(user.username, user.password, {
path: SettingsMenu.mappingProfilePath,
waiter: FieldMappingProfiles.waitLoading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ describe('data-import', () => {
user = userProperties;

cy.login(user.username, user.password);

Z3950TargetProfiles.changeOclcWorldCatToDefaultViaApi();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,10 @@ describe('data-import', () => {

cy.visit(TopMenu.inventoryPath);
InventorySearchAndFilter.searchInstanceByHRID(initialInstanceHrId);
InventoryInstance.openHoldingView();
HoldingsRecordView.checkTemporaryLocation('-');
HoldingsRecordView.checkDigitizationPolicy('-');
HoldingsRecordView.close();
InventoryInstance.openHoldingsAccordion(
collectionOfMappingAndActionProfilesForCreate[1].mappingProfile
.permanentLocationInHoldingsAccordion,
);
InventoryInstance.openItemByBarcode(itemBarcode);
ItemRecordView.checkAccessionNumber('-');
ItemRecordView.verifyNumberOfPieces('-');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe('data-import', () => {
InventoryInstance.getAssignedHRID().then((initialInstanceHrId) => {
instanceHrid = initialInstanceHrId;
});
cy.logout();

cy.createTempUser([Permissions.moduleDataImportEnabled.gui]).then((userProperties) => {
user = userProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('data-import', () => {
InventoryInstance.getAssignedHRID().then((initialInstanceHrId) => {
instanceHrid = initialInstanceHrId;
});
cy.logout();

cy.createTempUser([
Permissions.inventoryAll.gui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('data-import', () => {
describe('Permissions', () => {
let user;
const filePath = 'marcBibFileForC377023.mrc';
const marcFileName = `C377023 autotestFileName ${getRandomPostfix()}`;
const marcFileName = `C377023 autotestFileName${getRandomPostfix()}.mrc`;
const title = 'ROALD DAHL : TELLER OF THE UNEXPECTED : A BIOGRAPHY.';

const mappingProfile = {
Expand Down Expand Up @@ -112,7 +112,6 @@ describe('data-import', () => {
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(marcFileName);
Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED);
cy.logout();

cy.createTempUser([Permissions.moduleDataImportEnabled.gui]).then((userProperties) => {
user = userProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ describe('data-import', () => {
user = userProperties;

cy.login(user.username, user.password);
cy.visit(TopMenu.dataImportPath);
DataImport.verifyUploadState();
DataImport.waitLoading();
DataImport.uploadFile('oneMarcBib.mrc', fileName);
JobProfiles.waitFileIsUploaded();
JobProfiles.search('Default - Create instance and SRS MARC Bib');
JobProfiles.runImportFile();
JobProfiles.waitFileIsImported(fileName);
// DataImport.uploadFileViaApi('oneMarcBib.mrc', fileName);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ describe('data-import', () => {
NewJobProfile.saveAndClose();
JobProfiles.checkJobProfilePresented(jobProfile.profileName);

cy.logout();
cy.login(secondUser.username, secondUser.password, {
path: SettingsMenu.mappingProfilePath,
waiter: FieldMappingProfiles.waitLoading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('inventory', () => {

after('Delete test data', () => {
cy.getAdminToken().then(() => {
cy.wait(5000);
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(testData.barcode);
Users.deleteViaApi(testData.user.userId);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe('inventory', () => {
after('delete test data', () => {
cy.getAdminToken().then(() => {
Users.deleteViaApi(user.userId);
cy.wait(5000);
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(testData.barcode);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ describe('inventory', () => {
// Change the Call number -> Click "Save & Close" button
HoldingsRecordEdit.fillCallNumber(testData.callNumber);
HoldingsRecordEdit.saveAndClose({ holdingSaved: true });
HoldingsRecordView.close();
InventoryInstance.checkIsHoldingsCreated([
`${testData.location.name} > ${testData.callNumber}`,
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('inventory', () => {

afterEach(() => {
cy.getAdminToken().then(() => {
cy.wait(5000);
cy.getInstance({ limit: 1, expandAll: true, query: `"title"=="${instanceTitle}"` }).then(
(instance) => {
cy.deleteHoldingRecordViaApi(instance.holdings[0].id);
Expand All @@ -49,7 +50,7 @@ describe('inventory', () => {
});

it(
'C1294: Create a Holdings record as another user than the one that created the Instance (folijet)',
'C1294 Create a Holdings record as another user than the one that created the Instance (folijet)',
{ tags: ['smoke', 'folijet'] },
() => {
const InventoryNewInstance = InventoryInstances.addNewInventory();
Expand Down
4 changes: 3 additions & 1 deletion cypress/support/fragments/orders/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export default {
waitLoading() {
cy.expect([ordersFiltersPane.exists(), ordersResultsPane.exists()]);
},

clearSearchField() {
cy.get('#input-record-search').clear();
},
waitSettingsPageLoading() {
cy.expect([
Pane({ id: 'settings-nav-pane' }).exists(),
Expand Down

0 comments on commit 06c2759

Please sign in to comment.