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

fix(EMS-3508-3543): no pdf - application submission - XLSX - agent values #2675

Merged
merged 5 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions e2e-tests/commands/insurance/complete-export-contract-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @param {Boolean} agentChargeMethodFixedSum: Agent charge method is "fixed sum"
* @param {String} agentChargeFixedSumAmount: Agent charge fixed sum amount
* @param {Boolean} agentChargeMethodPercentage: Agent charge method is "percentage"
* @param {Boolean} alternativeCurrency: Should submit an "alternative currency". Defaults to false.
* @param {Boolean} attemptedPrivateMarketCover: Has attempted to insure through the private market
* @param {Boolean} finalDestinationKnown: "Final destination known"
* @param {Boolean} isUsingAgent: Exporter is using an agent
Expand All @@ -17,6 +18,7 @@ const completeExportContractSection = ({
agentChargeMethodFixedSum = false,
agentChargeFixedSumAmount,
agentChargeMethodPercentage = false,
alternativeCurrency = false,
attemptedPrivateMarketCover = false,
finalDestinationKnown,
isUsingAgent = false,
Expand Down Expand Up @@ -50,6 +52,16 @@ const completeExportContractSection = ({
fixedSumAmount: agentChargeFixedSumAmount,
percentageMethod: agentChargeMethodPercentage,
});

if (alternativeCurrency) {
cy.clickBackLink();

cy.clickProvideAlternativeCurrencyLink();

cy.clickAlternativeCurrencyRadioAndSubmitCurrency({});

cy.clickSubmitButton();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const { POLICY_TYPE } = APPLICATION;
* @param {String} agentChargeFixedSumAmount: Agent charge fixed sum amount
* @param {Boolean} agentChargeMethodPercentage: Agent charge method is "percentage".
* @param {Boolean} agentIsCharging: Should submit "yes" to "agent is charging" in the "agent details" form.
* @param {Boolean} alternativeBuyerCurrency: Should submit an "alternative currency" in the buyer section.
* @param {Boolean} alternativeCurrencyBuyer: Should submit an "buyer - alternative currency"
* @param {Boolean} alternativeCurrencyExportContract: Select the "agent - alternative currency" option
* @param {Boolean} alternativeCurrencyTurnover: Select the "turnover - alternative currency" option
* @param {Boolean} alternativeCurrencyPolicy: Select the "policy - alternative currency" option
* @param {Boolean} attemptedPrivateMarketCover: Should submit "yes" to "attempted to insure through the private market" form.
* @param {Boolean} buyerOutstandingPayments: Exporter has outstanding payments with the buyer.
* @param {Boolean} buyerFailedToPayOnTime: Buyer has failed to pay the exporter on the time.
Expand All @@ -33,15 +36,16 @@ const { POLICY_TYPE } = APPLICATION;
* @param {Boolean} submitCheckYourAnswers: Should click each section's "check your answers" submit button.
* @param {Boolean} totalContractValueOverThreshold: If total contract value in eligibility should be over threshold.
* @param {Boolean} usingBroker: Should submit "yes" or "no" to "using a broker".
* @param {Boolean} alternativeCurrencyTurnover: Select the "alternative currency" option
* @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option
*/
const completePrepareApplicationMultiplePolicyType = ({
agentChargeMethodFixedSum = false,
agentChargeFixedSumAmount,
agentChargeMethodPercentage = false,
agentIsCharging = false,
alternativeBuyerCurrency = false,
alternativeCurrencyBuyer = false,
alternativeCurrencyExportContract = false,
alternativeCurrencyTurnover = false,
alternativeCurrencyPolicy = false,
attemptedPrivateMarketCover = false,
buyerOutstandingPayments = false,
buyerFailedToPayOnTime = false,
Expand All @@ -64,8 +68,6 @@ const completePrepareApplicationMultiplePolicyType = ({
totalContractValueOverThreshold = false,
submitCheckYourAnswers = true,
usingBroker = false,
alternativeCurrencyTurnover = false,
alternativeCurrencyPolicy = false,
}) => {
cy.completeBusinessSection({
differentTradingName,
Expand All @@ -76,7 +78,7 @@ const completePrepareApplicationMultiplePolicyType = ({
});

cy.completeBuyerSection({
alternativeCurrency: alternativeBuyerCurrency,
alternativeCurrency: alternativeCurrencyBuyer,
hasConnectionToBuyer,
exporterHasTradedWithBuyer,
outstandingPayments: buyerOutstandingPayments,
Expand Down Expand Up @@ -106,6 +108,7 @@ const completePrepareApplicationMultiplePolicyType = ({
agentChargeMethodFixedSum,
agentChargeFixedSumAmount,
agentChargeMethodPercentage,
alternativeCurrency: alternativeCurrencyExportContract,
attemptedPrivateMarketCover,
finalDestinationKnown,
isUsingAgent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const { POLICY_TYPE } = FIELD_VALUES;
* @param {String} agentChargeFixedSumAmount: Agent charge fixed sum amount
* @param {Boolean} agentChargeMethodPercentage: Agent charge method is "percentage".
* @param {Boolean} agentIsCharging: Should submit "yes" to "agent is charging" in the "agent details" form.
* @param {Boolean} alternativeBuyerCurrency: Should submit an "alternative currency" in the buyer section.
* @param {Boolean} alternativeCurrencyBuyer: Should submit an "buyer - alternative currency"
* @param {Boolean} alternativeCurrencyExportContract: Select the "agent - alternative currency" option
* @param {Boolean} alternativeCurrencyTurnover: Select the "turnover - alternative currency" option
* @param {Boolean} alternativeCurrencyPolicy: Select the "policy - alternative currency" option
* @param {Boolean} attemptedPrivateMarketCover: Should submit "yes" to "attempted to insure through the private market" form.
* @param {Boolean} buyerOutstandingPayments: Exporter has outstanding payments with the buyer.
* @param {Boolean} buyerFailedToPayOnTime: Buyer has failed to pay the exporter on the time.
Expand All @@ -33,11 +36,12 @@ const { POLICY_TYPE } = FIELD_VALUES;
* @param {Boolean} submitCheckYourAnswers: Should click each section's "check your answers" submit button.
* @param {Boolean} totalContractValueOverThreshold: If total contract value in eligibility should be over threshold.
* @param {Boolean} usingBroker: Should submit "yes" or "no" to "using a broker".
* @param {Boolean} alternativeCurrencyTurnover: Select the "alternative currency" option
* @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option
*/
const completePrepareApplicationSinglePolicyType = ({
alternativeBuyerCurrency = false,
alternativeCurrencyBuyer = false,
alternativeCurrencyExportContract = false,
alternativeCurrencyTurnover = false,
alternativeCurrencyPolicy = false,
differentTradingName = false,
differentTradingAddress = false,
hasCreditControlProcess = false,
Expand All @@ -64,8 +68,6 @@ const completePrepareApplicationSinglePolicyType = ({
agentChargeFixedSumAmount,
agentChargeMethodPercentage = false,
submitCheckYourAnswers = true,
alternativeCurrencyTurnover = false,
alternativeCurrencyPolicy = false,
}) => {
cy.completeBusinessSection({
differentTradingName,
Expand All @@ -76,7 +78,7 @@ const completePrepareApplicationSinglePolicyType = ({
});

cy.completeBuyerSection({
alternativeCurrency: alternativeBuyerCurrency,
alternativeCurrency: alternativeCurrencyBuyer,
hasConnectionToBuyer,
exporterHasTradedWithBuyer,
outstandingPayments: buyerOutstandingPayments,
Expand Down Expand Up @@ -106,6 +108,7 @@ const completePrepareApplicationSinglePolicyType = ({
agentChargeMethodFixedSum,
agentChargeFixedSumAmount,
agentChargeMethodPercentage,
alternativeCurrency: alternativeCurrencyExportContract,
attemptedPrivateMarketCover,
finalDestinationKnown,
isUsingAgent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import completeSignInAndGoToApplication from './account/complete-sign-in-and-go-
* @param {Boolean} agentChargeMethodFixedSum: Agent charge method is "fixed sum".
* @param {Boolean} agentChargeMethodPercentage: Agent charge method is "percentage".
* @param {Boolean} agentIsCharging: Should submit "yes" to "agent is charging" in the "agent details" form.
* @param {Boolean} alternativeBuyerCurrency: Should submit an "alternative currency" in the buyer section.
* @param {Boolean} alternativeCurrencyBuyer: Should submit an "buyer - alternative currency".
* @param {Boolean} alternativeCurrencyExportContract: Select the "export contract - alternative currency" option
* @param {Boolean} alternativeCurrencyTurnover: Select the "turnover - alternative currency" option
* @param {Boolean} alternativeCurrencyPolicy: Select the "policy - alternative currency" option
* @param {Boolean} attemptedPrivateMarketCover: Should submit "yes" to "attempted to insure through the private market" form.
* @param {Boolean} buyerOutstandingPayments: Exporter has outstanding payments with the buyer.
* @param {Boolean} buyerFailedToPayOnTime: Buyer has failed to pay the exporter on the time.
Expand All @@ -34,12 +37,13 @@ import completeSignInAndGoToApplication from './account/complete-sign-in-and-go-
* @param {Boolean} submitCheckYourAnswers: Should click each section's "check your answers" submit button.
* @param {Boolean} totalContractValueOverThreshold: If total contract value in eligibility should be over threshold.
* @param {Boolean} usingBroker: Should submit "yes" or "no" to "using a broker".
* @param {Boolean} alternativeCurrencyTurnover: Select the "alternative currency" option
* @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option
* @return {String} Application reference number
*/
const completeSignInAndSubmitAnApplication = ({
alternativeBuyerCurrency = false,
alternativeCurrencyBuyer = false,
alternativeCurrencyExportContract = false,
alternativeCurrencyTurnover = false,
alternativeCurrencyPolicy = false,
agentIsCharging = false,
agentChargeMethodFixedSum = false,
agentChargeMethodPercentage = false,
Expand All @@ -66,8 +70,6 @@ const completeSignInAndSubmitAnApplication = ({
policyValueOverMvpMaximum = false,
totalContractValueOverThreshold = false,
usingBroker = false,
alternativeCurrencyTurnover = false,
alternativeCurrencyPolicy = false,
}) => {
completeSignInAndGoToApplication({ totalContractValueOverThreshold }).then(({ referenceNumber }) => {
if (policyType === APPLICATION.POLICY_TYPE.MULTIPLE) {
Expand All @@ -76,7 +78,10 @@ const completeSignInAndSubmitAnApplication = ({
agentChargeMethodPercentage,
agentIsCharging,
attemptedPrivateMarketCover,
alternativeBuyerCurrency,
alternativeCurrencyBuyer,
alternativeCurrencyExportContract,
alternativeCurrencyTurnover,
alternativeCurrencyPolicy,
buyerOutstandingPayments,
buyerFailedToPayOnTime,
differentPolicyContact,
Expand All @@ -97,15 +102,16 @@ const completeSignInAndSubmitAnApplication = ({
referenceNumber,
totalContractValueOverThreshold,
usingBroker,
alternativeCurrencyTurnover,
alternativeCurrencyPolicy,
});
} else {
cy.completePrepareApplicationSinglePolicyType({
agentChargeMethodFixedSum,
agentChargeMethodPercentage,
agentIsCharging,
alternativeBuyerCurrency,
alternativeCurrencyBuyer,
alternativeCurrencyExportContract,
alternativeCurrencyTurnover,
alternativeCurrencyPolicy,
attemptedPrivateMarketCover,
buyerFailedToPayOnTime,
buyerOutstandingPayments,
Expand All @@ -127,8 +133,6 @@ const completeSignInAndSubmitAnApplication = ({
referenceNumber,
totalContractValueOverThreshold,
usingBroker,
alternativeCurrencyTurnover,
alternativeCurrencyPolicy,
});
}
cy.completeAndSubmitCheckYourAnswers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ context(
before(() => {
cy.completeSignInAndSubmitAnApplication({
policyType: APPLICATION.POLICY_TYPE.MULTIPLE,
alternativeBuyerCurrency: true,
alternativeCurrencyBuyer: true,
exporterHasTradedWithBuyer: true,
buyerOutstandingPayments: true,
buyerFailedToPayOnTime: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { APPLICATION } from '../../../../../../../constants';

context('Insurance - submit an application - Multiple policy type, using an agent, fixed sum method, alternative currency', () => {
let referenceNumber;

before(() => {
cy.completeSignInAndSubmitAnApplication({
isUsingAgent: true,
agentIsCharging: true,
agentChargeMethodFixedSum: true,
alternativeCurrencyExportContract: true,
policyType: APPLICATION.POLICY_TYPE.MULTIPLE,
}).then((refNumber) => {
referenceNumber = refNumber;
});
});

beforeEach(() => {
cy.saveSession();
});

after(() => {
cy.deleteApplication(referenceNumber);
});

it('should successfully submit the application and redirect to `application submitted`', () => {
cy.assertApplicationSubmittedUrl(referenceNumber);
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { APPLICATION } from '../../../../../../../constants';

context('Insurance - submit an application - Multiple policy type, using an agent', () => {
context('Insurance - submit an application - Multiple policy type, using an agent, no charges', () => {
let referenceNumber;

before(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { APPLICATION } from '../../../../../../../constants';

context('Insurance - submit an application - Multiple policy type, using an agent, charges, percentage method', () => {
let referenceNumber;

before(() => {
cy.completeSignInAndSubmitAnApplication({
isUsingAgent: true,
agentIsCharging: true,
agentChargeMethodPercentage: true,
policyType: APPLICATION.POLICY_TYPE.MULTIPLE,
}).then((refNumber) => {
referenceNumber = refNumber;
});
});

beforeEach(() => {
cy.saveSession();
});

after(() => {
cy.deleteApplication(referenceNumber);
});

it('should successfully submit the application and redirect to `application submitted`', () => {
cy.assertApplicationSubmittedUrl(referenceNumber);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ context(
before(() => {
cy.completeSignInAndSubmitAnApplication({
policyType: APPLICATION.POLICY_TYPE.MULTIPLE,
alternativeBuyerCurrency: true,
alternativeCurrencyBuyer: true,
differentTradingName: true,
differentTradingAddress: true,
exporterHasTradedWithBuyer: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ context('Insurance - submit an application - Single policy type, exporter has tr

before(() => {
cy.completeSignInAndSubmitAnApplication({
alternativeBuyerCurrency: true,
alternativeCurrencyBuyer: true,
exporterHasTradedWithBuyer: true,
buyerOutstandingPayments: true,
buyerFailedToPayOnTime: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
context('Insurance - submit an application - Single policy type, using an agent, fixed sum method, alternative currency', () => {
let referenceNumber;

before(() => {
cy.completeSignInAndSubmitAnApplication({
isUsingAgent: true,
agentIsCharging: true,
agentChargeMethodFixedSum: true,
alternativeCurrencyExportContract: true,
}).then((refNumber) => {
referenceNumber = refNumber;
});
});

beforeEach(() => {
cy.saveSession();
});

after(() => {
cy.deleteApplication(referenceNumber);
});

it('should successfully submit the application and redirect to `application submitted`', () => {
cy.assertApplicationSubmittedUrl(referenceNumber);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
context('Insurance - submit an application - Single policy type, using an agent', () => {
context('Insurance - submit an application - Single policy type, using an agent, no charges', () => {
let referenceNumber;

before(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
context('Insurance - submit an application - Single policy type, using an agent, charges, percentage method', () => {
let referenceNumber;

before(() => {
cy.completeSignInAndSubmitAnApplication({
isUsingAgent: true,
agentIsCharging: true,
agentChargeMethodPercentage: true,
}).then((refNumber) => {
referenceNumber = refNumber;
});
});

beforeEach(() => {
cy.saveSession();
});

after(() => {
cy.deleteApplication(referenceNumber);
});

it('should successfully submit the application and redirect to `application submitted`', () => {
cy.assertApplicationSubmittedUrl(referenceNumber);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ context(

before(() => {
cy.completeSignInAndSubmitAnApplication({
alternativeBuyerCurrency: true,
alternativeCurrencyBuyer: true,
differentTradingName: true,
differentTradingAddress: true,
exporterHasTradedWithBuyer: true,
Expand Down
Loading
Loading