Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hmcts/et-xui-e2e-tests
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eaf87d5ebc96689338fa412b0a127826be455084
Choose a base ref
..
head repository: hmcts/et-xui-e2e-tests
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 11738c7c58ebcdd7ba908e71d92590dc964f5d4d
Choose a head ref
2 changes: 1 addition & 1 deletion playwrighte2e/pages/bfActionPage.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export default class BfActionPage extends BasePage {
async addBfAction() {
await expect(this.page.locator('ccd-case-edit-page')).toContainText('B/F Action');
await this.page.getByRole('button', { name: 'Add new' }).click();
await this.page.locator('#bfActions_0_cwActions').selectOption('Application of letter to ACAS/RPO');
await this.page.locator(this.elements.bfActionDropDown).selectOption('Application of letter to ACAS/RPO');
await this.page.locator(this.elements.bfDate).fill('11');
await this.page.locator(this.elements.bfMonth).fill('09');
await this.page.locator(this.elements.bfYear).fill('2024');
26 changes: 26 additions & 0 deletions playwrighte2e/pages/caseTransferPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { BasePage } from "./basePage";
import { expect } from "@playwright/test";
import { th } from "@faker-js/faker";


export default class CaseTransferPage extends BasePage {

elements = {
caseTransferReason:'#reasonForCT'
}

async progressCaseTransfer(){
await this.page.locator(this.elements.caseTransferReason).fill('Transfer case to Scotland RET');
await this.clickContinue();
}
async checkYourAnswer(caseNumber){
await expect(this.page.locator('ccd-case-edit-submit')).toContainText('Select the office you want to transfer the case to');
await expect(this.page.locator('ccd-case-edit-submit')).toContainText('Reason for Case Transfer');
await this.page.getByRole('button', { name: 'Transfer Case' }).click();
await expect(this.page.locator('#case-viewer-field-read--positionType')).toContainText('Case transferred - other country');
await expect(this.page.locator('h4')).toContainText('Case Status: Transferred');
await expect(this.page.getByLabel('Case Details').getByRole('paragraph')).toContainText('Case Transfer: Transferred to Glasgow ' +caseNumber);
await expect(this.page.getByRole('link', { name: '/2024' })).toBeVisible();
//add validation to varify link is clickable and open scotland case details
}
}
11 changes: 11 additions & 0 deletions playwrighte2e/pages/jurisdictionPage.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,17 @@ import { expect } from "@playwright/test";
export default class JurisdictionPage extends BasePage {

elements = {
jurisdictionDropdown:'#jurCodesCollection_1_juridictionCodesList'
}

async addJurisdictionCode(){
await this.page.getByRole('button', { name: 'Add new' }).nth(1).click();
await this.page.locator(this.elements.jurisdictionDropdown).selectOption('10: DDA');
await this.submitButton();
}

async verifyJurisdictionCodeOnTab(){
await this.page.getByText('Jurisdictions').click();
await expect(this.page.locator('ccd-read-collection-field')).toContainText('DDA');
}
}
61 changes: 34 additions & 27 deletions playwrighte2e/tests/etEvents.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { test } from "@playwright/test";
import { expect, test } from "@playwright/test";
import LoginPage from "../pages/loginPage";
import CreateCaseThroughApi from "../pages/createCaseThroughApi";
import CaseListPage from "../pages/caseListPage";
import Et1CaseServingPage from "../pages/et1CaseServingPage";
import BfActionPage from "../pages/bfActionPage";
import { params } from "../utils/config";
import JurisdictionPage from "../pages/jurisdictionPage";
import CaseTransferPage from "../pages/caseTransferPage";

test.describe('Various events in mange case application', () => {

test('Create a claim and perform B/F action event', async ({ page }) => {


test.describe('Various events in mange case application', () => {
test.beforeEach(async ({ page }) => {
let loginPage = new LoginPage(page);
let createCaseThroughApi = new CreateCaseThroughApi(page);
let caseListPage = new CaseListPage(page);
@@ -21,38 +24,42 @@ test.describe('Various events in mange case application', () => {
await page.goto(params.TestUrlForManageCaseAAT);
await loginPage.processLogin(params.TestEnvETCaseWorkerUser, params.TestEnvETPassword);
await caseListPage.searchCaseApplicationWithSubmissionReference('Eng/Wales - Singles', caseId.toString());
await caseListPage.processCaseFromCaseList(caseId);
let caseNumber = await caseListPage.processCaseFromCaseList(caseId);

//Accept case
await caseListPage.selectNextEvent('Accept/Reject Case');
await et1CaseServingPage.processET1CaseServingPages();

});

test('Create a claim and perform B/F action event', async ({ page }) => {
let caseListPage = new CaseListPage(page);
let bfActinoPage = new BfActionPage(page);

//BF action
await caseListPage.selectNextEvent('B/F Action');
await bfActinoPage.addBfAction();
});

// test('Create a claim and perform jurisdiction event', async ({ page }) => {
// let loginPage = new LoginPage(page);
// let createCaseThroughApi = new CreateCaseThroughApi(page);
// let caseListPage = new CaseListPage(page);
// let et1CaseServingPage = new Et1CaseServingPage(page);
// let bfActinoPage = new BfActionPage(page);
//
// let caseId = await createCaseThroughApi.processCaseToAcceptedState();
//
// await page.goto(params.TestUrlForManageCaseAAT);
// await loginPage.processLogin(params.TestEnvETCaseWorkerUser, params.TestEnvETPassword);
// await caseListPage.searchCaseApplicationWithSubmissionReference('Eng/Wales - Singles', caseId.toString());
// await caseListPage.processCaseFromCaseList(caseId);
//
// //Accept case
// await caseListPage.selectNextEvent('Accept/Reject Case');
// await et1CaseServingPage.processET1CaseServingPages();
//
// //Jurisdiction event
// await caseListPage.selectNextEvent('Jurisdiction');


// });
test('Create a claim and perform jurisdiction event', async ({ page }) => {
let caseListPage = new CaseListPage(page);
let jurisdictionPage = new JurisdictionPage(page);

//Jurisdiction event
await caseListPage.selectNextEvent('Jurisdiction');
await jurisdictionPage.addJurisdictionCode();
await jurisdictionPage.verifyJurisdictionCodeOnTab();
});

test('Create a England/Wales claim and transfer to Scotland', async ({ page }) => {
// let caseListPage = new CaseListPage(page);
// let caseTransferPage = new CaseTransferPage(page);
//
// //Jurisdiction event
// await caseListPage.selectNextEvent('Case Transfer (Scotland)');
//
// await caseTransferPage.progressCaseTransfer();
// await caseTransferPage.checkYourAnswer(caseNumber);
});

});
72 changes: 47 additions & 25 deletions playwrighte2e/tests/legalRepClaim.test.ts
Original file line number Diff line number Diff line change
@@ -12,39 +12,61 @@ const claimantsLastName= 'Malcom';
const respondentsFirstName= 'Mark';
const respondentsLastName = 'McDonald';

test('Claimant Representative creates a claim (England and Wales - Singles) and submit', async ({ page }) => {
test.describe('Legal Representative submits a case and perform various events', () => {
test('Claimant Representative creates a claim (England and Wales - Singles) and submit', async ({ page }) => {
let loginPage = new LoginPage(page);
let caseListPage = new CaseListPage(page);
let et1CreateDraftClaim = new Et1CreateDraftClaim(page);
//let applicationPage = new ApplicationPage(page);


let loginPage = new LoginPage(page);
let caseListPage= new CaseListPage(page);
let et1CreateDraftClaim= new Et1CreateDraftClaim(page);
//let applicationPage = new ApplicationPage(page);
await page.goto(params.TestUrlForManageCaseAAT);
await loginPage.processLogin(params.TestEnvETLegalRepUser, params.TestEnvETLegalRepPassword);
await caseListPage.claimantRepCreateCase('Employment', 'Eng/Wales - Singles', postcode);

await et1CreateDraftClaim.et1Section1(claimantsFirstName, claimantsLastName);
await et1CreateDraftClaim.et1Section2(respondentsFirstName, respondentsLastName);
await et1CreateDraftClaim.et1Section3();
let submissionReference = await et1CreateDraftClaim.et1SubmitClaim();
console.log('The value of the Case Number ' + submissionReference);

await page.goto(params.TestUrlForManageCaseAAT);
await loginPage.processLogin(params.TestEnvETLegalRepUser, params.TestEnvETLegalRepPassword);
await caseListPage.claimantRepCreateCase('Employment','Eng/Wales - Singles', postcode);
//Legal rep makes an application- R92 Yes (offline scenario -only claimant rep is online user)
//RET-5191&92
// await applicationPage.clickApplicationTab();
// await applicationPage.navigateMakeAnApplicationLink();
// await applicationPage.makeAnApplicationR92WithYesOption('Yes');
//
// //Legal rep makes an application- R92 No
// await applicationPage.clickApplicationTab();
// await applicationPage.navigateMakeAnApplicationLink();
// await applicationPage.makeAnApplicationR92WithYesOption('No');

await et1CreateDraftClaim.et1Section1(claimantsFirstName, claimantsLastName);
await et1CreateDraftClaim.et1Section2(respondentsFirstName, respondentsLastName);
await et1CreateDraftClaim.et1Section3();
let submissionReference = await et1CreateDraftClaim.et1SubmitClaim();
console.log('The value of the Case Number ' + submissionReference);
//TODO NOC-5188, 5190...

//Legal rep makes an application- R92 Yes (offline scenario -only claimant rep is online user)
//RET-5191&92
// await applicationPage.clickApplicationTab();
// await applicationPage.navigateMakeAnApplicationLink();
// await applicationPage.makeAnApplicationR92WithYesOption('Yes');
// await page.goto(params.TestUrlForManageCaseAAT);
// await loginPage.processLoginOnXui(params.TestEnvETLegalRepUserDiffOrg, params.TestEnvETLegalRepPasswordDiffOrg);

});

// test('Claimant Representative creates a claim (England and Wales - Singles) and add case documents', async ({ page }) => {
// let loginPage = new LoginPage(page);
// let caseListPage = new CaseListPage(page);
// let et1CreateDraftClaim = new Et1CreateDraftClaim(page);
// //let applicationPage = new ApplicationPage(page);
//
//
// await page.goto(params.TestUrlForManageCaseAAT);
// await loginPage.processLogin(params.TestEnvETLegalRepUser, params.TestEnvETLegalRepPassword);
// await caseListPage.claimantRepCreateCase('Employment', 'Eng/Wales - Singles', postcode);
//
// //Legal rep makes an application- R92 No
// await applicationPage.clickApplicationTab();
// await applicationPage.navigateMakeAnApplicationLink();
// await applicationPage.makeAnApplicationR92WithYesOption('No');
// await et1CreateDraftClaim.et1Section1(claimantsFirstName, claimantsLastName);
// await et1CreateDraftClaim.et1Section2(respondentsFirstName, respondentsLastName);
// await et1CreateDraftClaim.et1Section3();
// let submissionReference = await et1CreateDraftClaim.et1SubmitClaim();
// console.log('The value of the Case Number ' + submissionReference);

//TODO NOC-5188, 5190...
//Add case documents

// await page.goto(params.TestUrlForManageCaseAAT);
// await loginPage.processLoginOnXui(params.TestEnvETLegalRepUserDiffOrg, params.TestEnvETLegalRepPasswordDiffOrg);
// });

});
2 changes: 1 addition & 1 deletion yarn-audit-known-issues
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"actions":[],"advisories":{"1098681":{"findings":[{"version":"4.0.5","paths":["lint-staged>micromatch"]}],"metadata":null,"vulnerable_versions":"<4.0.8","module_name":"micromatch","severity":"moderate","github_advisory_id":"GHSA-952p-6rrq-rcjv","cves":["CVE-2024-4067"],"access":"public","patched_versions":">=4.0.8","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"updated":"2024-08-28T13:12:27.000Z","recommendation":"Upgrade to version 4.0.8 or later","cwe":["CWE-1333"],"found_by":null,"deleted":null,"id":1098681,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-4067\n- https://github.com/micromatch/micromatch/issues/243\n- https://github.com/micromatch/micromatch/pull/247\n- https://devhub.checkmarx.com/cve-details/CVE-2024-4067\n- https://github.com/micromatch/micromatch/blob/2c56a8604b68c1099e7bc0f807ce0865a339747a/index.js#L448\n- https://github.com/micromatch/micromatch/commit/500d5d6f42f0e8dfa1cb5464c6cb420b1b6aaaa0\n- https://github.com/micromatch/micromatch/pull/266\n- https://github.com/micromatch/micromatch/commit/03aa8052171e878897eee5d7bb2ae0ae83ec2ade\n- https://advisory.checkmarx.net/advisory/CVE-2024-4067\n- https://github.com/micromatch/micromatch/releases/tag/4.0.8\n- https://github.com/advisories/GHSA-952p-6rrq-rcjv","created":"2024-05-14T18:30:54.000Z","reported_by":null,"title":"Regular Expression Denial of Service (ReDoS) in micromatch","npm_advisory_id":null,"overview":"The NPM package `micromatch` prior to version 4.0.8 is vulnerable to Regular Expression Denial of Service (ReDoS). The vulnerability occurs in `micromatch.braces()` in `index.js` because the pattern `.*` will greedily match anything. By passing a malicious payload, the pattern matching will keep backtracking to the input while it doesn't find the closing bracket. As the input size increases, the consumption time will also increase until it causes the application to hang or slow down. There was a merged fix but further testing shows the issue persisted prior to https://github.com/micromatch/micromatch/pull/266. This issue should be mitigated by using a safe pattern that won't start backtracking the regular expression due to greedy matching.\n","url":"https://github.com/advisories/GHSA-952p-6rrq-rcjv"}},"muted":[],"metadata":{"vulnerabilities":{"info":0,"low":0,"moderate":1,"high":0,"critical":0},"dependencies":372,"devDependencies":0,"optionalDependencies":0,"totalDependencies":372}}
{"actions":[],"advisories":{"1098681":{"findings":[{"version":"4.0.5","paths":["lint-staged>micromatch"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-4067\n- https://github.com/micromatch/micromatch/issues/243\n- https://github.com/micromatch/micromatch/pull/247\n- https://devhub.checkmarx.com/cve-details/CVE-2024-4067\n- https://github.com/micromatch/micromatch/blob/2c56a8604b68c1099e7bc0f807ce0865a339747a/index.js#L448\n- https://github.com/micromatch/micromatch/commit/500d5d6f42f0e8dfa1cb5464c6cb420b1b6aaaa0\n- https://github.com/micromatch/micromatch/pull/266\n- https://github.com/micromatch/micromatch/commit/03aa8052171e878897eee5d7bb2ae0ae83ec2ade\n- https://advisory.checkmarx.net/advisory/CVE-2024-4067\n- https://github.com/micromatch/micromatch/releases/tag/4.0.8\n- https://github.com/advisories/GHSA-952p-6rrq-rcjv","created":"2024-05-14T18:30:54.000Z","id":1098681,"npm_advisory_id":null,"overview":"The NPM package `micromatch` prior to version 4.0.8 is vulnerable to Regular Expression Denial of Service (ReDoS). The vulnerability occurs in `micromatch.braces()` in `index.js` because the pattern `.*` will greedily match anything. By passing a malicious payload, the pattern matching will keep backtracking to the input while it doesn't find the closing bracket. As the input size increases, the consumption time will also increase until it causes the application to hang or slow down. There was a merged fix but further testing shows the issue persisted prior to https://github.com/micromatch/micromatch/pull/266. This issue should be mitigated by using a safe pattern that won't start backtracking the regular expression due to greedy matching.\n","reported_by":null,"title":"Regular Expression Denial of Service (ReDoS) in micromatch","metadata":null,"cves":["CVE-2024-4067"],"access":"public","severity":"moderate","module_name":"micromatch","vulnerable_versions":"<4.0.8","github_advisory_id":"GHSA-952p-6rrq-rcjv","recommendation":"Upgrade to version 4.0.8 or later","patched_versions":">=4.0.8","updated":"2024-08-28T13:12:27.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-952p-6rrq-rcjv"}},"muted":[],"metadata":{"vulnerabilities":{"info":0,"low":0,"moderate":1,"high":0,"critical":0},"dependencies":378,"devDependencies":0,"optionalDependencies":0,"totalDependencies":378}}