Skip to content

Commit

Permalink
feat(EMS-3660): export contract - how was contract awarded - UI setup (
Browse files Browse the repository at this point in the history
…#2837)

* feat(EMS-3660): export contract - how was contract awarded - page/flow setup

* feat(EMS-3660): fix/update e2e tests

* feat(EMS-3660): fix/update e2e tests

* feat(EMS-3660): fix/update e2e test
  • Loading branch information
ttbarnes authored Jul 30, 2024
1 parent 17e7c0a commit 5884388
Show file tree
Hide file tree
Showing 50 changed files with 420 additions and 36 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

## [2.22.0](https://github.com/UK-Export-Finance/exip/compare/v2.21.0...v2.22.0) (2024-07-30)


### Features

* **EMS-3668-69-73-74:** eligibility - Party to consortium and Member of a group ([#2832](https://github.com/UK-Export-Finance/exip/issues/2832)) ([b05ef07](https://github.com/UK-Export-Finance/exip/commit/b05ef0704e3b3771f697a21d4cb157732a1146fb))
- **EMS-3668-69-73-74:** eligibility - Party to consortium and Member of a group ([#2832](https://github.com/UK-Export-Finance/exip/issues/2832)) ([b05ef07](https://github.com/UK-Export-Finance/exip/commit/b05ef0704e3b3771f697a21d4cb157732a1146fb))

## [2.21.0](https://github.com/UK-Export-Finance/exip/compare/v2.20.0...v2.21.0) (2024-07-26)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* completeAndSubmitHowWasTheContractAwardedForm
* Complete and submit the "How was the contract awarded" form
*/
const completeAndSubmitHowWasTheContractAwardedForm = () => {
cy.clickSubmitButton();
};

export default completeAndSubmitHowWasTheContractAwardedForm;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const completeExportContractSection = ({
}) => {
cy.startInsuranceExportContractSection({ viaTaskList });

cy.completeAndSubmitHowWasTheContractAwardedForm();

cy.completeAndSubmitAboutGoodsOrServicesForm({ finalDestinationKnown });
cy.completeAndSubmitHowYouWillGetPaidForm({});

Expand Down
5 changes: 5 additions & 0 deletions e2e-tests/constants/routes/insurance/export-contract.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const ROOT = '/export-contract';
const HOW_WAS_THE_CONTRACT_AWARDED_ROOT = `${ROOT}/how-was-the-contract-awarded`;
const ABOUT_GOODS_OR_SERVICES_ROOT = `${ROOT}/about-goods-or-services`;
const HOW_WILL_YOU_GET_PAID_ROOT = `${ROOT}/how-will-you-get-paid`;
const PRIVATE_MARKET_ROOT = `${ROOT}/private-market`;
Expand All @@ -10,6 +11,10 @@ const AGENT_CHARGES_ROOT = `${ROOT}/agent-charges`;

export const EXPORT_CONTRACT = {
ROOT,
HOW_WAS_THE_CONTRACT_AWARDED: HOW_WAS_THE_CONTRACT_AWARDED_ROOT,
HOW_WAS_THE_CONTRACT_AWARDED_SAVE_AND_BACK: `${HOW_WAS_THE_CONTRACT_AWARDED_ROOT}/save-and-go-back`,
HOW_WAS_THE_CONTRACT_AWARDED_CHANGE: `${HOW_WAS_THE_CONTRACT_AWARDED_ROOT}/change`,
HOW_WAS_THE_CONTRACT_AWARDED_CHECK_AND_CHANGE: `${HOW_WAS_THE_CONTRACT_AWARDED_ROOT}/check-and-change`,
ABOUT_GOODS_OR_SERVICES: ABOUT_GOODS_OR_SERVICES_ROOT,
ABOUT_GOODS_OR_SERVICES_SAVE_AND_BACK: `${ABOUT_GOODS_OR_SERVICES_ROOT}/save-and-go-back`,
ABOUT_GOODS_OR_SERVICES_CHANGE: `${ABOUT_GOODS_OR_SERVICES_ROOT}/change`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const ROOT = {
"We may also ask you if you've tried to get credit insurance through the private market. This is because we're not in competition with the private insurance market but are here to help when they cannot.",
};

const HOW_WAS_THE_CONTRACT_AWARDED = {
...SHARED,
PAGE_TITLE: 'How was the contract awarded?',
};

const ABOUT_GOODS_OR_SERVICES = {
...SHARED,
PAGE_TITLE: 'About the goods or services',
Expand Down Expand Up @@ -69,6 +74,7 @@ const CHECK_YOUR_ANSWERS = {

module.exports = {
ROOT,
HOW_WAS_THE_CONTRACT_AWARDED,
ABOUT_GOODS_OR_SERVICES,
HOW_WILL_YOU_GET_PAID,
PRIVATE_MARKET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ context('Insurance - Export contract - About goods or services page - Final dest
cy.completeSignInAndGoToApplication({ totalContractValueOverThreshold: true }).then(({ referenceNumber: refNumber }) => {
referenceNumber = refNumber;

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

url = `${baseUrl}${ROOT}/${referenceNumber}${ABOUT_GOODS_OR_SERVICES}`;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ context(
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => {
referenceNumber = refNumber;

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

url = `${baseUrl}${ROOT}/${referenceNumber}${ABOUT_GOODS_OR_SERVICES}`;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ context('Insurance - Export contract - About goods or services page - Submission
cy.completeSignInAndGoToApplication({ totalContractValueOverThreshold: true }).then(({ referenceNumber: refNumber }) => {
referenceNumber = refNumber;

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

url = `${baseUrl}${ROOT}/${referenceNumber}${ABOUT_GOODS_OR_SERVICES}`;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const CONTENT_STRINGS = PAGES.INSURANCE.EXPORT_CONTRACT.ABOUT_GOODS_OR_SERVICES;

const {
ROOT,
EXPORT_CONTRACT: { ROOT: EXPORT_CONTRACT_ROOT, ABOUT_GOODS_OR_SERVICES, HOW_WILL_YOU_GET_PAID },
EXPORT_CONTRACT: { HOW_WAS_THE_CONTRACT_AWARDED, ABOUT_GOODS_OR_SERVICES, HOW_WILL_YOU_GET_PAID },
} = INSURANCE_ROUTES;

const {
Expand All @@ -34,7 +34,9 @@ context(
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => {
referenceNumber = refNumber;

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

url = `${baseUrl}${ROOT}/${referenceNumber}${ABOUT_GOODS_OR_SERVICES}`;

Expand All @@ -54,7 +56,7 @@ context(
cy.corePageChecks({
pageTitle: CONTENT_STRINGS.PAGE_TITLE,
currentHref: `${ROOT}/${referenceNumber}${ABOUT_GOODS_OR_SERVICES}`,
backLink: `${ROOT}/${referenceNumber}${EXPORT_CONTRACT_ROOT}`,
backLink: `${ROOT}/${referenceNumber}${HOW_WAS_THE_CONTRACT_AWARDED}`,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ context('Insurance - Export contract - About goods or services page - Save and g
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => {
referenceNumber = refNumber;

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

url = `${baseUrl}${INSURANCE_ROOT}/${referenceNumber}${ABOUT_GOODS_OR_SERVICES}`;

Expand Down Expand Up @@ -82,6 +84,7 @@ context('Insurance - Export contract - About goods or services page - Save and g

// go back to the page via the task list
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

cy.checkTextareaValue({
fieldId: FIELD_ID,
Expand Down Expand Up @@ -115,6 +118,7 @@ context('Insurance - Export contract - About goods or services page - Save and g

it(`should have no value in '${FIELD_ID}' when going back to the page`, () => {
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

cy.checkTextareaValue({
fieldId: FIELD_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ context('Insurance - Export contract - About goods or services page - form valid
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => {
referenceNumber = refNumber;

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();

url = `${baseUrl}${ROOT}/${referenceNumber}${ABOUT_GOODS_OR_SERVICES}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ context("Insurance - Export contract - Agent charges page - As an Exporter I wan

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ context('Insurance - Export contract - Agent charges page - Fixed sum amount as

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ context('Insurance - Export contract - Agent charges page - Fixed sum amount wit

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ context(

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ context(

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ context(`Insurance - Export contract - Agent charges - Save and go back - ${METH

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down Expand Up @@ -91,8 +92,8 @@ context(`Insurance - Export contract - Agent charges - Save and go back - ${METH

cy.startInsuranceExportContractSection({});

// go through 5 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 5 });
// go through 6 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 6 });

cy.assertAgentChargesFieldValues({ fixedSumMethod: true });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ context(`Insurance - Export contract - Agent charges - Save and go back - ${METH

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down Expand Up @@ -91,8 +92,8 @@ context(`Insurance - Export contract - Agent charges - Save and go back - ${METH

cy.startInsuranceExportContractSection({});

// go through 5 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 5 });
// go through 6 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 6 });

cy.assertAgentChargesFieldValues({ percentageMethod: true });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ context(`Insurance - Export contract - Agent charges - Save and go back - empty

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ context(`Insurance - Export contract - Agent charges page - form validation - ${

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ context('Insurance - Export contract - Agent charges page - form validation', ()

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ context(

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ context('Insurance - Export contract - Agent details - Save and go back', () =>

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down Expand Up @@ -94,8 +95,8 @@ context('Insurance - Export contract - Agent details - Save and go back', () =>

cy.startInsuranceExportContractSection({});

// go through 3 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 3 });
// go through 4 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 4 });

cy.assertAgentDetailsFieldValues({});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ context('Insurance - Export contract - Agent details page - form validation', ()

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ context(

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ context('Insurance - Export contract - Agent service - Save and go back', () =>

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down Expand Up @@ -93,8 +94,8 @@ context('Insurance - Export contract - Agent service - Save and go back', () =>

cy.startInsuranceExportContractSection({});

// go through 4 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 4 });
// go through 5 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 5 });

cy.assertAgentServiceFieldValues({});
});
Expand All @@ -120,8 +121,8 @@ context('Insurance - Export contract - Agent service - Save and go back', () =>

cy.startInsuranceExportContractSection({});

// go through 4 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 4 });
// go through 5 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 5 });

cy.assertAgentServiceFieldValues({ agentIsCharging: true });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ context('Insurance - Export contract - Agent service page - form validation', ()

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitAgentForm({ isUsingAgent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ context(

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ context('Insurance - Export contract - Agent - Save and go back', () => {

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});

Expand Down Expand Up @@ -74,8 +75,8 @@ context('Insurance - Export contract - Agent - Save and go back', () => {

cy.startInsuranceExportContractSection({});

// go through 2 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 2 });
// go through 3 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 3 });

cy.assertNoRadioOptionIsChecked();
});
Expand Down Expand Up @@ -104,8 +105,8 @@ context('Insurance - Export contract - Agent - Save and go back', () => {

cy.startInsuranceExportContractSection({});

// go through 2 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 2 });
// go through 3 export contract forms.
cy.clickSubmitButtonMultipleTimes({ count: 3 });

cy.assertYesRadioOptionIsChecked();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ context(

// go to the page we want to test.
cy.startInsuranceExportContractSection({});
cy.completeAndSubmitHowWasTheContractAwardedForm();
cy.completeAndSubmitAboutGoodsOrServicesForm({});
cy.completeAndSubmitHowYouWillGetPaidForm({});
cy.completeAndSubmitPrivateMarketForm({ attemptedPrivateMarketCover: true });
Expand Down
Loading

0 comments on commit 5884388

Please sign in to comment.