diff --git a/functional-test/api/client/sscs/factory/appeal.update.factory.ts b/functional-test/api/client/sscs/factory/appeal.update.factory.ts index 256708b84f..507603c12d 100644 --- a/functional-test/api/client/sscs/factory/appeal.update.factory.ts +++ b/functional-test/api/client/sscs/factory/appeal.update.factory.ts @@ -2,7 +2,7 @@ import {request} from '@playwright/test'; import {urls} from '../../../../config/config'; import logger from '../../../../utils/loggerUtil'; -import upload_response_payload_dwp_022_EC from '../../../data/payload/upload-response/upload-response-dwp-022-EC.json'; +import upload_response_payload_dwp_022_EC from '../../../data/payload/upload-response/upload-response-dwp-022-CC.json'; import upload_response_payload_hmrc_053_DQ from '../../../data/payload/upload-response/upload-response-hmrc-053-DQ.json'; import upload_response_dwp_av_002_PIP from '../../../data/payload/upload-response/upload-response-dwp-av-002-PIP.json'; diff --git a/functional-test/api/data/payload/create-appeal/pip_incomplete_appeal.json b/functional-test/api/data/payload/create-appeal/pip_incomplete_appeal.json index cbd63624d6..5448cca106 100644 --- a/functional-test/api/data/payload/create-appeal/pip_incomplete_appeal.json +++ b/functional-test/api/data/payload/create-appeal/pip_incomplete_appeal.json @@ -91,9 +91,9 @@ }, "scheduleHearing": true, "datesCantAttend": [ - "04-04-2018", - "05-04-2018", - "06-04-2018" + "04-04-2025", + "05-04-2025", + "06-04-2025" ] }, "signAndSubmit": { @@ -101,4 +101,4 @@ }, "pcqId": "12345678", "languagePreferenceWelsh": false -} \ No newline at end of file +} diff --git a/functional-test/api/data/payload/upload-response/upload-response-dwp-022-EC.json b/functional-test/api/data/payload/upload-response/upload-response-dwp-022-CC.json similarity index 97% rename from functional-test/api/data/payload/upload-response/upload-response-dwp-022-EC.json rename to functional-test/api/data/payload/upload-response/upload-response-dwp-022-CC.json index 816050ce5d..7bfdb3eb87 100644 --- a/functional-test/api/data/payload/upload-response/upload-response-dwp-022-EC.json +++ b/functional-test/api/data/payload/upload-response/upload-response-dwp-022-CC.json @@ -3,7 +3,7 @@ "mrnDetails": { "dwpIssuingOffice": "Child Support", "mrnDate": "2024-05-31", - "mrnLateReason": "Lost my paperwork", + "mrnLateReason": "Lost my papxerwork", "mrnMissingReason": null }, "appellant": { @@ -61,11 +61,10 @@ "hearingOptions": { "wantsToAttend": "Yes", "wantsSupport": "Yes", - "languageInterpreter": "Yes", - "languages": "An interpreter language", - "signLanguageType": "A sign language", + "languageInterpreter": "No", + "languages": null, + "signLanguageType": null, "arrangements": [ - "signLanguageInterpreter", "hearingLoop" ], "scheduleHearing": "Yes", @@ -178,7 +177,7 @@ }, "dwpEditedEvidenceReason": null, "dwpUploadAudioVideoEvidence": [], - "benefitCode": "022", + "benefitCode": "002", "issueCode": "EC", "dwpFurtherInfo": "No", "dwpUCB": null, diff --git a/functional-test/e2e/api-test-client.spec.ts b/functional-test/e2e/api-test-client.spec.ts index f3665cb3a5..848a7d375d 100644 --- a/functional-test/e2e/api-test-client.spec.ts +++ b/functional-test/e2e/api-test-client.spec.ts @@ -40,7 +40,7 @@ test("Test to Make an Appeal Dormant", async ({addNoteSteps}) => { /*test.only("Temporary testing of the JSON Node on Json Node", async ({addNoteSteps}) => { - fs.readFile('./functional-test/api/data/payload/upload-response/upload-response-dwp-022-EC.json', function read(err, data) { + fs.readFile('./functional-test/api/data/payload/upload-response/upload-response-dwp-022-CC.json', function read(err, data) { if (err) { throw err; } diff --git a/functional-test/e2e/issue-directions-notice.spec.ts b/functional-test/e2e/issue-directions-notice.spec.ts index 0e1069bc76..9597ea119c 100644 --- a/functional-test/e2e/issue-directions-notice.spec.ts +++ b/functional-test/e2e/issue-directions-notice.spec.ts @@ -6,12 +6,6 @@ let caseId: string; test.describe("Issue direction test", {tag: '@pipeline'}, async() => { - test("Issue Direction Notice - Invalid PIP Case - Pre Hearing - Appeal to Proceed", - async ({issueDirectionsNoticeSteps}) => { - test.slow(); - await issueDirectionsNoticeSteps.performIssueDirectionNoticeIncompleteApplicationPreHearingAppealToProceed(); - }); - test("Issue Direction Notice - Pre Hearing - Normal Tax Credit Application - Appeal to Proceed", async ({issueDirectionsNoticeSteps}) => { test.slow(); @@ -35,6 +29,12 @@ test.describe("Issue direction test", {tag: '@pipeline'}, async() => { test.slow(); await issueDirectionsNoticeSteps.performIssueDirectionErrorMessages(); }); + + test("Issue Direction Notice - Invalid PIP Case - Pre Hearing - Appeal to Proceed", + async ({issueDirectionsNoticeSteps}) => { + test.slow(); + await issueDirectionsNoticeSteps.performIssueDirectionNoticeIncompleteApplicationPreHearingAppealToProceed(); + }); }); diff --git a/functional-test/e2e/write-and-issue-final-decision.spec.ts b/functional-test/e2e/write-and-issue-final-decision.spec.ts new file mode 100644 index 0000000000..8259fb00d9 --- /dev/null +++ b/functional-test/e2e/write-and-issue-final-decision.spec.ts @@ -0,0 +1,51 @@ +import {test} from "../lib/steps.factory"; +import createCaseBasedOnCaseType from "../api/client/sscs/factory/appeal.type.factory"; +import performAppealDormantOnCase from "../api/client/sscs/appeal.event"; + +let caseId: string; + +test.describe('Issue Final Decision - PIP Appeal Type', {tag: '@pipeline'}, async () => { + + test("Issue Final Decision - Upload Response with Further Information as No - Simple Decision Notice - 'Yes' notice generated. - No Award Given", + async ({issueFinalDecisionSteps}) => { + test.slow(); + let pipCaseId = await createCaseBasedOnCaseType('PIP'); + await issueFinalDecisionSteps.performWriteFinalDecisionForAPIPAppealNoAwardAndNoticeGenerated(pipCaseId); + await issueFinalDecisionSteps.performIssueFinalDecisionForAPIPAppeal(pipCaseId); + await performAppealDormantOnCase(pipCaseId); + }); + + test("Issue Final Decision - Upload Response with Further Information as No - Simple Decision Notice - 'Yes' notice generated. - Yes Award is Given", + async ({issueFinalDecisionSteps}) => { + test.slow(); + let pipCaseId = await createCaseBasedOnCaseType('PIP'); + await issueFinalDecisionSteps.performWriteFinalDecisionForAPIPAppealAwardAndNoticeGenerated(pipCaseId); + await issueFinalDecisionSteps.performIssueFinalDecisionForAPIPAppeal(pipCaseId); + await performAppealDormantOnCase(pipCaseId); + }); + +}) + +test.describe('Issue Final Decision - Tax Credit Appeal Type', {tag: '@pipeline'}, async () => { + + test("Issue Final Decision - Upload Response with Further Information as No - Simple Decision Notice - 'No' notice generated", + async ({issueFinalDecisionSteps}) => { + test.slow(); + let taxCreditCaseId = await createCaseBasedOnCaseType('TAX CREDIT'); + await issueFinalDecisionSteps.performWriteFinalDecisionForATaxCreditAppealAndNoNoticeGenerated(taxCreditCaseId); + await issueFinalDecisionSteps.performIssueFinalDecisionForAPIPAppeal(taxCreditCaseId); + await performAppealDormantOnCase(taxCreditCaseId); + }); +}) + +test.describe('Issue Final Decision - Universal Credit Appeal Type', {tag: '@pipeline'}, async () => { + + test("Issue Final Decision - Simple Decision Notice - 'Yes' notice generated", + async ({issueFinalDecisionSteps}) => { + test.slow(); + let universalCreditCaseId = await createCaseBasedOnCaseType('UC'); + await issueFinalDecisionSteps.performWriteFinalDecisionForAUniversalCreditAppealAndNoticeGenerated(universalCreditCaseId); + await issueFinalDecisionSteps.performIssueFinalDecisionForAPIPAppeal(universalCreditCaseId); + await performAppealDormantOnCase(universalCreditCaseId); + }); +}) diff --git a/functional-test/fixtures/steps/base.ts b/functional-test/fixtures/steps/base.ts index 3616cc8c8d..b2345d83d5 100644 --- a/functional-test/fixtures/steps/base.ts +++ b/functional-test/fixtures/steps/base.ts @@ -47,6 +47,8 @@ import { ProcessAVPage } from '../../pages/process.av.page'; import { OtherPartyDetails } from '../../pages/tabs/other.party.details'; import { updateOtherPartyDataPage } from '../../pages/update.other.party.data.page'; import { SendCaseToTcwPage } from '../../pages/send.case.to.tcw.page'; +import {WriteFinalDecisionPages} from "../../pages/write.final.decision.page"; +import {SendToInterlocPrevalidPage} from "../../pages/send.to.interloc.prevalid.page"; export abstract class BaseStep { @@ -99,6 +101,9 @@ export abstract class BaseStep { protected updateOtherPartyDataPage: updateOtherPartyDataPage; protected otherPartyDetailsTab: OtherPartyDetails; protected sendCaseToTcwPage: SendCaseToTcwPage; + protected writeFinalDecisionPage : WriteFinalDecisionPages; + protected sendToInterlocPrevalidPage : SendToInterlocPrevalidPage; + constructor(page: Page) { this.page = page; @@ -149,7 +154,9 @@ export abstract class BaseStep { this.updateOtherPartyDataPage = new updateOtherPartyDataPage(this.page); this.otherPartyDetailsTab = new OtherPartyDetails(this.page); this.sendCaseToTcwPage = new SendCaseToTcwPage(this.page); - } + this.writeFinalDecisionPage = new WriteFinalDecisionPages(page); + this.sendToInterlocPrevalidPage = new SendToInterlocPrevalidPage(page); + } async loginUserWithCaseId(user, clearCacheFlag: boolean = false, caseId?: string) { await this.loginPage.goToLoginPage(); diff --git a/functional-test/fixtures/steps/issue.directions.notice.ts b/functional-test/fixtures/steps/issue.directions.notice.ts index c6d3648882..0b42929a52 100644 --- a/functional-test/fixtures/steps/issue.directions.notice.ts +++ b/functional-test/fixtures/steps/issue.directions.notice.ts @@ -10,6 +10,7 @@ import { import issueDirectionTestdata from "../../pages/content/issue.direction_en.json"; import eventTestData from "../../pages/content/event.name.event.description_en.json"; import actionFurtherEvidenceTestdata from '../../pages/content/action.further.evidence_en.json'; +import sendToInterLocPreValidData from '../../pages/content/send.to.interloc_en.json'; import logger from "../../utils/loggerUtil"; import performAppealDormantOnCase from "../../api/client/sscs/appeal.event"; @@ -45,14 +46,22 @@ export class IssueDirectionsNotice extends BaseStep { serviceTokenForCaseWorker.trim(),caseWorkerId.trim(),'SSCS','Benefit', taxCreditCaseId.trim(), 'uploadDocumentFurtherEvidence');*/ + //This block would also act as a Test for the Send to interloc - pre-valid Event. SSCSSI-228 await this.loginUserWithCaseId(credentials.amCaseWorker, false, pipCaseId); await this.homePage.reloadPage(); - await this.homePage.chooseEvent(actionFurtherEvidenceTestdata.eventNameCaptor); - await this.actionFurtherEvidencePage.submitActionFurtherEvidence( - actionFurtherEvidenceTestdata.sender, - actionFurtherEvidenceTestdata.other, - actionFurtherEvidenceTestdata.testfileone - ); + await this.homePage.chooseEvent("Send to interloc - pre-valid"); + await this.sendToInterlocPrevalidPage.verifyPageContentForTheInterlocReferralPage(); + await this.sendToInterlocPrevalidPage.inputReasonForReferral(); + await this.sendToInterlocPrevalidPage.submitContinueBtn(); + await this.textAreaPage.verifyPageContent(sendToInterLocPreValidData.sendToInterLocPreValidCaption, sendToInterLocPreValidData.appealNotepad, sendToInterLocPreValidData.enterNoteOptionalLabel); + await this.textAreaPage.inputData(sendToInterLocPreValidData.appealNotepadInput); + await this.sendToInterlocPrevalidPage.confirmSubmission(); + await this.eventNameAndDescriptionPage.verifyPageContent(sendToInterLocPreValidData.sendToInterLocPreValidCaption, + false); + await this.eventNameAndDescriptionPage.inputData(eventTestData.eventSummaryInput, + eventTestData.eventDescriptionInput); + await this.eventNameAndDescriptionPage.confirmSubmission(); + await this.verifyHistoryTabDetails("Send to interloc - pre-valid"); await this.homePage.signOut(); await new Promise(f => setTimeout(f, 2000)); //Delay required for the Case to be ready @@ -134,7 +143,8 @@ export class IssueDirectionsNotice extends BaseStep { async performIssueDirectionNoticePostHearingESAAppealToProceed() { - let esaCaseId = await createCaseBasedOnCaseType('ESA'); + //let esaCaseId = await createCaseBasedOnCaseType('ESA'); + let esaCaseId = await createCaseBasedOnCaseType('PIP'); await new Promise(f => setTimeout(f, 10000)); //Delay required for the Case to be ready logger.info('The value of the response writer : ' + credentials.dwpResponseWriter.email) let responseWriterToken: string = await accessToken(credentials.dwpResponseWriter); @@ -187,7 +197,8 @@ export class IssueDirectionsNotice extends BaseStep { async performIssueDirectionNoticePostHearingDLAAppealToProceed() { - let pipCaseId = await createCaseBasedOnCaseType('DLASANDL'); + //let pipCaseId = await createCaseBasedOnCaseType('DLASANDL'); + let pipCaseId = await createCaseBasedOnCaseType('PIP'); await new Promise(f => setTimeout(f, 10000)); //Delay required for the Case to be ready logger.info('The value of the response writer : ' + credentials.dwpResponseWriter.email) let responseWriterToken: string = await accessToken(credentials.dwpResponseWriter); @@ -238,10 +249,11 @@ export class IssueDirectionsNotice extends BaseStep { async performIssueDirectionErrorMessages() { - let pipCaseId = await createCaseBasedOnCaseType('DLASANDL'); + //let pipCaseId = await createCaseBasedOnCaseType('DLASANDL'); + let pipCaseId = await createCaseBasedOnCaseType('PIP'); await new Promise(f => setTimeout(f, 10000)); //Delay required for the Case to be ready logger.info('The value of the response writer : ' + credentials.dwpResponseWriter.email) - let responseWriterToken: string = await accessToken(credentials.dwpResponseWriter); + let responseWriterToken: string = await accessToken(credentials.dwpResponseWriter); let serviceToken: string = await getSSCSServiceToken(); let responseWriterId: string = await accessId(credentials.dwpResponseWriter); await performEventOnCaseWithUploadResponse(responseWriterToken.trim(), diff --git a/functional-test/fixtures/steps/write.final.decision.ts b/functional-test/fixtures/steps/write.final.decision.ts new file mode 100644 index 0000000000..07251885c0 --- /dev/null +++ b/functional-test/fixtures/steps/write.final.decision.ts @@ -0,0 +1,326 @@ +import {Page} from '@playwright/test'; +import {BaseStep} from './base'; +import {credentials} from "../../config/config"; +import createCaseBasedOnCaseType from "../../api/client/sscs/factory/appeal.type.factory"; +import {accessId, accessToken, getSSCSServiceToken} from "../../api/client/idam/idam.service"; +import { + performEventOnCaseForActionFurtherEvidence, + performEventOnCaseWithUploadResponse +} from "../../api/client/sscs/factory/appeal.update.factory"; +import issueDirectionTestdata from "../../pages/content/issue.direction_en.json"; +import actionFurtherEvidenceTestdata from '../../pages/content/action.further.evidence_en.json'; +import logger from "../../utils/loggerUtil"; +import performAppealDormantOnCase from "../../api/client/sscs/appeal.event"; + +export class WriteFinalDecision extends BaseStep { + + readonly page: Page; + + + constructor(page: Page) { + super(page); + this.page = page; + } + + async performWriteFinalDecisionForAPIPAppealNoAwardAndNoticeGenerated(pipCaseId) { + + await new Promise(f => setTimeout(f, 10000)); //Delay required for the Case to be ready + /*logger.info('The value of the response writer : ' + credentials.dwpResponseWriter.email) + let responseWriterToken: string = await accessToken(credentials.dwpResponseWriter); + let serviceToken: string = await getSSCSServiceToken(); + let responseWriterId: string = await accessId(credentials.dwpResponseWriter); + await performEventOnCaseWithUploadResponse(responseWriterToken.trim(), + serviceToken.trim(), responseWriterId.trim(), + 'SSCS', 'Benefit', + pipCaseId.trim(), 'dwpUploadResponse', 'dwp');*/ + + await this.loginUserWithCaseId(credentials.judge, false, pipCaseId); + //await this.homePage.reloadPage(); + await this.homePage.chooseEvent("Write final decision"); + + //The Type of Appeal Page + await this.writeFinalDecisionPage.verifyPageContentTypeOfAppealPage(true); + await this.writeFinalDecisionPage.inputTypeOfAppealPageData(false, true); //No Awards but Generate Notice + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + //Allowed or Refused Page (Because we opted not in the previous page) + await this.writeFinalDecisionPage.verifyPageContentAllowedOrRefusedPage(); + await this.writeFinalDecisionPage.chooseAllowedOrRefused("#writeFinalDecisionAllowedOrRefused-allowed"); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentTypeOfHearingPage(); + await this.writeFinalDecisionPage.inputTypeOfHearingPageData(false) + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForPanelMembersPage('PIP'); + await this.writeFinalDecisionPage.inputPageContentForPanelMembersPageData('PIP'); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForDecisionDatePage(); + await this.writeFinalDecisionPage.inputTypePageContentForDecisionPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForBundleSectionReferencePage(); + await this.writeFinalDecisionPage.inputPageContentForBundleSectionReferencePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForSummaryOutcomePage(); + await this.writeFinalDecisionPage.inputPageContentForSummaryOutcomePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForReasonForDecisionPage(); + await this.writeFinalDecisionPage.inputPageContentForReasonForDecisionPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForAnythingElseDecisionPage(); + await this.writeFinalDecisionPage.inputPageContentForAnythingElsePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); + + await this.writeFinalDecisionPage.verifyPageContentForPreviewDecisionNoticePage(true); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); + + await this.writeFinalDecisionPage.verifyPageContentForCheckYourAnswersPage(); + await this.writeFinalDecisionPage.confirmSubmission(); + await this.verifyHistoryTabDetails("Write final decision"); + } + + async performWriteFinalDecisionForAPIPAppealAwardAndNoticeGenerated(pipCaseId) { + + await new Promise(f => setTimeout(f, 10000)); //Delay required for the Case to be ready + /*logger.info('The value of the response writer : ' + credentials.dwpResponseWriter.email) + let responseWriterToken: string = await accessToken(credentials.dwpResponseWriter); + let serviceToken: string = await getSSCSServiceToken(); + let responseWriterId: string = await accessId(credentials.dwpResponseWriter); + await performEventOnCaseWithUploadResponse(responseWriterToken.trim(), + serviceToken.trim(), responseWriterId.trim(), + 'SSCS', 'Benefit', + pipCaseId.trim(), 'dwpUploadResponse', 'dwp');*/ + + await this.loginUserWithCaseId(credentials.judge, false, pipCaseId); + //await this.homePage.reloadPage(); + await this.homePage.chooseEvent("Write final decision"); + + //The Type of Appeal Page + await this.writeFinalDecisionPage.verifyPageContentTypeOfAppealPage(true); + await this.writeFinalDecisionPage.inputTypeOfAppealPageData(true, true); //No Awards but Generate Notice + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + /*//Allowed or Refused Page (Because we opted not in the previous page) + await this.writeFinalDecisionPage.verifyPageContentAllowedOrRefusedPage(); + await this.writeFinalDecisionPage.chooseAllowedOrRefused("#writeFinalDecisionAllowedOrRefused-allowed"); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready*/ + + await this.writeFinalDecisionPage.verifyPageContentTypeOfHearingPage(); + await this.writeFinalDecisionPage.inputTypeOfHearingPageData(false) + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyAndInputPageContentForTypeOfAwardPage(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyAndInputPageContentForAwardDatesPage(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyAndInputPageContentForAwardDatesPage(); + await this.writeFinalDecisionPage.inputPageContentForAwardDatesPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForPanelMembersPage('PIP'); + await this.writeFinalDecisionPage.inputPageContentForPanelMembersPageData('PIP'); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForDecisionDatePage(); + await this.writeFinalDecisionPage.inputTypePageContentForDecisionPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForSelectActivitiesPage(); + await this.writeFinalDecisionPage.inputPageContentForSelectActivitiesPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForDailyLivingNutrition(); + await this.writeFinalDecisionPage.inputPageContentForDailyLivingNutritionPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForMovingAround(); + await this.writeFinalDecisionPage.inputPageContentForMovingAroundPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForBundleSectionReferencePage(); + await this.writeFinalDecisionPage.inputPageContentForBundleSectionReferencePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForReasonForDecisionPage(); + await this.writeFinalDecisionPage.inputPageContentForReasonForDecisionPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForAnythingElseDecisionPage(); + await this.writeFinalDecisionPage.inputPageContentForAnythingElsePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); + + await this.writeFinalDecisionPage.verifyPageContentForPreviewDecisionNoticePage(true); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); + + await this.writeFinalDecisionPage.verifyPageContentForCheckYourAnswersPageForAwardsCriteria(); + await this.writeFinalDecisionPage.confirmSubmission(); + await this.verifyHistoryTabDetails("Write final decision"); + } + + async performWriteFinalDecisionForATaxCreditAppealAndNoNoticeGenerated(taxCreditCaseId) { + + /*await this.loginUserWithCaseId(credentials.caseWorker, false, taxCreditCaseId); + await this.homePage.reloadPage(); + await this.homePage.chooseEvent('Add a hearing'); + await this.addHearingPage.submitHearing(); + await this.eventNameAndDescriptionPage.confirmSubmission(); + await this.homePage.clickSignOut(); + await this.homePage.delay(3000);*/ + + + /*await this.homePage.delay(3000); + await this.homePage.chooseEvent('Hearing booked'); + await this.hearingBookedPage.submitHearingBooked(); + await this.homePage.clickSignOut();*/ + + await this.loginUserWithCaseId(credentials.judge, false, taxCreditCaseId); + await this.homePage.reloadPage(); + await this.homePage.chooseEvent("Write final decision"); + + await this.writeFinalDecisionPage.verifyPageContentTypeOfAppealPage(false) + await this.writeFinalDecisionPage.inputTypeOfAppealPageData(false, false, "TAX CREDIT"); //No Awards but Generate Notice + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + //Allowed or Refused Page (Because we opted not in the previous page) + await this.writeFinalDecisionPage.verifyPageContentAllowedOrRefusedPage(); + await this.writeFinalDecisionPage.chooseAllowedOrRefused("#writeFinalDecisionAllowedOrRefused-refused"); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForPreviewDecisionNoticePage(true); + await this.writeFinalDecisionPage.inputPageContentForPreviewDecisionNoticePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); + + await this.writeFinalDecisionPage.verifyPageContentForCheckYourAnswersPageForNoNoticeGenerated(); + await this.writeFinalDecisionPage.confirmSubmission(); + await this.verifyHistoryTabDetails("Write final decision"); + } + + async performWriteFinalDecisionForAUniversalCreditAppealAndNoticeGenerated(universalCreditCaseId :string) { + + /*await this.loginUserWithCaseId(credentials.caseWorker, false, taxCreditCaseId); + await this.homePage.reloadPage(); + await this.homePage.chooseEvent('Add a hearing'); + await this.addHearingPage.submitHearing(); + await this.eventNameAndDescriptionPage.confirmSubmission(); + await this.homePage.clickSignOut(); + await this.homePage.delay(3000);*/ + + + /*await this.homePage.delay(3000); + await this.homePage.chooseEvent('Hearing booked'); + await this.hearingBookedPage.submitHearingBooked(); + await this.homePage.clickSignOut();*/ + + await this.loginUserWithCaseId(credentials.judge, false, universalCreditCaseId); + await this.homePage.reloadPage(); + await this.homePage.chooseEvent("Write final decision"); + + await this.writeFinalDecisionPage.verifyPageContentTypeOfAppealPage(false) + await this.writeFinalDecisionPage.inputTypeOfAppealPageData(false, true, "UNIVERSAL CREDIT"); //No Awards but Generate Notice + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + //Allowed or Refused Page (Because we opted not in the previous page) + await this.writeFinalDecisionPage.verifyPageContentAllowedOrRefusedPage(); + await this.writeFinalDecisionPage.chooseAllowedOrRefused("#writeFinalDecisionAllowedOrRefused-allowed"); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentTypeOfHearingPage(); + await this.writeFinalDecisionPage.inputTypeOfHearingPageData(false) + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForPanelMembersPage('UNIVERSAL CREDIT'); + await this.writeFinalDecisionPage.inputPageContentForPanelMembersPageData('UNIVERSAL CREDIT'); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForDecisionDatePage(); + await this.writeFinalDecisionPage.inputTypePageContentForDecisionPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForWorkCapabilityAssessmentPage(); + await this.writeFinalDecisionPage.inputAndVerifyPageContentForWorkCapabilityAssessmentPageData() + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForSchedule7ActivitiesPage(); + await this.writeFinalDecisionPage.inputAndVerifyPageContentForSchedule7ActivitiesPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForBundleSectionReferencePage(); + await this.writeFinalDecisionPage.inputPageContentForBundleSectionReferencePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForReassessTheAwardPage(); + await this.writeFinalDecisionPage.inputPageContentForReassessTheAwardPage(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForReasonForDecisionPage(); + await this.writeFinalDecisionPage.inputPageContentForReasonForDecisionPageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); //Delay required for the Case to be ready + + await this.writeFinalDecisionPage.verifyPageContentForAnythingElseDecisionPage(); + await this.writeFinalDecisionPage.inputPageContentForAnythingElsePageData(); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); + + + await this.writeFinalDecisionPage.verifyPageContentForPreviewDecisionNoticePage(true); + await this.writeFinalDecisionPage.submitContinueBtn(); + await new Promise(f => setTimeout(f, 1000)); + + + await this.writeFinalDecisionPage.verifyPageContentForCheckYourAnswersPageForUCCaseWithScheduleAndReasses(); + await this.writeFinalDecisionPage.confirmSubmission(); + await this.verifyHistoryTabDetails("Write final decision"); + } + + async performIssueFinalDecisionForAPIPAppeal(pipCaseId) { + await this.homePage.chooseEvent("Issue final decision"); + await this.writeFinalDecisionPage.verifyPageContentForPreviewDecisionNoticePage(false); + await this.writeFinalDecisionPage.confirmSubmission(); + await this.verifyHistoryTabDetails("Issue final decision"); + } +} diff --git a/functional-test/lib/steps.factory.ts b/functional-test/lib/steps.factory.ts index b0b86738db..1d3d221576 100644 --- a/functional-test/lib/steps.factory.ts +++ b/functional-test/lib/steps.factory.ts @@ -32,11 +32,13 @@ import { SupplementaryResponse } from '../fixtures/steps/supplementary.response' import { UploadDocumentFurtherEvidence } from '../fixtures/steps/upload.document.further.evidence'; import { UpdateLanguagePreference } from '../fixtures/steps/update.language.preference'; import { ReviewPHE } from '../fixtures/steps/review.phe'; -import { IssueDirectionsNotice } from "../fixtures/steps/issue.directions.notice"; import { UpdateUCB } from "../fixtures/steps/update.ucb"; import { ProcessAVEvidence } from '../fixtures/steps/process.av.evidence'; import { UpdateSubscription } from '../fixtures/steps/update.subscription' import { UpdateOtherPartyData } from '../fixtures/steps/update.other.party.data'; +import {IssueDirectionsNotice} from "../fixtures/steps/issue.directions.notice"; +import {WriteFinalDecision} from "../fixtures/steps/write.final.decision"; + type MyStepsFixtures = { @@ -78,6 +80,7 @@ type MyStepsFixtures = { updateSubscriptionSteps: UpdateSubscription processAVEvidenceSteps: ProcessAVEvidence updateOtherPartyDataSteps: UpdateOtherPartyData + issueFinalDecisionSteps: WriteFinalDecision }; export const test = stepsFactory.extend({ @@ -225,6 +228,10 @@ export const test = stepsFactory.extend({ const updateSubscriptionSteps = new UpdateSubscription(page); await use(updateSubscriptionSteps); }, + issueFinalDecisionSteps:async ({ page }, use) => { + const issueFinalDecisionSteps = new WriteFinalDecision(page); + await use(issueFinalDecisionSteps); + }, processAVEvidenceSteps: async ({ page }, use) => { const processAVEvidenceSteps = new ProcessAVEvidence(page); await use(processAVEvidenceSteps); @@ -233,4 +240,5 @@ export const test = stepsFactory.extend({ const updateOtherPartyDataSteps = new UpdateOtherPartyData(page); await use(updateOtherPartyDataSteps); } + }) diff --git a/functional-test/pages/content/send.to.interloc_en.json b/functional-test/pages/content/send.to.interloc_en.json new file mode 100644 index 0000000000..7d17daa379 --- /dev/null +++ b/functional-test/pages/content/send.to.interloc_en.json @@ -0,0 +1,10 @@ +{ + "sendToInterLocPreValidCaption" : "Send to interloc - pre-valid", + "sendToInterLocPageHeading" : "Interloc referral", + "sendToInterLocReasonOptionLabel" : "Reason referred to interloc", + "sendToInterLocReferalReasonOptionValue" : "Other", + + "appealNotepad" : "Appeal notepad", + "enterNoteOptionalLabel" : "Enter note (Optional)", + "appealNotepadInput" : "Send to interloc - pre-valid notepad input - Automation" +} diff --git a/functional-test/pages/content/write.final.decision_en.json b/functional-test/pages/content/write.final.decision_en.json new file mode 100644 index 0000000000..48aa0cb3bc --- /dev/null +++ b/functional-test/pages/content/write.final.decision_en.json @@ -0,0 +1,179 @@ +{ + "eventNameCaptor": "Write final decision", + "eventNameHeading": "Write final decision", + "issueFinalDecisionEventNameCaptor": "Issue final decision", + + "typeOfAppealPageHeading": "Type of appeal", + "generateNoticeLabel" : "Generate notice?", + "isThisAwardAboutDailyLivingLabel" : "Is this award about daily living and/or mobility?", + "yesLabel" : "Yes", + "noLabel" : "No", + + "allowedRefusedPageHeading": "Allowed or refused", + "isTheAppealLabel" : "Is the appeal allowed or refused?", + "allowedLabel" : "Allowed", + "refusedLabel" : "Refused", + + "typeOfHearingPageHeading": "Type of hearing", + "whatTypeOfHearingWasHeldLabel" : "What type of hearing was held?", + "faceToFaceLabel" : "Face to face", + "telephoneLabel" : "Telephone", + "videoLabel" : "Video", + "paperLabel" : "Paper", + "triageLabel": "Triage", + "didAPresentingOfficerLabel" : "Did a Presenting Officer attend on behalf of the Respondent?", + "didTheAppellantAttendTheHearing" : "Did the appellant attend the hearing?", + "otherPartyAttendTheHearing" : "Other party attend the hearing?", + "otherPartySectionHeading" : "Other party", + "otherPartyNameLabel" : "Other party name", + "otherPartyAttendTheHearingLabel" : "Other party attend the hearing?", + + "panelMembersPageHeading" : "Panel members", + "nameOfDisabilityQualifiedPanelMemberDQPMLabel":"Name of the Disability Qualified Panel Member (DQPM) (Optional)", + "nameOfMedicallyQualifiedPanelMemberMQPMLabel" : "Name of the Medically Qualified Panel Member (MQPM) (Optional)", + "nameOfDisabilityQualifiedPanelMemberDQPMWithoutOptionalLabel":"Name of the Disability Qualified Panel Member (DQPM)", + "nameOfMedicallyQualifiedPanelMemberMQPMWithoutOptionalLabel" : "Name of the Medically Qualified Panel Member (MQPM)", + "otherLabel": "Other (Optional)", + "otherWithoutOptionalLabel": "Other", + "nameOfDisabilityQualifiedPanelMemberInput" : "Panel Member - Judge", + "nameOfMedicallyQualifiedPanelMemberInput" : "Panel Member - Doctor", + "otherPanelMemberInput" : "Panel Member - Clerk", + + "decisionDatePageHeading" : "Decision date", + "dateOfFTADecisionLabel" : "Date of FTA's decision", + "dayLabel" : "Day", + "monthLabel" : "Month", + "yearLabel" : "Year", + + "bundleSectionPreferenceHeading" : "Bundle page/section reference", + "whatIsTheLastPageInTheTribunalBundleLabel" : "What is the last page in the tribunal bundle?", + "whatIsTheLastPageInTheTribunalBundleGuidanceText" : "For example: B7", + "lastPageInTheTribunalBundleInput" : "Tribunal Bundle Input", + + "summaryOfOutcomePageHeading" : "Summary of outcome decision", + "summaryOfOutcomeLabel" : "Summary of outcome decision", + "summaryOfOutcomeInput" : " Automation - Summary of outcome decision - Input Text", + + "reasonsForDecisionPageHeading" : "Reasons for decision", + "reasonsForDecisionSectionHeading" : "Reasons for decision", + "reasonsForDecisionLabel" : "Reasons for decision", + "reasonsForDecisionInput" : " Automation - Reasons For Decision - Input Text", + + "anythingElsePageHeading" : "Anything else?", + "anythingElseLabel" : "Anything else? (Optional)", + "anythingElseInput" : "Automation Testing - Anything Else", + + + "previewDecisionNoticePageHeading" : "Preview Decision Notice", + "previewDecisionNoticeLabel" : "Preview Decision Notice", + "previewDecisionNoticeGuidanceText" : "All documents must be PDF formatted", + + "checkYourAnswersPageHeading" : "Write final decision", + "checkYourAnswersSectionHeading" : "Check your answers", + "checkYourInformationCarefullyLabel" : "Check the information below carefully.", + "checkYourAnswersNameOfDisabilityQualifiedPanelMemberDQPMLabel":"Name of the Disability Qualified Panel Member (DQPM)", + "checkYourAnswersNameOfMedicallyQualifiedPanelMemberMQPMLabel":"Name of the Medically Qualified Panel Member (MQPM)", + "checkYourAnswersShowTheFinalDecisionOutcomeLabel":"Summary of outcome decision", + "checkYourAnswersAnythingElse":"Anything else?", + + "typeOfAwardPageHeading" : "Type of award", + "whatAreYouConsideringAwardingForDailyLivingLabel" : "What are you considering awarding for daily living?", + "whatAreYouConsideringAwardingForMobilityLabel" : "What are you considering awarding for mobility?", + "howWouldThisNewAwardCompareToTheOriginalFTAAwardForDailyLiving" : "How would this new award compare to the original FTA award for daily living?", + "howWouldThisNewAwardCompareToTheOriginalFTAAwardForMobility" : "How would this new award compare to the original FTA award for mobility?", + "notConsideredLabel" : "Not considered", + "noAwardLabel" : "No award", + "standardRateLabel" : "Standard rate", + "enhancedRateLabel" : "Enhanced rate", + "higherLabel" : "Higher", + "sameLabel" : "Same", + "lowerLabel" : "Lower", + + "awardDatesPageHeading" : "Award dates", + "startDateLabel" : "Start date", + "doesThisAwardHaveAnEndDateLabel" : "Does this award have an end date?", + "setEndDateLabel" : "Set end date", + "indefiniteAwardLabel" : "Indefinite award", + "notApplicableNoAwardLabel" : "N/A - No award", + "endDateLabel" : "End date", + + "selectActivitiesPageHeading" : "Select activities", + "dailyActivitiesLabel" : "Daily living (Optional)", + "selectAllThatApplyGuidanceText" : "(Select all that apply)", + "preparingFoodLabel" : "Preparing food", + "takingNutritionLabel" : "Taking nutrition", + "managingTherapyOrMonitoringHealthConditionLabel" : "Managing therapy or monitoring a health condition", + "washingAndBathingLabel" : "Washing and bathing", + "managingToiletNeedsOrIncontinenceLabel": "Managing toilet needs or incontinence", + "dressingAndUndressingLabel" : "Dressing and undressing", + "communicatingVerballyLabel" : "Communicating verbally", + "readingAndUnderstandingSignsSymbolsAndWordsLabel": "Reading and understanding signs, symbols and words", + "engagingWithOtherPeopleF2FLabel": "Engaging with other people face to face", + "makingBudgetingDecisionsLabel": "Making budgeting decisions", + + "mobilityLabel" : "Mobility (Optional)", + "planningAndFollowingJourneysLabel" : "Planning and following journeys", + "movingAroundLabel" : "Moving around", + + "dailyLivingTakingNutritionPageHeading" : "Daily living: Taking nutrition", + "canTakeNutritionLabel" : "2a. Can take nutrition unaided. (0 points)", + "needsEitherLabel" : "2b. Needs either - (i) to use an aid or appliance to take nutrition; or (ii) supervision to be able to take nutrition; or (iii) assistance to be able to cut up food. (2 points)", + "needsATherapeuticLabel": "2c. Needs a therapeutic source to take nutrition. (2 points)", + "needsPromptingLabel": "2d. Needs prompting to be able to take nutrition. (4 points)", + "needsAssistanceLabel": "2e. Needs assistance to be able to manage a therapeutic source to take nutrition. (6 points)", + "cannotConveyFoodAndDrinkLabel": "2f. Cannot convey food and drink to their mouth and needs another person to do so. (10 points)", + + "mobilityActivitiesPageHeading" : "Mobility activities: Moving around", + "canStandAndThenMoveMoreThan200mLabel" : "12a. Can stand and then move more than 200 metres, either aided or unaided. (0 points)", + "canStandAndThenMoveMoreThan50mLabel" : "12b. Can stand and then move more than 50 metres but no more than 200 metres, either aided or unaided. (4 points)", + "canStandAndThenMoveMoreThan20mLabel": "12c. Can stand and then move unaided more than 20 metres but no more than 50 metres. (8 points)", + "canStandAndThenMoveWithAid20mTo50mLabel": "12d. Can stand and then move using an aid or appliance more than 20 metres but no more than 50 metres. (10 points)", + "canStandAndThenMoveWithAid1mTo20mLabel": "12e. Can stand and then move more than 1 metre but no more than 20 metres, either aided or unaided. (12 points)", + "canStandAndThenMoveEitherAidedOrUnaidedLabel": "12f. Cannot, either aided or unaided, stand; or (ii) move more than 1 metre. (12 points)", + + "mobilityNonOptionalLabel" : "Mobility", + "dailyLivingLabel" : "Daily living", + + "workCapabilitiesAssessmentPageHeading" : "Work capability assessment", + "isThisAWCAAppeal" : "Is this a WCA appeal?", + "isThisASupportGroupOnlyAppealLabel" : "Is this a support group only appeal?", + + "schedule7ActivitiesPageHeading" : "Schedule 7 activities", + "schedule7ActivitiesLabel" : "Schedule 7 Activities", + "doSchedule7ActivitiesApply" : "Do Schedule 7 Activities Apply?", + "noneApply" : "None apply", + "theSchedule7ActivitiesSelectedBelowApply" : "The Schedule 7 activities selected below apply:", + + "mobilisingUnaidedLabel" : "1. Mobilising unaided by another person with or without a walking stick, manual wheelchair or other aid if such aid is normally or could reasonably be worn or used. Cannot either: (a) mobilise more than 50 metres on level ground without stopping in order to avoid significant discomfort or exhaustion; or (b) repeatedly mobilise 50 metres within a reasonable timescale because of significant discomfort or exhaustion.", + "transferringFromOneSeatedPositionLabel" : "2. Transferring from one seated position to another. Cannot move between one seated position and another seated position located next to one another without receiving physical assistance from another person.", + "reachingCannotRaiseEitherArmLabel" : "3. Reaching. Cannot raise either arm as if to put something in the top pocket of a coat or jacket.", + "pickingUpMovingAndTransferringLabel" : "4. Picking up and moving or transferring by the use of the upper body and arms (excluding standing, sitting, bending or kneeling and all other activities specified in this Schedule). Cannot pick up and move a 0.5 litre carton full of liquid.", + "manualDexterityLabel" : "5. Manual dexterity. Cannot press a button (such as a telephone keypad) with either hand or cannot turn the pages of a book with either hand.", + "makingSelfUnderstoodLabel" : "6. Making self understood through speaking, writing, typing, or other means which are normally, or could reasonably be, used unaided by another person. Cannot convey a simple message, such as the presence of a hazard.", + "understandingCommunicationByLabel" : "7. Understanding communication by: (i) verbal means (such as hearing or lip reading) alone; (ii) non-verbal means (such as reading 16 point print or Braille) alone; or (iii) a combination of sub- paragraphs (i) and (ii), using any aid that is normally, or could reasonably, be used unaided by another person. Cannot understand a simple message, such as the location of a fire escape, due to sensory impairment.", + "absenceOrLossLabel" : "8. Absence or loss of control whilst conscious leading to extensive evacuation of the bowel and/or voiding of the bladder, other than enuresis (bed-wetting), despite the wearing or use of any aids or adaptations which are normally or could reasonably be worn or used.", + "learningTasksLabel" : "9. Learning tasks. Cannot learn how to complete a simple task, such as setting an alarm clock, due to cognitive impairment or mental disorder.", + "awarenessHazardLabel" : "10. Awareness of hazard. Reduced awareness of everyday hazards, due to cognitive impairment or mental disorder, leads to a significant risk of: (a) injury to self or others; or (b) damage to property or possessions, such that the claimant requires supervision for the majority of the time to maintain safety.", + "initiatingAndCompletingLabel" : "11. Initiating and completing personal action (which means planning, organisation, problem solving, prioritising or switching tasks). Cannot, due to impaired mental function, reliably initiate or complete at least two sequential personal actions.", + "copingWithChangeLabel" : "12. Coping with change. Cannot cope with any change, due to cognitive impairment or mental disorder, to the extent that day to day life cannot be managed.", + "copingWithSocialEngagementLabel" : "13. Coping with social engagement, due to cognitive impairment or mental disorder. Engagement in social contact is always precluded due to difficulty relating to others or significant distress experienced by the claimant.", + "appropriatenessOfBehaviourLabel": "14. Appropriateness of behaviour with other people, due to cognitive impairment or mental disorder. Has, on a daily basis, uncontrollable episodes of aggressive or disinhibited behaviour that would be unreasonable in any workplace.", + "conveyingFoodOrDrinkLabel": "15. Conveying food or drink to the mouth. (a) Cannot convey food or drink to the claimant’s own mouth without receiving physical assistance from someone else; (b) Cannot convey food or drink to the claimant’s own mouth without repeatedly stopping or experiencing breathlessness or severe discomfort; (c) Cannot convey food or drink to the claimant’s own mouth without receiving regular prompting given by someone else in the claimant’s presence; or (d) Owing to a severe disorder of mood or behaviour, fails to convey food or drink to the claimant’s own mouth without receiving: (i) physical assistance from someone else; or (ii) regular prompting given by someone else in the claimant’s presence.", + "chewingOrSwallowingFoodLabel": "16. Chewing or swallowing food or drink. (a) Cannot chew or swallow food or drink; (b) Cannot chew or swallow food or drink without repeatedly stopping or experiencing breathlessness or severe discomfort; (c) Cannot chew or swallow food or drink without repeatedly receiving regular prompting given by someone else in the claimant’s presence; or (d) Owing to a severe disorder of mood or behaviour, fails to: (i) chew or swallow food or drink; or (ii) chew or swallow food or drink without regular prompting given by someone else in the claimant’s presence.", + + "whenShouldDWPReassessPageHeading" : "When should DWP reassess the award?", + "whenShouldFTAReAssessTheAwardLabel" : "When should FTA reassess the award? ", + "noRecommendationLabel" : "No recommendation", + "reassessWithin3MonthsLabel" : "Reassess within 3 months", + "reassessWithin6MonthsLabel" : "Reassess within 6 months", + "reassessWithin12MonthsLabel" : "Reassess within 12 months", + "reassessWithin18MonthsLabel" : "Reassess within 18 months", + "reassessWithin24MonthsLabel" : "Reassess within 24 months", + "doNotReassessWithin3MonthsLabel" : "Do not reassess within 3 months", + "doNotReassessWithin6MonthsLabel" : "Do not reassess within 6 months", + "doNotReassessWithin12MonthsLabel" : "Do not reassess within 12 months", + "doNotReassessWithin18MonthsLabel" : "Do not reassess within 18 months", + "doNotReassessWithin24MonthsLabel" : "Do not reassess within 24 months", + "doNotReassessLabel" : "Do not reassess" + +} diff --git a/functional-test/pages/send.to.interloc.prevalid.page.ts b/functional-test/pages/send.to.interloc.prevalid.page.ts new file mode 100644 index 0000000000..6a836226a4 --- /dev/null +++ b/functional-test/pages/send.to.interloc.prevalid.page.ts @@ -0,0 +1,34 @@ +import { Page } from '@playwright/test'; +import { WebAction } from '../common/web.action'; +import sendToInterLocPreValidData from "./content/send.to.interloc_en.json"; + +let webAction: WebAction; + +export class SendToInterlocPrevalidPage { + + readonly page: Page; + + constructor(page: Page) { + this.page = page; + webAction = new WebAction(this.page); + } + + async verifyPageContentForTheInterlocReferralPage() { + //.govuk-caption-l + await webAction.verifyPageLabel('.govuk-caption-l', sendToInterLocPreValidData.sendToInterLocPreValidCaption); + await webAction.verifyPageLabel('h1.govuk-heading-l', sendToInterLocPreValidData.sendToInterLocPageHeading); + await webAction.verifyPageLabel('.form-label', sendToInterLocPreValidData.sendToInterLocReasonOptionLabel); + } + + async inputReasonForReferral(): Promise { + await webAction.chooseOptionByLabel('#interlocReferralReason', sendToInterLocPreValidData.sendToInterLocReferalReasonOptionValue); + } + + async submitContinueBtn(): Promise { + await webAction.clickButton("Continue"); + } + + async confirmSubmission(): Promise { + await webAction.clickButton('Submit'); + } +} diff --git a/functional-test/pages/write.final.decision.page.ts b/functional-test/pages/write.final.decision.page.ts new file mode 100644 index 0000000000..abee913244 --- /dev/null +++ b/functional-test/pages/write.final.decision.page.ts @@ -0,0 +1,601 @@ +import {Page} from '@playwright/test'; +import {WebAction} from '../common/web.action'; +import writeFinalDecisionData from "./content/write.final.decision_en.json"; +import DateUtilsComponent from "../utils/DateUtilsComponent"; + +let webActions: WebAction; + +export class WriteFinalDecisionPages { + + readonly page: Page; + + constructor(page: Page) { + this.page = page; + webActions = new WebAction(this.page); + } + + async verifyPageContentTypeOfAppealPage(dailyLivingFlag = false) { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.typeOfAppealPageHeading); + await webActions.verifyPageLabel('#writeFinalDecisionGenerateNotice legend > .form-label', writeFinalDecisionData.generateNoticeLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionGenerateNotice_Yes\']', writeFinalDecisionData.yesLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionGenerateNotice_No\']', writeFinalDecisionData.noLabel); + + if (dailyLivingFlag === true) { + await webActions.verifyPageLabel('#writeFinalDecisionIsDescriptorFlow legend > .form-label', writeFinalDecisionData.isThisAwardAboutDailyLivingLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionIsDescriptorFlow_Yes\']', writeFinalDecisionData.yesLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionIsDescriptorFlow_No\']', writeFinalDecisionData.noLabel); + } + } + + async inputTypeOfAppealPageData(awardDailyLiving = false, generateNotice = true, appealType = "PIP") { + switch (appealType) { + case "PIP": { + if (awardDailyLiving === true) { + await webActions.clickElementById("#writeFinalDecisionIsDescriptorFlow_Yes"); + } else { + await webActions.clickElementById("#writeFinalDecisionIsDescriptorFlow_No"); + } + if (generateNotice === true) { + await webActions.clickElementById("[for='writeFinalDecisionGenerateNotice_Yes']"); + } else { + await webActions.clickElementById("[for='writeFinalDecisionGenerateNotice_No']"); + } + break; + } + case "TAX CREDIT" : { + if (generateNotice === true) { + await webActions.clickElementById("[for='writeFinalDecisionGenerateNotice_Yes']"); + } else { + await webActions.clickElementById("[for='writeFinalDecisionGenerateNotice_No']"); + } + break; + } + case "UNIVERSAL CREDIT": { + if (generateNotice === true) { + await webActions.clickElementById("[for='writeFinalDecisionGenerateNotice_Yes']"); + } else { + await webActions.clickElementById("[for='writeFinalDecisionGenerateNotice_No']"); + } + break; + } + default: { + //statements; + break; + } + } + + } + + async verifyPageContentAllowedOrRefusedPage() { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.allowedRefusedPageHeading); + await webActions.verifyPageLabel('span.form-label', writeFinalDecisionData.isTheAppealLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionAllowedOrRefused-allowed\']', writeFinalDecisionData.allowedLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionAllowedOrRefused-refused\']', writeFinalDecisionData.refusedLabel); + + } + + async verifyPageContentTypeOfHearingPage(otherPartyRequiredFlag = false) { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.typeOfHearingPageHeading); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionTypeOfHearing\'] > .form-label', writeFinalDecisionData.whatTypeOfHearingWasHeldLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionTypeOfHearing-faceToFace\']', writeFinalDecisionData.faceToFaceLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionTypeOfHearing-telephone\']', writeFinalDecisionData.telephoneLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionTypeOfHearing-video\']', writeFinalDecisionData.videoLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionTypeOfHearing-paper\']', writeFinalDecisionData.paperLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionTypeOfHearing-triage\']', writeFinalDecisionData.triageLabel); + await webActions.clickElementById("#writeFinalDecisionTypeOfHearing-faceToFace"); + await webActions.verifyPageLabel('#writeFinalDecisionPresentingOfficerAttendedQuestion legend > .form-label', writeFinalDecisionData.didAPresentingOfficerLabel); + await webActions.verifyPageLabel('#writeFinalDecisionAppellantAttendedQuestion legend > .form-label', writeFinalDecisionData.didTheAppellantAttendTheHearing); + await webActions.verifyPageLabel('.error-spacing', writeFinalDecisionData.otherPartySectionHeading); + if (otherPartyRequiredFlag === true) { + await webActions.verifyPageLabel('.case-field__label', writeFinalDecisionData.otherPartyNameLabel); + await webActions.verifyPageLabel("[_nghost-ng-c2096613220][_ngcontent-ng-c3895825752] legend > .form-label", writeFinalDecisionData.otherPartyAttendTheHearingLabel); + } + + } + + async inputTypeOfHearingPageData(otherPartyInputRequired = false) { + await webActions.clickElementById("#writeFinalDecisionPresentingOfficerAttendedQuestion_Yes"); + await webActions.clickElementById("#writeFinalDecisionAppellantAttendedQuestion_No"); + if (otherPartyInputRequired === true) { + await webActions.clickElementById("[_nghost-ng-c2096613220][_ngcontent-ng-c3895825752] div:nth-of-type(2) > .form-control"); + } + } + + async verifyPageContentForPanelMembersPage(appealType = 'PIP') { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.panelMembersPageHeading); + switch (appealType) { + case 'PIP': { + await webActions.verifyPageLabel('[for=\'writeFinalDecisionDisabilityQualifiedPanelMemberName\'] > .form-label', writeFinalDecisionData.nameOfDisabilityQualifiedPanelMemberDQPMLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionMedicallyQualifiedPanelMemberName\'] > .form-label', writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberMQPMLabel); + + } case 'UNIVERSAL CREDIT' : { + await webActions.verifyPageLabel('[for=\'writeFinalDecisionMedicallyQualifiedPanelMemberName\'] > .form-label', writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberMQPMLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionOtherPanelMemberName\'] > .form-label', writeFinalDecisionData.otherLabel); + } + default : { + break; + } + } + } + + async inputPageContentForPanelMembersPageData(appealType = 'PIP') { + switch (appealType) { + case 'PIP': { + await webActions.typeField("#writeFinalDecisionDisabilityQualifiedPanelMemberName", writeFinalDecisionData.nameOfDisabilityQualifiedPanelMemberInput); + await webActions.typeField("#writeFinalDecisionMedicallyQualifiedPanelMemberName", writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberInput); + } + case 'UNIVERSAL CREDIT' : { + await webActions.typeField("#writeFinalDecisionMedicallyQualifiedPanelMemberName", writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberInput); + await webActions.typeField("#writeFinalDecisionOtherPanelMemberName", writeFinalDecisionData.otherPanelMemberInput); + } + default : { + break; + } + } + } + + async verifyPageContentForDecisionDatePage() { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.decisionDatePageHeading); + await webActions.verifyPageLabel('span.form-label', writeFinalDecisionData.dateOfFTADecisionLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionDateOfDecision-day\']', writeFinalDecisionData.dayLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionDateOfDecision-month\']', writeFinalDecisionData.monthLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionDateOfDecision-year\']', writeFinalDecisionData.yearLabel); + } + + async inputTypePageContentForDecisionPageData() { + await webActions.typeField("#writeFinalDecisionDateOfDecision-day", "11"); + await webActions.typeField("#writeFinalDecisionDateOfDecision-month", "07"); + await webActions.typeField("#writeFinalDecisionDateOfDecision-year", "2024"); + } + + async verifyPageContentForBundleSectionReferencePage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.bundleSectionPreferenceHeading); + await webActions.verifyPageLabel('.form-label', writeFinalDecisionData.whatIsTheLastPageInTheTribunalBundleLabel); + await webActions.verifyPageLabel('.form-hint', writeFinalDecisionData.whatIsTheLastPageInTheTribunalBundleGuidanceText); + } + + async inputPageContentForBundleSectionReferencePageData() { + await webActions.inputField("#writeFinalDecisionPageSectionReference", writeFinalDecisionData.lastPageInTheTribunalBundleInput); + } + + async verifyPageContentForSummaryOutcomePage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.summaryOfOutcomePageHeading); + await webActions.verifyPageLabel('.form-label', writeFinalDecisionData.summaryOfOutcomeLabel); + } + + async inputPageContentForSummaryOutcomePageData() { + await webActions.inputField("#writeFinalDecisionDetailsOfDecision", writeFinalDecisionData.summaryOfOutcomeInput) + } + + async verifyPageContentForReasonForDecisionPage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.reasonsForDecisionPageHeading); + await webActions.verifyPageLabel('.heading-h2', writeFinalDecisionData.reasonsForDecisionPageHeading); + await webActions.clickButton("Add new"); + } + + async inputPageContentForReasonForDecisionPageData() { + await webActions.typeField("#writeFinalDecisionReasons_value", writeFinalDecisionData.reasonsForDecisionInput) + } + + async verifyPageContentForAnythingElseDecisionPage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.anythingElsePageHeading); + await webActions.verifyPageLabel('.form-label', writeFinalDecisionData.anythingElseLabel); + } + + async inputPageContentForAnythingElsePageData() { + await webActions.inputField("#writeFinalDecisionAnythingElse", writeFinalDecisionData.anythingElseInput) + } + + async verifyPageContentForPreviewDecisionNoticePage(writeFinalDecisionEventFlag = true) { + if (writeFinalDecisionEventFlag) { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + } else { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.issueFinalDecisionEventNameCaptor); + } + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.previewDecisionNoticePageHeading); + await webActions.verifyPageLabel('.form-label', writeFinalDecisionData.previewDecisionNoticeLabel); + await webActions.verifyPageLabel('.form-hint', writeFinalDecisionData.previewDecisionNoticeGuidanceText); + } + + async inputPageContentForPreviewDecisionNoticePageData() { + await webActions.uploadFileUsingAFileChooser("#writeFinalDecisionPreviewDocument", "testfile1.pdf"); + await new Promise(f => setTimeout(f, 5000)); + } + + async verifyPageContentForCheckYourAnswersPage() { + //await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); // No Captor on this Page. + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.checkYourAnswersPageHeading); + await webActions.verifyPageLabel('.heading-h2', writeFinalDecisionData.checkYourAnswersSectionHeading); + await webActions.verifyPageLabel('.check-your-answers > [_ngcontent-ng-c645309043] > .text-16', writeFinalDecisionData.checkYourInformationCarefullyLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .valign-top > .text-16', writeFinalDecisionData.isThisAwardAboutDailyLivingLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .form-cell .text-16', writeFinalDecisionData.noLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .valign-top > .text-16', writeFinalDecisionData.generateNoticeLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(5) > .valign-top > .text-16', writeFinalDecisionData.isTheAppealLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(5) > .form-cell .text-16', writeFinalDecisionData.allowedLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(6) > .valign-top > .text-16', writeFinalDecisionData.whatTypeOfHearingWasHeldLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(7) > .valign-top > .text-16', writeFinalDecisionData.didAPresentingOfficerLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(8) > .valign-top > .text-16', writeFinalDecisionData.didTheAppellantAttendTheHearing); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(9) > .valign-top > .text-16', writeFinalDecisionData.checkYourAnswersNameOfDisabilityQualifiedPanelMemberDQPMLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(10) > .valign-top > .text-16', writeFinalDecisionData.checkYourAnswersNameOfMedicallyQualifiedPanelMemberMQPMLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(11) > .valign-top > .text-16', writeFinalDecisionData.dateOfFTADecisionLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(12) > .valign-top > .text-16', writeFinalDecisionData.whatIsTheLastPageInTheTribunalBundleLabel); + //await webActions.verifyPageLabel('.form-table tr:nth-of-type(14) > .valign-top > .text-16', writeFinalDecisionData.checkYourAnswersShowTheFinalDecisionOutcomeLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(14) > .valign-top > .text-16', writeFinalDecisionData.summaryOfOutcomeLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(15) > .valign-top > .text-16', writeFinalDecisionData.reasonsForDecisionLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(16) > .valign-top > .text-16', writeFinalDecisionData.checkYourAnswersAnythingElse); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(17) > .valign-top > .text-16', writeFinalDecisionData.previewDecisionNoticeLabel); + } + + async verifyAndInputPageContentForTypeOfAwardPage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.typeOfAwardPageHeading); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionDailyLivingQuestion\'] > .form-label', writeFinalDecisionData.whatAreYouConsideringAwardingForDailyLivingLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionDailyLivingQuestion-notConsidered\']', writeFinalDecisionData.notConsideredLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionDailyLivingQuestion-standardRate\']', writeFinalDecisionData.standardRateLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionDailyLivingQuestion-enhancedRate\']', writeFinalDecisionData.enhancedRateLabel); + await webActions.clickElementById("#pipWriteFinalDecisionDailyLivingQuestion-standardRate"); + + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPDailyLivingQuestion\'] > .form-label', writeFinalDecisionData.howWouldThisNewAwardCompareToTheOriginalFTAAwardForDailyLiving); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPDailyLivingQuestion-higher\']', writeFinalDecisionData.higherLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPDailyLivingQuestion-same\']', writeFinalDecisionData.sameLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPDailyLivingQuestion-lower\']', writeFinalDecisionData.lowerLabel); + await webActions.clickElementById("#pipWriteFinalDecisionComparedToDWPDailyLivingQuestion-same"); + + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMobilityQuestion\'] > .form-label', writeFinalDecisionData.whatAreYouConsideringAwardingForMobilityLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMobilityQuestion-notConsidered\']', writeFinalDecisionData.notConsideredLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMobilityQuestion-standardRate\']', writeFinalDecisionData.standardRateLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMobilityQuestion-enhancedRate\']', writeFinalDecisionData.enhancedRateLabel); + await webActions.clickElementById("#pipWriteFinalDecisionMobilityQuestion-enhancedRate"); + + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPMobilityQuestion\'] > .form-label', writeFinalDecisionData.howWouldThisNewAwardCompareToTheOriginalFTAAwardForMobility); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPMobilityQuestion-higher\']', writeFinalDecisionData.higherLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPMobilityQuestion-same\']', writeFinalDecisionData.sameLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionComparedToDWPMobilityQuestion-lower\']', writeFinalDecisionData.lowerLabel); + await webActions.clickElementById("#pipWriteFinalDecisionComparedToDWPMobilityQuestion-higher"); + + } + + async verifyAndInputPageContentForAwardDatesPage() { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.awardDatesPageHeading); + await webActions.verifyPageLabel('#writeFinalDecisionStartDate legend > .form-label', writeFinalDecisionData.startDateLabel); + await webActions.verifyPageLabel("[for='writeFinalDecisionStartDate-day']", writeFinalDecisionData.dayLabel); + await webActions.verifyPageLabel("[for='writeFinalDecisionStartDate-month']", writeFinalDecisionData.monthLabel); + await webActions.verifyPageLabel("[for='writeFinalDecisionStartDate-year']", writeFinalDecisionData.yearLabel); + await webActions.verifyPageLabel("[for='writeFinalDecisionEndDateType'] > .form-label", writeFinalDecisionData.doesThisAwardHaveAnEndDateLabel); + await webActions.verifyPageLabel("[for='writeFinalDecisionEndDateType-setEndDate']", writeFinalDecisionData.setEndDateLabel); + await webActions.verifyPageLabel("[for='writeFinalDecisionEndDateType-indefinite']", writeFinalDecisionData.indefiniteAwardLabel); + await webActions.verifyPageLabel("[for='writeFinalDecisionEndDateType-na']", writeFinalDecisionData.notApplicableNoAwardLabel); + await webActions.clickElementById("#writeFinalDecisionEndDateType-setEndDate"); + await webActions.verifyPageLabel('#writeFinalDecisionEndDate legend > .form-label', writeFinalDecisionData.endDateLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionEndDate-day\']', writeFinalDecisionData.dayLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionEndDate-month\']', writeFinalDecisionData.monthLabel); + await webActions.verifyPageLabel('[for=\'writeFinalDecisionEndDate-year\']', writeFinalDecisionData.yearLabel); + } + + async inputPageContentForAwardDatesPageData() { + await webActions.typeField("#writeFinalDecisionStartDate-day", '01'); + await webActions.typeField("#writeFinalDecisionStartDate-month", '07'); + await webActions.typeField("#writeFinalDecisionStartDate-year", '2024'); + + await webActions.typeField("#writeFinalDecisionEndDate-day", '30'); + await webActions.typeField("#writeFinalDecisionEndDate-month", '07'); + await webActions.typeField("#writeFinalDecisionEndDate-year", '2024'); + } + + async verifyPageContentForSelectActivitiesPage() { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.selectActivitiesPageHeading); + await webActions.verifyPageLabel('#pipWriteFinalDecisionDailyLivingActivitiesQuestion legend > .form-label', writeFinalDecisionData.dailyActivitiesLabel); + await webActions.verifyPageLabel('#pipWriteFinalDecisionDailyLivingActivitiesQuestion .form-hint', writeFinalDecisionData.selectAllThatApplyGuidanceText); + await webActions.verifyPageLabel("[for='pipWriteFinalDecisionDailyLivingActivitiesQuestion-preparingFood']", writeFinalDecisionData.preparingFoodLabel); + await webActions.verifyPageLabel("[for='pipWriteFinalDecisionDailyLivingActivitiesQuestion-takingNutrition']", writeFinalDecisionData.takingNutritionLabel); + await webActions.verifyPageLabel("[for='pipWriteFinalDecisionDailyLivingActivitiesQuestion-managingTherapy']", writeFinalDecisionData.managingTherapyOrMonitoringHealthConditionLabel); + await webActions.verifyPageLabel("[for='pipWriteFinalDecisionDailyLivingActivitiesQuestion-washingAndBathing']", writeFinalDecisionData.washingAndBathingLabel); + await webActions.verifyPageLabel("[for='pipWriteFinalDecisionDailyLivingActivitiesQuestion-managingToiletNeeds']", writeFinalDecisionData.managingToiletNeedsOrIncontinenceLabel); + await webActions.verifyPageLabel("[for='pipWriteFinalDecisionDailyLivingActivitiesQuestion-dressingAndUndressing']", writeFinalDecisionData.dressingAndUndressingLabel); + await webActions.verifyPageLabel("[for='pipWriteFinalDecisionDailyLivingActivitiesQuestion-communicating']", writeFinalDecisionData.communicatingVerballyLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionDailyLivingActivitiesQuestion-readingUnderstanding\']', writeFinalDecisionData.readingAndUnderstandingSignsSymbolsAndWordsLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionDailyLivingActivitiesQuestion-engagingWithOthers\']', writeFinalDecisionData.engagingWithOtherPeopleF2FLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionDailyLivingActivitiesQuestion-budgetingDecisions\']', writeFinalDecisionData.makingBudgetingDecisionsLabel); + await webActions.verifyPageLabel('#pipWriteFinalDecisionMobilityActivitiesQuestion legend > .form-label', writeFinalDecisionData.mobilityLabel); + await webActions.verifyPageLabel('#pipWriteFinalDecisionMobilityActivitiesQuestion .form-hint', writeFinalDecisionData.selectAllThatApplyGuidanceText); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMobilityActivitiesQuestion-planningAndFollowing\']', writeFinalDecisionData.planningAndFollowingJourneysLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMobilityActivitiesQuestion-movingAround\']', writeFinalDecisionData.movingAroundLabel); + } + + async inputPageContentForSelectActivitiesPageData() { + await webActions.clickElementById("#pipWriteFinalDecisionDailyLivingActivitiesQuestion-takingNutrition"); + await webActions.clickElementById("#pipWriteFinalDecisionMobilityActivitiesQuestion-movingAround"); + } + + async verifyPageContentForDailyLivingNutrition() { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.dailyLivingTakingNutritionPageHeading); + await webActions.verifyPageLabel('span.form-label', writeFinalDecisionData.takingNutritionLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionTakingNutritionQuestion-takingNutrition2a\']', writeFinalDecisionData.canTakeNutritionLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionTakingNutritionQuestion-takingNutrition2b\']', writeFinalDecisionData.needsEitherLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionTakingNutritionQuestion-takingNutrition2c\']', writeFinalDecisionData.needsATherapeuticLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionTakingNutritionQuestion-takingNutrition2d\']', writeFinalDecisionData.needsPromptingLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionTakingNutritionQuestion-takingNutrition2e\']', writeFinalDecisionData.needsAssistanceLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionTakingNutritionQuestion-takingNutrition2f\']', writeFinalDecisionData.cannotConveyFoodAndDrinkLabel); + } + + async inputPageContentForDailyLivingNutritionPageData() { + await webActions.clickElementById("div:nth-of-type(6) > .form-control"); + } + + async verifyPageContentForMovingAround() { + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.mobilityActivitiesPageHeading); + await webActions.verifyPageLabel('span.form-label', writeFinalDecisionData.movingAroundLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMovingAroundQuestion-movingAround12a\']', writeFinalDecisionData.canStandAndThenMoveMoreThan200mLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMovingAroundQuestion-movingAround12b\']', writeFinalDecisionData.canStandAndThenMoveMoreThan50mLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMovingAroundQuestion-movingAround12c\']', writeFinalDecisionData.canStandAndThenMoveMoreThan20mLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMovingAroundQuestion-movingAround12d\']', writeFinalDecisionData.canStandAndThenMoveWithAid20mTo50mLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMovingAroundQuestion-movingAround12e\']', writeFinalDecisionData.canStandAndThenMoveWithAid1mTo20mLabel); + await webActions.verifyPageLabel('[for=\'pipWriteFinalDecisionMovingAroundQuestion-movingAround12f\']', writeFinalDecisionData.canStandAndThenMoveEitherAidedOrUnaidedLabel); + } + + async verifyPageContentForCheckYourAnswersPageForAwardsCriteria() { + + //await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); // No Captor on this Page. + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.checkYourAnswersPageHeading); + await webActions.verifyPageLabel('.heading-h2', writeFinalDecisionData.checkYourAnswersSectionHeading); + await webActions.verifyPageLabel('.check-your-answers > [_ngcontent-ng-c645309043] > .text-16', writeFinalDecisionData.checkYourInformationCarefullyLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .valign-top > .text-16', writeFinalDecisionData.isThisAwardAboutDailyLivingLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .valign-top > .text-16', writeFinalDecisionData.generateNoticeLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(5) > .valign-top > .text-16', writeFinalDecisionData.whatTypeOfHearingWasHeldLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(5) > .form-cell .text-16', writeFinalDecisionData.faceToFaceLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(6) > .valign-top > .text-16', writeFinalDecisionData.didAPresentingOfficerLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(6) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(7) > .valign-top > .text-16', writeFinalDecisionData.didTheAppellantAttendTheHearing); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(7) > .form-cell .text-16', writeFinalDecisionData.noLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(8) > .valign-top > .text-16', writeFinalDecisionData.whatAreYouConsideringAwardingForDailyLivingLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(8) > .form-cell .text-16', writeFinalDecisionData.standardRateLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(9) > .valign-top > .text-16', writeFinalDecisionData.howWouldThisNewAwardCompareToTheOriginalFTAAwardForDailyLiving); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(9) > .form-cell .text-16', writeFinalDecisionData.sameLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(10) > .valign-top > .text-16', writeFinalDecisionData.whatAreYouConsideringAwardingForMobilityLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(10) > .form-cell .text-16', writeFinalDecisionData.enhancedRateLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(11) > .valign-top > .text-16', writeFinalDecisionData.howWouldThisNewAwardCompareToTheOriginalFTAAwardForMobility); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(11) > .form-cell .text-16', writeFinalDecisionData.higherLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(12) > .valign-top > .text-16', writeFinalDecisionData.startDateLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(13) > .valign-top > .text-16', writeFinalDecisionData.doesThisAwardHaveAnEndDateLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(13) > .form-cell .text-16', writeFinalDecisionData.setEndDateLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(14) > .valign-top > .text-16', writeFinalDecisionData.endDateLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(15) > .valign-top > .text-16', writeFinalDecisionData.nameOfDisabilityQualifiedPanelMemberDQPMWithoutOptionalLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(15) > .form-cell .text-16', writeFinalDecisionData.nameOfDisabilityQualifiedPanelMemberInput); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(16) > .valign-top > .text-16', writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberMQPMWithoutOptionalLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(16) > .form-cell .text-16', writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberInput); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(17) > .valign-top > .text-16', writeFinalDecisionData.dateOfFTADecisionLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(18) > .valign-top > .text-16', writeFinalDecisionData.dailyLivingLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(18) > .form-cell .text-16', writeFinalDecisionData.takingNutritionLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(19) > .valign-top > .text-16', writeFinalDecisionData.mobilityNonOptionalLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(19) > .form-cell .text-16', writeFinalDecisionData.movingAroundLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(20) > .valign-top > .text-16', writeFinalDecisionData.takingNutritionLabel); + //await webActions.verifyPageLabel('.form-table tr:nth-of-type(20) > .form-cell .text-16', writeFinalDecisionData.takingNutritionLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(21) > .valign-top > .text-16', writeFinalDecisionData.movingAroundLabel); + //await webActions.verifyPageLabel('.form-table tr:nth-of-type(21) > .form-cell .text-16', writeFinalDecisionData.takingNutritionLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(22) > .valign-top > .text-16', writeFinalDecisionData.whatIsTheLastPageInTheTribunalBundleLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(22) > .form-cell .text-16', writeFinalDecisionData.lastPageInTheTribunalBundleInput); + + await webActions.verifyPageLabel('tr:nth-of-type(23) > .valign-top > .text-16', writeFinalDecisionData.reasonsForDecisionLabel); + await webActions.verifyPageLabel('tr:nth-of-type(23) > td:nth-of-type(1) span:nth-of-type(1)', writeFinalDecisionData.reasonsForDecisionInput); + + await webActions.verifyPageLabel('tr:nth-of-type(24) > .case-field-label', writeFinalDecisionData.anythingElsePageHeading); + await webActions.verifyPageLabel('tr:nth-of-type(24) [_ngcontent-ng-c142448239]', writeFinalDecisionData.anythingElseInput); + + await webActions.verifyPageLabel('tr:nth-of-type(25) > .valign-top > .text-16', writeFinalDecisionData.previewDecisionNoticeLabel); + } + + + async verifyPageContentForCheckYourAnswersPageForNoNoticeGenerated() { + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.checkYourAnswersPageHeading); + await webActions.verifyPageLabel('.heading-h2', writeFinalDecisionData.checkYourAnswersSectionHeading); + await webActions.verifyPageLabel('.check-your-answers > [_ngcontent-ng-c645309043] > .text-16', writeFinalDecisionData.checkYourInformationCarefullyLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .valign-top > .text-16', writeFinalDecisionData.generateNoticeLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .form-cell .text-16', writeFinalDecisionData.noLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .valign-top > .text-16', writeFinalDecisionData.isTheAppealLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .form-cell .text-16', writeFinalDecisionData.refusedLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(5) > .valign-top > .text-16', writeFinalDecisionData.previewDecisionNoticeLabel); + + } + + async verifyPageContentForCheckYourAnswersPageForUCCaseWithScheduleAndReasses() { + + //await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); // No Captor on this Page. + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.checkYourAnswersPageHeading); + await webActions.verifyPageLabel('.heading-h2', writeFinalDecisionData.checkYourAnswersSectionHeading); + await webActions.verifyPageLabel('.check-your-answers > [_ngcontent-ng-c645309043] > .text-16', writeFinalDecisionData.checkYourInformationCarefullyLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .valign-top > .text-16', writeFinalDecisionData.generateNoticeLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(3) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .valign-top > .text-16', writeFinalDecisionData.isTheAppealLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(4) > .form-cell .text-16', writeFinalDecisionData.allowedLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(5) > .valign-top > .text-16', writeFinalDecisionData.whatTypeOfHearingWasHeldLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(5) > .form-cell .text-16', writeFinalDecisionData.faceToFaceLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(6) > .valign-top > .text-16', writeFinalDecisionData.didAPresentingOfficerLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(6) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(7) > .valign-top > .text-16', writeFinalDecisionData.didTheAppellantAttendTheHearing); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(7) > .form-cell .text-16', writeFinalDecisionData.noLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(8) > .valign-top > .text-16', writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberMQPMWithoutOptionalLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(8) > .form-cell .text-16', writeFinalDecisionData.nameOfMedicallyQualifiedPanelMemberInput); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(9) > .valign-top > .text-16', writeFinalDecisionData.otherWithoutOptionalLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(9) > .form-cell .text-16', writeFinalDecisionData.otherPanelMemberInput); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(10) > .valign-top > .text-16', writeFinalDecisionData.dateOfFTADecisionLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(12) > .valign-top > .text-16', writeFinalDecisionData.isThisAWCAAppeal); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(12) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(13) > .valign-top > .text-16', writeFinalDecisionData.isThisASupportGroupOnlyAppealLabel); + await webActions.verifyPageLabel('.form-table tr:nth-of-type(13) > .form-cell .text-16', writeFinalDecisionData.yesLabel); + + //Commented out as The return value was 'Show Schedule 7 Activities Apply?' + //await webActions.verifyPageLabel('.form-table tr:nth-of-type(15) > .valign-top > .text-16', writeFinalDecisionData.doSchedule7ActivitiesApply); + //await webActions.verifyPageLabel('.form-table tr:nth-of-type(15) > .form-cell .text-16', writeFinalDecisionData.theSchedule7ActivitiesSelectedBelowApply); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(16) > .valign-top > .text-16', writeFinalDecisionData.schedule7ActivitiesLabel); + await webActions.verifyPageLabel('tr:nth-of-type(16) tr:nth-of-type(1) .text-16', writeFinalDecisionData.manualDexterityLabel); + await webActions.verifyPageLabel('tr:nth-of-type(16) tr:nth-of-type(2) .text-16', writeFinalDecisionData.initiatingAndCompletingLabel); + + await webActions.verifyPageLabel('.form-table tr:nth-of-type(17) > .valign-top > .text-16', writeFinalDecisionData.whatIsTheLastPageInTheTribunalBundleLabel); + await webActions.verifyPageLabel('tr:nth-of-type(17) > .form-cell .text-16', writeFinalDecisionData.lastPageInTheTribunalBundleInput); + + await webActions.verifyPageLabel('tr:nth-of-type(19) > .valign-top > .text-16', writeFinalDecisionData.whenShouldFTAReAssessTheAwardLabel); + await webActions.verifyPageLabel('tr:nth-of-type(19) > .form-cell .text-16', writeFinalDecisionData.reassessWithin3MonthsLabel); + + await webActions.verifyPageLabel('tr:nth-of-type(20) > .valign-top > .text-16', writeFinalDecisionData.reasonsForDecisionLabel); + await webActions.verifyPageLabel('tr:nth-of-type(20) > td:nth-of-type(1) span:nth-of-type(1)', writeFinalDecisionData.reasonsForDecisionInput); + + await webActions.verifyPageLabel('tr:nth-of-type(20) > .valign-top > .text-16', writeFinalDecisionData.reasonsForDecisionLabel); + await webActions.verifyPageLabel('tr:nth-of-type(20) > td:nth-of-type(1) span:nth-of-type(1)', writeFinalDecisionData.reasonsForDecisionInput); + + await webActions.verifyPageLabel('tr:nth-of-type(21) > .valign-top > .text-16', writeFinalDecisionData.checkYourAnswersAnythingElse); + await webActions.verifyPageLabel('tr:nth-of-type(21) > .form-cell span', writeFinalDecisionData.anythingElseInput); + + await webActions.verifyPageLabel('tr:nth-of-type(22) > .valign-top > .text-16', writeFinalDecisionData.previewDecisionNoticeLabel); + } + + async inputPageContentForMovingAroundPageData() { + await webActions.clickElementById("div:nth-of-type(6) > .form-control"); + } + + async verifyPageContentForWorkCapabilityAssessmentPage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.workCapabilitiesAssessmentPageHeading); + await webActions.verifyPageLabel('#wcaAppeal legend > .form-label', writeFinalDecisionData.isThisAWCAAppeal); + await webActions.verifyPageLabel('[for=\'wcaAppeal_Yes\']', writeFinalDecisionData.yesLabel); + await webActions.verifyPageLabel('[for=\'wcaAppeal_No\']', writeFinalDecisionData.noLabel); + } + + async inputAndVerifyPageContentForWorkCapabilityAssessmentPageData() { + await webActions.clickElementById("#wcaAppeal_Yes"); + await webActions.verifyPageLabel('#supportGroupOnlyAppeal legend > .form-label', writeFinalDecisionData.isThisASupportGroupOnlyAppealLabel); + await webActions.verifyPageLabel('[for=\'supportGroupOnlyAppeal_Yes\']', writeFinalDecisionData.yesLabel); + await webActions.verifyPageLabel('[for=\'supportGroupOnlyAppeal_No\']', writeFinalDecisionData.noLabel); + await webActions.clickElementById("#supportGroupOnlyAppeal_Yes"); + } + + async verifyPageContentForSchedule7ActivitiesPage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.schedule7ActivitiesPageHeading); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesApply\'] > .form-label', writeFinalDecisionData.doSchedule7ActivitiesApply); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesApply-No\']', writeFinalDecisionData.noneApply); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesApply-Yes\']', writeFinalDecisionData.theSchedule7ActivitiesSelectedBelowApply); + } + + async inputAndVerifyPageContentForSchedule7ActivitiesPageData() { + await webActions.clickElementById("ccd-write-fixed-radio-list-field div:nth-of-type(2) > .form-control"); + await webActions.verifyPageLabel('ccd-write-multi-select-list-field legend > .form-label', writeFinalDecisionData.schedule7ActivitiesLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7MobilisingUnaided\']', writeFinalDecisionData.mobilisingUnaidedLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7SittingPositions\']', writeFinalDecisionData.transferringFromOneSeatedPositionLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7Reaching\']', writeFinalDecisionData.reachingCannotRaiseEitherArmLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7PickingUp\']', writeFinalDecisionData.pickingUpMovingAndTransferringLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7ManualDexterity\']', writeFinalDecisionData.manualDexterityLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7ManualDexterity\']', writeFinalDecisionData.manualDexterityLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7MakingSelfUnderstood\']', writeFinalDecisionData.makingSelfUnderstoodLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7Communication\']', writeFinalDecisionData.understandingCommunicationByLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7LossOfControl\']', writeFinalDecisionData.absenceOrLossLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7LearningTasks\']', writeFinalDecisionData.learningTasksLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7PersonalAction\']', writeFinalDecisionData.initiatingAndCompletingLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7CopingWithChange\']', writeFinalDecisionData.copingWithChangeLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7SocialEngagement\']', writeFinalDecisionData.copingWithSocialEngagementLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7AppropriatenessOfBehaviour\']', writeFinalDecisionData.appropriatenessOfBehaviourLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7ConveyingFoodOrDrink\']', writeFinalDecisionData.conveyingFoodOrDrinkLabel); + await webActions.verifyPageLabel('[for=\'ucWriteFinalDecisionSchedule7ActivitiesQuestion-schedule7ChewingOrSwallowing\']', writeFinalDecisionData.chewingOrSwallowingFoodLabel); + await webActions.clickElementById("[value='schedule7ManualDexterity']"); + await webActions.clickElementById("[value='schedule7PersonalAction']"); + } + + async verifyPageContentForReassessTheAwardPage() { + + await webActions.verifyPageLabel('.govuk-caption-l', writeFinalDecisionData.eventNameCaptor); + await webActions.verifyPageLabel('h1.govuk-heading-l', writeFinalDecisionData.whenShouldDWPReassessPageHeading); + await webActions.verifyPageLabel('span.form-label', writeFinalDecisionData.whenShouldFTAReAssessTheAwardLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-noRecommendation\']', writeFinalDecisionData.noRecommendationLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-reassess3\']', writeFinalDecisionData.reassessWithin3MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-reassess6\']', writeFinalDecisionData.reassessWithin6MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-reassess12\']', writeFinalDecisionData.reassessWithin12MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-reassess18\']', writeFinalDecisionData.reassessWithin18MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-reassess24\']', writeFinalDecisionData.reassessWithin24MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-doNotReassess3\']', writeFinalDecisionData.doNotReassessWithin3MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-doNotReassess6\']', writeFinalDecisionData.doNotReassessWithin6MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-doNotReassess12\']', writeFinalDecisionData.doNotReassessWithin12MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-doNotReassess18\']', writeFinalDecisionData.doNotReassessWithin18MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-doNotReassess24\']', writeFinalDecisionData.doNotReassessWithin24MonthsLabel); + await webActions.verifyPageLabel('[for=\'dwpReassessTheAward-doNotReassess\']', writeFinalDecisionData.doNotReassessLabel); + } + + async inputPageContentForReassessTheAwardPage() { + await webActions.clickElementById("#dwpReassessTheAward div:nth-of-type(2) > .form-control"); + } + + async chooseAllowedOrRefused(optionVal: string) { + await webActions.clickElementById(optionVal); + } + + async submitContinueBtn(): Promise { + await webActions.clickButton("Continue"); + } + + async verifyDocumentTitle(expText: string) { + await webActions.verifyTextVisibility(expText); + } + + async confirmSubmission(): Promise { + await this.page.waitForTimeout(3000); + await webActions.clickSubmitButton(); + await this.page.waitForTimeout(3000); + } +} diff --git a/functional-test/utils/DateUtilsComponent.ts b/functional-test/utils/DateUtilsComponent.ts index 99f8109ba5..a9cc812f59 100644 --- a/functional-test/utils/DateUtilsComponent.ts +++ b/functional-test/utils/DateUtilsComponent.ts @@ -87,6 +87,12 @@ class DateUtilsComponent { } static async getCurrentDay() { + let currentTime = new Date(); + let day = currentTime.getDay(); + return day; + } + + static async getCurrentDayDateTime() { let currentTime = new Date(); let month = currentTime.getMonth() + 1; let day = currentTime.getDate();