Skip to content

Commit

Permalink
chore(EMS-3900): corePageChecks - assert 'save and back' by default (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ttbarnes authored Oct 17, 2024
1 parent 1a79ff8 commit d78ae51
Show file tree
Hide file tree
Showing 97 changed files with 52 additions and 184 deletions.
2 changes: 2 additions & 0 deletions e2e-tests/commands/core-page-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ const corePageChecks = ({

if (assertSaveAndBackButtonDoesNotExist) {
cy.assertSaveAndBackButtonDoesNotExist();
} else {
cy.assertSaveAndBackButton();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ context('Accessibility statement page - Insurance - Signed in', () => {
backLink: dashboardUrl,
hasAForm: false,
assertAuthenticatedHeader: true,
assertSaveAndBackButtonDoesNotExist: true,
isInsurancePage: true,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ context('Accessibility statement page - Insurance', () => {
backLink: checkIfEligibleUrl,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
isInsurancePage: true,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ context(
backLink: YOUR_DETAILS,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
lightHouseThresholds: {
performance: 69,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ context(
backLink: `${CONFIRM_EMAIL}?id=${account.id}`,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ context(
currentHref: YOUR_DETAILS,
backLink: HAVE_AN_ACCOUNT,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
lightHouseThresholds: {
performance: 70,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ context(
assertBackLink: true,
hasAForm: false,
assertAuthenticatedHeader: true,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ context(
currentHref: PASSWORD_RESET_ROOT,
backLink: SIGN_IN_ROOT,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
submitButtonCopy: BUTTONS.SUBMIT,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ context('Insurance - Account - Password reset - expired link page', () => {
currentHref: EXPIRED_LINK,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ context(
currentHref: LINK_SENT,
backLink: PASSWORD_RESET_ROOT,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ context(
currentHref: url,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
submitButtonCopy: BUTTONS.SUBMIT,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ context(
currentHref: successUrl,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ context('Insurance - Account - Reactivated page', () => {
currentHref: REACTIVATED_ROOT,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ context(
currentHref: SIGN_IN_ROOT,
backLink: YOUR_DETAILS,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
lightHouseThresholds: {
performance: 70,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ context(
currentHref: ENTER_CODE,
backLink: SIGN_IN_ROOT,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ context(
backLink: ENTER_CODE,
submitButtonCopy: BUTTONS.SEND_NEW_ACCESS_CODE,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ context(
assertBackLink: false,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ context(
currentHref: accountSuspendedUrl,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ context(
currentHref: EMAIL_SENT,
backLink: `${SUSPENDED_ROOT}?id=${account.id}`,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ context('Insurance - Account - Suspended - Verify email - Visit with an expired
currentHref: verifyEmailUrl,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
submitButtonCopy: BUTTONS.REACTIVATE_ACCOUNT,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ context('Insurance - Account - Suspended - Verify email - Visit with an invalid
currentHref: verifyEmailUrl,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ context('Insurance - All sections - new application', () => {
backLink: ELIGIBILITY.ELIGIBLE_TO_APPLY_ONLINE,
hasAForm: false,
assertBackLink: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ context('Insurance - application submitted page', () => {
currentHref: `${INSURANCE_ROOT}/${referenceNumber}${APPLICATION_SUBMITTED}`,
backLink: `${INSURANCE_ROOT}/${referenceNumber}${CONFIRMATION_AND_ACKNOWLEDGEMENTS}`,
assertBackLink: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ context('Insurance - Check your answers - Policy - I want to confirm my selectio
it('renders a `completed` status tag', () => {
cy.checkTaskStatusCompleted(status);
});

it('renders a `save and back` button', () => {
cy.assertSaveAndBackButton();
});
});

describe('form submission', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ context(
cy.checkTaskStatusCompleted(status);
});

it('renders a `save and back` button', () => {
cy.assertSaveAndBackButton();
});

describe('form submission', () => {
it(`should redirect to ${YOUR_BUYER}`, () => {
cy.navigateToUrl(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ context(
cy.checkTaskStatusCompleted(status);
});

it('renders a `save and back` button', () => {
cy.assertSaveAndBackButton();
});

describe('form submission', () => {
it(`should redirect to ${TYPE_OF_POLICY}`, () => {
cy.navigateToUrl(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ context('Contact us page - Insurance', () => {
backLink: ROUTES.INSURANCE.ELIGIBILITY.CHECK_IF_ELIGIBLE,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
isInsurancePage: true,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ context('Cookies saved page - Insurance', () => {
backLink: COOKIES,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
isInsurancePage: true,
assertCookies: false,
});
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/insurance/cypress/e2e/journeys/cookies.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ context('Cookies page - Insurance', () => {
backLink: CHECK_IF_ELIGIBLE,
submitButtonCopy: BUTTONS.SAVE_CHANGES,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
isInsurancePage: true,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ context('Insurance - Buyer country page - as an exporter, I want to check if UKE
currentHref: BUYER_COUNTRY,
backLink: COMPANY_DETAILS,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
lightHouseThresholds: {
performance: 70,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ context('Insurance Eligibility - Cannot apply exit page', () => {
backLink: BUYER_COUNTRY,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ context('Insurance Eligibility - check if eligible page', () => {
currentHref: CHECK_IF_ELIGIBLE,
backLink: `${CHECK_IF_ELIGIBLE}#`,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ context(
currentHref: ROUTES.INSURANCE.ELIGIBILITY.COMPANIES_HOUSE_NUMBER,
backLink: ROUTES.INSURANCE.ELIGIBILITY.EXPORTER_LOCATION,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ context('Insurance - Eligibility - Companies house search page - I want to check
currentHref: ENTER_COMPANIES_HOUSE_NUMBER,
backLink: COMPANIES_HOUSE_NUMBER,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ context(
currentHref: url,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ context('Insurance - Eligibility - Companies details page - I want to check if I
currentHref: COMPANY_DETAILS,
backLink: ENTER_COMPANIES_HOUSE_NUMBER,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ context('Insurance - Eligibility - Company not active - I want to check if I can
currentHref: COMPANY_NOT_ACTIVE_EXIT,
backLink: ENTER_COMPANIES_HOUSE_NUMBER,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ context('Insurance - Eligibility - Contract too short page', () => {
backLink: `${CONTRACT_TOO_SHORT_EXIT}#`,
currentHref: CONTRACT_TOO_SHORT_EXIT,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ context(
currentHref: COVER_PERIOD_ROUTE,
backLink: TOTAL_VALUE_INSURED,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ context(
backLink: CHECK_YOUR_ANSWERS,
submitButtonCopy: CONTENT_STRINGS.SUBMIT_BUTTON,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ context(
currentHref: END_BUYER,
backLink: UK_GOODS_OR_SERVICES,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ context('Insurance - Exporter location page - as an exporter, I want to check if
currentHref: EXPORTER_LOCATION,
backLink: CHECK_IF_ELIGIBLE,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ context(
currentHref: HAVE_AN_ACCOUNT,
backLink: ELIGIBLE_TO_APPLY_ONLINE,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ context(
backLink: COVER_PERIOD,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ context(
backLink: MEMBER_OF_A_GROUP,
hasAForm: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ context(
currentHref: MEMBER_OF_A_GROUP,
backLink: PARTY_TO_CONSORTIUM,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ context('Insurance Eligibility - Need to start again exit page', () => {
assertBackLink: false,
submitButtonCopy: LINKS.START_AGAIN.TEXT,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ context('Insurance - Eligibility - You cannot apply for credit insurance page (n
currentHref: NO_COMPANIES_HOUSE_NUMBER_EXIT,
assertBackLink: false,
assertAuthenticatedHeader: false,
assertSaveAndBackButtonDoesNotExist: true,
hasAForm: false,
});
});
Expand Down
Loading

0 comments on commit d78ae51

Please sign in to comment.