From 48918199217bf7b21f603d515bf154222b4c7771 Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 7 Aug 2023 10:35:42 -0500 Subject: [PATCH 01/19] Added Duke and Cornell test files and updated helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 47 +++++++++++++++++++ ...-transfer-criteria-example-test-duke.cy.js | 0 .../fragments/users/transferFeeFine.js | 42 +++++++++++++++-- 3 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js create mode 100644 cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js new file mode 100644 index 0000000000..1c152916bf --- /dev/null +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -0,0 +1,47 @@ +import TestTypes from "../../../../support/dictionary/testTypes"; +import DevTeams from "../../../../support/dictionary/devTeams"; +import settingsMenu from "../../../../support/fragments/settingsMenu"; +import TransferFeeFine from "../../../../support/fragments/users/transferFeeFine"; + +describe("Build the Cornell bursar transfer file", () => { + before(() => { + cy.loginAsAdmin({ + path: settingsMenu.usersTransferCriteria, + waiter: TransferFeeFine.waitLoadingTransferCriteria, + }); + }); + + // Criteria: No criteria(always run) + it("should be able to set no criteria", () => { + TransferFeeFine.setCriteria(false); + + }); + + it("should be able to set scheduling", () => { + TransferFeeFine.setTransferCriteriaScheduling( + "Weeks", + "1", + "11:00 PM", + "Monday" + ); + }); + + // Aggregate by patron: Box unchecked + + // Header Format + it("should be able to set header format", () => { + TransferFeeFine.setDataFormatSection(); + }); + + // Account Data Format + + // Footer Format + + // Preview + + // Transfer Account to + + // Run manually/ save and run + + // Verify that the transfer was successful +}); diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 5af15bdd90..b32c9396ba 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,4 +1,5 @@ -import { Button, Modal, TextField, Select, Pane } from '../../../../interactors'; +import { el } from 'date-fns/locale'; +import { Button, Modal, TextField, Select, Pane, MultiSelect } from '../../../../interactors'; const rootModal = Modal({ id: 'transfer-modal' }); const amountTextfield = rootModal.find(TextField({ id: 'amount' })); @@ -7,7 +8,7 @@ const transferAccountSelect = rootModal.find(Select({ name: 'method' })); const transferButton = rootModal.find(Button({ id: 'submit-button' })); const confirmModal = Modal('Confirm fee/fine transfer'); const confirmButton = confirmModal.find(Button('Confirm')); -const transferPane = Pane('Transfer criteria'); +const transferPane = Pane('Transfer configuration'); export default { waitLoading: () => { @@ -18,8 +19,28 @@ export default { cy.expect(transferPane.exists()); }, - selectTransferCriteriaSchedulePeriod(period = 'Days') { - cy.do(Select({ name: 'schedulePeriod' }).choose(period)); + setTransferCriteriaScheduling(frequency, interval, time, weekDays) { + cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); + + if (frequency === 'Weeks') { + cy.do([ + TextField({ name: 'scheduling.time' }).fillIn(time) + ]); + cy.do([ + TextField({ name: 'scheduling.interval' }).fillIn(interval) + ]); + cy.do([ + Select({ name: 'scheduling.weekDays' }).choose(weekDays) + ]); + } + else if (frequency === 'Days') { + cy.do([ + Select({ name: 'scheduling.interval' }).choose(interval) + ]); + } + else if (frequency === 'Hours') { + } + else return; }, typeScheduleTime(time) { @@ -35,6 +56,19 @@ export default { cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); }, + // All three of our acceptance tests use no criteria for the Criteria field + setCriteria(criteria) { + if (!criteria) { + cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); + } + }, + + // sectionName: string like 'Header', 'Account Data', 'Footer' + // dataFormat will be a list of options we config + setDataFormatSection(sectionName, dataFormat) { + + }, + setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), setOwner: (owner) => cy.do(ownerSelect.choose(owner)), setTransferAccount: (account) => cy.do(transferAccountSelect.choose(account)), From fc83873c3f517ed833b3b6cc809b7b3193f93cc3 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 8 Aug 2023 10:48:22 -0500 Subject: [PATCH 02/19] Added run manully function --- ...ansfer-criteria-example-test-cornell.cy.js | 20 ++++++++++-------- .../fragments/users/transferFeeFine.js | 21 ++++++++++++++++++- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 1c152916bf..bc609c24a8 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -11,12 +11,6 @@ describe("Build the Cornell bursar transfer file", () => { }); }); - // Criteria: No criteria(always run) - it("should be able to set no criteria", () => { - TransferFeeFine.setCriteria(false); - - }); - it("should be able to set scheduling", () => { TransferFeeFine.setTransferCriteriaScheduling( "Weeks", @@ -26,7 +20,15 @@ describe("Build the Cornell bursar transfer file", () => { ); }); + it("should be able to set no criteria", () => { + TransferFeeFine.setCriteria(false); + + }); + // Aggregate by patron: Box unchecked + it("should be able to set aggregate by patron", () => { + TransferFeeFine.setAggregateByPatron(false); + }); // Header Format it("should be able to set header format", () => { @@ -37,11 +39,11 @@ describe("Build the Cornell bursar transfer file", () => { // Footer Format - // Preview - // Transfer Account to - // Run manually/ save and run + it("should be able to run manually", () => { + TransferFeeFine.runManually(); + }); // Verify that the transfer was successful }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index b32c9396ba..fd28ff11c4 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -30,7 +30,9 @@ export default { TextField({ name: 'scheduling.interval' }).fillIn(interval) ]); cy.do([ - Select({ name: 'scheduling.weekDays' }).choose(weekDays) + // get the multi-select element, then choose the weekday buttons + MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDays) + ]); } else if (frequency === 'Days') { @@ -43,6 +45,23 @@ export default { else return; }, + setAggregateByPatron(aggregate) { + if (!aggregate) { + // check if the box is already unchecked + cy.expect(Button({ text: 'Group data by patron' }).exists()); + // uncheck the box + cy.do([ + Button({ text: 'Group data by patron' }).click() + ]); + } + }, + + runManually() { + cy.do([ + Button({ text: 'Run manually' }).click(), + ]); + }, + typeScheduleTime(time) { // time: string like 9:15 AM cy.do([ From 0addf36ccfa153c1788678e767b32c738acc5ba0 Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 10 Aug 2023 09:31:11 -0500 Subject: [PATCH 03/19] Added openAccordion, aggregateByPatron, basic format functions --- ...ansfer-criteria-example-test-cornell.cy.js | 16 +++++++-- .../fragments/users/transferFeeFine.js | 36 ++++++++++--------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index bc609c24a8..1be80f2ff3 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -11,6 +11,10 @@ describe("Build the Cornell bursar transfer file", () => { }); }); + it("should be able to open all the panes", () => { + TransferFeeFine.openAllPanes(); + }); + it("should be able to set scheduling", () => { TransferFeeFine.setTransferCriteriaScheduling( "Weeks", @@ -22,7 +26,6 @@ describe("Build the Cornell bursar transfer file", () => { it("should be able to set no criteria", () => { TransferFeeFine.setCriteria(false); - }); // Aggregate by patron: Box unchecked @@ -32,7 +35,15 @@ describe("Build the Cornell bursar transfer file", () => { // Header Format it("should be able to set header format", () => { - TransferFeeFine.setDataFormatSection(); + // get the parent element that contains text 'Header Format', then loop through its children and press the trash icon for each + cy.get('.dropdown-menu:has("Header format")').parent().within(() => { + cy.get("button[class^='iconButton']").each((el) => { + cy.wrap(el).click(); + }); + } + ); + + }); // Account Data Format @@ -45,5 +56,4 @@ describe("Build the Cornell bursar transfer file", () => { TransferFeeFine.runManually(); }); - // Verify that the transfer was successful }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index fd28ff11c4..fbe3ed3ff0 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -29,11 +29,6 @@ export default { cy.do([ TextField({ name: 'scheduling.interval' }).fillIn(interval) ]); - cy.do([ - // get the multi-select element, then choose the weekday buttons - MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDays) - - ]); } else if (frequency === 'Days') { cy.do([ @@ -47,12 +42,10 @@ export default { setAggregateByPatron(aggregate) { if (!aggregate) { - // check if the box is already unchecked - cy.expect(Button({ text: 'Group data by patron' }).exists()); - // uncheck the box - cy.do([ - Button({ text: 'Group data by patron' }).click() - ]); + // it is an input checkbox wiht name aggregate + cy.get('input[name="aggregate"]').uncheck( + { force: true } + ); } }, @@ -60,6 +53,7 @@ export default { cy.do([ Button({ text: 'Run manually' }).click(), ]); + cy.get('@alert').should('have.been.calledOnceWith', 'Job has been scheduled') }, typeScheduleTime(time) { @@ -75,17 +69,27 @@ export default { cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); }, - // All three of our acceptance tests use no criteria for the Criteria field setCriteria(criteria) { if (!criteria) { cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); } }, - - // sectionName: string like 'Header', 'Account Data', 'Footer' - // dataFormat will be a list of options we config - setDataFormatSection(sectionName, dataFormat) { + openAllPanes() { + // see if you can find a button that says "Collapse all" + if (Button({ text: 'Collapse all' }).exists()) { + // if you can find it, click it then click the new button "Expand all" + cy.do([ + Button({ text: 'Collapse all' }).click(), + Button({ text: 'Expand all' }).click() + ]); + } + else { + // if you can't find it, click the button "Expand all" + cy.do([ + Button({ text: 'Expand all' }).click() + ]); + } }, setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), From d85599ef53500018cb4b7823a4a9a9462da7cf93 Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 10 Aug 2023 09:32:53 -0500 Subject: [PATCH 04/19] Cleaned up helper functions --- cypress/support/fragments/users/transferFeeFine.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index fbe3ed3ff0..761d405642 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -42,11 +42,11 @@ export default { setAggregateByPatron(aggregate) { if (!aggregate) { - // it is an input checkbox wiht name aggregate cy.get('input[name="aggregate"]').uncheck( { force: true } ); } + // Currently don't have any test cases for aggregate by patron }, runManually() { @@ -73,19 +73,11 @@ export default { if (!criteria) { cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); } + // Currently don't have any test cases for criteria }, openAllPanes() { - // see if you can find a button that says "Collapse all" - if (Button({ text: 'Collapse all' }).exists()) { - // if you can find it, click it then click the new button "Expand all" - cy.do([ - Button({ text: 'Collapse all' }).click(), - Button({ text: 'Expand all' }).click() - ]); - } - else { - // if you can't find it, click the button "Expand all" + if (!Button({ text: 'Collapse all' }).exists()) { cy.do([ Button({ text: 'Expand all' }).click() ]); From 3644efbf771dfd477e5d2d2392b33b64649caa38 Mon Sep 17 00:00:00 2001 From: danetsao Date: Thu, 10 Aug 2023 11:40:39 -0500 Subject: [PATCH 05/19] Added transfer account helper function --- ...ansfer-criteria-example-test-cornell.cy.js | 26 +++++++++++-------- .../fragments/users/transferFeeFine.js | 8 +++++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 1be80f2ff3..fb4ad24130 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -33,27 +33,31 @@ describe("Build the Cornell bursar transfer file", () => { TransferFeeFine.setAggregateByPatron(false); }); + it("should be able to set transfer account data to", () => { + TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + }); + // Header Format it("should be able to set header format", () => { - // get the parent element that contains text 'Header Format', then loop through its children and press the trash icon for each - cy.get('.dropdown-menu:has("Header format")').parent().within(() => { - cy.get("button[class^='iconButton']").each((el) => { - cy.wrap(el).click(); - }); - } - ); - - + // remove all current header options + cy.do([ + Button({ icon: "trash" }).click(), + Button({ icon: "trash" }).click(), + Button({ icon: "trash" }).click(), + ]); }); // Account Data Format // Footer Format - + // Transer account data to + it("should be able to set transfer account data to", () => { + TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + }); it("should be able to run manually", () => { - TransferFeeFine.runManually(); + //TransferFeeFine.runManually(); }); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 761d405642..03a8a1226a 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -76,6 +76,13 @@ export default { // Currently don't have any test cases for criteria }, + setTransferAccount(feeFineOwner, transferAccount) { + cy.do([ + Select({ name: 'transferInfo.else.owner' }).choose(feeFineOwner), + Select({ name: 'transferInfo.else.account' }).choose(transferAccount) + ]); + }, + openAllPanes() { if (!Button({ text: 'Collapse all' }).exists()) { cy.do([ @@ -86,7 +93,6 @@ export default { setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), setOwner: (owner) => cy.do(ownerSelect.choose(owner)), - setTransferAccount: (account) => cy.do(transferAccountSelect.choose(account)), transferAndConfirm: () => { cy.do([ transferButton.click(), From dcfd63648825efc6c64150bf1f851d9322c8e1dc Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 14 Aug 2023 07:56:26 -0500 Subject: [PATCH 06/19] Added verify expect statementes for each section --- ...ansfer-criteria-example-test-cornell.cy.js | 21 +-- .../fragments/users/transferFeeFine.js | 156 +++++++++++------- 2 files changed, 107 insertions(+), 70 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index fb4ad24130..6fa0d96d25 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -13,6 +13,7 @@ describe("Build the Cornell bursar transfer file", () => { it("should be able to open all the panes", () => { TransferFeeFine.openAllPanes(); + TransferFeeFine.verifyOpenAllPanes(); }); it("should be able to set scheduling", () => { @@ -22,29 +23,28 @@ describe("Build the Cornell bursar transfer file", () => { "11:00 PM", "Monday" ); + TransferFeeFine.verifyTransferCriteriaScheduling( + "Weeks", + "1", + "11:00 PM", + "Monday" + ); }); it("should be able to set no criteria", () => { TransferFeeFine.setCriteria(false); + TransferFeeFine.verifyCriteria(false); }); // Aggregate by patron: Box unchecked it("should be able to set aggregate by patron", () => { TransferFeeFine.setAggregateByPatron(false); - }); - - it("should be able to set transfer account data to", () => { - TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + TransferFeeFine.verifyAggregateByPatron(false); }); // Header Format it("should be able to set header format", () => { - // remove all current header options - cy.do([ - Button({ icon: "trash" }).click(), - Button({ icon: "trash" }).click(), - Button({ icon: "trash" }).click(), - ]); + TransferFeeFine.removeHeaderFormat(); }); // Account Data Format @@ -54,6 +54,7 @@ describe("Build the Cornell bursar transfer file", () => { // Transer account data to it("should be able to set transfer account data to", () => { TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); + TransferFeeFine.verifyTransferAccount("Lost Item Fine Office", "acct"); }); it("should be able to run manually", () => { diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 03a8a1226a..27fbeee5a1 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,14 +1,21 @@ -import { el } from 'date-fns/locale'; -import { Button, Modal, TextField, Select, Pane, MultiSelect } from '../../../../interactors'; - -const rootModal = Modal({ id: 'transfer-modal' }); -const amountTextfield = rootModal.find(TextField({ id: 'amount' })); -const ownerSelect = rootModal.find(Select({ id: 'ownerId' })); -const transferAccountSelect = rootModal.find(Select({ name: 'method' })); -const transferButton = rootModal.find(Button({ id: 'submit-button' })); -const confirmModal = Modal('Confirm fee/fine transfer'); -const confirmButton = confirmModal.find(Button('Confirm')); -const transferPane = Pane('Transfer configuration'); +import { el } from "date-fns/locale"; +import { + Button, + Modal, + TextField, + Select, + Pane, + MultiSelect, +} from "../../../../interactors"; + +const rootModal = Modal({ id: "transfer-modal" }); +const amountTextfield = rootModal.find(TextField({ id: "amount" })); +const ownerSelect = rootModal.find(Select({ id: "ownerId" })); +const transferAccountSelect = rootModal.find(Select({ name: "method" })); +const transferButton = rootModal.find(Button({ id: "submit-button" })); +const confirmModal = Modal("Confirm fee/fine transfer"); +const confirmButton = confirmModal.find(Button("Confirm")); +const transferPane = Pane("Transfer configuration"); export default { waitLoading: () => { @@ -20,90 +27,119 @@ export default { }, setTransferCriteriaScheduling(frequency, interval, time, weekDays) { - cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); - - if (frequency === 'Weeks') { - cy.do([ - TextField({ name: 'scheduling.time' }).fillIn(time) - ]); - cy.do([ - TextField({ name: 'scheduling.interval' }).fillIn(interval) - ]); - } - else if (frequency === 'Days') { - cy.do([ - Select({ name: 'scheduling.interval' }).choose(interval) - ]); - } - else if (frequency === 'Hours') { - } - else return; + cy.do(Select({ name: "scheduling.frequency" }).choose(frequency)); + + if (frequency === "Weeks") { + cy.do([TextField({ name: "scheduling.time" }).fillIn(time)]); + cy.do([TextField({ name: "scheduling.interval" }).fillIn(interval)]); + } else if (frequency === "Days") { + cy.do([Select({ name: "scheduling.interval" }).choose(interval)]); + } else if (frequency === "Hours") { + } else return; }, setAggregateByPatron(aggregate) { if (!aggregate) { - cy.get('input[name="aggregate"]').uncheck( - { force: true } - ); + cy.get('input[name="aggregate"]').uncheck({ force: true }); } // Currently don't have any test cases for aggregate by patron }, runManually() { - cy.do([ - Button({ text: 'Run manually' }).click(), - ]); - cy.get('@alert').should('have.been.calledOnceWith', 'Job has been scheduled') + cy.do([Button({ text: "Run manually" }).click()]); + cy.get("@alert").should( + "have.been.calledOnceWith", + "Job has been scheduled" + ); }, typeScheduleTime(time) { // time: string like 9:15 AM cy.do([ - TextField({ name: 'scheduleTime' }).fillIn(time), - Button({ icon: 'clock' }).click(), - Button('Set time').click() + TextField({ name: "scheduleTime" }).fillIn(time), + Button({ icon: "clock" }).click(), + Button("Set time").click(), ]); }, verifyScheduleTime(time) { - cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); + cy.expect(TextField({ name: "scheduleTime", value: time }).exists()); }, setCriteria(criteria) { if (!criteria) { - cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); + cy.do( + Select({ name: "criteria.type" }).choose("No criteria (always run)") + ); } // Currently don't have any test cases for criteria }, setTransferAccount(feeFineOwner, transferAccount) { cy.do([ - Select({ name: 'transferInfo.else.owner' }).choose(feeFineOwner), - Select({ name: 'transferInfo.else.account' }).choose(transferAccount) + Select({ name: "transferInfo.else.owner" }).choose(feeFineOwner), + Select({ name: "transferInfo.else.account" }).choose(transferAccount), ]); }, openAllPanes() { - if (!Button({ text: 'Collapse all' }).exists()) { - cy.do([ - Button({ text: 'Expand all' }).click() - ]); + if (!Button({ text: "Collapse all" }).exists()) { + cy.do([Button({ text: "Expand all" }).click()]); } }, - setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toFixed(2))), - setOwner: (owner) => cy.do(ownerSelect.choose(owner)), - transferAndConfirm: () => { - cy.do([ - transferButton.click(), - confirmButton.click(), - ]); + verifyOpenAllPanes() { + cy.expect(Button({ text: "Collapse all" }).exists()); + }, + + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { + if (frequency === "Weeks") { + cy.expect(TextField({ name: "scheduling.time", value: time }).exists()); + cy.expect( + TextField({ name: "scheduling.interval", value: interval }).exists() + ); + } else if (frequency === "Days") { + cy.expect( + Select({ name: "scheduling.interval", value: interval }).exists() + ); + } else if (frequency === "Hours") { + } else return; + }, + + verifyCriteria(criteria) { + if (!criteria) { + cy.expect( + Select({ + name: "criteria.type", + value: "No criteria (always run)", + }).exists() + ); + } + // Currently don't have any test cases for criteria + }, + + verifyTransferAccount(feeFineOwner, transferAccount) { + cy.expect( + Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + ); + cy.expect( + Select({ + name: "transferInfo.else.account", + value: transferAccount, + }).exists() + ); + }, + + verifyTransferAccount(feeFineOwner, transferAccount) { + cy.expect( + Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + ); + cy.expect( + Select({ + name: "transferInfo.else.account", + value: transferAccount, + }).exists() + ); }, - transferFeeFineViaApi:(apiBody, feeFineId) => cy.okapiRequest({ - method: 'POST', - path: `accounts/${feeFineId}/transfer`, - body: apiBody, - isDefaultSearchParamsRequired: false - }), }; From e01db805c17466af18654be0606bbd0d5f875a72 Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 14 Aug 2023 12:53:25 -0500 Subject: [PATCH 07/19] Change all double quotes to single quotes --- ...ansfer-criteria-example-test-cornell.cy.js | 44 ++++---- .../fragments/users/transferFeeFine.js | 100 +++++++++--------- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 6fa0d96d25..2a3d664964 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -1,9 +1,9 @@ -import TestTypes from "../../../../support/dictionary/testTypes"; -import DevTeams from "../../../../support/dictionary/devTeams"; -import settingsMenu from "../../../../support/fragments/settingsMenu"; -import TransferFeeFine from "../../../../support/fragments/users/transferFeeFine"; +import TestTypes from '../../../../support/dictionary/testTypes'; +import DevTeams from '../../../../support/dictionary/devTeams'; +import settingsMenu from '../../../../support/fragments/settingsMenu'; +import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; -describe("Build the Cornell bursar transfer file", () => { +describe('Build the Cornell bursar transfer file', () => { before(() => { cy.loginAsAdmin({ path: settingsMenu.usersTransferCriteria, @@ -11,39 +11,39 @@ describe("Build the Cornell bursar transfer file", () => { }); }); - it("should be able to open all the panes", () => { + it('should be able to open all the panes', () => { TransferFeeFine.openAllPanes(); TransferFeeFine.verifyOpenAllPanes(); }); - it("should be able to set scheduling", () => { + it('should be able to set scheduling', () => { TransferFeeFine.setTransferCriteriaScheduling( - "Weeks", - "1", - "11:00 PM", - "Monday" + 'Weeks', + '1', + '11:00 PM', + 'Monday' ); TransferFeeFine.verifyTransferCriteriaScheduling( - "Weeks", - "1", - "11:00 PM", - "Monday" + 'Weeks', + '1', + '11:00 PM', + 'Monday' ); }); - it("should be able to set no criteria", () => { + it('should be able to set no criteria', () => { TransferFeeFine.setCriteria(false); TransferFeeFine.verifyCriteria(false); }); // Aggregate by patron: Box unchecked - it("should be able to set aggregate by patron", () => { + it('should be able to set aggregate by patron', () => { TransferFeeFine.setAggregateByPatron(false); TransferFeeFine.verifyAggregateByPatron(false); }); // Header Format - it("should be able to set header format", () => { + it('should be able to set header format', () => { TransferFeeFine.removeHeaderFormat(); }); @@ -52,12 +52,12 @@ describe("Build the Cornell bursar transfer file", () => { // Footer Format // Transer account data to - it("should be able to set transfer account data to", () => { - TransferFeeFine.setTransferAccount("Lost Item Fine Office", "acct"); - TransferFeeFine.verifyTransferAccount("Lost Item Fine Office", "acct"); + it('should be able to set transfer account data to', () => { + TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('Lost Item Fine Office', 'acct'); }); - it("should be able to run manually", () => { + it('should be able to run manually', () => { //TransferFeeFine.runManually(); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 27fbeee5a1..f3f6b42a5c 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -1,4 +1,4 @@ -import { el } from "date-fns/locale"; +import { el } from 'date-fns/locale'; import { Button, Modal, @@ -6,16 +6,16 @@ import { Select, Pane, MultiSelect, -} from "../../../../interactors"; +} from '../../../../interactors'; -const rootModal = Modal({ id: "transfer-modal" }); -const amountTextfield = rootModal.find(TextField({ id: "amount" })); -const ownerSelect = rootModal.find(Select({ id: "ownerId" })); -const transferAccountSelect = rootModal.find(Select({ name: "method" })); -const transferButton = rootModal.find(Button({ id: "submit-button" })); -const confirmModal = Modal("Confirm fee/fine transfer"); -const confirmButton = confirmModal.find(Button("Confirm")); -const transferPane = Pane("Transfer configuration"); +const rootModal = Modal({ id: 'transfer-modal' }); +const amountTextfield = rootModal.find(TextField({ id: 'amount' })); +const ownerSelect = rootModal.find(Select({ id: 'ownerId' })); +const transferAccountSelect = rootModal.find(Select({ name: 'method' })); +const transferButton = rootModal.find(Button({ id: 'submit-button' })); +const confirmModal = Modal('Confirm fee/fine transfer'); +const confirmButton = confirmModal.find(Button('Confirm')); +const transferPane = Pane('Transfer configuration'); export default { waitLoading: () => { @@ -27,14 +27,14 @@ export default { }, setTransferCriteriaScheduling(frequency, interval, time, weekDays) { - cy.do(Select({ name: "scheduling.frequency" }).choose(frequency)); - - if (frequency === "Weeks") { - cy.do([TextField({ name: "scheduling.time" }).fillIn(time)]); - cy.do([TextField({ name: "scheduling.interval" }).fillIn(interval)]); - } else if (frequency === "Days") { - cy.do([Select({ name: "scheduling.interval" }).choose(interval)]); - } else if (frequency === "Hours") { + cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); + + if (frequency === 'Weeks') { + cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); + cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + } else if (frequency === 'Days') { + cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); + } else if (frequency === 'Hours') { } else return; }, @@ -46,30 +46,30 @@ export default { }, runManually() { - cy.do([Button({ text: "Run manually" }).click()]); - cy.get("@alert").should( - "have.been.calledOnceWith", - "Job has been scheduled" + cy.do([Button({ text: 'Run manually' }).click()]); + cy.get('@alert').should( + 'have.been.calledOnceWith', + 'Job has been scheduled' ); }, typeScheduleTime(time) { // time: string like 9:15 AM cy.do([ - TextField({ name: "scheduleTime" }).fillIn(time), - Button({ icon: "clock" }).click(), - Button("Set time").click(), + TextField({ name: 'scheduleTime' }).fillIn(time), + Button({ icon: 'clock' }).click(), + Button('Set time').click(), ]); }, verifyScheduleTime(time) { - cy.expect(TextField({ name: "scheduleTime", value: time }).exists()); + cy.expect(TextField({ name: 'scheduleTime', value: time }).exists()); }, setCriteria(criteria) { if (!criteria) { cy.do( - Select({ name: "criteria.type" }).choose("No criteria (always run)") + Select({ name: 'criteria.type' }).choose('No criteria (always run)') ); } // Currently don't have any test cases for criteria @@ -77,32 +77,33 @@ export default { setTransferAccount(feeFineOwner, transferAccount) { cy.do([ - Select({ name: "transferInfo.else.owner" }).choose(feeFineOwner), - Select({ name: "transferInfo.else.account" }).choose(transferAccount), + Select({ name: 'transferInfo.else.owner' }).choose(feeFineOwner), + Select({ name: 'transferInfo.else.account' }).choose(transferAccount), ]); }, openAllPanes() { - if (!Button({ text: "Collapse all" }).exists()) { - cy.do([Button({ text: "Expand all" }).click()]); + if (!Button({ text: 'Collapse all' }).exists()) { + cy.do([Button({ text: 'Expand all' }).click()]); } }, verifyOpenAllPanes() { - cy.expect(Button({ text: "Collapse all" }).exists()); + cy.expect(Button({ text: 'Collapse all' }).exists()); }, - + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { - if (frequency === "Weeks") { - cy.expect(TextField({ name: "scheduling.time", value: time }).exists()); - cy.expect( - TextField({ name: "scheduling.interval", value: interval }).exists() - ); - } else if (frequency === "Days") { - cy.expect( - Select({ name: "scheduling.interval", value: interval }).exists() - ); - } else if (frequency === "Hours") { + // should equal + cy.expect(Select({ name: 'scheduling.frequency'}).value()).to.equal(frequency); + return; + if (frequency === 'Weeks') { + cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + } else if (frequency === 'Days') { + cy.expect( + Select({ name: 'scheduling.interval', value: interval }).exists() + ); + } else if (frequency === 'Hours') { } else return; }, @@ -110,8 +111,8 @@ export default { if (!criteria) { cy.expect( Select({ - name: "criteria.type", - value: "No criteria (always run)", + name: 'criteria.type', + value: 'No criteria (always run)', }).exists() ); } @@ -120,11 +121,11 @@ export default { verifyTransferAccount(feeFineOwner, transferAccount) { cy.expect( - Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + Select({ name: 'transferInfo.else.owner', value: feeFineOwner }).exists() ); cy.expect( Select({ - name: "transferInfo.else.account", + name: 'transferInfo.else.account', value: transferAccount, }).exists() ); @@ -132,14 +133,13 @@ export default { verifyTransferAccount(feeFineOwner, transferAccount) { cy.expect( - Select({ name: "transferInfo.else.owner", value: feeFineOwner }).exists() + Select({ name: 'transferInfo.else.owner', value: feeFineOwner }).exists() ); cy.expect( Select({ - name: "transferInfo.else.account", + name: 'transferInfo.else.account', value: transferAccount, }).exists() ); }, - }; From fa69414d8f3538a12ef5b7d7f03dabf9185071ac Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 10:11:41 -0500 Subject: [PATCH 08/19] Updated verify helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 5 ++- .../fragments/users/transferFeeFine.js | 43 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 2a3d664964..315ac467e0 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -20,11 +20,11 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.setTransferCriteriaScheduling( 'Weeks', '1', - '11:00 PM', + '11:00 P', 'Monday' ); TransferFeeFine.verifyTransferCriteriaScheduling( - 'Weeks', + 'WEEK', '1', '11:00 PM', 'Monday' @@ -59,6 +59,7 @@ describe('Build the Cornell bursar transfer file', () => { it('should be able to run manually', () => { //TransferFeeFine.runManually(); + TransferFeeFine.verifyRunManually(); }); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index f3f6b42a5c..cc60438f5b 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -68,9 +68,7 @@ export default { setCriteria(criteria) { if (!criteria) { - cy.do( - Select({ name: 'criteria.type' }).choose('No criteria (always run)') - ); + cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); } // Currently don't have any test cases for criteria }, @@ -93,30 +91,17 @@ export default { }, verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { - // should equal - cy.expect(Select({ name: 'scheduling.frequency'}).value()).to.equal(frequency); - return; - if (frequency === 'Weeks') { - cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); - cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); - } else if (frequency === 'Days') { - cy.expect( - Select({ name: 'scheduling.interval', value: interval }).exists() - ); - } else if (frequency === 'Hours') { - } else return; + cy.expect(Select({ name: 'scheduling.frequency', value: frequency }).exists()); + if (frequency === 'WEEK') { + cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + } }, verifyCriteria(criteria) { if (!criteria) { - cy.expect( - Select({ - name: 'criteria.type', - value: 'No criteria (always run)', - }).exists() - ); + cy.expect(Select({ name: 'criteria.type', value: 'Pass' }).exists()); } - // Currently don't have any test cases for criteria }, verifyTransferAccount(feeFineOwner, transferAccount) { @@ -142,4 +127,18 @@ export default { }).exists() ); }, + + verifyRunManually() { + cy.get('@alert').should( + 'have.been.calledOnceWith', + 'Job has been scheduled' + ); + }, + + verifyAggregateByPatron(aggregate) { + if (!aggregate) { + // get checkbox value and verify it is unchecked + cy.get('input[name="aggregate"]').should('not.be.checked'); + } + } }; From 41cfeb4316101d20e323c9debf2db8831d33897c Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 10:31:10 -0500 Subject: [PATCH 09/19] Updated verify helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 9 +++-- .../fragments/users/transferFeeFine.js | 35 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 315ac467e0..35f619899a 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -44,21 +44,24 @@ describe('Build the Cornell bursar transfer file', () => { // Header Format it('should be able to set header format', () => { - TransferFeeFine.removeHeaderFormat(); }); // Account Data Format + it('should be able to set account data format', () => { + }); // Footer Format + it('should be able to set footer format', () => { + }); // Transer account data to it('should be able to set transfer account data to', () => { TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); - TransferFeeFine.verifyTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('b25fd8e7-a0e7-4690-ab0b-94039739c0db', '90c1820f-60bf-4b9a-99f5-d677ea78ddca'); }); it('should be able to run manually', () => { - //TransferFeeFine.runManually(); + TransferFeeFine.runManually(); TransferFeeFine.verifyRunManually(); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index cc60438f5b..961e032a88 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -47,10 +47,6 @@ export default { runManually() { cy.do([Button({ text: 'Run manually' }).click()]); - cy.get('@alert').should( - 'have.been.calledOnceWith', - 'Job has been scheduled' - ); }, typeScheduleTime(time) { @@ -68,7 +64,9 @@ export default { setCriteria(criteria) { if (!criteria) { - cy.do(Select({ name: 'criteria.type' }).choose('No criteria (always run)')); + cy.do( + Select({ name: 'criteria.type' }).choose('No criteria (always run)') + ); } // Currently don't have any test cases for criteria }, @@ -89,12 +87,16 @@ export default { verifyOpenAllPanes() { cy.expect(Button({ text: 'Collapse all' }).exists()); }, - + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { - cy.expect(Select({ name: 'scheduling.frequency', value: frequency }).exists()); + cy.expect( + Select({ name: 'scheduling.frequency', value: frequency }).exists() + ); if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); - cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + cy.expect( + TextField({ name: 'scheduling.interval', value: interval }).exists() + ); } }, @@ -129,16 +131,15 @@ export default { }, verifyRunManually() { - cy.get('@alert').should( - 'have.been.calledOnceWith', - 'Job has been scheduled' + cy.on('window:alert', (str) => { + expect(str).to.equal('Job has been scheduled'); + } ); - }, + }, - verifyAggregateByPatron(aggregate) { - if (!aggregate) { - // get checkbox value and verify it is unchecked - cy.get('input[name="aggregate"]').should('not.be.checked'); - } + verifyAggregateByPatron(aggregate) { + if (!aggregate) { + cy.get('input[name="aggregate"]').should('not.be.checked'); } + }, }; From a158a2ad6fcf788ae267f5278c0c00e663972e60 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 12:05:35 -0500 Subject: [PATCH 10/19] Added format clear helper function --- ...ansfer-criteria-example-test-cornell.cy.js | 3 ++ .../fragments/users/transferFeeFine.js | 33 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 35f619899a..bce55cceac 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -44,14 +44,17 @@ describe('Build the Cornell bursar transfer file', () => { // Header Format it('should be able to set header format', () => { + TransferFeeFine.clearFormat('header'); }); // Account Data Format it('should be able to set account data format', () => { + TransferFeeFine.clearFormat('data'); }); // Footer Format it('should be able to set footer format', () => { + TransferFeeFine.clearFormat('footer'); }); // Transer account data to diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 961e032a88..f7ec7f96bf 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -84,6 +84,34 @@ export default { } }, + clearFormat(format) { + let sectionName = ''; + if (format == 'header') { + sectionName = 'section[id="accordion_10"]'; + } else if (format == 'data') { + sectionName = 'section[id="accordion_11"]'; + } else { + sectionName = 'section[id="accordion_12"]'; + } + + // if section is empty, skip + cy.get(sectionName).then(($section) => { + // check for button trash icon + if ($section.find('button[icon="trash"]').length == 0) { + return; + } + else { + cy.get(sectionName).within(() => { + cy.get('button[icon="trash"]').then(($btn) => { + for (let i = 0; i < $btn.length; i++) { + cy.get('button[icon="trash"]').eq(0).click(); + } + }); + }); + } + }); + }, + verifyOpenAllPanes() { cy.expect(Button({ text: 'Collapse all' }).exists()); }, @@ -132,9 +160,8 @@ export default { verifyRunManually() { cy.on('window:alert', (str) => { - expect(str).to.equal('Job has been scheduled'); - } - ); + expect(str).to.equal('Job has been scheduled'); + }); }, verifyAggregateByPatron(aggregate) { From ad9b927bc63136aae70df8b6e6a546f16ac03c38 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 12:27:53 -0500 Subject: [PATCH 11/19] Added ESLint code fixes --- ...ansfer-criteria-example-test-cornell.cy.js | 4 +- .../fragments/users/transferFeeFine.js | 40 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index bce55cceac..65817b2b7c 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -45,16 +45,19 @@ describe('Build the Cornell bursar transfer file', () => { // Header Format it('should be able to set header format', () => { TransferFeeFine.clearFormat('header'); + TransferFeeFine.verifyClearFormat('header'); }); // Account Data Format it('should be able to set account data format', () => { TransferFeeFine.clearFormat('data'); + TransferFeeFine.verifyClearFormat('data'); }); // Footer Format it('should be able to set footer format', () => { TransferFeeFine.clearFormat('footer'); + TransferFeeFine.verifyClearFormat('footer'); }); // Transer account data to @@ -67,5 +70,4 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.runManually(); TransferFeeFine.verifyRunManually(); }); - }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index f7ec7f96bf..b2c971feaf 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -34,8 +34,7 @@ export default { cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); } else if (frequency === 'Days') { cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); - } else if (frequency === 'Hours') { - } else return; + } }, setAggregateByPatron(aggregate) { @@ -86,9 +85,9 @@ export default { clearFormat(format) { let sectionName = ''; - if (format == 'header') { + if (format === 'header') { sectionName = 'section[id="accordion_10"]'; - } else if (format == 'data') { + } else if (format === 'data') { sectionName = 'section[id="accordion_11"]'; } else { sectionName = 'section[id="accordion_12"]'; @@ -96,11 +95,7 @@ export default { // if section is empty, skip cy.get(sectionName).then(($section) => { - // check for button trash icon - if ($section.find('button[icon="trash"]').length == 0) { - return; - } - else { + if ($section.find('button[icon="trash"]').length !== 0) { cy.get(sectionName).within(() => { cy.get('button[icon="trash"]').then(($btn) => { for (let i = 0; i < $btn.length; i++) { @@ -112,6 +107,21 @@ export default { }); }, + verifyClearFormat(format) { + let sectionName = ''; + if (format === 'header') { + sectionName = 'section[id="accordion_10"]'; + } else if (format === 'data') { + sectionName = 'section[id="accordion_11"]'; + } else { + sectionName = 'section[id="accordion_12"]'; + } + + cy.get(sectionName).then(($section) => { + cy.expect($section.find('button[icon="trash"]').length).to.equal(0); + }); + }, + verifyOpenAllPanes() { cy.expect(Button({ text: 'Collapse all' }).exists()); }, @@ -146,18 +156,6 @@ export default { ); }, - verifyTransferAccount(feeFineOwner, transferAccount) { - cy.expect( - Select({ name: 'transferInfo.else.owner', value: feeFineOwner }).exists() - ); - cy.expect( - Select({ - name: 'transferInfo.else.account', - value: transferAccount, - }).exists() - ); - }, - verifyRunManually() { cy.on('window:alert', (str) => { expect(str).to.equal('Job has been scheduled'); From 2b751e8ae3ec974b181530ab05a8e1abfafcc021 Mon Sep 17 00:00:00 2001 From: nhanaa Date: Tue, 15 Aug 2023 12:59:40 -0500 Subject: [PATCH 12/19] Completed scheduling helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 4 ++-- .../fragments/users/transferFeeFine.js | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 65817b2b7c..89141c55d8 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -21,13 +21,13 @@ describe('Build the Cornell bursar transfer file', () => { 'Weeks', '1', '11:00 P', - 'Monday' + ['Monday'] ); TransferFeeFine.verifyTransferCriteriaScheduling( 'WEEK', '1', '11:00 PM', - 'Monday' + ['Monday'] ); }); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index b2c971feaf..25e7f75388 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -32,9 +32,14 @@ export default { if (frequency === 'Weeks') { cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + weekDays.map((weekDay) => cy.do([ + MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay), + ])); } else if (frequency === 'Days') { cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); - } + } else if (frequency === 'Hours') { + cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + } else ; }, setAggregateByPatron(aggregate) { @@ -126,16 +131,24 @@ export default { cy.expect(Button({ text: 'Collapse all' }).exists()); }, + verifyTransferCriteriaScheduling(frequency, interval, time, weekDays) { + // should equal cy.expect( Select({ name: 'scheduling.frequency', value: frequency }).exists() ); + cy.expect(Select({ name: 'scheduling.frequency' }).value()).to.equal(frequency); if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); + } else if (frequency === 'DAY') { cy.expect( - TextField({ name: 'scheduling.interval', value: interval }).exists() + Select({ name: 'scheduling.interval', value: interval }).exists() ); - } + } else if (frequency === 'HOUR') { + cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); + } else; }, verifyCriteria(criteria) { From 7ed872e5be69ff05519f33b64127e7299fc9ebe4 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 13:41:12 -0500 Subject: [PATCH 13/19] Added Cornell format helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 2 + .../fragments/users/transferFeeFine.js | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 65817b2b7c..064d10e535 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -46,12 +46,14 @@ describe('Build the Cornell bursar transfer file', () => { it('should be able to set header format', () => { TransferFeeFine.clearFormat('header'); TransferFeeFine.verifyClearFormat('header'); + TransferFeeFine.addCornellHeaderFormat(); }); // Account Data Format it('should be able to set account data format', () => { TransferFeeFine.clearFormat('data'); TransferFeeFine.verifyClearFormat('data'); + TransferFeeFine.addCornellDataFormat(); }); // Footer Format diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index b2c971feaf..16bef32162 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -167,4 +167,52 @@ export default { cy.get('input[name="aggregate"]').should('not.be.checked'); } }, + + addCornellHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + const numItems = 2; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + + cy.do(Select({ name: 'header[0].type' }).choose('Text')); + cy.do(TextField({ name: 'header[0].text' }).fillIn('LIB02')); + + cy.do(Select({ name: 'header[1].type' }).choose('Newline (LF)')); + }); + }, + + addCornellDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + const numItems = 8; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + }); + + cy.do(Select({ name: 'data[0].type' }).choose('User info')); + cy.do(Select({ name: 'data[0].userAttribute' }).choose('First name')); + cy.do(TextField({ name: 'data[0].placeholder' }).fillIn('No name')); + + cy.do(Select({ name: 'data[1].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[2].type' }).choose('Account amount')); + cy.get('input[name="data[2].decimal"]').check(); + + cy.do(Select({ name: 'data[3].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[4].type' }).choose('Account date')); + cy.do(Select({ name: 'data[4].dateProperty' }).choose('Creation date')); + cy.do(Select({ name: 'data[4].format' }).choose('Year (4-digit)')); + // There is two America/New_York in the list, so we need to find out the second one + // cy.do(Select({ name: 'data[4].timezone' }).choose('America/New_York')); + cy.do(TextField({ name: 'data[4].placeholder' }).fillIn('')); + + cy.do(Select({ name: 'data[5].type' }).choose('Newline (LF)')); + + cy.do(Select({ name: 'data[6].type' }).choose('Fee/fine type')); + cy.do(Select({ name: 'data[6].feeFineAttribute' }).choose('Type ID')); + + cy.do(Select({ name: 'data[7].type' }).choose('Newline (LF)')); + } }; From b8838d16a1d5074158516d96444866a76f8e99bd Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 15:11:13 -0500 Subject: [PATCH 14/19] Added Header Format and Account Data Format verify helper functions --- ...ansfer-criteria-example-test-cornell.cy.js | 2 + .../fragments/users/transferFeeFine.js | 45 ++++++++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index 35589cfec3..f8fa3a690f 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -47,6 +47,7 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.clearFormat('header'); TransferFeeFine.verifyClearFormat('header'); TransferFeeFine.addCornellHeaderFormat(); + TransferFeeFine.verifyAddCornellHeaderFormat(); }); // Account Data Format @@ -54,6 +55,7 @@ describe('Build the Cornell bursar transfer file', () => { TransferFeeFine.clearFormat('data'); TransferFeeFine.verifyClearFormat('data'); TransferFeeFine.addCornellDataFormat(); + TransferFeeFine.verifyAddCornellDataFormat(); }); // Footer Format diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 6e84d38da2..4abd677152 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -32,9 +32,7 @@ export default { if (frequency === 'Weeks') { cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); - weekDays.map((weekDay) => cy.do([ - MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay), - ])); + // weekDays.map((weekDay) => cy.do([MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay)])); } else if (frequency === 'Days') { cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); } else if (frequency === 'Hours') { @@ -137,11 +135,11 @@ export default { cy.expect( Select({ name: 'scheduling.frequency', value: frequency }).exists() ); - cy.expect(Select({ name: 'scheduling.frequency' }).value()).to.equal(frequency); + if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); - weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); + // weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); } else if (frequency === 'DAY') { cy.expect( Select({ name: 'scheduling.interval', value: interval }).exists() @@ -227,5 +225,42 @@ export default { cy.do(Select({ name: 'data[6].feeFineAttribute' }).choose('Type ID')); cy.do(Select({ name: 'data[7].type' }).choose('Newline (LF)')); + }, + + verifyAddCornellHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + cy.expect(Select({ name: 'header[0].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[0].text', value: 'LIB02' }).exists()); + + cy.expect(Select({ name: 'header[1].type', value: 'Newline' }).exists()); + }); + }, + + verifyAddCornellDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + cy.expect(Select({ name: 'data[0].type', value: 'UserData' }).exists()); + cy.expect(Select({ name: 'data[0].userAttribute', value: 'FIRST_NAME' }).exists()); + cy.expect(TextField({ name: 'data[0].placeholder', value: 'No name' }).exists()); + + cy.expect(Select({ name: 'data[1].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[2].type', value: 'FeeAmount' }).exists()); + cy.get('input[name="data[2].decimal"]').should('be.checked'); + + cy.expect(Select({ name: 'data[3].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[4].type', value: 'FeeDate' }).exists()); + cy.expect(Select({ name: 'data[4].dateProperty', value: 'CREATED' }).exists()); + cy.expect(Select({ name: 'data[4].format', value: 'YEAR_LONG' }).exists()); + // cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); + cy.expect(TextField({ name: 'data[4].placeholder', value: '' }).exists()); + + cy.expect(Select({ name: 'data[5].type', value: 'Newline' }).exists()); + + cy.expect(Select({ name: 'data[6].type', value: 'FeeFineMetadata' }).exists()); + cy.expect(Select({ name: 'data[6].feeFineAttribute', value: 'FEE_FINE_TYPE_ID' }).exists()); + + cy.expect(Select({ name: 'data[7].type', value: 'Newline' }).exists()); + }); } }; From d4fdb5fe0a2c8d0178c738f9c2ed462ca72b3363 Mon Sep 17 00:00:00 2001 From: danetsao Date: Tue, 15 Aug 2023 15:30:50 -0500 Subject: [PATCH 15/19] Added basic outline for Duke bursar file --- ...ansfer-criteria-example-test-cornell.cy.js | 2 - ...-transfer-criteria-example-test-duke.cy.js | 61 +++++++++++++++++++ .../fragments/users/transferFeeFine.js | 14 ++++- 3 files changed, 74 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js index f8fa3a690f..d53fe8c65c 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-cornell.cy.js @@ -1,5 +1,3 @@ -import TestTypes from '../../../../support/dictionary/testTypes'; -import DevTeams from '../../../../support/dictionary/devTeams'; import settingsMenu from '../../../../support/fragments/settingsMenu'; import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js index e69de29bb2..cde50cc84d 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js @@ -0,0 +1,61 @@ +import settingsMenu from '../../../../support/fragments/settingsMenu'; +import TransferFeeFine from '../../../../support/fragments/users/transferFeeFine'; + +describe('Build the Duke bursar transfer file', () => { + before(() => { + cy.loginAsAdmin({ + path: settingsMenu.usersTransferCriteria, + waiter: TransferFeeFine.waitLoadingTransferCriteria, + }); + }); + + it('should be able to open all the panes', () => { + TransferFeeFine.openAllPanes(); + TransferFeeFine.verifyOpenAllPanes(); + }); + + it('should be able to set scheduling', () => { + }); + + it('should be able to set no criteria', () => { + TransferFeeFine.setCriteria(false); + TransferFeeFine.verifyCriteria(false); + }); + + // Aggregate by patron: Box unchecked + it('should be able to set aggregate by patron', () => { + TransferFeeFine.setAggregateByPatron(false); + TransferFeeFine.verifyAggregateByPatron(false); + }); + + // Header Format + it('should be able to set header format', () => { + TransferFeeFine.clearFormat('header'); + TransferFeeFine.verifyClearFormat('header'); + TransferFeeFine.addDukeHeaderFormat(); + TransferFeeFine.verifyAddDukeHeaderFormat(); + }); + + // Account Data Format + it('should be able to set account data format', () => { + TransferFeeFine.clearFormat('data'); + TransferFeeFine.verifyClearFormat('data'); + TransferFeeFine.addDukeDataFormat(); + TransferFeeFine.verifyAddDukeDataFormat(); + }); + + // Footer Format + it('should be able to set footer format', () => { + TransferFeeFine.clearFormat('footer'); + TransferFeeFine.verifyClearFormat('footer'); + }); + + // Transer account data to + it('should be able to set transfer account data to', () => { + }); + + it('should be able to run manually', () => { + TransferFeeFine.runManually(); + TransferFeeFine.verifyRunManually(); + }); +}); diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 4abd677152..094996254d 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -179,6 +179,8 @@ export default { } }, + // Cornell format Helper functions + addCornellHeaderFormat() { cy.get('section[id="accordion_10"]').within(() => { const numItems = 2; @@ -262,5 +264,15 @@ export default { cy.expect(Select({ name: 'data[7].type', value: 'Newline' }).exists()); }); - } + }, + + // Duke format Helper functions + + addDukeHeaderFormat() {}, + + addDukeDataFormat() {}, + + verifyAddDukeHeaderFormat() {}, + + verifyAddDukeDataFormat() {}, }; From 3726329c02429c8e462be992960e4008c20c83f3 Mon Sep 17 00:00:00 2001 From: danetsao Date: Wed, 16 Aug 2023 11:01:14 -0500 Subject: [PATCH 16/19] Added Duke body and header function --- ...-transfer-criteria-example-test-duke.cy.js | 14 +++ .../fragments/users/transferFeeFine.js | 94 ++++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js index cde50cc84d..abbbafba8b 100644 --- a/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js +++ b/cypress/e2e/settings/users/fee&Fine/configure-transfer-criteria-example-test-duke.cy.js @@ -15,6 +15,18 @@ describe('Build the Duke bursar transfer file', () => { }); it('should be able to set scheduling', () => { + TransferFeeFine.setTransferCriteriaScheduling( + 'Weeks', + '0', + '3:30 P', + ['Monday'] + ); + TransferFeeFine.verifyTransferCriteriaScheduling( + 'WEEK', + '0', + '3:30 PM', + ['Monday'] + ); }); it('should be able to set no criteria', () => { @@ -52,6 +64,8 @@ describe('Build the Duke bursar transfer file', () => { // Transer account data to it('should be able to set transfer account data to', () => { + TransferFeeFine.setTransferAccount('Lost Item Fine Office', 'acct'); + TransferFeeFine.verifyTransferAccount('b25fd8e7-a0e7-4690-ab0b-94039739c0db', '90c1820f-60bf-4b9a-99f5-d677ea78ddca'); }); it('should be able to run manually', () => { diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 094996254d..19be837a20 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -268,9 +268,99 @@ export default { // Duke format Helper functions - addDukeHeaderFormat() {}, + addDukeHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + const numItems = 11; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + + cy.do(Select({ name: 'header[0].type' }).choose('Text')); + cy.do(TextField({ name: 'header[0].text' }).fillIn('Batch')); + + cy.do(Select({ name: 'header[1].type' }).choose('Whitespace')); + // fill text in the input named header[1].repeat + cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + + cy.do(Select({ name: 'header[2].type' }).choose('Current date')); + cy.do(Select({ name: 'header[2].format' }).choose('YYYYMMDD')); + // cy.do(Select({ name: 'header[2].timezone' }).choose('America/New_York')); + + cy.do(Select({ name: 'header[3].type' }).choose('Whitespace')); + cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + + cy.do(Select({ name: 'header[4].type' }).choose('Text')); + cy.do(TextField({ name: 'header[4].text' }).fillIn('DU LIBRARY')); + + cy.do(Select({ name: 'header[5].type' }).choose('Whitespace')); + cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + - addDukeDataFormat() {}, + cy.do(Select({ name: 'header[6].type' }).choose('Current date')); + cy.do(Select({ name: 'header[6].format' }).choose('Quarter')); + // cy.do(Select({ name: 'header[6].timezone' }).choose('America/New_York')); + + cy.do(Select({ name: 'header[7].type' }).choose('Total amount')); + cy.get('input[name="header[7].decimal"]').check(); + + cy.do(Select({ name: 'header[8].type' }).choose('Text')); + cy.do(TextField({ name: 'header[8].text' }).fillIn('TXT_CNT')); + + cy.do(Select({ name: 'header[9].type' }).choose('Text')); + cy.do(TextField({ name: 'header[9].text' }).fillIn('DU LIBRARIES DEBITS')); + + cy.do(Select({ name: 'header[10].type' }).choose('Newline (LF)')); + }); + }, + + addDukeDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + const numItems = 14; + for (let i = 0; i < numItems; i++) { + cy.get('button:contains("Add")').click(); + } + }); + + cy.do(Select({ name: 'data[0].type' }).choose('User info')); + cy.do(Select({ name: 'data[0].userAttribute' }).choose('External ID')); + + cy.do(Select({ name: 'data[1].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[2].type' }).choose('User info')); + cy.do(Select({ name: 'data[2].userAttribute' }).choose('Username')); + // click on gear icon within data[2] section + + cy.do(Select({ name: 'data[3].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[4].type' }).choose('Account date')); + cy.do(Select({ name: 'data[4].dateProperty' }).choose('Item due date')); + cy.do(Select({ name: 'data[4].format' }).choose('YYYYMMDD')); + // There is two America/New_York in the list, so we need to find out the second one + // cy.do(Select({ name: 'data[4].timezone' }).choose('America/New_York')); + + cy.do(Select({ name: 'data[5].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[6].type' }).choose('Current date')); + cy.do(Select({ name: 'data[6].format' }).choose('Quarter')); + + cy.do(Select({ name: 'data[7].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[8].type' }).choose('Fee/fine type')); + cy.do(Select({ name: 'data[8].feeFineAttribute' }).choose('Type name')); + // gear icon + + cy.do(Select({ name: 'data[9].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[10].type' }).choose('Account amount')); + cy.get('input[name="data[10].decimal"]').check({ force: true }); + + cy.do(Select({ name: 'data[11].type' }).choose('Tab')); + + cy.do(Select({ name: 'data[12].type' }).choose('Fee/fine type')); + cy.do(Select({ name: 'data[12].feeFineAttribute' }).choose('Type ID')); + + cy.do(Select({ name: 'data[13].type' }).choose('Newline (LF)')); + }, verifyAddDukeHeaderFormat() {}, From d59afcd3afe49e7998265e57151d3a958f42790b Mon Sep 17 00:00:00 2001 From: nhanaa Date: Fri, 18 Aug 2023 13:22:41 -0500 Subject: [PATCH 17/19] Fix problem with scheduling weekdays multiselect --- .../support/fragments/users/transferFeeFine.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index 19be837a20..ed4b75035f 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -30,13 +30,19 @@ export default { cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency)); if (frequency === 'Weeks') { - cy.do([TextField({ name: 'scheduling.time' }).fillIn(time)]); - cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); - // weekDays.map((weekDay) => cy.do([MultiSelect({ name: 'scheduling.weekdays' }).choose(weekDay)])); + cy.do(TextField({ name: 'scheduling.time' }).fillIn(time)); + cy.do(TextField({ name: 'scheduling.interval' }).fillIn(interval)); + + // clear all the options + cy.get('li[id$=_multiselect_selected]').each(($li) => { + cy.wrap($li).find('button').click(); + }); + + cy.do(MultiSelect({ label: 'Run on weekdays*' }).select(weekDays)); } else if (frequency === 'Days') { - cy.do([Select({ name: 'scheduling.interval' }).choose(interval)]); + cy.do(Select({ name: 'scheduling.interval' }).choose(interval)); } else if (frequency === 'Hours') { - cy.do([TextField({ name: 'scheduling.interval' }).fillIn(interval)]); + cy.do(TextField({ name: 'scheduling.interval' }).fillIn(interval)); } else ; }, @@ -139,7 +145,7 @@ export default { if (frequency === 'WEEK') { cy.expect(TextField({ name: 'scheduling.time', value: time }).exists()); cy.expect(TextField({ name: 'scheduling.interval', value: interval }).exists()); - // weekDays.map((weekDay) => cy.expect(MultiSelect({ name: 'scheduling.weekdays' }).value()).to.include(weekDay)); + cy.expect(MultiSelect({ label: 'Run on weekdays*', selected: weekDays }).exists()); } else if (frequency === 'DAY') { cy.expect( Select({ name: 'scheduling.interval', value: interval }).exists() From 00dd91efdc234df1e5fd797792fdc0ebcab7d0f9 Mon Sep 17 00:00:00 2001 From: danetsao Date: Fri, 18 Aug 2023 14:48:52 -0500 Subject: [PATCH 18/19] Added Duke verify functions, header and body --- .../fragments/users/transferFeeFine.js | 85 ++++++++++++++++++- 1 file changed, 81 insertions(+), 4 deletions(-) diff --git a/cypress/support/fragments/users/transferFeeFine.js b/cypress/support/fragments/users/transferFeeFine.js index ed4b75035f..0de79fbeba 100644 --- a/cypress/support/fragments/users/transferFeeFine.js +++ b/cypress/support/fragments/users/transferFeeFine.js @@ -293,13 +293,13 @@ export default { // cy.do(Select({ name: 'header[2].timezone' }).choose('America/New_York')); cy.do(Select({ name: 'header[3].type' }).choose('Whitespace')); - cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + cy.do(TextField({ name: 'header[3].repeat' }).fillIn('1')); cy.do(Select({ name: 'header[4].type' }).choose('Text')); cy.do(TextField({ name: 'header[4].text' }).fillIn('DU LIBRARY')); cy.do(Select({ name: 'header[5].type' }).choose('Whitespace')); - cy.do(TextField({ name: 'header[1].repeat' }).fillIn('1')); + cy.do(TextField({ name: 'header[5].repeat' }).fillIn('1')); cy.do(Select({ name: 'header[6].type' }).choose('Current date')); @@ -319,6 +319,45 @@ export default { }); }, + verifyAddDukeHeaderFormat() { + cy.get('section[id="accordion_10"]').within(() => { + cy.expect(Select({ name: 'header[0].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[0].text', value: 'Batch' }).exists()); + + cy.expect(Select({ name: 'header[1].type', value: 'Space' }).exists()); + cy.expect(TextField({ name: 'header[1].repeat', value: '1' }).exists()); + + cy.expect(Select({ name: 'header[2].type', value: 'CurrentDate' }).exists()); + cy.expect(Select({ name: 'header[2].format', value: 'YYYYMMDD' }).exists()); + // cy.expect(Select({ name: 'header[2].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'header[3].type', value: 'Space' }).exists()); + cy.expect(TextField({ name: 'header[3].repeat', value: '1' }).exists()); + + cy.expect(Select({ name: 'header[4].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[4].text', value: 'DU LIBRARY' }).exists()); + + cy.expect(Select({ name: 'header[5].type', value: 'Space' }).exists()); + cy.expect(TextField({ name: 'header[5].repeat', value: '1' }).exists()); + + cy.expect(Select({ name: 'header[6].type', value: 'CurrentDate' }).exists()); + cy.expect(Select({ name: 'header[6].format', value: 'QUARTER' }).exists()); + // cy.expect(Select({ name: 'header[6].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'header[7].type', value: 'AggregateTotal' }).exists()); + cy.get('input[name="header[7].decimal"]').should('be.checked'); + + cy.expect(Select({ name: 'header[8].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[8].text', value: 'TXT_CNT' }).exists()); + + cy.expect(Select({ name: 'header[9].type', value: 'Constant' }).exists()); + cy.expect(TextField({ name: 'header[9].text', value: 'DU LIBRARIES DEBITS' }).exists()); + + cy.expect(Select({ name: 'header[10].type', value: 'Newline' }).exists()); + }); + }, + + addDukeDataFormat() { cy.get('section[id="accordion_11"]').within(() => { const numItems = 14; @@ -368,7 +407,45 @@ export default { cy.do(Select({ name: 'data[13].type' }).choose('Newline (LF)')); }, - verifyAddDukeHeaderFormat() {}, + verifyAddDukeDataFormat() { + cy.get('section[id="accordion_11"]').within(() => { + cy.expect(Select({ name: 'data[0].type', value: 'UserData' }).exists()); + cy.expect(Select({ name: 'data[0].userAttribute', value: 'EXTERNAL_SYSTEM_ID' }).exists()); + + cy.expect(Select({ name: 'data[1].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[2].type', value: 'UserData' }).exists()); + cy.expect(Select({ name: 'data[2].userAttribute', value: 'USERNAME' }).exists()); + + cy.expect(Select({ name: 'data[3].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[4].type', value: 'FeeDate' }).exists()); + cy.expect(Select({ name: 'data[4].dateProperty', value: 'DUE' }).exists()); + cy.expect(Select({ name: 'data[4].format', value: 'YYYYMMDD' }).exists()); + // cy.expect(Select({ name: 'data[4].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'data[5].type', value: 'Tab' }).exists()); - verifyAddDukeDataFormat() {}, + cy.expect(Select({ name: 'data[6].type', value: 'CurrentDate' }).exists()); + cy.expect(Select({ name: 'data[6].format', value: 'QUARTER' }).exists()); + // cy.expect(Select({ name: 'data[6].timezone', value: 'America/New_York' }).exists()); + + cy.expect(Select({ name: 'data[7].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[8].type', value: 'FeeFineMetadata' }).exists()); + cy.expect(Select({ name: 'data[8].feeFineAttribute', value: 'FEE_FINE_TYPE_NAME' }).exists()); + + cy.expect(Select({ name: 'data[9].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[10].type', value: 'FeeAmount' }).exists()); + cy.get('input[name="data[10].decimal"]').should('be.checked'); + + cy.expect(Select({ name: 'data[11].type', value: 'Tab' }).exists()); + + cy.expect(Select({ name: 'data[12].type', value: 'FeeFineMetadata' }).exists()); + cy.expect(Select({ name: 'data[12].feeFineAttribute', value: 'FEE_FINE_TYPE_ID' }).exists()); + + cy.expect(Select({ name: 'data[13].type', value: 'Newline' }).exists()); + }); + }, }; From 3478bde0db52e44f5fab0707dc6af56b717240c1 Mon Sep 17 00:00:00 2001 From: danetsao Date: Mon, 28 Aug 2023 15:41:34 -0500 Subject: [PATCH 19/19] Added Alabama file --- .../configure.transfer-criteria-example-test-alabama.cy.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js diff --git a/cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js b/cypress/e2e/settings/users/fee&Fine/configure.transfer-criteria-example-test-alabama.cy.js new file mode 100644 index 0000000000..e69de29bb2