generated from hmcts/ccd-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
576 additions
and
151 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 |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
"test/**/*.{js,jsx,ts,tsx}": "eslint" | ||
}, | ||
"dependencies": { | ||
"@axe-core/playwright": "4.10.0", | ||
"@faker-js/faker": "8.4.1", | ||
"@noble/hashes": "^1.5.0", | ||
"axios": "^1.7.4", | ||
|
@@ -55,14 +56,16 @@ | |
"webdriverio": "8.36.0" | ||
}, | ||
"resolutions": { | ||
"axios": "^1.7.4", | ||
"braces": "^3.0.3", | ||
"cross-spawn": "^7.0.5", | ||
"express": "^4.19.2", | ||
"got": "^11.8.5", | ||
"log4js": "^6.4.0", | ||
"micromatch": "^4.0.8", | ||
"semver-regex": "^3.1.4", | ||
"tough-cookie": "^4.1.3", | ||
"braces": "^3.0.3", | ||
"ws": "^8.17.1", | ||
"axios": "^1.7.4" | ||
"ws": "^8.17.1" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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,19 @@ | ||
import { expect, Page } from "@playwright/test"; | ||
import AxeBuilder from ""; | ||
|
||
async function axeTest(page: Page): Promise<void> { | ||
// accessibility testing function | ||
const accessibilityScanResults = await new AxeBuilder({ page }) | ||
.withTags([ | ||
"wcag2a", | ||
"wcag2aa", | ||
"wcag21a", | ||
"wcag21aa", | ||
"wcag22a", | ||
"wcag22aa", | ||
]) | ||
.analyze(); | ||
expect(accessibilityScanResults.violations).toEqual([]); | ||
} | ||
|
||
export default axeTest; |
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
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,74 @@ | ||
import { BasePage } from "./basePage"; | ||
import { params } from "../utils/config"; | ||
import { expect, Page } from '@playwright/test'; | ||
|
||
|
||
export default class Et3LoginPage extends BasePage { | ||
|
||
protected constructor(page: Page) { | ||
super(page); | ||
} | ||
|
||
public static create(page: Page): Et3LoginPage { | ||
return new Et3LoginPage(page); | ||
} | ||
|
||
elements={ | ||
|
||
returnToExistingResponse:this.page.locator('[href="/return-to-existing?lng=en"]'), | ||
submit:this.page.locator('[type="submit"]'), | ||
startNow:this.page.locator('[href="/case-number-check"]'), | ||
replyToNewClaim:this.page.locator('[href="/self-assignment-form?lng=en"]'), | ||
submissionRefNumber: '#caseReferenceId', | ||
respName:'#respondentName', | ||
claimantFirstName:'#claimantFirstName', | ||
claimantLastName:'#claimantLastName', | ||
caseRefNumber:this.page.locator('#ethosCaseReference') | ||
} | ||
async processRespondentLogin(username: string, password: string, caseNumber: string) { | ||
await this.page.goto(params.TestUrlRespondentUi); | ||
await this.elements.startNow.click(); | ||
await expect(this.page.locator('h1')).toContainText('Case Number'); | ||
await this.elements.caseRefNumber.fill(caseNumber.toString()); | ||
await this.clickContinue(); | ||
await this.loginRespondentUi(username, password); | ||
} | ||
|
||
async loginRespondentUi(username, password){ | ||
await this.page.locator('#username').fill(username); | ||
await this.page.locator('#password').fill(password); | ||
await this.elements.submit.click(); | ||
} | ||
|
||
|
||
async replyToNewClaim(submissionRef, caseNumber){ | ||
await expect(this.page.locator('h1')).toContainText('Before you continue'); | ||
await this.clickContinue(); | ||
await expect(this.page.locator('#main-content')).toContainText('ET3 Responses'); | ||
await this.elements.replyToNewClaim.click(); | ||
await this.caseDetailsPage(submissionRef); | ||
await this.checkAndSubmitPage(caseNumber); | ||
} | ||
|
||
async caseDetailsPage(submissionRef){ | ||
await expect(this.page.locator('h1')).toContainText('Case Details'); | ||
await this.page.locator(this.elements.submissionRefNumber).fill(submissionRef.toString()); | ||
//resp name is hard coded here as case is created from api which is using json | ||
await this.page.locator(this.elements.respName).fill('Mrs Test Auto'); | ||
await this.page.locator(this.elements.claimantFirstName).fill('Grayson'); | ||
await this.page.locator(this.elements.claimantLastName).fill('Becker'); | ||
await this.clickContinue(); | ||
} | ||
|
||
async checkAndSubmitPage(caseNumber){ | ||
await expect(this.page.locator('h1')).toContainText('Check and submit'); | ||
await this.page.locator('#confirmation').check(); | ||
await this.submitButton(); | ||
|
||
//validate claim is displayed in awaiting response | ||
await expect(this.page.locator('#main-content')).toContainText('ET3 Responses'); | ||
await this.elements.replyToNewClaim.isVisible(); | ||
await this.page.getByLabel('view ' + caseNumber.toString() + ':').click(); | ||
} | ||
|
||
} |
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,100 @@ | ||
import {BasePage} from "./basePage"; | ||
import { expect, Page } from '@playwright/test'; | ||
|
||
class RespClaimantDetails extends BasePage { | ||
protected constructor(page: Page) { | ||
super(page); | ||
} | ||
|
||
public static create(page: Page): RespClaimantDetails { | ||
return new RespClaimantDetails(page); | ||
} | ||
|
||
elements={ | ||
clickAcasEarlyConciliationLink:this.page.locator('[href="/acas-early-conciliation-certificate"]'), | ||
}; | ||
|
||
async et3Section2() { | ||
await this.earlyConciliationDetails(); | ||
await this.claimantJobDetails(); | ||
|
||
} | ||
|
||
async earlyConciliationDetails(){ | ||
await expect(this.page.locator('h1')).toContainText('Your response form (ET3)'); | ||
await this.elements.clickAcasEarlyConciliationLink.click(); | ||
await this.acasEarlyConciliation(); | ||
} | ||
|
||
async acasEarlyConciliation(){ | ||
await expect(this.page.locator('h1')).toContainText('Acas early conciliation certificate'); | ||
await this.page.getByLabel('No').check(); | ||
await this.page.getByLabel('Why do you disagree with the').fill('Test ACAS'); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantJobDetails(){ | ||
await this.claimantEmploymentDates(); | ||
await this.claimantEmploymentContinuing(); | ||
await this.claimantJobTitle(); | ||
await this.claimantAverageWeeklyHours(); | ||
await this.claimantDetailsCya(); | ||
await this.claimantPayDetails(); | ||
await this.claimantNoticeDetails(); | ||
await this.claimantBenefitsDetails(); | ||
await this.claimantDetailsCya(); | ||
} | ||
|
||
async claimantEmploymentDates(){ | ||
await this.page.getByLabel('No', { exact: true }).check(); | ||
await this.saveAndContinueButton(); | ||
await this.page.getByRole('group', { name: 'Employment start date (' }).getByLabel('Day').fill('1'); | ||
await this.page.getByRole('group', { name: 'Employment start date (' }).getByLabel('Month').fill('1'); | ||
await this.page.getByRole('group', { name: 'Employment start date (' }).getByLabel('Year').fill('2024'); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantEmploymentContinuing(){ | ||
await this.page.getByLabel('Yes').check(); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantJobTitle(){ | ||
await this.page.getByLabel('No', { exact: true }).check(); | ||
await this.page.getByLabel('What is or was the claimant’s').fill('Tester'); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantAverageWeeklyHours(){ | ||
await this.page.getByLabel('No', { exact: true }).check(); | ||
await this.page.getByLabel('What are the claimant’s').fill('40'); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantDetailsCya(){ | ||
await this.page.getByLabel('Yes, I’ve completed this').check(); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantPayDetails(){ | ||
await this.page.getByLabel('No', { exact: true }).check(); | ||
await this.saveAndContinueButton(); | ||
await this.page.getByLabel('Monthly').check(); | ||
await this.page.getByLabel('Enter the claimant’s pay').fill('3500'); | ||
await this.page.getByLabel('Enter the claimant’s normal').fill('2700'); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantNoticeDetails(){ | ||
await this.page.getByLabel('Yes').check(); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
async claimantBenefitsDetails(){ | ||
await this.page.getByLabel('Not applicable').check(); | ||
await this.saveAndContinueButton(); | ||
} | ||
|
||
} | ||
|
||
export default RespClaimantDetails; |
Oops, something went wrong.