Skip to content

Commit

Permalink
PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYME… (
Browse files Browse the repository at this point in the history
#905)

* PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
      [PAY-7200] (https://tools.hmcts.net/jira/browse/PAY-7200).

* PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
      [PAY-7200] (https://tools.hmcts.net/jira/browse/PAY-7200).

* PAY-7200: Front end changes to Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
      [PAY-7200] (https://tools.hmcts.net/jira/browse/PAY-7200).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* update case trasaction page amount values

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

* PAY-7103: Calculate the AMOUNT DUE and OVERPAYMENTS for ( Issue refund and Remission-Refunds)
       [PAY-7103] (https://tools.hmcts.net/jira/browse/PAY-7103).

---------

Co-authored-by: shravanmechineni <[email protected]>
  • Loading branch information
Thor-tech-of-metal and shravanmechineni authored Sep 10, 2024
1 parent de8313d commit c5a615d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 53 deletions.
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

0 comments on commit c5a615d

Please sign in to comment.