-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(EMS-3769-3770-3771-3772-3782): buyer - split outstanding/overdue…
… and failed payments (#3012) * feat(EMS-3769-7-1-2): split your buyer section with relevant sections * feat(EMS-3769-7-1-2): fix some failing tests * feat(EMS-3769-7-1-2): added new check your answers row * feat(EMS-3769-7-1-2): fixed failing ui tests * feat(EMS-3769-7-1-2): update failing e2e tests * feat(EMS-3769-7-1-2): fix failing tests * feat(EMS-3769-7-1-2): code changes and improvements * feat(EMS-3769-7-1-2): remove test * feat(EMS-3769-7-1-2): fix failing tests * feat(EMS-3769-7-1-2): code and test fixes --------- Co-authored-by: Zain Kassam <[email protected]>
- Loading branch information
Showing
107 changed files
with
5,402 additions
and
3,303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
e2e-tests/commands/insurance/your-buyer/complete-and-submit-failed-to-pay-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* completeAndSubmitFailedToPayForm | ||
* Complete and submit the "failed to pay" form | ||
* @param {Boolean} failedToPay: Buyer has failed to pay the exporter on the time | ||
*/ | ||
const completeAndSubmitFailedToPayForm = ({ failedToPay = false }) => { | ||
cy.completeFailedToPayForm({ failedToPay }); | ||
|
||
cy.clickSubmitButton(); | ||
}; | ||
|
||
export default completeAndSubmitFailedToPayForm; |
26 changes: 26 additions & 0 deletions
26
...commands/insurance/your-buyer/complete-and-submit-outstanding-or-overdue-payments-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { YOUR_BUYER as FIELD_IDS } from '../../../constants/field-ids/insurance/your-buyer'; | ||
import application from '../../../fixtures/application'; | ||
|
||
const { TOTAL_OUTSTANDING_PAYMENTS, TOTAL_AMOUNT_OVERDUE } = FIELD_IDS; | ||
|
||
const { BUYER } = application; | ||
|
||
/** | ||
* completeAndSubmitOutstandingOrOverduePaymentsForm | ||
* Complete and submit the "outstanding or overdue payments" form | ||
* @param {String} amountOverDue: enter the amount overdue - defaults to BUYER[TOTAL_AMOUNT_OVERDUE] | ||
* @param {String} totalOutstanding: enter the total outstanding - defaults to BUYER[TOTAL_OUTSTANDING_PAYMENTS] | ||
*/ | ||
const completeAndSubmitOutstandingOrOverduePaymentsForm = ({ | ||
amountOverDue = BUYER[TOTAL_AMOUNT_OVERDUE], | ||
totalOutstanding = BUYER[TOTAL_OUTSTANDING_PAYMENTS], | ||
}) => { | ||
cy.completeOutstandingOrOverduePaymentsForm({ | ||
amountOverDue, | ||
totalOutstanding, | ||
}); | ||
|
||
cy.clickSubmitButton(); | ||
}; | ||
|
||
export default completeAndSubmitOutstandingOrOverduePaymentsForm; |
20 changes: 1 addition & 19 deletions
20
...ests/commands/insurance/your-buyer/complete-and-submit-trading-history-with-buyer-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
e2e-tests/commands/insurance/your-buyer/complete-failed-to-pay-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* completeFailedToPayForm | ||
* Complete the "failed to pay" form | ||
* @param {Boolean} failedToPay: Buyer has failed to pay the exporter on the time - defaults to false | ||
*/ | ||
const completeFailedToPayForm = ({ failedToPay = false }) => { | ||
if (failedToPay) { | ||
cy.clickYesRadioInput(); | ||
} else { | ||
cy.clickNoRadioInput(); | ||
} | ||
}; | ||
|
||
export default completeFailedToPayForm; |
20 changes: 20 additions & 0 deletions
20
e2e-tests/commands/insurance/your-buyer/complete-outstanding-or-overdue-payments-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { field } from '../../../pages/shared'; | ||
import { YOUR_BUYER as FIELD_IDS } from '../../../constants/field-ids/insurance/your-buyer'; | ||
import application from '../../../fixtures/application'; | ||
|
||
const { TOTAL_OUTSTANDING_PAYMENTS, TOTAL_AMOUNT_OVERDUE } = FIELD_IDS; | ||
|
||
const { BUYER } = application; | ||
|
||
/** | ||
* completeOutstandingOrOverduePaymentsForm | ||
* Complete the "outstanding or overdue payments" form | ||
* @param {String} amountOverdue: enter the amount overdue - default to BUYER[TOTAL_AMOUNT_OVERDUE] | ||
* @param {String} totalOutstanding: enter the total outstanding - default to BUYER[TOTAL_OUTSTANDING_PAYMENTS] | ||
*/ | ||
const completeOutstandingOrOverduePaymentsForm = ({ amountOverdue = BUYER[TOTAL_AMOUNT_OVERDUE], totalOutstanding = BUYER[TOTAL_OUTSTANDING_PAYMENTS] }) => { | ||
cy.keyboardInput(field(TOTAL_AMOUNT_OVERDUE).input(), amountOverdue); | ||
cy.keyboardInput(field(TOTAL_OUTSTANDING_PAYMENTS).input(), totalOutstanding); | ||
}; | ||
|
||
export default completeOutstandingOrOverduePaymentsForm; |
27 changes: 1 addition & 26 deletions
27
e2e-tests/commands/insurance/your-buyer/complete-trading-history-with-buyer-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,14 @@ | ||
import { field } from '../../../pages/shared'; | ||
import { YOUR_BUYER as FIELD_IDS } from '../../../constants/field-ids/insurance/your-buyer'; | ||
import application from '../../../fixtures/application'; | ||
|
||
const { TOTAL_OUTSTANDING_PAYMENTS, TOTAL_AMOUNT_OVERDUE } = FIELD_IDS; | ||
|
||
const { BUYER } = application; | ||
|
||
/** | ||
* completeTradingHistoryWithBuyerForm | ||
* Complete the "trading history with buyer" form | ||
* @param {Boolean} outstandingPayments: Exporter has outstanding payments with the buyer | ||
* @param {Boolean} failedToPay: Buyer has failed to pay the exporter on the time | ||
* @param {String} amountOverDue: enter the amount overdue - default to application value | ||
* @param {String} totalOutstanding: enter the total outstanding - default to application value | ||
*/ | ||
const completeTradingHistoryWithBuyerForm = ({ | ||
outstandingPayments = false, | ||
failedToPay = false, | ||
amountOverDue = BUYER[TOTAL_AMOUNT_OVERDUE], | ||
totalOutstanding = BUYER[TOTAL_OUTSTANDING_PAYMENTS], | ||
}) => { | ||
const completeTradingHistoryWithBuyerForm = ({ outstandingPayments = false }) => { | ||
if (outstandingPayments) { | ||
cy.clickYesRadioInput(); | ||
|
||
cy.keyboardInput(field(TOTAL_AMOUNT_OVERDUE).input(), amountOverDue); | ||
cy.keyboardInput(field(TOTAL_OUTSTANDING_PAYMENTS).input(), totalOutstanding); | ||
} else { | ||
cy.clickNoRadioInput(); | ||
} | ||
|
||
if (failedToPay) { | ||
cy.clickYesRadioInput(1); | ||
} else { | ||
cy.clickNoRadioInput(1); | ||
} | ||
}; | ||
|
||
export default completeTradingHistoryWithBuyerForm; |
15 changes: 15 additions & 0 deletions
15
...s/commands/shared-commands/assertions/assert-empty-overdue-or-outstanding-field-values.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { field } from '../../../pages/shared'; | ||
import { YOUR_BUYER as FIELD_IDS } from '../../../constants/field-ids/insurance/your-buyer'; | ||
|
||
const { TOTAL_AMOUNT_OVERDUE, TOTAL_OUTSTANDING_PAYMENTS } = FIELD_IDS; | ||
|
||
/** | ||
* assertEmptyOverdueOrOutstandingFieldValues | ||
* Assert all field values in the "overdue or outstanding" form are empty. | ||
*/ | ||
const assertEmptyOverdueOrOutstandingFieldValues = () => { | ||
cy.checkValue(field(TOTAL_AMOUNT_OVERDUE), ''); | ||
cy.checkValue(field(TOTAL_OUTSTANDING_PAYMENTS), ''); | ||
}; | ||
|
||
export default assertEmptyOverdueOrOutstandingFieldValues; |
21 changes: 0 additions & 21 deletions
21
e2e-tests/commands/shared-commands/assertions/assert-empty-trading-history-field-values.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.