Skip to content

Commit

Permalink
Sscssi 187 (#1658)
Browse files Browse the repository at this point in the history
* test: write/issue final decision tests

* test: added another PIP test for the purpose of testing.

* test: add test perform the issue final decision

* test: add tags to the tests for execution

* test: added a fix to the decision page input

* test: added the retry for the tests to execute smoothly

* test: adding the tax credit - generate notice no scenario

* test: fix the ci configuration for the tests

* test:added the universal credit issue final decision test

* test: adding the send to interloc test for the purposes of automation.

* fix: removed the unwanted only and reverted the config 0

* fix: adding all the unwanted files to the test

* fix: fixed the issue directions error tests

* fix: tests for the issue order notice

* fix: test that was failing by changing the input fields....

* fix: a method was missed during the merge resolutions

---------

Co-authored-by: Pettedson John <pettedson.john1@hmcts.net>
  • Loading branch information
pats-john and Pettedson John committed Jul 23, 2024
1 parent 621aa06 commit aa3ea24
Show file tree
Hide file tree
Showing 15 changed files with 1,263 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@
},
"scheduleHearing": true,
"datesCantAttend": [
"04-04-2018",
"05-04-2018",
"06-04-2018"
"04-04-2025",
"05-04-2025",
"06-04-2025"
]
},
"signAndSubmit": {
"signer": "Joe Bloggs"
},
"pcqId": "12345678",
"languagePreferenceWelsh": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"mrnDetails": {
"dwpIssuingOffice": "Child Support",
"mrnDate": "2024-05-31",
"mrnLateReason": "Lost my paperwork",
"mrnLateReason": "Lost my papxerwork",
"mrnMissingReason": null
},
"appellant": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -178,7 +177,7 @@
},
"dwpEditedEvidenceReason": null,
"dwpUploadAudioVideoEvidence": [],
"benefitCode": "022",
"benefitCode": "002",
"issueCode": "EC",
"dwpFurtherInfo": "No",
"dwpUCB": null,
Expand Down
2 changes: 1 addition & 1 deletion functional-test/e2e/api-test-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
12 changes: 6 additions & 6 deletions functional-test/e2e/issue-directions-notice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
});
});


51 changes: 51 additions & 0 deletions functional-test/e2e/write-and-issue-final-decision.spec.ts
Original file line number Diff line number Diff line change
@@ -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);
});
})
9 changes: 8 additions & 1 deletion functional-test/fixtures/steps/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
32 changes: 22 additions & 10 deletions functional-test/fixtures/steps/issue.directions.notice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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(),
Expand Down
Loading

0 comments on commit aa3ea24

Please sign in to comment.