-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SSCSSI-207 update not listable (#1662)
* Added test for Listing Error event and updating verifyPageContent method. * Added test for Listing Error event and updating verifyPageContent method. * Update config.ts * Update listing-error.spec.ts * SSCSSI-278: Evidence Reminder case tests (#1571) * Add initial tests * Update tests for evidence reminder * Update tests for evidence reminder * Update steps for evidence reminder * Fix conflict * Fix conflicts * Readd URLs * functional-test/pages/common/homePage.ts --------- Co-authored-by: gokul-sol <gokul.sridharan@HMCTS.NET> * Adding Not listable and Update not listable case tests. * Updating Not listable and Update not listable case test suite. --------- Co-authored-by: pats-john <13101669+pats-john@users.noreply.github.com> Co-authored-by: Derin Aya <106395889+derin-aya@users.noreply.github.com> Co-authored-by: gokul-sol <gokul.sridharan@HMCTS.NET>
- Loading branch information
1 parent
aa3ea24
commit 49aaeb2
Showing
7 changed files
with
391 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {test} from "../lib/steps.factory"; | ||
|
||
|
||
|
||
test.describe("Update Not listable tests", {tag: '@WIP'}, async() => { | ||
|
||
//Happy Path Test | ||
test("Not listable test - Set case to Not listable", async ({updateNotListableSteps}) => { | ||
test.slow(); | ||
await updateNotListableSteps.performNotListableEvent(); | ||
}); | ||
|
||
//Test for Error Messages | ||
test("Not listable test - Not listable error message test", async({updateNotListableSteps})=> { | ||
test.slow(); | ||
await updateNotListableSteps.verifyNotListableErrorMessages() | ||
}) | ||
|
||
test("Update Not listable test - Directions fulfilled case ready to list",async({updateNotListableSteps})=> { | ||
test.slow(); | ||
await updateNotListableSteps.performUpdateNotListableDirectionFulfilled(); | ||
}) | ||
|
||
test("Update Not Listable test - Directions not fulfilled - New Due Date Assigned", async({updateNotListableSteps}) =>{ | ||
test.slow(); | ||
await updateNotListableSteps.performUpdateNotListableDirectionNotFulfilledNewDueDate(); | ||
}) | ||
|
||
test("Update Not listable test - Directions not fulfilled - Case moves to ready to list",async({updateNotListableSteps})=> { | ||
test.slow(); | ||
await updateNotListableSteps.performUpdateNotListableDirectionNotFulfilledReadyToList(); | ||
}) | ||
|
||
test("Update Not listable test - Directions not fulfilled - Case moves to With FTA",async({updateNotListableSteps})=> { | ||
test.slow(); | ||
await updateNotListableSteps.performUpdateNotListableDirectionNotFulfilledWithFTA(); | ||
}) | ||
|
||
test("Update Not listable test - Directions not fulfilled - Interlocutory Review (TCW)",async({updateNotListableSteps})=> { | ||
test.slow(); | ||
await updateNotListableSteps.performUpdateNotListableDirectionNotFulfilledTCW() | ||
}) | ||
|
||
test("Update Not listable test - Directions not fulfilled - Interlocutory Review (Judge)",async({updateNotListableSteps})=> { | ||
test.slow(); | ||
await updateNotListableSteps.performUpdateNotListableDirectionNotFulfilledJudge() | ||
}) | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
import {BaseStep} from "./base"; | ||
import {Page} from "@playwright/test"; | ||
import createCaseBasedOnCaseType from "../../api/client/sscs/factory/appeal.type.factory"; | ||
import {credentials} from "../../config/config"; | ||
import updateNotListableData from "../../pages/content/update.not.listable_en.json"; | ||
import eventTestData from "../../pages/content/event.name.event.description_en.json"; | ||
|
||
|
||
export class UpdateNotListable extends BaseStep { | ||
|
||
readonly page: Page; | ||
|
||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.page = page; | ||
} | ||
|
||
async performNotListableEvent() { | ||
let pipCaseId = await createCaseBasedOnCaseType('PIP'); | ||
//Trigger Not listable event: | ||
await this.goToNotListablePage(this.page, pipCaseId); | ||
await this.notListablePage.verifyPageContent(); //Verifying Heading and Caption for event | ||
//inserting data and verifying said data during the event | ||
await this.notListablePage.enterNotListableProvideReason(); | ||
await this.notListablePage.continueEvent(); | ||
|
||
await this.notListablePage.enterValidDirectionDueDate(); | ||
await this.notListablePage.continueEvent(); | ||
|
||
await this.notListablePage.confirmSubmission(); | ||
// verifying that event has submitted successfully and details are showing in Summary and History Tabs | ||
await this.verifyHistoryTabDetails("Not listable","Not listable") | ||
} | ||
|
||
//Method to verify the error messaging for Not listable. | ||
async verifyNotListableErrorMessages(){ | ||
let pipCaseId = await createCaseBasedOnCaseType('PIP'); | ||
await this.goToNotListablePage(this.page, pipCaseId); | ||
await this.notListablePage.verifyPageContent(); | ||
await this.notListablePage.continueEvent() | ||
await this.notListablePage.verifyNotListableReasonError() | ||
|
||
await this.notListablePage.enterNotListableProvideReason() | ||
await this.notListablePage.continueEvent() | ||
|
||
await this.notListablePage.enterInvalidDirectionDueDate() | ||
await this.notListablePage.confirmSubmission() | ||
await this.notListablePage.verifyPastDueDateErrorMessage() | ||
} | ||
|
||
async performUpdateNotListableDirectionFulfilled(){ | ||
await this.performNotListableEvent(); | ||
await this.homePage.chooseEvent("Update not listable case"); | ||
await this.updateNotListablePage.verifyPageContent(); | ||
await this.updateNotListablePage.requirementsFulfilled() | ||
await this.updateNotListablePage.confirmSubmission() | ||
await this.verifyHistoryTabDetails("Ready to list", "Update not listable case"); | ||
} | ||
|
||
async performUpdateNotListableDirectionNotFulfilledReadyToList(){ | ||
|
||
await this.performNotListableEvent(); | ||
await this.homePage.chooseEvent("Update not listable case"); | ||
await this.updateNotListablePage.requirementsNotFulfilled(); | ||
|
||
//Set interlocutory review option to No | ||
await this.updateNotListablePage.interlocutoryReviewStateNotRequired(); | ||
|
||
//Selecting NO to updating Directions Due Date | ||
await this.updateNotListablePage.noNewDueDateRequired(); | ||
|
||
//Moving case to ready to list and confirming event success | ||
await this.updateNotListablePage.moveCaseToReadyToList(); | ||
await this.updateNotListablePage.confirmSubmission(); | ||
|
||
await this.verifyHistoryTabDetails("Ready to list", "Update not listable case"); | ||
} | ||
|
||
async performUpdateNotListableDirectionNotFulfilledWithFTA(){ | ||
|
||
await this.performNotListableEvent(); | ||
//Trigger Update not listable case event | ||
await this.homePage.chooseEvent("Update not listable case"); | ||
await this.updateNotListablePage.requirementsNotFulfilled(); | ||
|
||
//Set interlocutory review option to No | ||
await this.updateNotListablePage.interlocutoryReviewStateNotRequired() | ||
|
||
//Selecting NO to updating Directions Due Date | ||
await this.updateNotListablePage.noNewDueDateRequired() | ||
|
||
//Moving case to With FTA and confirming event success | ||
await this.updateNotListablePage.moveCaseToWithFTA(); | ||
|
||
await this.verifyHistoryTabDetails("With FTA", "Update not listable case"); | ||
} | ||
|
||
async performUpdateNotListableDirectionNotFulfilledNewDueDate(){ | ||
|
||
await this.performNotListableEvent(); | ||
//Trigger Update not listable case event | ||
await this.homePage.chooseEvent("Update not listable case"); | ||
await this.updateNotListablePage.requirementsNotFulfilled(); | ||
|
||
//Set interlocutory review option to No | ||
await this.updateNotListablePage.interlocutoryReviewStateNotRequired() | ||
|
||
//Selecting NO to updating Directions Due Date | ||
await this.updateNotListablePage.newDueDateRequired(); | ||
|
||
await this.updateNotListablePage.confirmSubmission(); | ||
|
||
await this.verifyHistoryTabDetails("Not listable", "Update not listable case"); | ||
} | ||
|
||
async performUpdateNotListableDirectionNotFulfilledTCW(){ | ||
await this.performNotListableEvent(); | ||
//Trigger Update not listable case event | ||
await this.homePage.chooseEvent("Update not listable case"); | ||
await this.updateNotListablePage.requirementsNotFulfilled(); | ||
|
||
//Set interlocutory review option to Yes TCW to review. | ||
await this.updateNotListablePage.interlocutoryReviewRequiredTCW() | ||
|
||
await this.updateNotListablePage.confirmSubmission() | ||
|
||
await this.verifyHistoryTabDetails("Not listable", "Update not listable case"); | ||
} | ||
|
||
async performUpdateNotListableDirectionNotFulfilledJudge(){ | ||
await this.performNotListableEvent(); | ||
//Trigger Update not listable case event | ||
await this.homePage.chooseEvent("Update not listable case"); | ||
await this.updateNotListablePage.requirementsNotFulfilled(); | ||
|
||
//Set interlocutory review option to Yes Judge to review. | ||
await this.updateNotListablePage.interlocutoryReviewRequiredJudge() | ||
|
||
await this.updateNotListablePage.confirmSubmission() | ||
|
||
await this.verifyHistoryTabDetails("Not listable", "Update not listable case"); | ||
} | ||
|
||
private async goToNotListablePage(page: Page, caseId: string) { | ||
await this.loginUserWithCaseId(credentials.amCaseWorker, true, caseId); | ||
await this.homePage.chooseEvent("Not listable"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"notListableEventCaption": "Not listable", | ||
"notListableEventHeading": "Reasons", | ||
"notListableReasonsErrorMessage": "Reason(s) for the case being unlistable is required", | ||
"notListablePastDueDataErrorMessage": "Directions due date must be in the future", | ||
"notListableProvideReasons": "Test Reason(s) for the case being not listable is required", | ||
"updateNotListableEventCaption": "Update not listable case", | ||
"updateNotListableEventHeading": "Directions fulfilled" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import {WebAction} from "../common/web.action"; | ||
import {Page} from "@playwright/test"; | ||
import updatenotListableData from "./content/update.not.listable_en.json"; | ||
import eventTestData from "./content/event.name.event.description_en.json"; | ||
|
||
let webActions: WebAction; | ||
|
||
export class NotListablePage { | ||
|
||
readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
webActions = new WebAction(this.page); | ||
} | ||
|
||
async verifyPageContent() { | ||
await webActions.verifyPageLabel('.govuk-caption-l', updatenotListableData.notListableEventCaption); //Caption Text | ||
await webActions.verifyPageLabel('.govuk-heading-l', updatenotListableData.notListableEventHeading); //Heading Text | ||
} | ||
|
||
async enterNotListableProvideReason(){ | ||
await webActions.inputField('#notListableProvideReasons',updatenotListableData.notListableProvideReasons); | ||
} | ||
|
||
|
||
async enterValidDirectionDueDate() { | ||
await webActions.inputField('#notListableDueDate-day', '21'); | ||
await webActions.inputField('#notListableDueDate-month', '12'); | ||
await webActions.inputField('#notListableDueDate-year', '2025'); | ||
await this.page.getByText('Continue').click(); | ||
} | ||
|
||
async enterInvalidDirectionDueDate() { | ||
await webActions.inputField('#notListableDueDate-day', '01'); | ||
await webActions.inputField('#notListableDueDate-month', '02'); | ||
await webActions.inputField('#notListableDueDate-year', '2024'); | ||
await this.page.getByText('Continue').click() | ||
} | ||
|
||
async verifyPastDueDateErrorMessage(){ | ||
this.page.getByText(updatenotListableData.notListablePastDueDataErrorMessage) | ||
} | ||
|
||
async verifyNotListableReasonError(){ | ||
await webActions.verifyPageLabel('.validation-error', updatenotListableData.notListableReasonsErrorMessage); | ||
} | ||
|
||
async verifyCheckYourAnswersPage(){ | ||
await webActions.verifyTextVisibility('Test Reason(s) for the case being not listable is required'); | ||
await webActions.verifyTextVisibility('21 Dec 2025'); | ||
} | ||
|
||
async insertEventSummaryAndDescription(){ | ||
await webActions.inputField('#field-trigger-summary',eventTestData.eventSummaryInput) | ||
await webActions.inputField('#field-trigger-description',eventTestData.eventDescriptionInput) | ||
} | ||
|
||
async confirmSubmission(): Promise<void> { | ||
await this.page.waitForTimeout(3000); | ||
await this.page.getByText('Submit').dblclick(); | ||
await this.page.waitForLoadState("domcontentloaded"); | ||
} | ||
|
||
async continueEvent(): Promise<void> { | ||
await this.page.waitForTimeout(3000); | ||
await this.page.getByText('Continue').click(); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.