Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYME… #905

Merged
merged 19 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
22e49e3
PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYME…
Thor-tech-of-metal Jul 10, 2024
5bac736
PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYME…
Thor-tech-of-metal Jul 16, 2024
8cbdd44
Merge branch 'master' of github.com:hmcts/ccpay-bubble into PAY-7103
Thor-tech-of-metal Jul 22, 2024
86a6269
PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYME…
Thor-tech-of-metal Jul 22, 2024
14a8524
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 1, 2024
1bd0994
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 9, 2024
6bb7961
Merge branches 'PAY-7103' and 'master' of github.com:hmcts/ccpay-bubb…
Thor-tech-of-metal Aug 9, 2024
00390af
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 20, 2024
807ca0e
update case trasaction page amount values
shravanmechineni Aug 20, 2024
209e99a
Merge branch 'PAY-7103' of https://github.com/hmcts/ccpay-bubble into…
shravanmechineni Aug 20, 2024
9cbbc5c
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 21, 2024
bb2ecc0
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 21, 2024
c378f96
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 21, 2024
36a6a72
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 22, 2024
10d0849
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 22, 2024
077d829
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Aug 23, 2024
03d1867
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Sep 2, 2024
34480bb
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Sep 2, 2024
1b7ef12
PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refun…
Thor-tech-of-metal Sep 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ Scenario('Bulk scan cash Over Payment refund, preview RefundWhenContacted email
const reviewRefundDetailsDataAfterApproval = assertionData.reviewRefundDetailsDataAfterApproverAction(refundReference, paymentRcReference, 'Overpayment', '27.00', emailAddress, '', 'payments probate', 'approver probate');
const refundNotificationPreviewDataAfterApproval = assertionData.refundNotificationPreviewData(emailAddress, '', ccdCaseNumber, refundReference, '27', 'Refund for Overpayment', bulkScanPaymentMethod);
await RefundsList.verifyRefundDetailsAfterRefundApproved(reviewRefundDetailsDataAfterApproval, true, true, false, refundNotificationPreviewDataAfterApproval);

// Refund Accepted by liberata
await apiUtils.updateRefundStatusByRefundReference(refundReference, '', 'ACCEPTED');
I.wait(CCPBATConstants.fiveSecondWaitTime);
I.refreshPage();
I.wait(CCPBATConstants.fiveSecondWaitTime);
await CaseTransaction.validateCaseTransactionsDetails('£300.00', '0', '£0.00', '£0.00', '£0.00');

await I.Logout();
I.clearCookie();
}).tag('@pipeline @nightly');
Expand Down Expand Up @@ -158,17 +166,8 @@ Scenario('Refund journey for complete cheque amount(500) with OverPayment option
I.waitForText('Issue refund', 5);
I.click('Issue refund');
I.wait(CCPBATConstants.fiveSecondWaitTime);

// DTRJ Updated to select Full Payment.
I.click('//*[@id="full-payment"]');
I.wait(CCPBATConstants.fiveSecondWaitTime);
I.click('Continue');
I.wait(CCPBATConstants.fiveSecondWaitTime);

const reviewProcessRefundPageData = assertionData.reviewProcessRefundPageDataForFeeRefundSelection(paymentRcReference, 'Notice of hearing date for 1.1 or 1.2 application. Only one payable if applications joined up.', '£220.00', '500.00', '500', '1');

// DTRJ Fee already selected.
//await InitiateRefunds.verifyProcessRefundPageForFeeRefundSelection(reviewProcessRefundPageData, ccdCaseNumber);
const reviewProcessRefundPageData = assertionData.reviewProcessRefundPageDataForFeeRefundSelection(paymentRcReference, 'Notice of hearing date for 1.1 or 1.2 application. Only one payable if applications joined up.', '£220.00', '£220.00', '220', '1');
await InitiateRefunds.verifyProcessRefundPageForFeeRefundSelection(reviewProcessRefundPageData, ccdCaseNumber);
I.click('Continue');
I.wait(CCPBATConstants.fiveSecondWaitTime);
const refundReason = 'System/technical error';
Expand All @@ -178,27 +177,20 @@ Scenario('Refund journey for complete cheque amount(500) with OverPayment option
I.fillField('//*[@id="email"]', emailAddress);
I.click('Continue');
I.wait(CCPBATConstants.fiveSecondWaitTime);
const checkYourAnswersDataBeforeSubmitRefund2 = assertionData.checkYourAnswersBeforeSubmitRefund(paymentRcReference, '£500.00', '', refundReason, '£500.00', emailAddress, '', 'SendRefund');
I.click('Cancel');
I.wait(CCPBATConstants.fiveSecondWaitTime);

// DTRJ Verify will fail as the refund amount is more than 220.00.
// This part of the test needs to be reviewed.
//await InitiateRefunds.verifyCheckYourAnswersPageAndSubmitRefundForExactAmountPaidNonCashPartialOrFullRefunds(checkYourAnswersDataBeforeSubmitRefund2, false, false, false, false);
//const refundRef = await InitiateRefunds.verifyRefundSubmittedPage('500.00');
//I.wait(CCPBATConstants.tenSecondWaitTime);
//await CaseTransaction.validateCaseTransactionsDetails('£500.00', '0', '£0.00', '£0.00', '£500.00');
const checkYourAnswersDataBeforeSubmitRefund2 = assertionData.checkYourAnswersBeforeSubmitRefund(paymentRcReference, '£500.00', '', refundReason, '£220.00', emailAddress, '', 'SendRefund');
await InitiateRefunds.verifyCheckYourAnswersPageAndSubmitRefundForExactAmountPaidNonCashPartialOrFullRefunds(checkYourAnswersDataBeforeSubmitRefund2, false, false, false, false);
const refundRef = await InitiateRefunds.verifyRefundSubmittedPage('220.00');
I.wait(CCPBATConstants.tenSecondWaitTime);
await CaseTransaction.validateCaseTransactionsDetails('£500.00', '0', '£0.00', '£0.00', '£280.00');
await I.Logout();
I.clearCookie();
I.wait(CCPBATConstants.fiveSecondWaitTime);

// DTRJ Can only approve one refund.
// Approve both refunds from Refund list page
I.login(testConfig.TestRefundsApproverUserName, testConfig.TestRefundsApproverPassword, '/refund-list?takePayment=false&refundlist=true');
let refundsDataBeforeApproverAction;

//for (let i = 0; i <= 1; i++) {
for (let i = 0; i <= 0; i++) {
for (let i = 0; i <= 1; i++) {
I.wait(CCPBATConstants.fifteenSecondWaitTime);
if (i === 0) {
refundsDataBeforeApproverAction = assertionData.reviewRefundDetailsDataBeforeApproverAction(refundRefOverPayments, 'Overpayment', '£280.00', emailAddress, '', 'payments probate', 'SendRefund');
Expand All @@ -223,39 +215,37 @@ Scenario('Refund journey for complete cheque amount(500) with OverPayment option
I.wait(CCPBATConstants.tenSecondWaitTime);
await miscUtils.multipleSearch(CaseSearch, I, ccdCaseNumber);
I.wait(CCPBATConstants.fiveSecondWaitTime);

// DTRJ Ignoring second refund as it was never created.
// New validation for Overpayment refund
//await CaseTransaction.validateTransactionPageForRefunds(refundRef, refundRefOverPayments);
await CaseTransaction.validateTransactionPageForRefundOverPayment(refundRefOverPayments);

await CaseTransaction.validateCaseTransactionsDetails('£500.00', '0', '£0.00', '£0.00', '£280.00');
await CaseTransaction.validateTransactionPageForRefunds(refundRef, refundRefOverPayments);
await I.click(`//td[contains(.,'${refundRefOverPayments}')]/following-sibling::td/a[.=\'Review\'][1]`);
I.wait(CCPBATConstants.tenSecondWaitTime);
const reviewOverPaymentRefundDetailsDataAfterApproval = assertionData.reviewRefundDetailsDataAfterApproverAction(refundRefOverPayments, paymentRcReference, 'Overpayment', '£280.00', emailAddress, '', 'payments probate', 'approver probate');
await RefundsList.verifyRefundDetailsAfterRefundApproved(reviewOverPaymentRefundDetailsDataAfterApproval);
I.click('Back');

// DTRJ Ignoring second refund as it was never created.
//I.wait(CCPBATConstants.fiveSecondWaitTime);
//await I.click(`//td[contains(.,'${refundRef}')]/following-sibling::td/a[.=\'Review\'][1]`);
//I.wait(CCPBATConstants.tenSecondWaitTime);
//const reviewRefundDetailsDataAfterApproval = assertionData.reviewRefundDetailsDataAfterApproverAction(refundRef, paymentRcReference, refundReason, '£220.00', emailAddress, '', 'payments probate', 'approver probate');
//await RefundsList.verifyRefundDetailsAfterRefundApproved(reviewRefundDetailsDataAfterApproval);
//I.click('Back');
I.wait(CCPBATConstants.fiveSecondWaitTime);
await I.click(`//td[contains(.,'${refundRef}')]/following-sibling::td/a[.=\'Review\'][1]`);
I.wait(CCPBATConstants.tenSecondWaitTime);
await CaseTransaction.validateCaseTransactionsDetails('£500.00', '0', '£0.00', '£0.00', '£280.00');
const reviewRefundDetailsDataAfterApproval = assertionData.reviewRefundDetailsDataAfterApproverAction(refundRef, paymentRcReference, refundReason, '£220.00', emailAddress, '', 'payments probate', 'approver probate');
await RefundsList.verifyRefundDetailsAfterRefundApproved(reviewRefundDetailsDataAfterApproval);
I.click('Back');

// Update refund reference with Rejection (called by Liberata) for System approved RefundWhenContacted email notification verification
//await apiUtils.updateRefundStatusByRefundReference(refundRef, '', 'ACCEPTED');
//I.wait(CCPBATConstants.fiveSecondWaitTime);
//await apiUtils.updateRefundStatusByRefundReference(refundRef, 'Unable to apply refund to Card', 'REJECTED');
await apiUtils.updateRefundStatusByRefundReference(refundRef, '', 'ACCEPTED');
I.wait(CCPBATConstants.fiveSecondWaitTime);
await I.refreshPage();
I.wait(CCPBATConstants.tenSecondWaitTime);
await CaseTransaction.validateCaseTransactionsDetails('£500.00', '0', '£0.00', '£0.00', '£60.00');
await apiUtils.updateRefundStatusByRefundReference(refundRef, 'Unable to apply refund to Card', 'REJECTED');
await I.refreshPage();
I.wait(CCPBATConstants.tenSecondWaitTime);
await CaseTransaction.validateCaseTransactionsDetails('£500.00', '0', '£0.00', '£0.00', '£280.00');

//await I.click(`//td[contains(.,'${refundRef}')]/following-sibling::td/a[.=\'Review\'][1]`);
//I.wait(CCPBATConstants.tenSecondWaitTime);
//const reviewRefundDetailsData = assertionData.reviewRefundDetailsDataAfterApproverAction(refundRef, paymentRcReference, refundReason, '£220.00', emailAddress, '', 'payments probate', 'approver probate');
//const refundNotificationPreviewData = assertionData.refundNotificationPreviewData(emailAddress, '', ccdCaseNumber, refundRef, '220', 'Due to a technical error a payment was taken incorrectly and has now been refunded');
await I.click(`//td[contains(.,'${refundRef}')]/following-sibling::td/a[.=\'Review\'][1]`);
I.wait(CCPBATConstants.tenSecondWaitTime);
const reviewRefundDetailsData = assertionData.reviewRefundDetailsDataAfterApproverAction(refundRef, paymentRcReference, refundReason, '£220.00', emailAddress, '', 'payments probate', 'approver probate');
const refundNotificationPreviewData = assertionData.refundNotificationPreviewData(emailAddress, '', ccdCaseNumber, refundRef, '220', 'Due to a technical error a payment was taken incorrectly and has now been refunded');

//await RefundsList.verifyRefundDetailsAfterLiberataRejection(reviewRefundDetailsData, true, refundNotificationPreviewData);
await RefundsList.verifyRefundDetailsAfterLiberataRejection(reviewRefundDetailsData, true, refundNotificationPreviewData);

await I.Logout();
I.clearCookie();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ Scenario('Fully Paid Fee with Retro Remission CAN have Full Remission Refunded',
const reviewRemissionRefundDetailsDataAfterApproval = assertionData.reviewRefundDetailsDataAfterApproverAction(refundRefRemissions, paymentRcReference, 'Retrospective remission', '£100.00', emailAddress, '', 'payments probate', 'approver probate');
await RefundsList.verifyRefundDetailsAfterRefundApproved(reviewRemissionRefundDetailsDataAfterApproval);

// Refund Accepted by liberata
await apiUtils.updateRefundStatusByRefundReference(refundRefRemissions, '', 'ACCEPTED');
I.wait(CCPBATConstants.fiveSecondWaitTime);
I.click('Back');
I.wait(CCPBATConstants.fiveSecondWaitTime);
await CaseTransaction.validateCaseTransactionsDetails('£273.00', '0', '£100.00', '£0.00', '£0.00');

await I.Logout();
I.clearCookie();
I.wait(CCPBATConstants.fiveSecondWaitTime);
Expand Down Expand Up @@ -330,6 +337,13 @@ Scenario('Partially Paid Fee with Retro Remission resulting in a POSITIVE Balanc
const reviewRemissionRefundDetailsDataAfterApproval = assertionData.reviewRefundDetailsDataAfterApproverAction(refundRefRemissions, paymentRcReference, 'Retrospective remission', '£63.00', emailAddress, '', 'payments probate', 'approver probate');
await RefundsList.verifyRefundDetailsAfterRefundApproved(reviewRemissionRefundDetailsDataAfterApproval);

// Refund Accepted by liberata
await apiUtils.updateRefundStatusByRefundReference(refundRefRemissions, '', 'ACCEPTED');
I.wait(CCPBATConstants.fiveSecondWaitTime);
I.click('Back');
I.wait(CCPBATConstants.fiveSecondWaitTime);
await CaseTransaction.validateCaseTransactionsDetails('£200.00', '0', '£100.00', '£0.00', '£0.00');

await I.Logout();
I.clearCookie();
I.wait(CCPBATConstants.fiveSecondWaitTime);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@angular-eslint/schematics": "^18.0.1",
"@babel/eslint-parser": "^7.11.0",
"@babel/helper-create-class-features-plugin": "^7.21.8",
"@hmcts/ccpay-web-component": "6.2.6",
"@hmcts/ccpay-web-component": "6.2.3",
"@hmcts/cookie-manager": "^1.0.0",
"@hmcts/nodejs-healthcheck": "^1.8.0",
"@hmcts/nodejs-logging": "^4.0.4",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4449,15 +4449,15 @@ __metadata:
languageName: node
linkType: hard

"@hmcts/ccpay-web-component@npm:6.2.6":
version: 6.2.6
resolution: "@hmcts/ccpay-web-component@npm:6.2.6"
"@hmcts/ccpay-web-component@npm:6.2.3":
version: 6.2.3
resolution: "@hmcts/ccpay-web-component@npm:6.2.3"
dependencies:
tslib: ^2.3.0
peerDependencies:
"@angular/common": ^16.1.6
"@angular/core": ^16.1.6
checksum: 74dc665406e50ba0465d977943a69ce184fcd6d855ed4617dd1322fad88e763d78d143c6d18d132fddd10c47be411a42bfc1e86129753d995571eef2cbf9d996
checksum: fab2f04808bb1fd55783962c8ed5c03964345fad542bc5b3a7c29feef210a5adfa4baaa0e96dd6c7600563859e2869b74dfd73d3641dd27626e0a6c2bfd96887
languageName: node
linkType: hard

Expand Down Expand Up @@ -9777,7 +9777,7 @@ __metadata:
"@babel/helper-create-class-features-plugin": ^7.21.8
"@codeceptjs/allure-legacy": ^1.0.2
"@codeceptjs/helper": ^1.0.2
"@hmcts/ccpay-web-component": 6.2.6
"@hmcts/ccpay-web-component": 6.2.3
"@hmcts/cookie-manager": ^1.0.0
"@hmcts/eslint-config": ^1.4.0
"@hmcts/nodejs-healthcheck": ^1.8.0
Expand Down