Skip to content

Commit

Permalink
Sscssi 297 process audio/video evidence (#1679)
Browse files Browse the repository at this point in the history
* add Process Audio/Video Evidence

* Create hearing test code (#1674)

* Create hearing test code

* cancellation test

* cancellation tests

* suppress yarn warnings

* add amend test code

* dynamically set weekdays for hearings

* update date value

---------

Co-authored-by: gokul-sol <gokul.sridharan@HMCTS.NET>

* [SSCSSI-295]: add tests for Allocate Case Roles and Create Bundle work allocation task (#1682)

* add allocate case roles and create bundle wa tasks tests

* update spec files

---------

Co-authored-by: Pavi <pva08@Pavithrans-MacBook-Pro.local>

* [SSCSSI-281]: add Review PHE Request work allocation task tests (#1686)

* add review PHE request wa task tests

* update review PHE wa task tests

---------

Co-authored-by: Pavi <pva08@Pavithrans-MacBook-Pro.local>

* Esa tests (#1683)

Co-authored-by: gokul-sol <gokul.sridharan@HMCTS.NET>

* Enhanced confidentiality tests (#1688)

* Enhanced confidentiality tests

* Refuse confidentiality tests

---------

Co-authored-by: gokul-sol <gokul.sridharan@HMCTS.NET>

* test: add postponement test (#1685)

* test: add postponement test

* fix(test) : merge conflict resolved properly

* test(fix): add the correct retries to the test pack.

* test: add all the remaining postponement tests.

* revert: retry count to be reverted back to 2 from 0.

* test: testing the postponement tests in the PR pipeline

* test: adding the tests to the pipeline for the postponement tests

* test: testing the pipeline with all the tests

* fix(test) : add reload to the page for test to be fixed.

* test:fix(removing the unlink case test)

* test(fix): tagged the postponement tests

* test(fix) : add number of worker to get the tests to pass

* test:fix(add the workers for the tests to execute correctly)

* test:fix(added the verificaition code for this test)

* test(fix): reverting the retries

* test: removed an unwanted only

* fix(test): state change from Ready to List to Hearing

* test(fix) : disabling the remove link tests

* test(fix): trying to fix the submit button issue

* amend submit locator

* suppress warnings

* test(fix): fixed the submit button issue

* test(fix): reverting the changes done for local testing of the retries

---------

Co-authored-by: Pettedson John <pettedson.john1@hmcts.net>
Co-authored-by: gokul-sol <gokul.sridharan@HMCTS.NET>

* update process audio/video evidence spec file

* disabled playwright tests on Jenkinsfile_CNP

---------

Co-authored-by: gokul <69240498+gokul-sol@users.noreply.github.com>
Co-authored-by: gokul-sol <gokul.sridharan@HMCTS.NET>
Co-authored-by: pavihmcts <110388263+pavihmcts@users.noreply.github.com>
Co-authored-by: Pavi <pva08@Pavithrans-MacBook-Pro.local>
Co-authored-by: pats-john <13101669+pats-john@users.noreply.github.com>
Co-authored-by: Pettedson John <pettedson.john1@hmcts.net>
  • Loading branch information
7 people committed Aug 20, 2024
1 parent 4c1a8c4 commit 2e314b4
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 18 deletions.
30 changes: 15 additions & 15 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,21 @@ withPipeline("nodejs", product, component) {
env.TEST_E2E_URL_GATEWAY = params.CCD_GATEWAY_URL
env.TEST_E2E_API_URI = params.TRIBUNALS_API_URI

stage('Playwright tests') {
try{
yarnBuilder.yarn('test:jenkins')
} finally {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: "playwright-report",
reportFiles: 'index.html',
reportName: 'SSCS E2E Test Report'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**/*'
}
}
// stage('Playwright tests') {
// try{
// yarnBuilder.yarn('test:jenkins')
// } finally {
// publishHTML([
// allowMissing: true,
// alwaysLinkToLastBuild: true,
// keepAll: true,
// reportDir: "playwright-report",
// reportFiles: 'index.html',
// reportName: 'SSCS E2E Test Report'
// ])
// steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**/*'
// }
// }
}

afterSuccess('smoketest:aat') {
Expand Down
66 changes: 64 additions & 2 deletions functional-test/e2e/process-audio-video-evidence.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,70 @@ test.describe("Process audio/video evidence test", {tag: "@pipeline"}, async() =
await processAVEvidenceSteps.excludeEvidenceUploadedByCTSC(caseId);
});


test.afterAll("Case has to be set to Dormant",async () => {
// await performAppealDormantOnCase(caseId);
await performAppealDormantOnCase(caseId);
});
});

test.describe.serial('WA - Manual Process Audio/Video Evidence task completion test', {tag: '@work-allocation'}, async() => {

test.beforeAll("Case has to be Created",async () => {
caseId = await createCaseBasedOnCaseType('PIP');
});

test("As a TCW view and complete Process Audio/Video Evidence manually", async ({ uploadDocumentFurtherEvidenceSteps, processAVEvidenceSteps }) => {

test.slow();
await uploadDocumentFurtherEvidenceSteps.performUploadDocumentFurtherEvidence(caseId, true);
await processAVEvidenceSteps.verifyTcwWithCaseAllocatorRoleCanViewAndAssignProcessAudioVideoEvidenceTask(caseId);
await processAVEvidenceSteps.verifyTcwCanMarkProcessAudioVideoEvidenceTaskCanViewAndCompleteTheTaskMarkAsDone(caseId);
});

test.afterAll("Case has to be set to Dormant",async () => {
await performAppealDormantOnCase(caseId);
});
});

test.describe.serial('WA - Process Audio/Video Evidence task iniation and completion tests', {tag: '@work-allocation'}, async() => {

test.beforeAll("Case has to be Created",async () => {
caseId = await createCaseBasedOnCaseType('PIP');
});

test("Perform upload document further evidence and assign to the task to TCW", async ({ uploadDocumentFurtherEvidenceSteps, processAVEvidenceSteps }) => {

test.slow();
await uploadDocumentFurtherEvidenceSteps.performUploadDocumentFurtherEvidence(caseId, true);
await processAVEvidenceSteps.verifyTcwWithCaseAllocatorRoleCanViewAndAssignProcessAudioVideoEvidenceTask(caseId);
});

test("As a TCW, complete Process Audio/Video Evidence task", async ({ processAVEvidenceSteps }) => {

test.slow();
await processAVEvidenceSteps.verifyTcwAsAnAssignedUserForProcessAudioVideoEvidenceTaskCanViewAndCompleteTheTask(caseId);
});

test.afterAll("Case has to be set to Dormant",async () => {
await performAppealDormantOnCase(caseId);
});
});

test.describe.serial('WA - Process Audio/Video Evidence task automatic cancellation when case is void', {tag: '@work-allocation'}, async() => {

test.beforeAll("Case has to be Created", async () => {
caseId = await createCaseBasedOnCaseType('PIP');
});

test("Grant - Audio/video evidence uploaded by CTSC", async ({ uploadDocumentFurtherEvidenceSteps }) => {
await uploadDocumentFurtherEvidenceSteps.performUploadDocumentFurtherEvidence(caseId, true);
});

test("Process Audio/Video Evidence task is cancelled automatically when case is void", async ({ processAVEvidenceSteps }) => {
await processAVEvidenceSteps.verifyProcessAudioVideoEvidenceTaskIsCancelledAutomaticallyWhenTheCaseIsVoid(caseId);
});

test.afterAll("Case has to be set to Dormant", async () => {
await performAppealDormantOnCase(caseId);
});
});
104 changes: 103 additions & 1 deletion functional-test/fixtures/steps/process.av.evidence.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseStep } from "./base";
import { Page } from '@playwright/test';
import { expect, Page } from '@playwright/test';
import { credentials } from "../../config/config";
import { timingSafeEqual } from "crypto";
import createCaseBasedOnCaseType from "../../api/client/sscs/factory/appeal.type.factory";
Expand All @@ -8,6 +8,9 @@ import {
performEventOnCaseWithUploadResponse
} from "../../api/client/sscs/factory/appeal.update.factory";
import logger from "../../utils/loggerUtil";
import task from '../../pages/content/process.audio.video.evidence_en.json';
import { VoidCase } from './void.case';
import { UploadDocumentFurtherEvidence } from "./upload.document.further.evidence";

const actionFurtherEvidenceTestdata = require('../../pages/content/action.further.evidence_en.json');
const issueDirectionTestdata = require('../../pages/content/issue.direction_en.json');
Expand Down Expand Up @@ -176,4 +179,103 @@ export class ProcessAVEvidence extends BaseStep {
await this.homePage.navigateToTab('History');
await this.verifyHistoryTabDetails('Process audio/video evidence');
}

async completeProcessAudioVideoEvidenceEvent() {

await this.processAVPage.selectRequestedEvidence('Test file');
await this.processAVPage.verifyPageContent(avEvidenceTestdata.ftaValue);
await this.processAVPage.grantApprovalEvidence();
await this.processAVPage.continueOnPreviewDoc();

await expect(this.homePage.summaryTab).toBeVisible();
await this.homePage.delay(3000);
await this.homePage.navigateToTab(avEvidenceTestdata.docTab);
await this.documentsTab.verifyPageContentByKeyValue(avEvidenceTestdata.docTypeField, avEvidenceTestdata.docTypeValue);
await this.documentsTab.verifyPageContentByKeyValue("Bundle addition", "A");
await this.documentsTab.verifydueDates('Date added');

await this.homePage.navigateToTab('History');
await this.verifyHistoryTabDetails('Process audio/video evidence');
}

async verifyTcwWithoutCaseAllocatorRoleCanViewProcessAudioVideoEvidenceTask(caseId: string) {

// Verify TCW can view the unassigned Process Audio/Video Evidence task
// await this.performUploadDocumentFurtherEvidence(caseId);
await this.loginUserWithCaseId(credentials.amTribunalCaseWorker,true, caseId);
await this.homePage.navigateToTab('Tasks');
await this.tasksTab.verifyTaskIsDisplayed(task.name);
await this.tasksTab.verifyPriortiy(task.name, task.priority);
await this.tasksTab.verifyPageContentByKeyValue(task.name, 'Assigned to', task.assignedToWhenNotAssigned);
await this.tasksTab.verifyManageOptions(task.name, task.unassignedManageOptions);
}

async verifyTcwWithCaseAllocatorRoleCanViewAndAssignProcessAudioVideoEvidenceTask(caseId: string) {

/* Login as Senior TCW with case allocator role and view the
unassigned Process Audio/Video Evidence task and assign it to another TCW */
await this.loginUserWithCaseId(credentials.amSeniorTribunalCaseWorkerWithCaseAllocatorRole, true, caseId);
await this.homePage.navigateToTab('Tasks')
await this.tasksTab.verifyTaskIsDisplayed(task.name);
await this.tasksTab.verifyPriortiy(task.name, task.priority);
await this.tasksTab.verifyPageContentByKeyValue(task.name, 'Assigned to', task.assignedToWhenNotAssigned);
await this.tasksTab.verifyManageOptions(task.name, task.unassignedManageOptionsForCaseAllocator);
await this.tasksTab.assignTaskToTcwUser(task.name, credentials.amTribunalCaseWorker.email);
}

async verifyTcwCanMarkProcessAudioVideoEvidenceTaskCanViewAndCompleteTheTaskMarkAsDone(caseId: string) {

// Login as TCW and view the unassigned Process Audio/Video Evidence task and Mark as done
await this.loginUserWithCaseId(credentials.amTribunalCaseWorker, true, caseId);
await this.homePage.navigateToTab('Tasks')
await this.tasksTab.verifyTaskIsDisplayed(task.name);
await this.tasksTab.verifyPageContentByKeyValue(task.name, 'Assigned to', task.assignedTo);
await this.tasksTab.verifyManageOptions(task.name, task.assignedManageOptions);
await this.tasksTab.verifyNextStepsOptions(task.name, task.nextStepsOptions);
await this.tasksTab.markTheTaskAsDone(task.name);
await this.homePage.navigateToTab('Tasks');
await this.tasksTab.verifyTaskIsHidden(task.name);
}

async verifyTcwAsAnAssignedUserForProcessAudioVideoEvidenceTaskCanViewAndCompleteTheTask(caseId: string) {

// Login as TCW and view the unassigned Process Audi Video Evidence task
await this.loginUserWithCaseId(credentials.amTribunalCaseWorker, true, caseId);
await this.homePage.navigateToTab('Tasks')
await this.tasksTab.verifyTaskIsDisplayed(task.name);
await this.tasksTab.verifyPageContentByKeyValue(task.name, 'Assigned to', task.assignedTo);
await this.tasksTab.verifyManageOptions(task.name, task.assignedManageOptions);
await this.tasksTab.verifyNextStepsOptions(task.name, task.nextStepsOptions);

// Select Process audio/video evidence next step and complete the event
await this.tasksTab.clickNextStepLink(task.processAudioVideoEvidence.link);
await this.completeProcessAudioVideoEvidenceEvent();

// Verify task is removed from the tasks list within Tasks tab
await this.homePage.navigateToTab('Tasks');
await this.tasksTab.verifyTaskIsHidden(task.name);
}

async verifyProcessAudioVideoEvidenceTaskIsCancelledAutomaticallyWhenTheCaseIsVoid(caseId: string) {

// Verify TCW with case allocator role can view the unassigned Process Audio/Video Evidence task
// await this.performUploadDocumentFurtherEvidence(caseId);
await this.loginUserWithCaseId(credentials.amSeniorTribunalCaseWorkerWithCaseAllocatorRole, true, caseId);
await this.homePage.navigateToTab('Tasks')
await this.tasksTab.verifyTaskIsDisplayed(task.name);
await this.tasksTab.verifyManageOptions(task.name, task.unassignedManageOptionsForCaseAllocator);

// TCW with case allocator role assigns task to another TCW user
await this.tasksTab.assignTaskToTcwUser(task.name, credentials.amTribunalCaseWorker.email);
await this.tasksTab.verifyPageContentByKeyValue(task.name, 'Assigned to', task.assignedTo);
await this.tasksTab.verifyManageOptions(task.name, task.assignedManageOptionsForCaseAllocator);

// TCW voids the case
let voidCase = new VoidCase(this.page);
await voidCase.performVoidCase(caseId, false);

// Verify task is removed from the tasks list within Tasks tab
await this.homePage.navigateToTab('Tasks');
await this.tasksTab.verifyTaskIsHidden(task.name);
}
}
37 changes: 37 additions & 0 deletions functional-test/pages/content/process.audio.video.evidence_en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "Process audio/video evidence - LO",
"priority": "low",
"assignedToWhenNotAssigned": "Unassigned",
"assignedTo": "SSCS cw",
"unassignedManageOptions" : [
"Assign to me"
],
"assignedManageOptions" : [
"Mark as done",
"Reassign task",
"Unassign task"
],
"unassignedManageOptionsForCaseAllocator": [
"Assign task",
"Cancel task",
"Assign to me"
],
"assignedManageOptionsForCaseAllocator" : [
"Cancel task",
"Mark as done",
"Reassign task",
"Unassign task"
],
"nextStepsOptions": [
"Amend interloc review state",
"Process audio/video evidence"
],
"amendInterlocReviewState": {
"link": "Amend interloc review state",
"eventTitle": "Amend interloc review state"
},
"processAudioVideoEvidence": {
"link": "Process audio/video evidence",
"eventTitle": "Process Audio/Video Evidence"
}
}

0 comments on commit 2e314b4

Please sign in to comment.