From b5b5f56fdd0b6a4752a5d859e86f95f95ffb0b50 Mon Sep 17 00:00:00 2001 From: bohdanihor Date: Tue, 16 Apr 2024 19:54:49 +0300 Subject: [PATCH 1/3] Fix extended tests Thunderjet --- ...g-by-export-method-does-not-reset-search-results.cy.js | 3 +++ .../e2e/orders/verify-orders-numbers-is-hyperlink.cy.js | 4 +++- .../inventory/browse-call-numbers-and-subjects.cy.js | 2 +- .../export/export-results-to-csv-from-receiving.cy.js | 8 ++++++++ cypress/support/fragments/finance/funds/funds.js | 2 +- .../fragments/inventory/inventorySearchAndFilter.js | 7 +++++-- cypress/support/fragments/orders/orderLines.js | 5 +---- cypress/support/fragments/orders/orders.js | 1 + 8 files changed, 23 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js b/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js index a76b8c6fd9..05ee70c792 100644 --- a/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js +++ b/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js @@ -179,6 +179,9 @@ describe('orders: export', () => { ExportManagerSearchPane.sortByJobID(); ExportManagerSearchPane.selectJobByIntegrationInList(integrationNameForFirstOrganization); ExportManagerSearchPane.resetAll(); + ExportManagerSearchPane.searchBySuccessful(); + ExportManagerSearchPane.searchByFailed(); + ExportManagerSearchPane.sortByJobID(); ExportManagerSearchPane.selectJobByIntegrationInList(integrationNameForSecondOrganization); }, ); diff --git a/cypress/e2e/orders/verify-orders-numbers-is-hyperlink.cy.js b/cypress/e2e/orders/verify-orders-numbers-is-hyperlink.cy.js index f9245ca753..d63342f13f 100644 --- a/cypress/e2e/orders/verify-orders-numbers-is-hyperlink.cy.js +++ b/cypress/e2e/orders/verify-orders-numbers-is-hyperlink.cy.js @@ -73,7 +73,7 @@ describe('Orders', () => { 'C369087 - Orders| Results List | Verify that value in "PO number" and "POL number" columns are hyperlinks (thunderjet) (TaaS)', { tags: ['extendedPath', 'thunderjet'] }, () => { - Orders.selectStatusInSearch(ORDER_STATUSES.PENDING); + Orders.selectPendingStatusFilter(); Orders.waitLoading(); [...Array(ordersCount).keys()].forEach((index) => { const title = testData.orders[index].poNumber; @@ -82,6 +82,7 @@ describe('Orders', () => { Orders.selectFromResultsList(title); OrderDetails.verifyOrderTitle(`Purchase order - ${title}`); }); + Orders.resetFilters(); Orders.selectOrderLines(); OrderLines.verifyNoResultsMessage(); @@ -94,6 +95,7 @@ describe('Orders', () => { OrderLines.selectOrderline(title); OrderLines.verifyOrderTitlePOL(`PO Line details - ${title}`); }); + Orders.resetFilters(); }, ); }); diff --git a/cypress/e2e/permissions/inventory/browse-call-numbers-and-subjects.cy.js b/cypress/e2e/permissions/inventory/browse-call-numbers-and-subjects.cy.js index 132564224b..a0a17f839a 100644 --- a/cypress/e2e/permissions/inventory/browse-call-numbers-and-subjects.cy.js +++ b/cypress/e2e/permissions/inventory/browse-call-numbers-and-subjects.cy.js @@ -57,7 +57,7 @@ describe('Permisions -> Inventory', () => { InventorySearchAndFilter.browseSearch('K1'); InventorySearchAndFilter.verifySearchAndResetAllButtonsDisabled(false); InventorySearchAndFilter.verifyBrowseInventorySearchResults(); - + InventorySearchAndFilter.resetAll(); InventorySearchAndFilter.selectBrowseSubjects(); InventorySearchAndFilter.verifySearchAndResetAllButtonsDisabled(true); InventorySearchAndFilter.browseSearch('art'); diff --git a/cypress/e2e/receiving/export/export-results-to-csv-from-receiving.cy.js b/cypress/e2e/receiving/export/export-results-to-csv-from-receiving.cy.js index 15dc3ebd6a..30cf99095a 100644 --- a/cypress/e2e/receiving/export/export-results-to-csv-from-receiving.cy.js +++ b/cypress/e2e/receiving/export/export-results-to-csv-from-receiving.cy.js @@ -68,6 +68,10 @@ describe('Receiving', () => { 'Vendor', 'Requester', 'Rush', + 'Created by', + 'Date created', + 'Updated by', + 'Date updated', ]; const pieceFields = [ 'Display summary', @@ -86,6 +90,10 @@ describe('Receiving', () => { 'Receiving status', 'Internal note', 'External note', + 'Created by (Piece)', + 'Date created (Piece)', + 'Updated by (Piece)', + 'Date updated (Piece)', ]; before('Create test order', () => { diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 03bd58c689..aaf25ab552 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -280,7 +280,7 @@ export default { ]); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(4000); - cy.do([Button('Save').click()]); + cy.do([saveAndClose.click()]); }, addPlannedBudgetWithoutFY: (allocatedQuantity) => { diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 0e4094e2fc..3577ca0018 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -574,7 +574,7 @@ export default { }, resetAll() { - cy.do(resetAllButton.click()); + cy.do(resetAllBtn.click()); }, clickResetAllButton() { @@ -798,7 +798,10 @@ export default { }, verifySearchAndResetAllButtonsDisabled(state) { - cy.expect([searchButton.has({ disabled: state }), resetAllBtn.has({ disabled: state })]); + cy.expect([ + Section({ id: 'browse-inventory-filters-pane' }).find(searchButton).has({ disabled: state }), + Section({ id: 'browse-inventory-filters-pane' }).find(resetAllBtn).has({ disabled: state }), + ]); }, verifyNoRecordsFound() { diff --git a/cypress/support/fragments/orders/orderLines.js b/cypress/support/fragments/orders/orderLines.js index c2930da44f..0b03390711 100644 --- a/cypress/support/fragments/orders/orderLines.js +++ b/cypress/support/fragments/orders/orderLines.js @@ -778,13 +778,10 @@ export default { submitOrderLine(); }, - addReveivingNoteToItemDetailsAndSave(orderNumber) { + addReveivingNoteToItemDetailsAndSave() { cy.do([TextArea('Receiving note').fillIn(note), saveAndCloseButton.click()]); cy.wait(4000); submitOrderLine(); - InteractorsTools.checkCalloutMessage( - `The purchase order line ${orderNumber}-1 was successfully updated`, - ); }, rolloverPOLineInfoforPhysicalMaterialWith2Funds( diff --git a/cypress/support/fragments/orders/orders.js b/cypress/support/fragments/orders/orders.js index f565c7e0b2..4cd11f02bd 100644 --- a/cypress/support/fragments/orders/orders.js +++ b/cypress/support/fragments/orders/orders.js @@ -739,6 +739,7 @@ export default { }, selectPendingStatusFilter: () => { + cy.wait(4000); cy.do(Checkbox({ id: 'clickable-filter-workflowStatus-pending' }).click()); }, From 8cd33fd04c25b1a34b3596d5d187ea945e679f54 Mon Sep 17 00:00:00 2001 From: bohdanihor Date: Tue, 23 Apr 2024 13:01:21 +0300 Subject: [PATCH 2/3] Implement FAT-12537 --- ...-in-not-a-vendor-organization-record.cy.js | 77 +++++++++++++++++++ cypress/support/dictionary/permissions.js | 4 + .../fragments/organizations/organizations.js | 46 ++++++++++- 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js diff --git a/cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js b/cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js new file mode 100644 index 0000000000..69c49aa60d --- /dev/null +++ b/cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js @@ -0,0 +1,77 @@ +import permissions from '../../support/dictionary/permissions'; +import Organizations from '../../support/fragments/organizations/organizations'; +import TopMenu from '../../support/fragments/topMenu'; +import Users from '../../support/fragments/users/users'; +import getRandomPostfix from '../../support/utils/stringTools'; +import NewOrganization from '../../support/fragments/organizations/newOrganization'; + +describe('Organizations', () => { + const organization = { + name: `1_autotest_name_${getRandomPostfix()}`, + status: 'Active', + code: `autotest_code_${getRandomPostfix()}`, + isVendor: false, + isDonor: true, + erpCode: `ERP-${getRandomPostfix()}`, + }; + const firstContact = { ...NewOrganization.defaultContact }; + const secondContact = { + firstName: `2AT_FN_${getRandomPostfix()}`, + lastName: `2AT_LN_${getRandomPostfix()}`, + }; + + let user; + + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + }); + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.selectOrganization(organization.name); + Organizations.editOrganization(); + Organizations.addNewDonorContact(firstContact); + Organizations.closeContact(); + Organizations.addDonorContactToOrganization(firstContact); + Organizations.checkDonorContactIsAdd(firstContact); + Organizations.saveOrganization(); + cy.createTempUser([ + permissions.uiOrganizationsViewEdit.gui, + permissions.uiOrganizationsViewEditCreateDeletePrivilegedDonorInformation.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.organizationsPath, + waiter: Organizations.waitLoading, + }); + }); + }); + + after(() => { + cy.getAdminToken(); + Users.deleteViaApi(user.userId); + Organizations.getOrganizationViaApi({ query: `name="${organization.name}"` }).then( + (returnedOrganization) => { + Organizations.deleteOrganizationViaApi(returnedOrganization.id); + }, + ); + }); + + it( + 'C423690 Add privileged donor information in Organization (NOT a vendor) record (thunderjet)', + { tags: ['criticalPath', 'thunderjet'] }, + () => { + Organizations.searchByParameters('Name', organization.name); + Organizations.selectOrganization(organization.name); + Organizations.editOrganization(); + Organizations.addNewDonorContact(secondContact); + Organizations.closeContact(); + Organizations.addDonorContactToOrganization(secondContact); + Organizations.checkDonorContactIsAdd(secondContact); + Organizations.cancelOrganization(); + Organizations.keepEditingOrganization(); + Organizations.saveOrganization(); + }, + ); +}); diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 45b2c0b0f5..68127a2e6c 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -867,6 +867,10 @@ export default { internal: 'ui-organizations.create', gui: 'Organizations: View, edit, create', }, + uiOrganizationsViewEditCreateDeletePrivilegedDonorInformation: { + internal: 'ui-organizations.privileged-contacts.edit', + gui: 'Organizations: can view, create, edit, delete privileged donor information', + }, uiOrganizationsViewEditDelete: { internal: 'ui-organizations.delete', gui: 'Organizations: View, edit, delete', diff --git a/cypress/support/fragments/organizations/organizations.js b/cypress/support/fragments/organizations/organizations.js index bc99a13070..c28bae3cf6 100644 --- a/cypress/support/fragments/organizations/organizations.js +++ b/cypress/support/fragments/organizations/organizations.js @@ -520,6 +520,35 @@ export default { InteractorsTools.checkCalloutMessage('The contact was saved'); }, + addNewDonorContact: (contact) => { + cy.do([ + Button({ id: 'accordion-toggle-button-privilegedDonorInformation' }).click(), + Section({ id: 'privilegedDonorInformation' }).find(Button('Add donor')).click(), + addContacsModal.find(buttonNew).click(), + lastNameField.fillIn(contact.lastName), + firstNameField.fillIn(contact.firstName), + saveButtonInCotact.click(), + ]); + InteractorsTools.checkCalloutMessage('The contact was saved'); + }, + + addDonorContactToOrganization: (contact) => { + cy.do([ + Button({ id: 'accordion-toggle-button-privilegedDonorInformation' }).click(), + Section({ id: 'privilegedDonorInformation' }).find(Button('Add donor')).click(), + addContacsModal.find(TextField({ id: 'input-record-search' })).fillIn(contact.lastName), + addContacsModal.find(Button('Search')).click(), + ]); + cy.wait(4000); + cy.do([ + addContacsModal + .find(MultiColumnListCell({ row: 0, columnIndex: 0 })) + .find(Checkbox()) + .click(), + addContacsModal.find(saveButton).click(), + ]); + }, + deleteContact: () => { cy.do([actionsButton.click(), deleteButton.click(), confirmButton.click()]); }, @@ -608,15 +637,29 @@ export default { cy.do(Button('Cancel').click()); }, + keepEditingOrganization: () => { + cy.do( + Modal({ id: 'cancel-editing-confirmation' }) + .find(Button({ id: 'clickable-cancel-editing-confirmation-confirm' })) + .click(), + ); + }, + checkContactIsAdd: (contact) => { cy.expect( - contactPeopleSection + Section({ id: 'privilegedDonorInformation' }) .find(MultiColumnListRow({ index: 0 })) .find(MultiColumnListCell({ columnIndex: 0 })) .has({ content: `${contact.lastName}, ${contact.firstName}` }), ); }, + checkDonorContactIsAdd: (contact, index = 0) => { + cy.get('#privilegedDonorInformation [data-row-index="row-' + index + '"]').within(() => { + cy.get('div[class*=mclCell-]').eq(0).contains(`${contact.lastName}, ${contact.firstName}`); + }); + }, + checkInterfaceIsAdd: (defaultInterface) => { cy.do(openInterfaceSectionButton.click()); cy.expect(interfaceSection.find(KeyValue({ value: defaultInterface.name })).exists()); @@ -775,6 +818,7 @@ export default { saveOrganization: () => { cy.do(saveAndClose.click()); + cy.wait(6000); }, addBankingInformation: (bankingInformation) => { From 06f73a7eb6aa987cdec5be0c3acdd3aea287dd24 Mon Sep 17 00:00:00 2001 From: bohdanihor Date: Wed, 24 Apr 2024 13:47:57 +0300 Subject: [PATCH 3/3] Implement FAT-12537 --- ...d-donor-information-in-not-a-vendor-organization-record.cy.js | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js b/cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js index 69c49aa60d..ed0ccc315a 100644 --- a/cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js +++ b/cypress/e2e/organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.cy.js @@ -19,7 +19,6 @@ describe('Organizations', () => { firstName: `2AT_FN_${getRandomPostfix()}`, lastName: `2AT_LN_${getRandomPostfix()}`, }; - let user; before(() => {