Skip to content

Commit

Permalink
Nightly dev 16 10 (#398)
Browse files Browse the repository at this point in the history
* 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

* add tranfer to scotland case

* add new test

* add new test

* add notification test

* add new test

* add noc test

* add config file

* fix failure

* run test

* add try catch

* fix broken test

* fix CI issue

---------

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 Oct 16, 2024
1 parent ed8fa98 commit ca73d0e
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 31 deletions.
9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@
"license": "hmcts",
"private": true,
"scripts": {
"test:fullfunctional": "yarn playwright install chromium && yarn playwright test --project=chromium --grep @smoke",
"test:functional-chromium": "yarn playwright install chromium && yarn playwright test --project=chromium",
"test:functional-webkit": "yarn playwright install webkit && yarn playwright test --project=webkit --grep @cx",
"test:functional-firefox": "yarn playwright install firefox && yarn playwright test --project=firefox --grep @cx",
"test:crossbrowser": "yarn playwright install firefox && yarn playwright install webkit && yarn playwright test --project=webkit --project=firefox --grep @cx",
"test:local": "rm -rf functional-output && DEBUG='codeceptjs:heal' && codeceptjs run --ai -c codecept.conf.js --verbose --reporter mocha-multi",
"parallel": "codeceptjs run --steps -c codecept.conf.js run-multiple parallel",
"codeceptjs:headless": "HEADLESS=true codeceptjs run --steps",
"lint-staged": "lint-staged",
"lint": "eslint",
"fortifyScan": "./src/test/java/gradlew -p src/test/java fortifyScan",
"codeceptjs:demo": "codeceptjs run --steps -c node_modules/@codeceptjs/examples/codecept.webdriver.conf.js",
"codeceptjs:demo:headless": "HEADLESS=true codeceptjs run --steps -c node_modules/@codeceptjs/examples/codecept.webdriver.conf.js",
"codeceptjs:demo:ui": "codecept-ui --app -c node_modules/@codeceptjs/examples/codecept.webdriver.conf.js",
"test:profile": "SAUCE_TUNNEL_NAME=sunnyayeni_tunnel_name yarn test:fullfunctional --steps -c saucelabs.conf.js --profile sauce:chrome,firefox,safari",
"prepare": "husky install",
"yarn-update": "yarn set version 3.x",
"install-dependencies": "/usr/bin/yarn install --silent"
Expand Down
2 changes: 1 addition & 1 deletion playwrighte2e/pages/basePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export abstract class BasePage {
this.continueButton = page.getByRole('button', { name: 'Continue' });
this.saveAsDraftButton = page.getByRole('button', { name: 'Save as draft' });
this.closeAndReturnButton = this.page.getByRole('button', { name: 'Close and Return to case' });
this.submit = this.page.getByRole('button', { name: 'submit' });
this.submit = this.page.getByRole('button', { name: 'Submit' });
this.postcode = page.getByRole('textbox', { name: 'Enter a UK postcode' });
this.findAddress = page.getByRole('button', { name: 'Find address' });
this.signout = page.getByText('Sign out');
Expand Down
30 changes: 21 additions & 9 deletions playwrighte2e/pages/caseListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ export default class CaseListPage extends BasePage{

async searchCaseApplicationWithSubmissionReference(option, submissionReference) {
await this.page.reload();
await this.elements.caseListLink.isVisible();
await expect(this.elements.caseListLink).toBeVisible();
await this.elements.caseListLink.click();
await this.elements.caseTypeDropdown.isVisible();
await this.elements.applyButton.isVisible();
await expect(this.elements.caseTypeDropdown).toBeVisible();
await expect(this.elements.applyButton).toBeVisible();
await expect(this.page.locator('h1')).toContainText('Case list');
try {
switch (option) {
Expand All @@ -133,17 +133,29 @@ export default class CaseListPage extends BasePage{
let caseNumber = await this.page.getByLabel('go to case with Case').allTextContents();
console.log('The value of the Case Number ' +caseNumber);
await this.page.getByLabel('go to case with Case').click();
await this.page.waitForSelector('#mat-tab-label-0-1');
// let caseNumber = this.page.locator('//*[@id="undefined"]/dt/ccd-markdown/div/markdown/h1[1]').textContent();
// console.log('The value of the Case Number ' +caseNumber);
await expect(this.page.getByRole('tab', { name: 'Case Details' }).locator('div')).toContainText('Case Details');
// await this.page.waitForSelector('#mat-tab-label-0-1');
return caseNumber;
}

async selectNextEvent(option) {
await this.elements.nextEventDropdown.selectOption(option);
await this.elements.submitEventButton.isDisabled();
await this.page.getByLabel('Next step').selectOption(option);
//await this.elements.nextEventDropdown.selectOption(option);
await this.elements.submitEventButton.isVisible();
await this.elements.submitEventButton.click();
}
//

// Check if button is visible
const isVisible = await this.elements.submitEventButton.isVisible();

if (isVisible) {
// click Go button if visible
await this.elements.submitEventButton.click();
}
} catch (error) {
console.error('Error performing an Event', error);
}

// async selectTab(title, submissionReference) {
// let tabUrl = testConfig.TestUrlForManageCaseAAT + `/cases/case-details/${submissionReference}/${title}`;
// I.amOnPage(tabUrl);
Expand Down
2 changes: 1 addition & 1 deletion playwrighte2e/pages/caseTransferPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ async progressCaseTransfer(){
const page1Promise = this.page.waitForEvent('popup');
const page1 = await page1Promise;
await expect(page1.locator('#case-viewer-field-read--managingOffice')).toContainText('Glasgow');
//add validation to varify link is clickable and open scotland case details

}
}
1 change: 1 addition & 0 deletions playwrighte2e/pages/claimantDetailsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default class ClaimantDetailsPage extends BasePage{
await expect(this.page.locator(this.elements.occupation)).toBeVisible();
await this.clickContinue();
await expect(this.page.locator(this.elements.hearingPreference)).toBeVisible();
await this.page.locator('#claimantHearingPreference_contact_language-English').check();
await this.submitButton();
}

Expand Down
15 changes: 14 additions & 1 deletion playwrighte2e/pages/et1CaseServingPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,25 @@ export default class Et1CaseServingPage extends BasePage {
}

async processET1CaseServingPages() {
await expect(this.page.locator('ccd-case-edit-page')).toContainText('Accept/Reject Case');
await expect(this.page.locator('ccd-case-edit-page')).toContainText('Pre-Acceptance');
await this.page.getByLabel('Yes').check();
await this.elements.date_accepted_day.fill(String(today.getDate()));
await this.elements.date_accepted_month.fill(String(today.getMonth() +1));
await this.elements.date_accepted_year.fill(String(today.getFullYear()));
await this.submitButton();

try {
// Check if the element is visible
const isVisible = await this.page.locator('cut-alert').isVisible();

if (!isVisible) {
// Click the button if the element is not visible
await this.submitButton();
}
} catch (error) {
console.error('Error performing Accept/Reject case Event', error);
}

}


Expand Down
6 changes: 3 additions & 3 deletions playwrighte2e/pages/nocPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export default class NocPage extends BasePage{
await this.page.locator(this.elements.caseRef).fill(submissionRef);
await this.clickContinue();
await expect(this.page.locator('h1')).toContainText('Enter details');
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.page.locator(this.elements.respName).fill('Mark McDonald');
await this.page.locator(this.elements.claimantFirstName).fill('Jessamine');
await this.page.locator(this.elements.claimantLastName).fill('Malcom');
await this.clickContinue();
await this.page.getByRole('heading', { name: 'Check and submit'}).click();
await this.page.locator(this.elements.confirmDetailsCheckBox).check();
Expand Down
14 changes: 7 additions & 7 deletions playwrighte2e/tests/etEvents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { params } from "../utils/config";
import JurisdictionPage from "../pages/jurisdictionPage";
import CaseTransferPage from "../pages/caseTransferPage";

let caseId;
let submissionRef;
let caseNumber;


Expand All @@ -20,20 +20,20 @@ test.describe('Various events in mange case application', () => {
let caseListPage = new CaseListPage(page);
let et1CaseServingPage = new Et1CaseServingPage(page);

caseId = await createCaseThroughApi.processCaseToAcceptedState();
submissionRef = await createCaseThroughApi.processCaseToAcceptedState();

await page.goto(params.TestUrlForManageCaseAAT);
await loginPage.processLogin(params.TestEnvETCaseWorkerUser, params.TestEnvETPassword);
await caseListPage.searchCaseApplicationWithSubmissionReference('Eng/Wales - Singles', caseId.toString());
caseNumber = await caseListPage.processCaseFromCaseList(caseId);
await caseListPage.searchCaseApplicationWithSubmissionReference('Eng/Wales - Singles', submissionRef.toString());
caseNumber = await caseListPage.processCaseFromCaseList(submissionRef);

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

});

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

Expand Down Expand Up @@ -71,8 +71,8 @@ test.describe('Various events in mange case application', () => {

//judge log in
await loginPage.processLogin(params.TestEnvETJudgeUserEng, params.TestEnvETJudgeUserEngPassword);
await caseListPage.searchCaseApplicationWithSubmissionReference('Eng/Wales - Singles', caseId.toString());
await caseListPage.processCaseFromCaseList(caseId);
await caseListPage.searchCaseApplicationWithSubmissionReference('Eng/Wales - Singles', submissionRef.toString());
await caseListPage.processCaseFromCaseList(submissionRef);

await caseListPage.clickTab('Judgments');

Expand Down

0 comments on commit ca73d0e

Please sign in to comment.