-
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-4141): broker address lookup - manual entry (#3494)
* feat(EMS-4141): broker address lookup - enter manually * feat(EMS-4141): fix/update e2e tests * chore(e2e): fix typo * feat(EMS-4141): additional e2e test coverage * chore(e2e): dry click/assert enter address manually commands * feat(EMS-4141): update xlsx mapping * chore(e2e): address todo comment * feat(EMS-4141): update broker summary list mapping * feat(EMS-4141): update broker controllers 'manual address' urls * feat(EMS-4141): update broker controllers 'manual address' urls * feat(EMS-4141): improve e2e coverage * chore(docs): improve documentation * feat(EMS-4141): remove todo comment * feat(EMS-4141): fix/update e2e test * feat(EMS-4141): update broker submitted data mapping issue * feat(EMS-4141): fix/update/improve e2e test coverage
- Loading branch information
Showing
55 changed files
with
905 additions
and
259 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
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
11 changes: 11 additions & 0 deletions
11
e2e-tests/commands/shared-commands/click-events/click-enter-address-manually-link.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,11 @@ | ||
import { enterAddressManuallyLink } from '../../../partials/insurance'; | ||
|
||
/** | ||
* clickEnterAddressManuallyLink | ||
* Click the "enter manually" link in the "zero addresses" page. | ||
*/ | ||
const clickEnterAddressManuallyLink = () => { | ||
enterAddressManuallyLink().click(); | ||
}; | ||
|
||
export default clickEnterAddressManuallyLink; |
11 changes: 0 additions & 11 deletions
11
e2e-tests/commands/shared-commands/click-events/click-zero-addresses-enter-manually-link.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
37 changes: 37 additions & 0 deletions
37
...submit-an-application-multiple-policy-type-with-broker-based-in-uk-manual-address.spec.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,37 @@ | ||
import { APPLICATION, BUILDING_NAMES, VALID_POSTCODES } from '../../../../../../../constants'; | ||
|
||
context( | ||
'Insurance - submit an application - Multiple policy type with a broker - Based in UK - Manual address - As an Exporter, I want to submit my completed credit insurance application, So that UKEF can process and make a decision on my application', | ||
() => { | ||
let referenceNumber; | ||
|
||
before(() => { | ||
cy.completeSignInAndSubmitAnApplication({ | ||
policyType: APPLICATION.POLICY_TYPE.MULTIPLE, | ||
usingBroker: true, | ||
brokerIsBasedInUk: true, | ||
brokerPostcode: VALID_POSTCODES.WITH_SPACE, | ||
brokerBuildingNumberOrName: BUILDING_NAMES.TREASURY, | ||
provideBrokerAddressManually: 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); | ||
}); | ||
|
||
it('should render the application in a `submitted` state in the dashboard', () => { | ||
cy.assertDashboardApplicationSubmitted(referenceNumber); | ||
}); | ||
}, | ||
); |
36 changes: 36 additions & 0 deletions
36
...s/submit-an-application-single-policy-type-with-broker-based-in-uk-manual-address.spec.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,36 @@ | ||
import { BUILDING_NAMES, VALID_POSTCODES } from '../../../../../../../constants'; | ||
|
||
context( | ||
'Insurance - submit an application - Single policy type with a broker - Based in UK - Manual address - As an Exporter, I want to submit my completed credit insurance application, So that UKEF can process and make a decision on my application', | ||
() => { | ||
let referenceNumber; | ||
|
||
before(() => { | ||
cy.completeSignInAndSubmitAnApplication({ | ||
usingBroker: true, | ||
brokerIsBasedInUk: true, | ||
brokerPostcode: VALID_POSTCODES.WITH_SPACE, | ||
brokerBuildingNumberOrName: BUILDING_NAMES.TREASURY, | ||
provideBrokerAddressManually: 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); | ||
}); | ||
|
||
it('should render the application in a `submitted` state in the dashboard', () => { | ||
cy.assertDashboardApplicationSubmitted(referenceNumber); | ||
}); | ||
}, | ||
); |
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
83 changes: 83 additions & 0 deletions
83
...rance/cypress/e2e/journeys/policy/broker-manual-address/save-and-back-based-in-uk.spec.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,83 @@ | ||
import { field } from '../../../../../../pages/shared'; | ||
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance'; | ||
import { POLICY as POLICY_FIELD_IDS } from '../../../../../../constants/field-ids/insurance/policy'; | ||
import application from '../../../../../../fixtures/application'; | ||
|
||
const { | ||
BROKER_MANUAL_ADDRESS: { FULL_ADDRESS: FIELD_ID }, | ||
} = POLICY_FIELD_IDS; | ||
|
||
const { | ||
ROOT, | ||
POLICY: { BROKER_MANUAL_ADDRESS_ROOT }, | ||
} = INSURANCE_ROUTES; | ||
|
||
const baseUrl = Cypress.config('baseUrl'); | ||
|
||
context('Insurance - Policy - Broker manual address page - Based in UK - Save and back', () => { | ||
let referenceNumber; | ||
let url; | ||
|
||
before(() => { | ||
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => { | ||
referenceNumber = refNumber; | ||
|
||
// go to the page we want to test. | ||
cy.completeAndSubmitPolicyForms({ | ||
stopSubmittingAfter: 'brokerDetails', | ||
usingBroker: true, | ||
isBasedInUk: true, | ||
buildingNumberOrName: '123456789', | ||
}); | ||
|
||
cy.clickEnterAddressManuallyLink(); | ||
|
||
url = `${baseUrl}${ROOT}/${referenceNumber}${BROKER_MANUAL_ADDRESS_ROOT}`; | ||
|
||
cy.assertUrl(url); | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.saveSession(); | ||
}); | ||
|
||
after(() => { | ||
cy.deleteApplication(referenceNumber); | ||
}); | ||
|
||
describe('when submitting an empty form via `save and go back` button', () => { | ||
beforeEach(() => { | ||
cy.navigateToUrl(url); | ||
|
||
cy.clickSaveAndBackButton(); | ||
}); | ||
|
||
it('should redirect to `all sections`', () => { | ||
cy.assertAllSectionsUrl(referenceNumber); | ||
}); | ||
|
||
it('should retain the `insurance policy` task status as `in progress`', () => { | ||
cy.checkTaskPolicyStatusIsInProgress(); | ||
}); | ||
}); | ||
|
||
describe('when submitting an answer and submitting the form via `save and go back` button', () => { | ||
beforeEach(() => { | ||
cy.navigateToUrl(url); | ||
|
||
// submit the form via 'save and go back' button | ||
cy.keyboardInput(field(FIELD_ID).textarea(), application.BROKER[FIELD_ID]); | ||
|
||
cy.clickSaveAndBackButton(); | ||
}); | ||
|
||
it('should redirect to `all sections`', () => { | ||
cy.assertAllSectionsUrl(referenceNumber); | ||
}); | ||
|
||
it('should retain the `insurance policy` task status as `in progress`', () => { | ||
cy.checkTaskPolicyStatusIsInProgress(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.