-
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-237]: Add send to judge test (#1586)
* Add send to judge test * remove unused imports * update send to judge test * update send to judge tests --------- Co-authored-by: Pavi <pva08@Pavithrans-MacBook-Pro.local>
- Loading branch information
Showing
9 changed files
with
116 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { test } from "../lib/steps.factory"; | ||
|
||
test("Send to Judge", async ({ sendToJudgeSteps }) => { | ||
await sendToJudgeSteps.performSendToJudge(); | ||
}); |
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,36 @@ | ||
import { Page } from '@playwright/test'; | ||
import eventTestData from "../../pages/content/event.name.event.description_en.json"; | ||
import { SendToJudgePage } from '../../pages/send.to.judge.page'; | ||
import { BaseStep } from './base'; | ||
|
||
export class SendToJudge extends BaseStep { | ||
|
||
readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.page = page; | ||
} | ||
|
||
async performSendToJudge() { | ||
|
||
let sendToJudgePage = new SendToJudgePage(this.page); | ||
|
||
await this.loginAsSuperUserWithoutCaseId(undefined, "TAX CREDIT"); | ||
await this.homePage.reloadPage(); | ||
await this.homePage.chooseEvent('Send to Judge'); | ||
|
||
await sendToJudgePage.verifyPageContent(); | ||
await sendToJudgePage.selectHearingType(); | ||
await sendToJudgePage.inputData(); | ||
await sendToJudgePage.selectInterlocutoryReviewState(); | ||
await sendToJudgePage.confirmSubmission(); | ||
|
||
await this.eventNameAndDescriptionPage.verifyPageContent('Send to Judge'); | ||
await this.eventNameAndDescriptionPage.inputData(eventTestData.eventSummaryInput, | ||
eventTestData.eventDescriptionInput); | ||
await this.eventNameAndDescriptionPage.confirmSubmission(); | ||
|
||
await this.verifyHistoryTabDetails('With FTA', 'Send to Judge', eventTestData.eventDescriptionInput); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"sendToJudgeCaption" : "Send to Judge", | ||
"sendToJudgeHeading" : "Send to Judge", | ||
"sendToJudgeTextFieldLabel" : "Enter note (Optional)", | ||
"sendToJudgePrePostHearingFieldLabel" : "Pre or post hearing?", | ||
"sendToJudgeReviewStateFieldLabel" : "Interlocutory review state", | ||
"sendToJudgeInput" : "Automation testing of the Send to Judge Event", | ||
"sendToJudgePrePostHearingSelectValue" : "Pre Hearing", | ||
"sendToJudgeReviewStateSelectValue" : "Awaiting Information" | ||
} |
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,38 @@ | ||
import { Page } from '@playwright/test'; | ||
import { WebAction } from '../common/web.action'; | ||
import sendToJudgeData from "./content/send.to.judge_en.json"; | ||
|
||
let webAction: WebAction; | ||
|
||
export class SendToJudgePage { | ||
|
||
readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
webAction = new WebAction(this.page); | ||
} | ||
|
||
async verifyPageContent() { | ||
await webAction.verifyPageLabel('h1.govuk-heading-l', sendToJudgeData.sendToJudgeHeading); //Heading Text | ||
await webAction.verifyPageLabel('label[for=\'prePostHearing\']', sendToJudgeData.sendToJudgePrePostHearingFieldLabel); //Field Label | ||
await webAction.verifyPageLabel('label[for=\'tempNoteDetail\']', sendToJudgeData.sendToJudgeTextFieldLabel); | ||
await webAction.verifyPageLabel('label[for=\'interlocReviewState\']', sendToJudgeData.sendToJudgeReviewStateFieldLabel); | ||
} | ||
|
||
async selectHearingType(): Promise<void> { | ||
await webAction.chooseOptionByLabel('#prePostHearing', sendToJudgeData.sendToJudgePrePostHearingSelectValue); | ||
} | ||
|
||
async inputData(): Promise<void> { | ||
await webAction.inputField('#tempNoteDetail', sendToJudgeData.sendToJudgeInput); | ||
} | ||
|
||
async selectInterlocutoryReviewState(): Promise<void> { | ||
await webAction.chooseOptionByLabel('#interlocReviewState', sendToJudgeData.sendToJudgeReviewStateSelectValue); | ||
} | ||
|
||
async confirmSubmission(): Promise<void> { | ||
await webAction.clickButton('Submit'); | ||
} | ||
} |