From 5f0b43e9bb8e2bae67f7328e56c76c0294143452 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Thu, 13 Apr 2023 18:29:34 +0300 Subject: [PATCH 01/32] added cy.wrap --- .../inventory/item-status-date-updates.cy.js | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 45c0a466a2..8d2e4184d0 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -115,27 +115,27 @@ describe('ui-inventory: Item status date updates', () => { }); }); - afterEach(() => { - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(order => Orders.deleteOrderApi(order[0].id)); - UserEdit.changeServicePointPreferenceViaApi( - userForDeliveryRequest.userId, - [effectiveLocationServicePoint.id, notEffectiveLocationServicePoint.id] - ) - .then(() => { - ServicePoint.deleteViaApi(effectiveLocationServicePoint.id); - ServicePoint.deleteViaApi(notEffectiveLocationServicePoint.id); - Users.deleteViaApi(userForDeliveryRequest.userId); - }); - - NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - effectiveLocation.institutionId, - effectiveLocation.campusId, - effectiveLocation.libraryId, - effectiveLocation.id - ); - }); + // afterEach(() => { + // InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + // Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + // .then(order => Orders.deleteOrderApi(order[0].id)); + // UserEdit.changeServicePointPreferenceViaApi( + // userForDeliveryRequest.userId, + // [effectiveLocationServicePoint.id, notEffectiveLocationServicePoint.id] + // ) + // .then(() => { + // ServicePoint.deleteViaApi(effectiveLocationServicePoint.id); + // ServicePoint.deleteViaApi(notEffectiveLocationServicePoint.id); + // Users.deleteViaApi(userForDeliveryRequest.userId); + // }); + + // NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + // effectiveLocation.institutionId, + // effectiveLocation.campusId, + // effectiveLocation.libraryId, + // effectiveLocation.id + // ); + // }); const openItem = (title, itemLocation, barcode) => { cy.visit(TopMenu.inventoryPath); @@ -192,7 +192,6 @@ describe('ui-inventory: Item status date updates', () => { UsersCard.showOpenedLoans(); }; - // test is looping it('C9200 Item status date updates (folijet) (prokopovych)', () => { const caption = `autotest_caption_${getRandomPostfix()}`; const numberOfPieces = '3'; @@ -282,12 +281,14 @@ describe('ui-inventory: Item status date updates', () => { // create delivery request (hold or recall) on item cy.visit(TopMenu.requestsPath); - NewRequest.createDeliveryRequest({ - itemBarcode, - itemTitle: null, - requesterBarcode: userForDeliveryRequest.barcode, - requestType: 'Hold' - }); + cy.wrap( + NewRequest.createDeliveryRequest({ + itemBarcode, + itemTitle: null, + requesterBarcode: userForDeliveryRequest.barcode, + requestType: 'Hold' + }) + ); cy.visit(TopMenu.checkInPath); CheckInActions.checkInItem(itemBarcode); ConfirmItemInModal.confirmMultipieceCheckInModal(); From 8e94ee6dd64af7713ccb8359afc25f50d973801d Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Tue, 18 Apr 2023 11:36:15 +0300 Subject: [PATCH 02/32] fixed linter issue --- .../fragments/users/loans/confirmItemStatusModal.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cypress/support/fragments/users/loans/confirmItemStatusModal.js b/cypress/support/fragments/users/loans/confirmItemStatusModal.js index f8652bff89..00767153b2 100644 --- a/cypress/support/fragments/users/loans/confirmItemStatusModal.js +++ b/cypress/support/fragments/users/loans/confirmItemStatusModal.js @@ -9,14 +9,15 @@ const additionalInformationField = confirmModal.find(TextArea('Additional inform export default { confirmItemStatus:(reasonToChangeStatus = additionalInformation) => { - return cy.do([additionalInformationField.fillIn(reasonToChangeStatus), - confirmButton.click()]); + return cy.do([ + additionalInformationField.fillIn(reasonToChangeStatus), + confirmButton.click() + ]); }, verifyModalView:(titleToCheck) => { cy.do(additionalInformationField.exists()); cy.expect(confirmButton.has({ disabled: true, visible: true })); cy.expect(Modal(including(titleToCheck)).exists()); return cy.do(cancelButton.click()); - }, - + } }; From d694825361ea278a23721da1c937ef40afde0a2d Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Tue, 18 Apr 2023 15:36:06 +0300 Subject: [PATCH 03/32] changed rules --- .../inventory/item-status-date-updates.cy.js | 73 ++++++++----------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 8d2e4184d0..55a205d066 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -39,60 +39,51 @@ import DateTools from '../../support/utils/dateTools'; import UserEdit from '../../support/fragments/users/userEdit'; import ServicePoint from '../../support/fragments/servicePoint/servicePoint'; import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; +import CirculationRules from '../../support/fragments/circulation/circulation-rules'; describe('ui-inventory: Item status date updates', () => { const instanceTitle = `autotestTitle ${Helper.getRandomBarcode()}`; const itemQuantity = '1'; + const itemBarcode = Helper.getRandomBarcode(); + const userName = Cypress.env('diku_login'); let orderNumber; let effectiveLocationServicePoint; let notEffectiveLocationServicePoint; let effectiveLocation; + let addedCirculationRule; + let originalCirculationRules; let userForDeliveryRequest = {}; - const itemBarcode = Helper.getRandomBarcode(); - const userName = Cypress.env('diku_login'); before(() => { cy.loginAsAdmin(); - cy.getAdminToken() - .then(() => { - cy.getLoanPolicy({ query: `name=="${LOAN_POLICY_NAMES.EXAMPLE_LOAN}"` }); - cy.getRequestPolicy({ query: `name=="${REQUEST_POLICY_NAMES.ALLOW_ALL}"` }); - cy.getNoticePolicy({ query: `name=="${NOTICE_POLICY_NAMES.SEND_NO_NOTICES}"` }); - cy.getOverdueFinePolicy({ query: `name=="${OVERDUE_FINE_POLICY_NAMES.OVERDUE_FINE_POLICY}"` }); - cy.getLostItemFeesPolicy({ query: `name=="${LOST_ITEM_FEES_POLICY_NAMES.LOST_ITEM_FEES_POLICY}"` }); - }).then(() => { - const loanPolicy = Cypress.env(CY_ENV.LOAN_POLICY).id; - const requestPolicyId = Cypress.env(CY_ENV.REQUEST_POLICY)[0].id; - const noticePolicyId = Cypress.env(CY_ENV.NOTICE_POLICY)[0].id; - const overdueFinePolicyId = Cypress.env(CY_ENV.OVERDUE_FINE_POLICY)[0].id; - const lostItemFeesPolicyId = Cypress.env(CY_ENV.LOST_ITEM_FEES_POLICY)[0].id; - const policy = `l ${loanPolicy} r ${requestPolicyId} n ${noticePolicyId} o ${overdueFinePolicyId} i ${lostItemFeesPolicyId}`; - const priority = 'priority: number-of-criteria, criterium (t, s, c, b, a, m, g), last-line'; - const newRule = `${priority}\nfallback-policy: ${policy}`; - - cy.updateCirculationRules({ - rulesAsText: newRule, + cy.getAdminToken(); + CirculationRules.getViaApi().then((circulationRule) => { + originalCirculationRules = circulationRule.rulesAsText; + const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); + ruleProps.r = requestPolicyBody.id; + addedCirculationRule = 't ' + testData.loanTypeId + ': i ' + ruleProps.i + ' l ' + ruleProps.l + ' r ' + ruleProps.r + ' o ' + ruleProps.o + ' n ' + ruleProps.n; + CirculationRules.addRuleViaApi(originalCirculationRules, ruleProps, 't ', testData.loanTypeId); + + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) + .then((servicePoints) => { + effectiveLocationServicePoint = servicePoints[0]; + NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) + .then((location) => { + effectiveLocation = location; + Orders.createOrderWithOrderLineViaApi( + NewOrder.getDefaultOrder(), + BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id) + ) + .then(order => { + orderNumber = order; + }); + }); }); - ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) - .then((servicePoints) => { - effectiveLocationServicePoint = servicePoints[0]; - NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) - .then((location) => { - effectiveLocation = location; - Orders.createOrderWithOrderLineViaApi( - NewOrder.getDefaultOrder(), - BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id) - ) - .then(order => { - orderNumber = order; - }); - }); - }); - ServicePoints.getViaApi({ limit: 1, query: 'name=="Online"' }) - .then((servicePoints) => { - notEffectiveLocationServicePoint = servicePoints[0]; - }); - }); + ServicePoints.getViaApi({ limit: 1, query: 'name=="Online"' }) + .then((servicePoints) => { + notEffectiveLocationServicePoint = servicePoints[0]; + }); + }); cy.createTempUser([ permissions.checkoutAll.gui, From 3f4e64af88ecd359c8facbf5343b0eabf5240060 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Tue, 18 Apr 2023 16:45:34 +0300 Subject: [PATCH 04/32] added rules --- cypress/e2e/inventory/item-status-date-updates.cy.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 55a205d066..6d751713bd 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -60,9 +60,11 @@ describe('ui-inventory: Item status date updates', () => { CirculationRules.getViaApi().then((circulationRule) => { originalCirculationRules = circulationRule.rulesAsText; const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); - ruleProps.r = requestPolicyBody.id; - addedCirculationRule = 't ' + testData.loanTypeId + ': i ' + ruleProps.i + ' l ' + ruleProps.l + ' r ' + ruleProps.r + ' o ' + ruleProps.o + ' n ' + ruleProps.n; - CirculationRules.addRuleViaApi(originalCirculationRules, ruleProps, 't ', testData.loanTypeId); + const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n}`; + + addedCirculationRule = `\nl ${loanPolicyForCourseReserves.id} ${defaultProps}`; + cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); + }); ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) .then((servicePoints) => { From c5d35edf74ff258feb3a3d02ce4c9c0f1d6df1a6 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 19 Apr 2023 19:54:55 +0300 Subject: [PATCH 05/32] changed circulation rules --- .../inventory/assign-preceding-title.cy.js | 2 +- ...catalogue-new-ordered-recieved-title.cy.js | 4 +- .../create-edit-delete-material-types.cy.js | 2 +- .../inventory/create-fast-add-record.cy.js | 2 +- .../create-instance-with-add-new.cy.js | 2 +- .../enter-different-type-of-identifiers.cy.js | 2 +- .../filter/filter-items-with-status.cy.js | 2 +- .../create-holdings-as-different-user.cy.js | 2 +- .../inventory/item-status-date-updates.cy.js | 169 +++++++++--------- .../update-effective-location-for-item.cy.js | 2 +- .../marking/mark-item-as-missing.cy.js | 2 +- .../marking/mark-item-as-withdrawn.cy.js | 2 +- .../single-record-import/import-by-oclc.cy.js | 2 +- ...confirmItemInModal.js => checkInModals.js} | 10 +- .../check-out-actions/check-out-actions.js | 21 +-- .../check-out-actions/checkOutModals.js | 16 ++ 16 files changed, 121 insertions(+), 121 deletions(-) rename cypress/support/fragments/check-in-actions/{confirmItemInModal.js => checkInModals.js} (80%) create mode 100644 cypress/support/fragments/check-out-actions/checkOutModals.js diff --git a/cypress/e2e/inventory/assign-preceding-title.cy.js b/cypress/e2e/inventory/assign-preceding-title.cy.js index e5233c8741..caa861c034 100644 --- a/cypress/e2e/inventory/assign-preceding-title.cy.js +++ b/cypress/e2e/inventory/assign-preceding-title.cy.js @@ -8,7 +8,7 @@ import Helper from '../../support/fragments/finance/financeHelper'; import TestTypes from '../../support/dictionary/testTypes'; import DevTeams from '../../support/dictionary/devTeams'; -describe('ui-inventory: Assign a Preceding title for an instance', () => { +describe('inventory', () => { const instanceIds = []; const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; const instanceTitle2 = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; diff --git a/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js b/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js index 55bdb72d95..d63e92efda 100644 --- a/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js +++ b/cypress/e2e/inventory/catalogue-new-ordered-recieved-title.cy.js @@ -20,7 +20,7 @@ import ItemRecordView from '../../support/fragments/inventory/itemRecordView'; import ItemRecordEdit from '../../support/fragments/inventory/itemRecordEdit'; import CheckInActions from '../../support/fragments/check-in-actions/checkInActions'; import SwitchServicePoint from '../../support/fragments/servicePoint/switchServicePoint'; -import ConfirmItemInModal from '../../support/fragments/check-in-actions/confirmItemInModal'; +import CheckInModals from '../../support/fragments/check-in-actions/checkInModals'; import Users from '../../support/fragments/users/users'; import ServicePoint from '../../support/fragments/servicePoint/servicePoint'; import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; @@ -159,7 +159,7 @@ describe('orders: Receive piece from Order', () => { SwitchServicePoint.switchServicePoint(secondServicePoint.name); cy.visit(TopMenu.checkInPath); CheckInActions.checkInItem(barcode); - ConfirmItemInModal.confirmInTransitModal(); + CheckInModals.confirmInTransit(); cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Keyword (title, contributor, identifier, HRID, UUID)', instanceTitle); diff --git a/cypress/e2e/inventory/create-edit-delete-material-types.cy.js b/cypress/e2e/inventory/create-edit-delete-material-types.cy.js index 5dee2630cd..d2b93df56a 100644 --- a/cypress/e2e/inventory/create-edit-delete-material-types.cy.js +++ b/cypress/e2e/inventory/create-edit-delete-material-types.cy.js @@ -7,7 +7,7 @@ import NewMaterialType from '../../support/fragments/settings/inventory/newMater import Users from '../../support/fragments/users/users'; import DevTeams from '../../support/dictionary/devTeams'; -describe('ui-inventory: Create, edit, delete material types', () => { +describe('inventory', () => { let userId; const materialTypeName = `autoTestMaterialType.${getRandomPostfix()}`; const newMaterialTypeName = `autoTestMaterialType.${getRandomPostfix()}`; diff --git a/cypress/e2e/inventory/create-fast-add-record.cy.js b/cypress/e2e/inventory/create-fast-add-record.cy.js index ece34ad773..8cfb8c7555 100644 --- a/cypress/e2e/inventory/create-fast-add-record.cy.js +++ b/cypress/e2e/inventory/create-fast-add-record.cy.js @@ -14,7 +14,7 @@ import InventoryInstances from '../../support/fragments/inventory/inventoryInsta import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; import FastAdd from '../../support/fragments/settings/inventory/instance-holdings-item/fastAdd'; -describe('ui-inventory: Create fast add record', () => { +describe('inventory', () => { const timeStamp = { start: null, end: null, diff --git a/cypress/e2e/inventory/create-instance-with-add-new.cy.js b/cypress/e2e/inventory/create-instance-with-add-new.cy.js index 22db9b428d..07f84d2c65 100644 --- a/cypress/e2e/inventory/create-instance-with-add-new.cy.js +++ b/cypress/e2e/inventory/create-instance-with-add-new.cy.js @@ -7,7 +7,7 @@ import { MultiColumnListCell } from '../../../interactors'; import DevTeams from '../../support/dictionary/devTeams'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; -describe('ui-inventory: Create new instance with add "New"', () => { +describe('inventory', () => { const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; before('navigate to Inventory', () => { diff --git a/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js b/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js index 0a57fa2a92..136f663711 100644 --- a/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js +++ b/cypress/e2e/inventory/enter-different-type-of-identifiers.cy.js @@ -8,7 +8,7 @@ import Helper from '../../support/fragments/finance/financeHelper'; import TopMenu from '../../support/fragments/topMenu'; import DevTeams from '../../support/dictionary/devTeams'; -describe('ui-inventory: Enter different type of identifiers', () => { +describe('inventory', () => { let instanceTitle; let instanceId; let resourceIdentifier; diff --git a/cypress/e2e/inventory/filter/filter-items-with-status.cy.js b/cypress/e2e/inventory/filter/filter-items-with-status.cy.js index 54e7c12c80..6a080938f7 100644 --- a/cypress/e2e/inventory/filter/filter-items-with-status.cy.js +++ b/cypress/e2e/inventory/filter/filter-items-with-status.cy.js @@ -18,7 +18,7 @@ const holdingId = uuid(); const title = `Filter items with status test ${Number(new Date())}`; let source; -describe('ui-inventory: items with status', () => { +describe('inventory', () => { before('create inventory instance', () => { cy.createTempUser([ permissions.inventoryAll.gui, diff --git a/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js b/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js index 3018807ed8..325932b6e1 100644 --- a/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js +++ b/cypress/e2e/inventory/holdings/create-holdings-as-different-user.cy.js @@ -10,7 +10,7 @@ import Users from '../../../support/fragments/users/users'; import Helper from '../../../support/fragments/finance/financeHelper'; import DevTeams from '../../../support/dictionary/devTeams'; -describe('ui-inventory: Create a Holdings record as another user than the one that created the Instance', () => { +describe('inventory', () => { let firstUser; let secondUser; const instanceTitle = `autoTestInstanceTitle ${Helper.getRandomBarcode()}`; diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 6d751713bd..313103b034 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -1,13 +1,6 @@ /* eslint-disable cypress/no-unnecessary-waiting */ +import uuid from 'uuid'; import getRandomPostfix from '../../support/utils/stringTools'; -import { - REQUEST_POLICY_NAMES, - NOTICE_POLICY_NAMES, - OVERDUE_FINE_POLICY_NAMES, - CY_ENV, - LOST_ITEM_FEES_POLICY_NAMES, - LOAN_POLICY_NAMES, -} from '../../support/constants'; import Orders from '../../support/fragments/orders/orders'; import NewOrder from '../../support/fragments/orders/newOrder'; import TopMenu from '../../support/fragments/topMenu'; @@ -22,7 +15,7 @@ import NewRequest from '../../support/fragments/requests/newRequest'; import CheckOut from '../../support/fragments/checkout/checkout'; import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; import UsersCard from '../../support/fragments/users/usersCard'; -import ConfirmItemInModal from '../../support/fragments/check-in-actions/confirmItemInModal'; +import CheckInModals from '../../support/fragments/check-in-actions/checkInModals'; import UserLoans from '../../support/fragments/users/loans/userLoans'; import ConfirmItemStatusModal from '../../support/fragments/users/loans/confirmItemStatusModal'; import RenewConfirmationModal from '../../support/fragments/users/loans/renewConfirmationModal'; @@ -36,16 +29,19 @@ import Users from '../../support/fragments/users/users'; import CheckOutActions from '../../support/fragments/check-out-actions/check-out-actions'; import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; import DateTools from '../../support/utils/dateTools'; -import UserEdit from '../../support/fragments/users/userEdit'; -import ServicePoint from '../../support/fragments/servicePoint/servicePoint'; import ItemActions from '../../support/fragments/inventory/inventoryItem/itemActions'; import CirculationRules from '../../support/fragments/circulation/circulation-rules'; +import NewMaterialType from '../../support/fragments/settings/inventory/newMaterialType'; +import UsersOwners from '../../support/fragments/settings/users/usersOwners'; +import CheckOutModals from '../../support/fragments/check-out-actions/checkOutModals'; +import MaterialTypes from '../../support/fragments/settings/inventory/materialTypes'; -describe('ui-inventory: Item status date updates', () => { +describe('inventory', () => { const instanceTitle = `autotestTitle ${Helper.getRandomBarcode()}`; const itemQuantity = '1'; const itemBarcode = Helper.getRandomBarcode(); const userName = Cypress.env('diku_login'); + const ownerId = uuid(); let orderNumber; let effectiveLocationServicePoint; let notEffectiveLocationServicePoint; @@ -53,43 +49,57 @@ describe('ui-inventory: Item status date updates', () => { let addedCirculationRule; let originalCirculationRules; let userForDeliveryRequest = {}; + let materialTypeId; - before(() => { + before('create test data', () => { cy.loginAsAdmin(); cy.getAdminToken(); - CirculationRules.getViaApi().then((circulationRule) => { - originalCirculationRules = circulationRule.rulesAsText; - const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); - const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n}`; + NewMaterialType.createViaApi(NewMaterialType.getDefaultMaterialType()) + .then(mtypes => { + materialTypeId = mtypes.body.id; - addedCirculationRule = `\nl ${loanPolicyForCourseReserves.id} ${defaultProps}`; - cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); - }); + CirculationRules.getViaApi().then((circulationRule) => { + originalCirculationRules = circulationRule.rulesAsText; + const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); + const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n} l ${ruleProps.l}`; - ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) - .then((servicePoints) => { - effectiveLocationServicePoint = servicePoints[0]; - NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) - .then((location) => { - effectiveLocation = location; - Orders.createOrderWithOrderLineViaApi( - NewOrder.getDefaultOrder(), - BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id) - ) - .then(order => { - orderNumber = order; - }); - }); - }); - ServicePoints.getViaApi({ limit: 1, query: 'name=="Online"' }) - .then((servicePoints) => { - notEffectiveLocationServicePoint = servicePoints[0]; + addedCirculationRule = ` \nm ${materialTypeId}:${defaultProps}`; + cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); }); - }); + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) + .then((servicePoints) => { + effectiveLocationServicePoint = servicePoints[0]; + NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) + .then((location) => { + effectiveLocation = location; + Orders.createOrderWithOrderLineViaApi( + NewOrder.getDefaultOrder(), + BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id, materialTypeId) + ) + .then(order => { + orderNumber = order; + }); + }); + UsersOwners.createViaApi({ + id: ownerId, + owner: 'AutotestOwner' + getRandomPostfix(), + servicePointOwner: [ + { + value: effectiveLocationServicePoint.id, + label: effectiveLocationServicePoint.name, + }, + ], + }); + }); + }); + ServicePoints.getViaApi({ limit: 1, query: 'name=="Online"' }) + .then((servicePoints) => { + notEffectiveLocationServicePoint = servicePoints[0]; + }); cy.createTempUser([ permissions.checkoutAll.gui, - permissions.requestsAll.gui, + permissions.requestsAll.gui ]) .then(userProperties => { userForDeliveryRequest = userProperties; @@ -108,27 +118,20 @@ describe('ui-inventory: Item status date updates', () => { }); }); - // afterEach(() => { - // InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - // Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - // .then(order => Orders.deleteOrderApi(order[0].id)); - // UserEdit.changeServicePointPreferenceViaApi( - // userForDeliveryRequest.userId, - // [effectiveLocationServicePoint.id, notEffectiveLocationServicePoint.id] - // ) - // .then(() => { - // ServicePoint.deleteViaApi(effectiveLocationServicePoint.id); - // ServicePoint.deleteViaApi(notEffectiveLocationServicePoint.id); - // Users.deleteViaApi(userForDeliveryRequest.userId); - // }); - - // NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - // effectiveLocation.institutionId, - // effectiveLocation.campusId, - // effectiveLocation.libraryId, - // effectiveLocation.id - // ); - // }); + afterEach('delete test data', () => { + Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + .then(order => Orders.deleteOrderApi(order[0].id)); + UsersOwners.deleteViaApi(ownerId); + Users.deleteViaApi(userForDeliveryRequest.userId); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + MaterialTypes.deleteApi(materialTypeId); + NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + effectiveLocation.institutionId, + effectiveLocation.campusId, + effectiveLocation.libraryId, + effectiveLocation.id + ); + }); const openItem = (title, itemLocation, barcode) => { cy.visit(TopMenu.inventoryPath); @@ -159,11 +162,10 @@ describe('ui-inventory: Item status date updates', () => { const checkIn = (barcode, status, confirmModal) => { cy.visit(TopMenu.checkInPath); - // TODO investigate why need 1 min wait before each step - // it's enough to wait 15000 before and after check in - cy.wait(15000); CheckInActions.checkInItem(barcode); - cy.wait(15000); + // TODO investigate why need 1 min wait before each step + // it's enough to wait 10000 before and after check in + cy.wait(10000); checkOpenItem(barcode, status, confirmModal); }; @@ -215,17 +217,17 @@ describe('ui-inventory: Item status date updates', () => { fullCheck(ItemRecordView.itemStatuses.missing); // check in item at service point assigned to its effective location - checkIn(itemBarcode, ItemRecordView.itemStatuses.available, ConfirmItemInModal.confirmMissingModal); + checkIn(itemBarcode, ItemRecordView.itemStatuses.available, CheckInModals.confirmMissing); // check in item at service point assigned to its effective location checkIn(itemBarcode, ItemRecordView.itemStatuses.available); // check in item at service point not assigned to its effective location SwitchServicePoint.switchServicePoint(notEffectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); + checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, CheckInModals.confirmInTransit); // check in item at service point not assigned to its effective location - checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); + checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, CheckInModals.confirmInTransit); // check in item at service point assigned to its effective location SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); @@ -243,14 +245,14 @@ describe('ui-inventory: Item status date updates', () => { // check in item at a service point other than the pickup service point for the request SwitchServicePoint.switchServicePoint(notEffectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, ConfirmItemInModal.confirmInTransitModal); + checkIn(itemBarcode, ItemRecordView.itemStatuses.inTransit, CheckInModals.confirmInTransit); // check in item at the pickup service point for the page request SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); - checkIn(itemBarcode, ItemRecordView.itemStatuses.awaitingPickup, ConfirmItemInModal.confirmAvaitingPickUpModal); + checkIn(itemBarcode, ItemRecordView.itemStatuses.awaitingPickup, CheckInModals.confirmAvaitingPickUp); // check out item to user for whom page request was created - checkOut(userName, itemBarcode, ItemRecordView.itemStatuses.checkedOut, ConfirmItemInModal.confirmAvaitingPickupCheckInModal); + checkOut(userName, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckInModals.confirmAvaitingPickupCheckIn); // declare item lost openUser(userName); @@ -274,30 +276,31 @@ describe('ui-inventory: Item status date updates', () => { // create delivery request (hold or recall) on item cy.visit(TopMenu.requestsPath); - cy.wrap( - NewRequest.createDeliveryRequest({ - itemBarcode, - itemTitle: null, - requesterBarcode: userForDeliveryRequest.barcode, - requestType: 'Hold' - }) - ); + NewRequest.createDeliveryRequest({ + itemBarcode, + itemTitle: null, + requesterBarcode: userForDeliveryRequest.barcode, + requestType: 'Hold' + }); cy.visit(TopMenu.checkInPath); CheckInActions.checkInItem(itemBarcode); - ConfirmItemInModal.confirmMultipieceCheckInModal(); + CheckInModals.confirmMultipieceCheckIn(); cy.visit(TopMenu.checkOutPath); CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - CheckOutActions.cancelMultipleCheckOutModal(); + CheckOutModals.cancelMultipleCheckOut(); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); // check out item to user with delivery request - checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut); + checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); // check in item at service point assigned to its effective location - SwitchServicePoint.switchServicePoint(effectiveLocationServicePoint.name); cy.visit(TopMenu.checkInPath); CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + // TODO investigate why need 1 min wait before each step + // it's enough to wait 10000 before and after check in + cy.wait(10000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.available); }); diff --git a/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js b/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js index 8c553e3535..dc47c3ad8c 100644 --- a/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js +++ b/cypress/e2e/inventory/locations/update-effective-location-for-item.cy.js @@ -12,7 +12,7 @@ import Users from '../../../support/fragments/users/users'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import Helper from '../../../support/fragments/finance/financeHelper'; -describe('ui-inventory: Update the effective location for the item', () => { +describe('inventory', () => { const itemData = { instanceTitle: `autoTestInstanceTitle ${Helper.getRandomBarcode()}`, itemBarcode: GenerateItemBarcode() diff --git a/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js b/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js index 9acc2cf213..53efde4828 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-missing.cy.js @@ -11,7 +11,7 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import ItemRecordView from '../../../support/fragments/inventory/itemRecordView'; import ItemActions from '../../../support/fragments/inventory/inventoryItem/itemActions'; -describe('ui-inventory: Mark an item as Missing', () => { +describe('inventory', () => { let user = {}; let defaultServicePointId = ''; const requesterIds = []; diff --git a/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js b/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js index 4358b55992..a760f4ca87 100644 --- a/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js +++ b/cypress/e2e/inventory/marking/mark-item-as-withdrawn.cy.js @@ -11,7 +11,7 @@ import InventoryInstance from '../../../support/fragments/inventory/inventoryIns import DevTeams from '../../../support/dictionary/devTeams'; import ItemRecordView from '../../../support/fragments/inventory/itemRecordView'; -describe('ui-inventory: Mark items as withdrawn', () => { +describe('inventory', () => { let user = {}; let defaultServicePointId = ''; const requesterIds = []; diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js index a954daffce..59433e6323 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc.cy.js @@ -12,7 +12,7 @@ import DevTeams from '../../../support/dictionary/devTeams'; let user; const oclc = '1007797324'; -describe('ui-inventory: import by OCLC', () => { +describe('inventory', () => { before('create user', () => { cy.createTempUser([ permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, diff --git a/cypress/support/fragments/check-in-actions/confirmItemInModal.js b/cypress/support/fragments/check-in-actions/checkInModals.js similarity index 80% rename from cypress/support/fragments/check-in-actions/confirmItemInModal.js rename to cypress/support/fragments/check-in-actions/checkInModals.js index 3149c23a8b..48f54d24c4 100644 --- a/cypress/support/fragments/check-in-actions/confirmItemInModal.js +++ b/cypress/support/fragments/check-in-actions/checkInModals.js @@ -6,25 +6,25 @@ const closeButton = Button('Close'); const printSlipCheckbox = Checkbox('Print slip'); export default { - confirmMissingModal:() => { + confirmMissing:() => { cy.do(Modal('Check in missing item?').find(Button('Confirm')).click()); }, - confirmInTransitModal:() => { + confirmInTransit:() => { cy.do(inTransitModal.find(printSlipCheckbox).click()); cy.do(inTransitModal.find(closeButton).click()); }, - confirmAvaitingPickUpModal:() => { + confirmAvaitingPickUp:() => { cy.do(awaitingPickupModal.find(printSlipCheckbox).click()); cy.do(awaitingPickupModal.find(closeButton).click()); }, - confirmAvaitingPickupCheckInModal:() => { + confirmAvaitingPickupCheckIn:() => { cy.do(Modal('Items awaiting pickup').find(closeButton).click()); }, - confirmMultipieceCheckInModal:() => { + confirmMultipieceCheckIn:() => { cy.do(Modal('Confirm multipiece check in').find(Button('Check in')).click()); } }; diff --git a/cypress/support/fragments/check-out-actions/check-out-actions.js b/cypress/support/fragments/check-out-actions/check-out-actions.js index 122ee23ab2..967d751d1f 100644 --- a/cypress/support/fragments/check-out-actions/check-out-actions.js +++ b/cypress/support/fragments/check-out-actions/check-out-actions.js @@ -10,15 +10,12 @@ import { MultiColumnListCell, HTML, including, - PaneContent, - Checkbox + PaneContent } from '../../../../interactors'; import SelectUser from './selectUser'; -const modal = Modal('Confirm multipiece check out'); const endSessionButton = Button('End session'); const userPane = PaneContent({ id: 'patron-details-content' }); -const modalForDeliveryRequest = Modal('Route for delivery request'); function addPatron(userName) { cy.do(Button({ id:'clickable-find-user' }).click()); @@ -27,7 +24,6 @@ function addPatron(userName) { } export default { - modal, addPatron, checkOutUser(userBarcode, otherParameter) { return cy.do([ @@ -103,16 +99,6 @@ export default { cy.expect(MultiColumnList({ id:'list-items-checked-out' }).find(HTML(including(barcode))).absent()); }, - confirmMultipieceCheckOut(barcode) { - cy.do(modal.find(Button('Check out')).click()); - cy.expect(MultiColumnList({ id: 'list-items-checked-out' }).find(HTML(including(barcode))).exists()); - }, - - cancelMultipleCheckOutModal:() => { - cy.do(modal.find(Button('Cancel')).click()); - cy.expect(modal.absent()); - }, - openLoanDetails() { cy.do(Button({ id: 'available-item-actions-button' }).click()); cy.do(Button('Loan details').click()); @@ -149,10 +135,5 @@ export default { cy.do(Button({ id: 'clickable-add-item' }).click()); // waiters needs for check out item in loop cy.wait(1000); - }, - - closeForDeliveryRequestModal:() => { - cy.do(modalForDeliveryRequest.find(Checkbox('Print slip')).click()); - cy.do(modalForDeliveryRequest.find(Button('Close and check out')).click()); } }; diff --git a/cypress/support/fragments/check-out-actions/checkOutModals.js b/cypress/support/fragments/check-out-actions/checkOutModals.js new file mode 100644 index 0000000000..10f3a2ac94 --- /dev/null +++ b/cypress/support/fragments/check-out-actions/checkOutModals.js @@ -0,0 +1,16 @@ +import { Button, Modal } from '../../../../interactors'; + +const modal = Modal('Confirm multipiece check out'); + +export default { + confirmMultipieceCheckOut:() => { + cy.do(modal.find(Button('Check out')).click()); + cy.expect(modal.absent()); + }, + + cancelMultipleCheckOut:() => { + cy.do(modal.find(Button('Cancel')).click()); + cy.expect(modal.absent()); + } +}; + From 6a9bbc6ba6d23cc29d3536ea5ff8e5746ff83e75 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 19 Apr 2023 20:22:41 +0300 Subject: [PATCH 06/32] added cy.wrap --- .../inventory/item-status-date-updates.cy.js | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 313103b034..edd6b42e4a 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -276,20 +276,23 @@ describe('inventory', () => { // create delivery request (hold or recall) on item cy.visit(TopMenu.requestsPath); - NewRequest.createDeliveryRequest({ - itemBarcode, - itemTitle: null, - requesterBarcode: userForDeliveryRequest.barcode, - requestType: 'Hold' + cy.wrap( + NewRequest.createDeliveryRequest({ + itemBarcode, + itemTitle: null, + requesterBarcode: userForDeliveryRequest.barcode, + requestType: 'Hold' + }) + ).then(() => { + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + cy.visit(TopMenu.checkOutPath); + CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + CheckOutModals.cancelMultipleCheckOut(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); }); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - CheckOutModals.cancelMultipleCheckOut(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); // check out item to user with delivery request checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); From 0d2eb9274fd807ac71fefe0c7f4646d6a687e7f0 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 19 Apr 2023 20:45:13 +0300 Subject: [PATCH 07/32] addad cy.wait --- .../inventory/item-status-date-updates.cy.js | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index edd6b42e4a..1a2fa8393c 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -276,27 +276,26 @@ describe('inventory', () => { // create delivery request (hold or recall) on item cy.visit(TopMenu.requestsPath); - cy.wrap( - NewRequest.createDeliveryRequest({ - itemBarcode, - itemTitle: null, - requesterBarcode: userForDeliveryRequest.barcode, - requestType: 'Hold' - }) - ).then(() => { - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - CheckOutModals.cancelMultipleCheckOut(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + NewRequest.createDeliveryRequest({ + itemBarcode, + itemTitle: null, + requesterBarcode: userForDeliveryRequest.barcode, + requestType: 'Hold' }); - + cy.wait(2000); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + cy.wait(2000); + cy.visit(TopMenu.checkOutPath); + CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + CheckOutModals.cancelMultipleCheckOut(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + cy.wait(2000); // check out item to user with delivery request checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - + cy.wait(2000); // check in item at service point assigned to its effective location cy.visit(TopMenu.checkInPath); CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); From 613374c04053aeb2e674f4795a89956fb697d35f Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 19 Apr 2023 21:07:08 +0300 Subject: [PATCH 08/32] commented 285-307 --- .../inventory/item-status-date-updates.cy.js | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 1a2fa8393c..b64111a6fc 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -282,28 +282,28 @@ describe('inventory', () => { requesterBarcode: userForDeliveryRequest.barcode, requestType: 'Hold' }); - cy.wait(2000); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - cy.wait(2000); - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - CheckOutModals.cancelMultipleCheckOut(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - cy.wait(2000); - // check out item to user with delivery request - checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - cy.wait(2000); - // check in item at service point assigned to its effective location - cy.visit(TopMenu.checkInPath); - CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - // TODO investigate why need 1 min wait before each step - // it's enough to wait 10000 before and after check in - cy.wait(10000); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.available); + // cy.wait(2000); + // cy.visit(TopMenu.checkInPath); + // CheckInActions.checkInItem(itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); + // cy.wait(2000); + // cy.visit(TopMenu.checkOutPath); + // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + // CheckOutModals.cancelMultipleCheckOut(); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + // cy.wait(2000); + // // check out item to user with delivery request + // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); + // cy.wait(2000); + // // check in item at service point assigned to its effective location + // cy.visit(TopMenu.checkInPath); + // CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); + // // TODO investigate why need 1 min wait before each step + // // it's enough to wait 10000 before and after check in + // cy.wait(10000); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.available); }); }); From 3b72746bf47b8d1ce0bd280b8680347d31985c7c Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 19 Apr 2023 22:37:33 +0300 Subject: [PATCH 09/32] deleted this --- .../support/fragments/requests/newRequest.js | 85 ++++++++++--------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index a1716361e6..4853440666 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -27,53 +27,58 @@ function openNewRequestPane() { ]); } -export default { - addRequester, - openNewRequestPane, +function fillRequiredFields(newRequest) { + if ('instanceHRID' in newRequest) { + cy.expect(Checkbox({ name: 'createTitleLevelRequest', disabled: false }).exists()); + cy.do(titleLevelRequest.click()); + cy.do(instanceHridInput.fillIn(newRequest.instanceHRID)); + cy.intercept('/inventory/instances?*').as('getLoans'); + cy.do(Section({ id: 'new-item-info' }).find(Button('Enter')).click()); + } else { + cy.do(itemBarcodeInput.fillIn(newRequest.itemBarcode)); + cy.intercept('/circulation/loans?*').as('getLoans'); + cy.do(enterItemBarcodeButton.click()); + } + cy.do(selectRequestType.choose(newRequest.requestType)); + cy.wait('@getLoans'); + cy.do(requesterBarcodeInput.fillIn(newRequest.requesterBarcode)); + cy.intercept('/proxiesfor?*').as('getUsers'); + cy.do(enterRequesterBarcodeButton.click()); + cy.expect(selectServicePoint.exists); + cy.wait('@getUsers'); +} - fillRequiredFields(newRequest) { - if ('instanceHRID' in newRequest) { - cy.expect(Checkbox({ name: 'createTitleLevelRequest', disabled: false }).exists()); - cy.do(titleLevelRequest.click()); - cy.do(instanceHridInput.fillIn(newRequest.instanceHRID)); - cy.intercept('/inventory/instances?*').as('getLoans'); - cy.do(Section({ id: 'new-item-info' }).find(Button('Enter')).click()); - } else { - cy.do(itemBarcodeInput.fillIn(newRequest.itemBarcode)); - cy.intercept('/circulation/loans?*').as('getLoans'); - cy.do(enterItemBarcodeButton.click()); - } - cy.do(selectRequestType.choose(newRequest.requestType)); - cy.wait('@getLoans'); - cy.do(requesterBarcodeInput.fillIn(newRequest.requesterBarcode)); - cy.intercept('/proxiesfor?*').as('getUsers'); - cy.do(enterRequesterBarcodeButton.click()); - cy.expect(selectServicePoint.exists); - cy.wait('@getUsers'); - }, +function saveRequestAndClose() { cy.do(saveAndCloseButton.click()); } - choosepickupServicePoint(pickupServicePoint) { - cy.do(selectServicePoint.choose(pickupServicePoint)); - cy.expect(HTML(including(pickupServicePoint)).exists()); - }, +function choosepickupServicePoint(pickupServicePoint) { + cy.do(selectServicePoint.choose(pickupServicePoint)); + cy.expect(HTML(including(pickupServicePoint)).exists()); +} + +function waitLoading() { cy.expect(Pane({ title: 'Request Detail' }).exists()); } - saveRequestAndClose:() => cy.do(saveAndCloseButton.click()), - waitLoading:() => cy.expect(Pane({ title: 'Request Detail' }).exists()), +export default { + addRequester, + openNewRequestPane, + fillRequiredFields, + saveRequestAndClose, + choosepickupServicePoint, + waitLoading, createNewRequest(newRequest) { openNewRequestPane(); - this.fillRequiredFields(newRequest); - this.choosepickupServicePoint(newRequest.pickupServicePoint); - this.saveRequestAndClose(); - this.waitLoading(); + fillRequiredFields(newRequest); + choosepickupServicePoint(newRequest.pickupServicePoint); + saveRequestAndClose(); + waitLoading(); }, createDeliveryRequest(newRequest) { - this.openNewRequestPane(); - this.fillRequiredFields(newRequest); + openNewRequestPane(); + fillRequiredFields(newRequest); // need to wait until instanceId is uploaded cy.wait(2500); - this.saveRequestAndClose(); + saveRequestAndClose(); }, createWithUserName(newRequest) { @@ -89,9 +94,9 @@ export default { cy.wait('@getLoans'); // need to wait until instanceId is uploaded cy.wait(2500); - this.choosepickupServicePoint(newRequest.pickupServicePoint); - this.saveRequestAndClose(); - this.waitLoading(); + choosepickupServicePoint(newRequest.pickupServicePoint); + saveRequestAndClose(); + waitLoading(); }, waitLoadingNewRequestPage(TLR = false) { @@ -151,6 +156,6 @@ export default { cy.do(enterRequesterBarcodeButton.click()); cy.expect(selectServicePoint.exists); cy.wait('@getUsers'); - this.choosepickupServicePoint(newRequest.pickupServicePoint); + choosepickupServicePoint(newRequest.pickupServicePoint); } }; From 6367d3294675a30d9563816c971587bd8d53655a Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 19 Apr 2023 22:55:12 +0300 Subject: [PATCH 10/32] changed fill request function --- .../support/fragments/requests/newRequest.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index 4853440666..1a8fed6291 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -28,24 +28,24 @@ function openNewRequestPane() { } function fillRequiredFields(newRequest) { - if ('instanceHRID' in newRequest) { - cy.expect(Checkbox({ name: 'createTitleLevelRequest', disabled: false }).exists()); - cy.do(titleLevelRequest.click()); - cy.do(instanceHridInput.fillIn(newRequest.instanceHRID)); - cy.intercept('/inventory/instances?*').as('getLoans'); - cy.do(Section({ id: 'new-item-info' }).find(Button('Enter')).click()); - } else { + // if ('instanceHRID' in newRequest) { + // cy.expect(Checkbox({ name: 'createTitleLevelRequest', disabled: false }).exists()); + // cy.do(titleLevelRequest.click()); + // cy.do(instanceHridInput.fillIn(newRequest.instanceHRID)); + // cy.intercept('/inventory/instances?*').as('getLoans'); + // cy.do(Section({ id: 'new-item-info' }).find(Button('Enter')).click()); + // } else { cy.do(itemBarcodeInput.fillIn(newRequest.itemBarcode)); cy.intercept('/circulation/loans?*').as('getLoans'); cy.do(enterItemBarcodeButton.click()); - } + // } cy.do(selectRequestType.choose(newRequest.requestType)); - cy.wait('@getLoans'); + // cy.wait('@getLoans'); cy.do(requesterBarcodeInput.fillIn(newRequest.requesterBarcode)); cy.intercept('/proxiesfor?*').as('getUsers'); cy.do(enterRequesterBarcodeButton.click()); cy.expect(selectServicePoint.exists); - cy.wait('@getUsers'); + // cy.wait('@getUsers'); } function saveRequestAndClose() { cy.do(saveAndCloseButton.click()); } From 9b6a818e5dec4a4e44634ceebf5b058a6a602acd Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Thu, 20 Apr 2023 07:18:41 +0300 Subject: [PATCH 11/32] uncommented code --- .../inventory/item-status-date-updates.cy.js | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index b64111a6fc..a698e0b528 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -278,32 +278,31 @@ describe('inventory', () => { cy.visit(TopMenu.requestsPath); NewRequest.createDeliveryRequest({ itemBarcode, - itemTitle: null, requesterBarcode: userForDeliveryRequest.barcode, requestType: 'Hold' }); - // cy.wait(2000); - // cy.visit(TopMenu.checkInPath); - // CheckInActions.checkInItem(itemBarcode); - // CheckInModals.confirmMultipieceCheckIn(); - // cy.wait(2000); - // cy.visit(TopMenu.checkOutPath); - // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - // CheckOutModals.cancelMultipleCheckOut(); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - // cy.wait(2000); - // // check out item to user with delivery request - // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - // cy.wait(2000); - // // check in item at service point assigned to its effective location - // cy.visit(TopMenu.checkInPath); - // CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - // CheckInModals.confirmMultipieceCheckIn(); - // // TODO investigate why need 1 min wait before each step - // // it's enough to wait 10000 before and after check in - // cy.wait(10000); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // fullCheck(ItemRecordView.itemStatuses.available); + cy.wait(2000); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + cy.wait(2000); + cy.visit(TopMenu.checkOutPath); + CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + CheckOutModals.cancelMultipleCheckOut(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + cy.wait(2000); + // check out item to user with delivery request + checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); + cy.wait(2000); + // check in item at service point assigned to its effective location + cy.visit(TopMenu.checkInPath); + CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + // TODO investigate why need 1 min wait before each step + // it's enough to wait 10000 before and after check in + cy.wait(10000); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.available); }); }); From dab450e26390ff9428163238cb345d37ec38f355 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Thu, 20 Apr 2023 11:11:10 +0300 Subject: [PATCH 12/32] deleted waiters --- .../inventory/item-status-date-updates.cy.js | 6 ++-- .../support/fragments/requests/newRequest.js | 28 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index a698e0b528..b729fbf0df 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -281,20 +281,18 @@ describe('inventory', () => { requesterBarcode: userForDeliveryRequest.barcode, requestType: 'Hold' }); - cy.wait(2000); cy.visit(TopMenu.checkInPath); CheckInActions.checkInItem(itemBarcode); CheckInModals.confirmMultipieceCheckIn(); - cy.wait(2000); cy.visit(TopMenu.checkOutPath); CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); CheckOutModals.cancelMultipleCheckOut(); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - cy.wait(2000); + // check out item to user with delivery request checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - cy.wait(2000); + // check in item at service point assigned to its effective location cy.visit(TopMenu.checkInPath); CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index 1a8fed6291..443499ac84 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -28,24 +28,24 @@ function openNewRequestPane() { } function fillRequiredFields(newRequest) { - // if ('instanceHRID' in newRequest) { - // cy.expect(Checkbox({ name: 'createTitleLevelRequest', disabled: false }).exists()); - // cy.do(titleLevelRequest.click()); - // cy.do(instanceHridInput.fillIn(newRequest.instanceHRID)); - // cy.intercept('/inventory/instances?*').as('getLoans'); - // cy.do(Section({ id: 'new-item-info' }).find(Button('Enter')).click()); - // } else { + if ('instanceHRID' in newRequest) { + cy.expect(Checkbox({ name: 'createTitleLevelRequest', disabled: false }).exists()); + cy.do(titleLevelRequest.click()); + cy.do(instanceHridInput.fillIn(newRequest.instanceHRID)); + cy.intercept('/inventory/instances?*').as('getLoans'); + cy.do(Section({ id: 'new-item-info' }).find(Button('Enter')).click()); + } else { cy.do(itemBarcodeInput.fillIn(newRequest.itemBarcode)); cy.intercept('/circulation/loans?*').as('getLoans'); cy.do(enterItemBarcodeButton.click()); - // } + } cy.do(selectRequestType.choose(newRequest.requestType)); - // cy.wait('@getLoans'); + cy.wait('@getLoans'); cy.do(requesterBarcodeInput.fillIn(newRequest.requesterBarcode)); cy.intercept('/proxiesfor?*').as('getUsers'); cy.do(enterRequesterBarcodeButton.click()); cy.expect(selectServicePoint.exists); - // cy.wait('@getUsers'); + cy.wait('@getUsers'); } function saveRequestAndClose() { cy.do(saveAndCloseButton.click()); } @@ -75,7 +75,13 @@ export default { createDeliveryRequest(newRequest) { openNewRequestPane(); - fillRequiredFields(newRequest); + cy.do(itemBarcodeInput.fillIn(newRequest.itemBarcode)); + cy.intercept('/circulation/loans?*').as('getLoans'); + cy.do(enterItemBarcodeButton.click()); + cy.do(selectRequestType.choose(newRequest.requestType)); + cy.do(requesterBarcodeInput.fillIn(newRequest.requesterBarcode)); + cy.do(enterRequesterBarcodeButton.click()); + cy.expect(selectServicePoint.exists); // need to wait until instanceId is uploaded cy.wait(2500); saveRequestAndClose(); From 61e20fe2018eeb8659bd2557dff013946a489ab9 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Sat, 22 Apr 2023 12:46:58 +0300 Subject: [PATCH 13/32] commented 293-304 --- .../inventory/item-status-date-updates.cy.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index b729fbf0df..a1e51c80d9 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -290,17 +290,17 @@ describe('inventory', () => { openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - // check out item to user with delivery request - checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - - // check in item at service point assigned to its effective location - cy.visit(TopMenu.checkInPath); - CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - // TODO investigate why need 1 min wait before each step - // it's enough to wait 10000 before and after check in - cy.wait(10000); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.available); + // // check out item to user with delivery request + // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); + + // // check in item at service point assigned to its effective location + // cy.visit(TopMenu.checkInPath); + // CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); + // // TODO investigate why need 1 min wait before each step + // // it's enough to wait 10000 before and after check in + // cy.wait(10000); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.available); }); }); From def64dde1358332d7a2c3e87cda0b564fdfdc33d Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Sat, 22 Apr 2023 13:02:03 +0300 Subject: [PATCH 14/32] commented 287-304 --- cypress/e2e/inventory/item-status-date-updates.cy.js | 10 +++++----- .../fragments/check-in-actions/checkInActions.js | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index a1e51c80d9..56080d7660 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -284,11 +284,11 @@ describe('inventory', () => { cy.visit(TopMenu.checkInPath); CheckInActions.checkInItem(itemBarcode); CheckInModals.confirmMultipieceCheckIn(); - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - CheckOutModals.cancelMultipleCheckOut(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + // cy.visit(TopMenu.checkOutPath); + // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + // CheckOutModals.cancelMultipleCheckOut(); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); // // check out item to user with delivery request // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); diff --git a/cypress/support/fragments/check-in-actions/checkInActions.js b/cypress/support/fragments/check-in-actions/checkInActions.js index eed7665195..02dcc3a865 100644 --- a/cypress/support/fragments/check-in-actions/checkInActions.js +++ b/cypress/support/fragments/check-in-actions/checkInActions.js @@ -63,7 +63,8 @@ export default { cy.wait(1000); }, checkInItemGui:(barcode) => { - return cy.do([itemBarcodeField.exists(), + return cy.do([ + itemBarcodeField.exists(), itemBarcodeField.fillIn(barcode), addItemButton.click() ]); From 5ba4e5bb28cd518d724bc676f01d3a51d83de91e Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Sat, 22 Apr 2023 13:17:50 +0300 Subject: [PATCH 15/32] commented 284-304 --- cypress/e2e/inventory/item-status-date-updates.cy.js | 6 +++--- .../fragments/check-out-actions/check-out-actions.js | 4 ---- cypress/support/fragments/inventory/inventoryInstance.js | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 56080d7660..726369da2c 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -281,9 +281,9 @@ describe('inventory', () => { requesterBarcode: userForDeliveryRequest.barcode, requestType: 'Hold' }); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); + // cy.visit(TopMenu.checkInPath); + // CheckInActions.checkInItem(itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); // cy.visit(TopMenu.checkOutPath); // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); // CheckOutModals.cancelMultipleCheckOut(); diff --git a/cypress/support/fragments/check-out-actions/check-out-actions.js b/cypress/support/fragments/check-out-actions/check-out-actions.js index 967d751d1f..b8090450c3 100644 --- a/cypress/support/fragments/check-out-actions/check-out-actions.js +++ b/cypress/support/fragments/check-out-actions/check-out-actions.js @@ -124,13 +124,9 @@ export default { checkOutItemWithUserName(userName, itemBarcode) { addPatron(userName); - cy.intercept('/circulation/loans?*').as('getLoans'); cy.do(Button({ id: 'clickable-find-patron' }).click()); cy.expect(KeyValue('Borrower').exists()); - cy.wait('@getLoans'); - cy.intercept('/circulation/requests?*').as('getRequests'); cy.do(TextField({ name: 'item.barcode' }).fillIn(itemBarcode)); - cy.wait('@getRequests'); cy.wait(2000); cy.do(Button({ id: 'clickable-add-item' }).click()); // waiters needs for check out item in loop diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index 8e05840e4f..ada60239aa 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -147,7 +147,7 @@ const openHoldings = (...holdingToBeOpened) => { const openItemByBarcode = (itemBarcode) => { cy.do(Link(including(itemBarcode)).click()); - ItemRecordView.waitLoading(); + cy.wait(1500); }; const verifyInstanceTitle = (title) => { From 9c12ee106788fe5374b5e20702889b205709540e Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Sat, 22 Apr 2023 16:27:05 +0300 Subject: [PATCH 16/32] fixed function --- cypress/support/fragments/requests/newRequest.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index 443499ac84..b14b66ff9d 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -75,12 +75,11 @@ export default { createDeliveryRequest(newRequest) { openNewRequestPane(); - cy.do(itemBarcodeInput.fillIn(newRequest.itemBarcode)); - cy.intercept('/circulation/loans?*').as('getLoans'); - cy.do(enterItemBarcodeButton.click()); - cy.do(selectRequestType.choose(newRequest.requestType)); - cy.do(requesterBarcodeInput.fillIn(newRequest.requesterBarcode)); - cy.do(enterRequesterBarcodeButton.click()); + cy.do([itemBarcodeInput.fillIn(newRequest.itemBarcode), + enterItemBarcodeButton.click(), + selectRequestType.choose(newRequest.requestType), + requesterBarcodeInput.fillIn(newRequest.requesterBarcode), + enterRequesterBarcodeButton.click()]); cy.expect(selectServicePoint.exists); // need to wait until instanceId is uploaded cy.wait(2500); From 4a37bae7f2f3039fdbeb10068661ef66ea8e508a Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 24 Apr 2023 14:52:48 +0300 Subject: [PATCH 17/32] renamed function --- cypress/e2e/inventory/item-status-date-updates.cy.js | 2 +- cypress/support/fragments/requests/newRequest.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 726369da2c..26f1986cbe 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -120,7 +120,7 @@ describe('inventory', () => { afterEach('delete test data', () => { Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(order => Orders.deleteOrderApi(order[0].id)); + .then(order => Orders.deleteOrderViaApi(order[0].id)); UsersOwners.deleteViaApi(ownerId); Users.deleteViaApi(userForDeliveryRequest.userId); InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index b14b66ff9d..a4a8a3d79a 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -79,7 +79,8 @@ export default { enterItemBarcodeButton.click(), selectRequestType.choose(newRequest.requestType), requesterBarcodeInput.fillIn(newRequest.requesterBarcode), - enterRequesterBarcodeButton.click()]); + enterRequesterBarcodeButton.click() + ]); cy.expect(selectServicePoint.exists); // need to wait until instanceId is uploaded cy.wait(2500); From b598a2072ddf4910912fd17feb75e8b130e0e8ad Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 1 May 2023 21:00:14 +0300 Subject: [PATCH 18/32] uncommented code --- .../inventory/item-status-date-updates.cy.js | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 26f1986cbe..fcefe6ef8e 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -276,31 +276,34 @@ describe('inventory', () => { // create delivery request (hold or recall) on item cy.visit(TopMenu.requestsPath); + cy.wait(8000); NewRequest.createDeliveryRequest({ itemBarcode, requesterBarcode: userForDeliveryRequest.barcode, requestType: 'Hold' }); - // cy.visit(TopMenu.checkInPath); - // CheckInActions.checkInItem(itemBarcode); - // CheckInModals.confirmMultipieceCheckIn(); - // cy.visit(TopMenu.checkOutPath); - // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - // CheckOutModals.cancelMultipleCheckOut(); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - - // // check out item to user with delivery request - // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - - // // check in item at service point assigned to its effective location - // cy.visit(TopMenu.checkInPath); - // CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - // CheckInModals.confirmMultipieceCheckIn(); - // // TODO investigate why need 1 min wait before each step - // // it's enough to wait 10000 before and after check in - // cy.wait(10000); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // fullCheck(ItemRecordView.itemStatuses.available); + cy.wait(8000); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + cy.wait(8000); + cy.visit(TopMenu.checkOutPath); + CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + CheckOutModals.cancelMultipleCheckOut(); + cy.wait(8000); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + + // check out item to user with delivery request + checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); + + // check in item at service point assigned to its effective location + cy.visit(TopMenu.checkInPath); + cy.wait(8000); + CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + cy.wait(8000); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.available); }); }); From 680b5a98e9dc859a7681cd8154ad1a9a709c6733 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 31 Jul 2023 17:04:18 +0300 Subject: [PATCH 19/32] commented after block --- .../inventory/item-status-date-updates.cy.js | 106 +++++++++--------- .../check-in-actions/checkInModals.js | 1 + .../check-out-actions/check-out-actions.js | 2 +- .../fragments/check-out-actions/selectUser.js | 4 +- .../support/fragments/requests/newRequest.js | 27 ++--- 5 files changed, 69 insertions(+), 71 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 498607b3c8..0decbb75f9 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -64,43 +64,42 @@ describe('inventory', () => { before('create test data', () => { cy.loginAsAdmin(); cy.getAdminToken(); - NewMaterialType.createViaApi(NewMaterialType.getDefaultMaterialType()) - .then(mtypes => { - materialTypeId = mtypes.body.id; - - CirculationRules.getViaApi().then((circulationRule) => { - originalCirculationRules = circulationRule.rulesAsText; - const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); - const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n} l ${ruleProps.l}`; - - addedCirculationRule = ` \nm ${materialTypeId}:${defaultProps}`; - cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); - }); - ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) - .then((servicePoints) => { - effectiveLocationServicePoint = servicePoints[0]; - NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) - .then((location) => { - effectiveLocation = location; - Orders.createOrderWithOrderLineViaApi( - NewOrder.getDefaultOrder(), - BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id, materialTypeId) - ) - .then(order => { - orderNumber = order; - }); + // NewMaterialType.createViaApi(NewMaterialType.getDefaultMaterialType()) + // .then(mtypes => { + // materialTypeId = mtypes.body.id; + + // CirculationRules.getViaApi() + // .then((circulationRule) => { + // originalCirculationRules = circulationRule.rulesAsText; + // const ruleProps = CirculationRules.getRuleProps(circulationRule.rulesAsText); + // const defaultProps = ` i ${ruleProps.i} r ${ruleProps.r} o ${ruleProps.o} n ${ruleProps.n} l ${ruleProps.l}`; + // addedCirculationRule = ` \nm ${materialTypeId}: ${defaultProps}`; + // cy.updateCirculationRules({ rulesAsText: `${originalCirculationRules}${addedCirculationRule}` }); + // }); + ServicePoints.getViaApi({ limit: 1, query: 'name=="Circ Desk 2"' }) + .then((servicePoints) => { + effectiveLocationServicePoint = servicePoints[0]; + NewLocation.createViaApi(NewLocation.getDefaultLocation(effectiveLocationServicePoint.id)) + .then((location) => { + effectiveLocation = location; + Orders.createOrderWithOrderLineViaApi( + NewOrder.getDefaultOrder(), + BasicOrderLine.getDefaultOrderLine(itemQuantity, instanceTitle, effectiveLocation.id, materialTypeId) + ) + .then(order => { + orderNumber = order; }); - UsersOwners.createViaApi({ - id: ownerId, - owner: 'AutotestOwner' + getRandomPostfix(), - servicePointOwner: [ - { - value: effectiveLocationServicePoint.id, - label: effectiveLocationServicePoint.name, - }, - ], - }); }); + UsersOwners.createViaApi({ + id: ownerId, + owner: 'AutotestOwner' + getRandomPostfix(), + servicePointOwner: [ + { + value: effectiveLocationServicePoint.id, + label: effectiveLocationServicePoint.name, + }, + ], + }); }); ServicePoints.getViaApi({ limit: 1, query: 'name=="Online"' }) .then((servicePoints) => { @@ -128,20 +127,20 @@ describe('inventory', () => { }); }); - afterEach('delete test data', () => { - Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) - .then(order => Orders.deleteOrderViaApi(order[0].id)); - UsersOwners.deleteViaApi(ownerId); - Users.deleteViaApi(userForDeliveryRequest.userId); - InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); - MaterialTypes.deleteApi(materialTypeId); - NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( - effectiveLocation.institutionId, - effectiveLocation.campusId, - effectiveLocation.libraryId, - effectiveLocation.id - ); - }); + // afterEach('delete test data', () => { + // Orders.getOrdersApi({ limit: 1, query: `"poNumber"=="${orderNumber}"` }) + // .then(order => Orders.deleteOrderViaApi(order[0].id)); + // UsersOwners.deleteViaApi(ownerId); + // Users.deleteViaApi(userForDeliveryRequest.userId); + // InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(itemBarcode); + // MaterialTypes.deleteApi(materialTypeId); + // NewLocation.deleteViaApiIncludingInstitutionCampusLibrary( + // effectiveLocation.institutionId, + // effectiveLocation.campusId, + // effectiveLocation.libraryId, + // effectiveLocation.id + // ); + // }); const openItem = (title, itemLocation, barcode) => { cy.visit(TopMenu.inventoryPath); @@ -248,7 +247,8 @@ describe('inventory', () => { NewRequest.createWithUserName({ itemBarcode, requesterName: userName, - pickupServicePoint: effectiveLocationServicePoint.name + pickupServicePoint: effectiveLocationServicePoint.name, + requestType: 'Page' }); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.paged); @@ -268,6 +268,7 @@ describe('inventory', () => { openUser(userName); UserLoans.declareLoanLost(itemBarcode); ConfirmItemStatusModal.confirmItemStatus(); + cy.wait(8000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.declaredLost); @@ -276,6 +277,7 @@ describe('inventory', () => { UserLoans.renewItem(itemBarcode); RenewConfirmationModal.confirmRenewOverrideItem(); OverrideAndRenewModal.confirmOverrideItem(); + cy.wait(8000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.checkedOut); @@ -303,10 +305,10 @@ describe('inventory', () => { cy.wait(8000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - + cy.wait(8000); // check out item to user with delivery request checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - + cy.wait(8000); // check in item at service point assigned to its effective location cy.visit(TopMenu.checkInPath); cy.wait(8000); diff --git a/cypress/support/fragments/check-in-actions/checkInModals.js b/cypress/support/fragments/check-in-actions/checkInModals.js index 48f54d24c4..57ea09c427 100644 --- a/cypress/support/fragments/check-in-actions/checkInModals.js +++ b/cypress/support/fragments/check-in-actions/checkInModals.js @@ -17,6 +17,7 @@ export default { confirmAvaitingPickUp:() => { cy.do(awaitingPickupModal.find(printSlipCheckbox).click()); + cy.wait(1500); cy.do(awaitingPickupModal.find(closeButton).click()); }, diff --git a/cypress/support/fragments/check-out-actions/check-out-actions.js b/cypress/support/fragments/check-out-actions/check-out-actions.js index 76abaf5345..a5836238c5 100644 --- a/cypress/support/fragments/check-out-actions/check-out-actions.js +++ b/cypress/support/fragments/check-out-actions/check-out-actions.js @@ -20,7 +20,7 @@ const userPane = PaneContent({ id: 'patron-details-content' }); function addPatron(userName) { cy.do(Button({ id:'clickable-find-user' }).click()); SelectUser.searchUser(userName); - SelectUser.selectUserFromList(userName); + SelectUser.selectUserFromList(); } export default { diff --git a/cypress/support/fragments/check-out-actions/selectUser.js b/cypress/support/fragments/check-out-actions/selectUser.js index 63b1959f17..8f99c3f333 100644 --- a/cypress/support/fragments/check-out-actions/selectUser.js +++ b/cypress/support/fragments/check-out-actions/selectUser.js @@ -9,8 +9,8 @@ export default { cy.expect(selectUserModal.find(HTML(including('1 record found'))).exists()); }, - selectUserFromList:(userName) => { - cy.do(selectUserModal.find(MultiColumnListCell(including(userName))).click()); + selectUserFromList:() => { + cy.do(selectUserModal.find(MultiColumnListCell({ columnIndex: 0 })).click()); cy.expect(selectUserModal.absent()); } }; diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index 671125d6a6..5f7517d46a 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -32,7 +32,7 @@ const selectItemPane = Pane({ id: 'items-dialog-instance-items-list' }); function addRequester(userName) { cy.do(Button({ id:'requestform-addrequest' }).click()); SelectUser.searchUser(userName); - SelectUser.selectUserFromList(userName); + SelectUser.selectUserFromList(); } function openNewRequestPane() { @@ -83,24 +83,18 @@ export default { createNewRequest(newRequest) { openNewRequestPane(); - fillRequiredFields(newRequest); - choosepickupServicePoint(newRequest.pickupServicePoint); - saveRequestAndClose(); - waitLoading(); + this.fillRequiredFields(newRequest); + this.choosepickupServicePoint(newRequest.pickupServicePoint); + this.saveRequestAndClose(); + this.waitLoading(); }, createDeliveryRequest(newRequest) { - openNewRequestPane(); - cy.do([itemBarcodeInput.fillIn(newRequest.itemBarcode), - enterItemBarcodeButton.click(), - selectRequestType.choose(newRequest.requestType), - requesterBarcodeInput.fillIn(newRequest.requesterBarcode), - enterRequesterBarcodeButton.click() - ]); - cy.expect(selectServicePoint.exists); + this.openNewRequestPane(); + this.fillRequiredFields(newRequest); // need to wait until instanceId is uploaded cy.wait(2500); - saveRequestAndClose(); + this.saveRequestAndClose(); }, createWithUserName(newRequest) { @@ -117,12 +111,13 @@ export default { // need to wait until instanceId is uploaded cy.wait(2500); this.choosepickupServicePoint(newRequest.pickupServicePoint); + cy.do(selectRequestType.choose(newRequest.requestType)); this.saveRequestAndClose(); this.waitLoading(); }, enableTitleLevelRequest() { - //need to synchronize actions before click + // need to synchronize actions before click cy.wait(3000); cy.do(titleLevelRequest.click()); }, @@ -196,6 +191,6 @@ export default { cy.do(enterRequesterBarcodeButton.click()); cy.expect(selectServicePoint.exists()); cy.wait('@getUsers'); - choosepickupServicePoint(newRequest.pickupServicePoint); + this.choosepickupServicePoint(newRequest.pickupServicePoint); } }; From 1085c4cf00bd51c79581da528c479585fba43b45 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 31 Jul 2023 17:21:31 +0300 Subject: [PATCH 20/32] added waiter --- cypress/e2e/inventory/item-status-date-updates.cy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 0decbb75f9..92d971ad73 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -145,6 +145,7 @@ describe('inventory', () => { const openItem = (title, itemLocation, barcode) => { cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.searchByParameter('Title (all)', title); + cy.wait(3000); InventoryInstances.selectInstance(); InventoryInstance.openHoldings(itemLocation); InventoryInstance.openItemByBarcode(barcode); From 399ec330018cfd5818a40d9ec6a0a61515a20b22 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 31 Jul 2023 17:39:17 +0300 Subject: [PATCH 21/32] changed method selected user --- cypress/support/fragments/users/usersSearchPane.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/fragments/users/usersSearchPane.js b/cypress/support/fragments/users/usersSearchPane.js index 940921b480..d815e863bd 100644 --- a/cypress/support/fragments/users/usersSearchPane.js +++ b/cypress/support/fragments/users/usersSearchPane.js @@ -38,8 +38,8 @@ export default { waitClick(); }, - selectUserFromList: (userName) => { - cy.do(Pane({ id:'users-search-results-pane' }).find(MultiColumnListCell(userName)).click()); + selectUserFromList: (rowNumber = 0) => { + cy.do(Pane({ id:'users-search-results-pane' }).click({ row: rowNumber })); }, openUser(userId) { From 4c37cc611f93d06c36c20092ff91f9b4c7edfe16 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 31 Jul 2023 17:54:50 +0300 Subject: [PATCH 22/32] changed method --- cypress/support/fragments/requests/selectUser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/support/fragments/requests/selectUser.js b/cypress/support/fragments/requests/selectUser.js index a230c910cd..c74c543df2 100644 --- a/cypress/support/fragments/requests/selectUser.js +++ b/cypress/support/fragments/requests/selectUser.js @@ -9,8 +9,9 @@ export default { cy.expect(selectUserModal.find(HTML(including('1 record found'))).exists()); }, - selectUserFromList:(userName) => { - cy.do(selectUserModal.find(MultiColumnListCell(userName)).click()); + selectUserFromList:() => { + cy.do(selectUserModal.click({ row: 0 })); + //cy.do(selectUserModal.find(MultiColumnListCell(userName)).click()); cy.expect(selectUserModal.absent()); } }; From 28313e58cb51174472b9f2b09ea16e575b21c082 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 31 Jul 2023 19:01:23 +0300 Subject: [PATCH 23/32] fixed method select user --- .../check-out-actions/check-out-actions.js | 19 ++++++++++++++++++- .../support/fragments/requests/selectUser.js | 5 ++--- .../fragments/users/usersSearchPane.js | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/cypress/support/fragments/check-out-actions/check-out-actions.js b/cypress/support/fragments/check-out-actions/check-out-actions.js index a5836238c5..af9c11c696 100644 --- a/cypress/support/fragments/check-out-actions/check-out-actions.js +++ b/cypress/support/fragments/check-out-actions/check-out-actions.js @@ -14,16 +14,19 @@ import { } from '../../../../interactors'; import SelectUser from './selectUser'; +const modal = Modal('Confirm multipiece check out'); const endSessionButton = Button('End session'); const userPane = PaneContent({ id: 'patron-details-content' }); +const modalForDeliveryRequest = Modal('Route for delivery request'); function addPatron(userName) { cy.do(Button({ id:'clickable-find-user' }).click()); SelectUser.searchUser(userName); - SelectUser.selectUserFromList(); + SelectUser.selectUserFromList(userName); } export default { + modal, addPatron, checkOutUser(userBarcode, otherParameter) { return cy.do([ @@ -99,6 +102,16 @@ export default { cy.expect(MultiColumnList({ id:'list-items-checked-out' }).find(HTML(including(barcode))).absent()); }, + confirmMultipieceCheckOut(barcode) { + cy.do(modal.find(Button('Check out')).click()); + cy.expect(MultiColumnList({ id: 'list-items-checked-out' }).find(HTML(including(barcode))).exists()); + }, + + cancelMultipleCheckOutModal:() => { + cy.do(modal.find(Button('Cancel')).click()); + cy.expect(modal.absent()); + }, + openLoanDetails() { cy.do(Button({ id: 'available-item-actions-button' }).click()); cy.do(Button('Loan details').click()); @@ -123,9 +136,13 @@ export default { checkOutItemWithUserName(userName, itemBarcode) { addPatron(userName); + cy.intercept('/circulation/loans?*').as('getLoans'); cy.do(Button({ id: 'clickable-find-patron' }).click()); cy.expect(KeyValue('Borrower').exists()); + cy.wait('@getLoans'); + cy.intercept('/circulation/requests?*').as('getRequests'); cy.do(TextField({ name: 'item.barcode' }).fillIn(itemBarcode)); + cy.wait('@getRequests'); cy.wait(2000); cy.do(Button({ id: 'clickable-add-item' }).click()); // waiters needs for check out item in loop diff --git a/cypress/support/fragments/requests/selectUser.js b/cypress/support/fragments/requests/selectUser.js index c74c543df2..0da5b3b1c7 100644 --- a/cypress/support/fragments/requests/selectUser.js +++ b/cypress/support/fragments/requests/selectUser.js @@ -1,4 +1,4 @@ -import { Button, Modal, TextField, HTML, including, MultiColumnListCell } from '../../../../interactors'; +import { Button, Modal, TextField, HTML, including, MultiColumnListRow } from '../../../../interactors'; const selectUserModal = Modal('Select User'); @@ -10,8 +10,7 @@ export default { }, selectUserFromList:() => { - cy.do(selectUserModal.click({ row: 0 })); - //cy.do(selectUserModal.find(MultiColumnListCell(userName)).click()); + cy.do(selectUserModal.find(MultiColumnListRow({ indexRow: 'row-0' })).click()); cy.expect(selectUserModal.absent()); } }; diff --git a/cypress/support/fragments/users/usersSearchPane.js b/cypress/support/fragments/users/usersSearchPane.js index d815e863bd..940921b480 100644 --- a/cypress/support/fragments/users/usersSearchPane.js +++ b/cypress/support/fragments/users/usersSearchPane.js @@ -38,8 +38,8 @@ export default { waitClick(); }, - selectUserFromList: (rowNumber = 0) => { - cy.do(Pane({ id:'users-search-results-pane' }).click({ row: rowNumber })); + selectUserFromList: (userName) => { + cy.do(Pane({ id:'users-search-results-pane' }).find(MultiColumnListCell(userName)).click()); }, openUser(userId) { From c1892e559e10dc3e1d2988a0e91242ba381f231e Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Mon, 31 Jul 2023 19:20:34 +0300 Subject: [PATCH 24/32] added waiters --- .../e2e/inventory/item-status-date-updates.cy.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 92d971ad73..b834e0e909 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -267,19 +267,26 @@ describe('inventory', () => { // declare item lost openUser(userName); + cy.wait(3000); UserLoans.declareLoanLost(itemBarcode); + cy.wait(3000); ConfirmItemStatusModal.confirmItemStatus(); - cy.wait(8000); + cy.wait(3000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); + cy.wait(3000); fullCheck(ItemRecordView.itemStatuses.declaredLost); // renew item (through override) openUser(userName); + cy.wait(3000); UserLoans.renewItem(itemBarcode); + cy.wait(3000); RenewConfirmationModal.confirmRenewOverrideItem(); + cy.wait(3000); OverrideAndRenewModal.confirmOverrideItem(); - cy.wait(8000); + cy.wait(3000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); + cy.wait(3000); fullCheck(ItemRecordView.itemStatuses.checkedOut); // edit item record so that it has multiple pieces @@ -302,9 +309,11 @@ describe('inventory', () => { cy.wait(8000); cy.visit(TopMenu.checkOutPath); CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + cy.wait(3000); CheckOutModals.cancelMultipleCheckOut(); cy.wait(8000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); + cy.wait(3000); fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); cy.wait(8000); // check out item to user with delivery request @@ -317,6 +326,7 @@ describe('inventory', () => { CheckInModals.confirmMultipieceCheckIn(); cy.wait(8000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); + cy.wait(3000); fullCheck(ItemRecordView.itemStatuses.available); }); }); From 827b63e25e4dec4ebfc56ea02260d30b3c1c9deb Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Tue, 1 Aug 2023 08:24:00 +0300 Subject: [PATCH 25/32] commented 268-332 --- .../inventory/item-status-date-updates.cy.js | 126 +++++++++--------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index b834e0e909..e0e31a76e2 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -265,68 +265,70 @@ describe('inventory', () => { // check out item to user for whom page request was created checkOut(userName, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckInModals.confirmAvaitingPickupCheckIn); - // declare item lost - openUser(userName); - cy.wait(3000); - UserLoans.declareLoanLost(itemBarcode); - cy.wait(3000); - ConfirmItemStatusModal.confirmItemStatus(); - cy.wait(3000); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - cy.wait(3000); - fullCheck(ItemRecordView.itemStatuses.declaredLost); - - // renew item (through override) - openUser(userName); - cy.wait(3000); - UserLoans.renewItem(itemBarcode); - cy.wait(3000); - RenewConfirmationModal.confirmRenewOverrideItem(); - cy.wait(3000); - OverrideAndRenewModal.confirmOverrideItem(); - cy.wait(3000); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - cy.wait(3000); - fullCheck(ItemRecordView.itemStatuses.checkedOut); - - // edit item record so that it has multiple pieces - InventoryInstance.edit(); - ItemRecordView.addPieceToItem(numberOfPieces); - fullCheck(ItemRecordView.itemStatuses.checkedOut); + // // declare item lost + // openUser(userName); + // cy.wait(3000); + // UserLoans.declareLoanLost(itemBarcode); + // cy.wait(3000); + // ConfirmItemStatusModal.confirmItemStatus(); + // cy.wait(3000); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // cy.wait(3000); + // fullCheck(ItemRecordView.itemStatuses.declaredLost); + // cy.pause(); + // // renew item (through override) + // openUser(userName); + // cy.wait(3000); + // UserLoans.renewItem(itemBarcode); + // cy.wait(3000); + // cy.pause(); + // RenewConfirmationModal.confirmRenewOverrideItem(); + // cy.wait(3000); + // OverrideAndRenewModal.confirmOverrideItem(); + // cy.wait(3000); + // cy.pause(); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // cy.wait(3000); + // fullCheck(ItemRecordView.itemStatuses.checkedOut); + // cy.pause(); + // // edit item record so that it has multiple pieces + // InventoryInstance.edit(); + // ItemRecordView.addPieceToItem(numberOfPieces); + // fullCheck(ItemRecordView.itemStatuses.checkedOut); - // create delivery request (hold or recall) on item - cy.visit(TopMenu.requestsPath); - cy.wait(8000); - NewRequest.createDeliveryRequest({ - itemBarcode, - requesterBarcode: userForDeliveryRequest.barcode, - requestType: REQUEST_TYPES.HOLD - }); - cy.wait(8000); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - cy.wait(8000); - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - cy.wait(3000); - CheckOutModals.cancelMultipleCheckOut(); - cy.wait(8000); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - cy.wait(3000); - fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - cy.wait(8000); - // check out item to user with delivery request - checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - cy.wait(8000); - // check in item at service point assigned to its effective location - cy.visit(TopMenu.checkInPath); - cy.wait(8000); - CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - cy.wait(8000); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - cy.wait(3000); - fullCheck(ItemRecordView.itemStatuses.available); + // // create delivery request (hold or recall) on item + // cy.visit(TopMenu.requestsPath); + // cy.wait(8000); + // NewRequest.createDeliveryRequest({ + // itemBarcode, + // requesterBarcode: userForDeliveryRequest.barcode, + // requestType: REQUEST_TYPES.HOLD + // }); + // cy.wait(8000); + // cy.visit(TopMenu.checkInPath); + // CheckInActions.checkInItem(itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); + // cy.wait(8000); + // cy.visit(TopMenu.checkOutPath); + // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + // cy.wait(3000); + // CheckOutModals.cancelMultipleCheckOut(); + // cy.wait(8000); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // cy.wait(3000); + // fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + // cy.wait(8000); + // // check out item to user with delivery request + // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); + // cy.wait(8000); + // // check in item at service point assigned to its effective location + // cy.visit(TopMenu.checkInPath); + // cy.wait(8000); + // CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); + // cy.wait(8000); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // cy.wait(3000); + // fullCheck(ItemRecordView.itemStatuses.available); }); }); From bb9fef13db4f6ff9b76f1ede473304b1b277baa6 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 2 Aug 2023 15:56:22 +0300 Subject: [PATCH 26/32] created new method for open accordion --- .../inventory/item-status-date-updates.cy.js | 123 +++++++----------- cypress/support/fragments/users/usersCard.js | 4 + 2 files changed, 51 insertions(+), 76 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index e0e31a76e2..1bbff63775 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -1,16 +1,7 @@ /* eslint-disable cypress/no-unnecessary-waiting */ import uuid from 'uuid'; import getRandomPostfix from '../../support/utils/stringTools'; -import { - REQUEST_POLICY_NAMES, - NOTICE_POLICY_NAMES, - OVERDUE_FINE_POLICY_NAMES, - CY_ENV, - LOST_ITEM_FEES_POLICY_NAMES, - LOAN_POLICY_NAMES, - FULFILMENT_PREFERENCES, - REQUEST_TYPES -} from '../../support/constants'; +import { FULFILMENT_PREFERENCES, REQUEST_TYPES } from '../../support/constants'; import Orders from '../../support/fragments/orders/orders'; import NewOrder from '../../support/fragments/orders/newOrder'; import TopMenu from '../../support/fragments/topMenu'; @@ -193,7 +184,7 @@ describe('inventory', () => { cy.visit(TopMenu.usersPath); UsersSearchPane.searchByKeywords(name); UsersSearchPane.selectUserFromList(name); - UsersCard.openLoans(); + UsersCard.openLoansAccordion(); UsersCard.showOpenedLoans(); }; @@ -265,70 +256,50 @@ describe('inventory', () => { // check out item to user for whom page request was created checkOut(userName, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckInModals.confirmAvaitingPickupCheckIn); - // // declare item lost - // openUser(userName); - // cy.wait(3000); - // UserLoans.declareLoanLost(itemBarcode); - // cy.wait(3000); - // ConfirmItemStatusModal.confirmItemStatus(); - // cy.wait(3000); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // cy.wait(3000); - // fullCheck(ItemRecordView.itemStatuses.declaredLost); - // cy.pause(); - // // renew item (through override) - // openUser(userName); - // cy.wait(3000); - // UserLoans.renewItem(itemBarcode); - // cy.wait(3000); - // cy.pause(); - // RenewConfirmationModal.confirmRenewOverrideItem(); - // cy.wait(3000); - // OverrideAndRenewModal.confirmOverrideItem(); - // cy.wait(3000); - // cy.pause(); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // cy.wait(3000); - // fullCheck(ItemRecordView.itemStatuses.checkedOut); - // cy.pause(); - // // edit item record so that it has multiple pieces - // InventoryInstance.edit(); - // ItemRecordView.addPieceToItem(numberOfPieces); - // fullCheck(ItemRecordView.itemStatuses.checkedOut); - - // // create delivery request (hold or recall) on item - // cy.visit(TopMenu.requestsPath); - // cy.wait(8000); - // NewRequest.createDeliveryRequest({ - // itemBarcode, - // requesterBarcode: userForDeliveryRequest.barcode, - // requestType: REQUEST_TYPES.HOLD - // }); - // cy.wait(8000); - // cy.visit(TopMenu.checkInPath); - // CheckInActions.checkInItem(itemBarcode); - // CheckInModals.confirmMultipieceCheckIn(); - // cy.wait(8000); - // cy.visit(TopMenu.checkOutPath); - // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - // cy.wait(3000); - // CheckOutModals.cancelMultipleCheckOut(); - // cy.wait(8000); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // cy.wait(3000); - // fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - // cy.wait(8000); - // // check out item to user with delivery request - // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - // cy.wait(8000); - // // check in item at service point assigned to its effective location - // cy.visit(TopMenu.checkInPath); - // cy.wait(8000); - // CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - // CheckInModals.confirmMultipieceCheckIn(); - // cy.wait(8000); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // cy.wait(3000); - // fullCheck(ItemRecordView.itemStatuses.available); + // declare item lost + openUser(userName); + UserLoans.declareLoanLost(itemBarcode); + ConfirmItemStatusModal.confirmItemStatus(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.declaredLost); + + // renew item (through override) + openUser(userName); + UserLoans.renewItem(itemBarcode); + RenewConfirmationModal.confirmRenewOverrideItem(); + OverrideAndRenewModal.confirmOverrideItem(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.checkedOut); + + // edit item record so that it has multiple pieces + InventoryInstance.edit(); + ItemRecordView.addPieceToItem(numberOfPieces); + fullCheck(ItemRecordView.itemStatuses.checkedOut); + + // create delivery request (hold or recall) on item + cy.visit(TopMenu.requestsPath); + NewRequest.createDeliveryRequest({ + itemBarcode, + requesterBarcode: userForDeliveryRequest.barcode, + requestType: REQUEST_TYPES.HOLD + }); + cy.visit(TopMenu.checkInPath); + CheckInActions.checkInItem(itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + cy.visit(TopMenu.checkOutPath); + CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + CheckOutModals.cancelMultipleCheckOut(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + + // check out item to user with delivery request + checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); + + // check in item at service point assigned to its effective location + cy.visit(TopMenu.checkInPath); + CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + CheckInModals.confirmMultipieceCheckIn(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.available); }); }); diff --git a/cypress/support/fragments/users/usersCard.js b/cypress/support/fragments/users/usersCard.js index 2b9e1d1f51..8268f4200e 100644 --- a/cypress/support/fragments/users/usersCard.js +++ b/cypress/support/fragments/users/usersCard.js @@ -45,6 +45,10 @@ export default { cy.do(Accordion({ id : 'loansSection' }).clickHeader()); return cy.wait('@getLoans', { requestTimeout: 10000 }); }, + openLoansAccordion() { + cy.do(Accordion({ id : 'loansSection' }).clickHeader()); + }, + openFeeFines() { cy.do(feesFinesAccourdion.clickHeader()); }, From 681dc22a1de45780d63fde0806ce4b33ada22563 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 2 Aug 2023 17:22:29 +0300 Subject: [PATCH 27/32] commented 266-303 --- .../inventory/item-status-date-updates.cy.js | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 1bbff63775..ad47e0ba58 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -263,43 +263,43 @@ describe('inventory', () => { openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.declaredLost); - // renew item (through override) - openUser(userName); - UserLoans.renewItem(itemBarcode); - RenewConfirmationModal.confirmRenewOverrideItem(); - OverrideAndRenewModal.confirmOverrideItem(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.checkedOut); - - // edit item record so that it has multiple pieces - InventoryInstance.edit(); - ItemRecordView.addPieceToItem(numberOfPieces); - fullCheck(ItemRecordView.itemStatuses.checkedOut); - - // create delivery request (hold or recall) on item - cy.visit(TopMenu.requestsPath); - NewRequest.createDeliveryRequest({ - itemBarcode, - requesterBarcode: userForDeliveryRequest.barcode, - requestType: REQUEST_TYPES.HOLD - }); - cy.visit(TopMenu.checkInPath); - CheckInActions.checkInItem(itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - cy.visit(TopMenu.checkOutPath); - CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); - CheckOutModals.cancelMultipleCheckOut(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); - - // check out item to user with delivery request - checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); - - // check in item at service point assigned to its effective location - cy.visit(TopMenu.checkInPath); - CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); - CheckInModals.confirmMultipieceCheckIn(); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.available); + // // renew item (through override) + // openUser(userName); + // UserLoans.renewItem(itemBarcode); + // RenewConfirmationModal.confirmRenewOverrideItem(); + // OverrideAndRenewModal.confirmOverrideItem(); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.checkedOut); + + // // edit item record so that it has multiple pieces + // InventoryInstance.edit(); + // ItemRecordView.addPieceToItem(numberOfPieces); + // fullCheck(ItemRecordView.itemStatuses.checkedOut); + + // // create delivery request (hold or recall) on item + // cy.visit(TopMenu.requestsPath); + // NewRequest.createDeliveryRequest({ + // itemBarcode, + // requesterBarcode: userForDeliveryRequest.barcode, + // requestType: REQUEST_TYPES.HOLD + // }); + // cy.visit(TopMenu.checkInPath); + // CheckInActions.checkInItem(itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); + // cy.visit(TopMenu.checkOutPath); + // CheckOutActions.checkOutItemWithUserName(userName, itemBarcode); + // CheckOutModals.cancelMultipleCheckOut(); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.awaitingDelivery); + + // // check out item to user with delivery request + // checkOut(userForDeliveryRequest.username, itemBarcode, ItemRecordView.itemStatuses.checkedOut, CheckOutModals.confirmMultipieceCheckOut); + + // // check in item at service point assigned to its effective location + // cy.visit(TopMenu.checkInPath); + // CheckInActions.backdateCheckInItem(DateTools.getPreviousDayDate(), itemBarcode); + // CheckInModals.confirmMultipieceCheckIn(); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.available); }); }); From de8175f5270ca6a4b101dfca5c1f87258fb2627f Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 2 Aug 2023 18:07:09 +0300 Subject: [PATCH 28/32] commented 274-303 --- .../e2e/inventory/item-status-date-updates.cy.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index ad47e0ba58..e60bd2a816 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -263,13 +263,13 @@ describe('inventory', () => { openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.declaredLost); - // // renew item (through override) - // openUser(userName); - // UserLoans.renewItem(itemBarcode); - // RenewConfirmationModal.confirmRenewOverrideItem(); - // OverrideAndRenewModal.confirmOverrideItem(); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // fullCheck(ItemRecordView.itemStatuses.checkedOut); + // renew item (through override) + openUser(userName); + UserLoans.renewItem(itemBarcode); + RenewConfirmationModal.confirmRenewOverrideItem(); + OverrideAndRenewModal.confirmOverrideItem(); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.checkedOut); // // edit item record so that it has multiple pieces // InventoryInstance.edit(); From 5a3ac4769df8ef3d821dfc3e9bed482834187695 Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 2 Aug 2023 18:47:33 +0300 Subject: [PATCH 29/32] adde waiters --- cypress/e2e/inventory/item-status-date-updates.cy.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index e60bd2a816..997c52bee2 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -262,12 +262,14 @@ describe('inventory', () => { ConfirmItemStatusModal.confirmItemStatus(); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.declaredLost); - + cy.wait(8000); // renew item (through override) openUser(userName); UserLoans.renewItem(itemBarcode); + cy.wait(8000); RenewConfirmationModal.confirmRenewOverrideItem(); OverrideAndRenewModal.confirmOverrideItem(); + cy.wait(8000); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.checkedOut); From 81f5461d93ef1b685ca19fc9ab97d913b4fb4cbe Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 2 Aug 2023 18:58:49 +0300 Subject: [PATCH 30/32] added true --- cypress/e2e/inventory/item-status-date-updates.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 997c52bee2..eb2b97bd7e 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -262,10 +262,10 @@ describe('inventory', () => { ConfirmItemStatusModal.confirmItemStatus(); openItem(instanceTitle, effectiveLocation.name, itemBarcode); fullCheck(ItemRecordView.itemStatuses.declaredLost); - cy.wait(8000); + // renew item (through override) openUser(userName); - UserLoans.renewItem(itemBarcode); + UserLoans.renewItem(itemBarcode, true); cy.wait(8000); RenewConfirmationModal.confirmRenewOverrideItem(); OverrideAndRenewModal.confirmOverrideItem(); From 8a82d39d71947b041bee9988b065a4c17b7561bc Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Wed, 2 Aug 2023 19:14:24 +0300 Subject: [PATCH 31/32] commented 269-305 --- cypress/e2e/inventory/item-status-date-updates.cy.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index eb2b97bd7e..6b25bcb7de 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -266,12 +266,12 @@ describe('inventory', () => { // renew item (through override) openUser(userName); UserLoans.renewItem(itemBarcode, true); - cy.wait(8000); - RenewConfirmationModal.confirmRenewOverrideItem(); - OverrideAndRenewModal.confirmOverrideItem(); - cy.wait(8000); - openItem(instanceTitle, effectiveLocation.name, itemBarcode); - fullCheck(ItemRecordView.itemStatuses.checkedOut); + // cy.wait(8000); + // RenewConfirmationModal.confirmRenewOverrideItem(); + // OverrideAndRenewModal.confirmOverrideItem(); + // cy.wait(8000); + // openItem(instanceTitle, effectiveLocation.name, itemBarcode); + // fullCheck(ItemRecordView.itemStatuses.checkedOut); // // edit item record so that it has multiple pieces // InventoryInstance.edit(); From 5b19c1d4702a565425db8d92a513bed54eea218c Mon Sep 17 00:00:00 2001 From: Tetiana_Paranich Date: Thu, 3 Aug 2023 09:52:49 +0300 Subject: [PATCH 32/32] uncommented 272-277 --- .../e2e/inventory/item-status-date-updates.cy.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/inventory/item-status-date-updates.cy.js b/cypress/e2e/inventory/item-status-date-updates.cy.js index 6b25bcb7de..69e0ec370e 100644 --- a/cypress/e2e/inventory/item-status-date-updates.cy.js +++ b/cypress/e2e/inventory/item-status-date-updates.cy.js @@ -183,8 +183,11 @@ describe('inventory', () => { const openUser = (name) => { cy.visit(TopMenu.usersPath); UsersSearchPane.searchByKeywords(name); + cy.wait(8000); UsersSearchPane.selectUserFromList(name); + cy.wait(8000); UsersCard.openLoansAccordion(); + cy.wait(8000); UsersCard.showOpenedLoans(); }; @@ -266,12 +269,12 @@ describe('inventory', () => { // renew item (through override) openUser(userName); UserLoans.renewItem(itemBarcode, true); - // cy.wait(8000); - // RenewConfirmationModal.confirmRenewOverrideItem(); - // OverrideAndRenewModal.confirmOverrideItem(); - // cy.wait(8000); - // openItem(instanceTitle, effectiveLocation.name, itemBarcode); - // fullCheck(ItemRecordView.itemStatuses.checkedOut); + cy.wait(8000); + RenewConfirmationModal.confirmRenewOverrideItem(); + OverrideAndRenewModal.confirmOverrideItem(); + cy.wait(8000); + openItem(instanceTitle, effectiveLocation.name, itemBarcode); + fullCheck(ItemRecordView.itemStatuses.checkedOut); // // edit item record so that it has multiple pieces // InventoryInstance.edit();