Skip to content

Commit

Permalink
Nightly dev 20 sep (#396)
Browse files Browse the repository at this point in the history
* add happy path for welsh translation

* fix lint issue

* push local changes to remote

* push local changes to remote

* push changes to remote

* page after login is taking forever to load

* test latest fix

* test latest fix

* test latest fix

* fix lint issue

* fix lint issue

* rafcator login process

* refactor login process

* update WA scenario

* update ECC steps

* push changes to remote

* update readme and test files

* update readme and test files

* assigning task from task tab

* test WA referrals on Jenkins

* update test to cover case link page from citizen side

* fix lint issue

* adding refreshpage to help failing test

* update yarn.lock

* suppress yarn known issues

* merge master to nightly dev

* WA -Assign a Judge to a case -judicial review referral -working locally

* fix lint issue

* update users on azure

* update users on azure

* set view to false

* verified test working on AAT

* fix send notification by CW

* fix send notification by CW

* fix et3 notification test

* fix et3 notification test

* fix bundles

* fix lint issue

* fix lint issue and remove the dulpicate account creation step

* fix lint issue and remove the dulpicate account creation step

* change file path

* fix case file view

* fix bundle legal rep

* fix  global search test

* fix  global search test

* refactor ecc scenario ands send notification steps

* refactor config.js

* refactor jenkins file

* update lock file

* migrate eslint to v9

* migrate eslint to v9 part 2

* fix ETAvailabletask test 18/04

* fix ETAvailabletask test- 19/4

* push changes to remote

* fix notice expiration date

* push send notification for multiple to remote

* added batch notification scenario to multiple

* push more mutilple scenarios to remote branch

* fix global search test

* Specific Access and Challenged Access-Legal Officer automation coverage

* Update send ECC notification as per RET-5037

* Update send notification for multiple

* Added test coverage scenarios for Case Notes Multiple

* fix dependency issue

* fix dependency issue part 2

* HJ - Dependencies

Signed-off-by: Harpreet Jhita <[email protected]>

* HJ - Dependencies

Signed-off-by: Harpreet Jhita <[email protected]>

* HJ - Dependencies

Signed-off-by: Harpreet Jhita <[email protected]>

* Revert "HJ - Dependencies"

This reverts commit e115b36.

* HJ - Dependencies

Signed-off-by: Harpreet Jhita <[email protected]>

* HJ - Dependencies

Signed-off-by: Harpreet Jhita <[email protected]>

* resolve merge issue

* fix XB

* update functional test script

* update functional test script

* Update config.js

* push local file to remote

* push local file to remote part 2

* push local file to remote part 2

* replace ai module because of license

* fix typo

* fix typo in package.json

* restore deleted file

* remove nyc

* refactor step

* remove .only option from scenario

* update batch test to verify case stayed and lead case flag on CUI

* add multiple test coverage for claimant and legal rep

* remove typo

* remove duplicate scenario

* add test coverage for adding documewnt to multiple and granting parties access to the document

* remove dependency failure

* enabling and updating test scenarios

* remove Scenario.only

* Resolve RET-3961 & RET-3962

* add time out to help deal with xui and elastic search taking time to return search results

* resolve dependency issue

* fix typo in Scenarios

* fix additional failing steps

* fix additional failing steps

* removed feature yet to be released from nightly execution

* fix bundle test

* update Scotland Journey for bundle

* update Scotland Journey for bundle

* fix failing test and update user in azure

* add accesibility test in CI

* fix Send Notification test

* revert changes

* ET3 Notification test

* Add test coverage for RET-5205

* add more coverage for multiples

* fix failure

* fix case submission

* add cases not vetted to multiples

* modify multiple creation step

* remove TODOs

* extend legal rep test

* updating multiple test to cover RET-5267

* added retry to scenarios because of instability of test environment

* fix et3 notification tests

* add retry to access test

* add make an application for legal rep

* remove commented code

* try healing step to help with CI environment

* fix ET3 notification failure and update legal rep viewing notification

* fix ET3 notification failure and update legal rep viewing notification

* rename scenario accordingly

* first commit playwright

* first commit

* 24/7 plawright

* commit 25/7

* update jenkinsfile to run nightly on master branch only

* commit 26/7

* add read me file

* make an applciation for legal rep

* playwright CI

* commit 2/8

* commit 2/8

* Update Jenkinsfile_nightly

* fix dependency

* commit 21/8

* resolve dependency issue

* update credential

* Cx browser

* update CI

* update CI

* disable cross browser

* run cx tests

* fix nightly jenkins

* update json

* update json

* update json

* update json

* dependancy and json fix

* add cx

* update report path

* disable test

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* revert master version

* yarn lock

* run playwright tests

* fix dependency

* comment test

* comment tests

* update tag

* playwright tests

* fix

* fix build

* fix dependency

* fix dependency

* fix dependency

* fix dependency

* fix dependency

* fix dependency

* fix build

* fix build

* fix build

* playwright test

* fix playwight dependency

* fix report

* fix report

* fix report

* fix nightly run

* fix build

* fix build

* add B/F action test

* update tag

* fix broken test

* fix report

* fix report cx

* fix report

* fix report

* fix build

* add new file

* remove code

* add new test

* add new test

* add new test

---------

Signed-off-by: Harpreet Jhita <[email protected]>
Co-authored-by: Sunday Ayeni <[email protected]>
Co-authored-by: SunnyAyeni <[email protected]>
Co-authored-by: Harpreet Jhita <[email protected]>
Co-authored-by: Sunday Ayeni <[email protected]>
Co-authored-by: GauravChawlaMOJ <[email protected]>
  • Loading branch information
6 people authored Sep 20, 2024
1 parent 5aa66b8 commit d4c3d37
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 54 deletions.
2 changes: 1 addition & 1 deletion playwrighte2e/pages/bfActionPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
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
Expand Up @@ -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);
Expand All @@ -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
Expand Up @@ -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}}

0 comments on commit d4c3d37

Please sign in to comment.