Skip to content

Commit

Permalink
CIV-13463 Update set Aside Judgment (#4354)
Browse files Browse the repository at this point in the history
* CIV-13463 Added judgment type

* CIV-13463 updated the label configuration

* CIV-13463 updated api test

* CIV-13463 updated api test

* CIV-13463 Fix package.json

* CIV-13463 fixed merge errors

* CIV-13463 updated api test

* CIV-13463 updated test temporarly

* CIV-13463 updated test configuration

* CIV-13463 added more logs

* CIV-13463 updated test configuration

* CIV-13463 removed unnecessary console logs

* fixes

---------

Co-authored-by: ShwetaTandel-hmcts <[email protected]>
Co-authored-by: ShwetaTandel-hmcts <[email protected]>
  • Loading branch information
3 people authored Jun 3, 2024
1 parent 2d2f3c5 commit e4e4836
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 26 deletions.
7 changes: 3 additions & 4 deletions ccd-definition/CaseEvent/User/UserEvents-JO-nonprod.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"Description": "Set aside judgment",
"DisplayOrder": 1,
"PreConditionState(s)": "All_FINAL_ORDERS_ISSUED",
"PostConditionState": "All_FINAL_ORDERS_ISSUED",
"PostConditionState": "*",
"SecurityClassification": "Public",
"ShowSummary": "Y",
"ShowEventNotes": "N",
Expand All @@ -34,7 +34,7 @@
"CallBackURLSubmittedEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/cases/callbacks/submitted",
"RetriesTimeoutAboutToStartEvent": 0,
"RetriesTimeoutURLAboutToSubmitEvent": 0,
"EventEnablingCondition": "joIsLiveJudgmentExists = \"Yes\" AND CaseAccessCategory=\"SPEC_CLAIM\""
"EventEnablingCondition": "joIsLiveJudgmentExists = \"Yes\" AND CaseAccessCategory=\"SPEC_CLAIM\" AND activeJudgment.type = \"DEFAULT_JUDGMENT\""
},
{
"CaseTypeID": "CIVIL",
Expand Down Expand Up @@ -111,7 +111,6 @@
"ShowEventNotes": "N",
"RetriesTimeoutAboutToStartEvent": 0,
"RetriesTimeoutURLAboutToSubmitEvent": 0,
"RetriesTimeoutURLSubmittedEvent": 0,
"EventEnablingCondition": "joIsLiveJudgmentExists != \"Yes\" AND CaseAccessCategory=\"SPEC_CLAIM\""
"RetriesTimeoutURLSubmittedEvent": 0
}
]
15 changes: 11 additions & 4 deletions e2e/api/steps_LRspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const eventData = {
FULL_DEFENCE_PBAv3_INTERMEDIATE_CLAIM: data.DEFENDANT_RESPONSE_INTERMEDIATE_CLAIM('FULL_DEFENCE', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
FULL_ADMISSION_PBAv3_MULTI_CLAIM: data.DEFENDANT_RESPONSE_MULTI_CLAIM('FULL_ADMISSION', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT', 'MULTI_CLAIM'),
FULL_ADMISSION_PBAv3_INTERMEDIATE_CLAIM: data.DEFENDANT_RESPONSE_INTERMEDIATE_CLAIM('FULL_ADMISSION', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
FULL_DEFENCE_PBAv3_SetAside_DJ: data.DEFENDANT_RESPONSE('FULL_DEFENCE', 'DEFAULT_JUDGEMENT_NON_DIVERGENT_SPEC'),
FULL_ADMISSION: data.DEFENDANT_RESPONSE('FULL_ADMISSION'),
FULL_ADMISSION_PBAv3: data.DEFENDANT_RESPONSE('FULL_ADMISSION', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
PART_ADMISSION_PBAv3_MULTI_CLAIM: data.DEFENDANT_RESPONSE_MULTI_CLAIM('PART_ADMISSION', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
Expand All @@ -105,6 +106,7 @@ const eventData = {
ONE_V_TWO: {
FULL_DEFENCE: data.DEFENDANT_RESPONSE_1v2('FULL_DEFENCE'),
FULL_DEFENCE_PBAv3: data.DEFENDANT_RESPONSE_1v2('FULL_DEFENCE', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
FULL_DEFENCE_PBAv3_SetAside_DJ: data.DEFENDANT_RESPONSE_1v2('FULL_DEFENCE', 'DEFAULT_JUDGEMENT_NON_DIVERGENT_SPEC'),
FULL_DEFENCE_PBAv3_MULTI_CLAIM: data.DEFENDANT_RESPONSE_MULTI_CLAIM('FULL_DEFENCE', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
FULL_DEFENCE_PBAv3_INTERMEDIATE_CLAIM: data.DEFENDANT_RESPONSE_INTERMEDIATE_CLAIM('FULL_DEFENCE', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
FULL_ADMISSION: data.DEFENDANT_RESPONSE_1v2('FULL_ADMISSION'),
Expand Down Expand Up @@ -913,7 +915,7 @@ module.exports = {

defendantResponse: async (user, response = 'FULL_DEFENCE', scenario = 'ONE_V_ONE',
expectedEvent = 'AWAITING_APPLICANT_INTENTION', carmEnabled = false,
isMintiCase = false, claimAmountMinti) => {
isMintiCase = false, claimAmountMinti, djSetaside=false) => {

await adjustCaseSubmittedDateForCarm(caseId, carmEnabled, isMintiCase);
await apiRequest.setupTokens(user);
Expand All @@ -924,6 +926,10 @@ module.exports = {
response = response+'_PBAv3';
}

if(djSetaside){
response = response+'_SetAside_DJ';
}

if(carmEnabled){
response = response+'_Mediation';
}
Expand Down Expand Up @@ -1506,17 +1512,18 @@ module.exports = {
await waitForFinishedBusinessProcess(caseId);
},

setAsideJudgment: async (user, setAsideReason, setAsideOrderType) => {
setAsideJudgment: async (user, setAsideReason, setAsideOrderType,expectedState = 'PROCEEDS_IN_HERITAGE_SYSTEM') => {
console.log(`case in All set aside judgment ${caseId}`);
console.log(`calling setup token *** setAside case ${caseId} user : ${user.email}`);
await apiRequest.setupTokens(user);

eventName = 'SET_ASIDE_JUDGMENT';
let returnedCaseData = await apiRequest.startEvent(eventName, caseId);
delete returnedCaseData['SearchCriteria'];
caseData = returnedCaseData;
assertContainsPopulatedFields(returnedCaseData);
await validateEventPages(data.SET_ASIDE_JUDGMENT(setAsideReason, setAsideOrderType));
await assertSubmittedEvent('All_FINAL_ORDERS_ISSUED', {
console.log(`setAside case ${caseId} user : ${user.email}`);
await assertSubmittedEvent(expectedState, {
header: '',
body: ''
}, true);
Expand Down
6 changes: 5 additions & 1 deletion e2e/fixtures/events/defendantResponseSpec1v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ module.exports = {
],
value: listElement(config.defendantSelectedCourt)
},
reasonForHearingAtSpecificCourt: 'Reasons'
reasonForHearingAtSpecificCourt: 'Reasons',
caseLocation: {
region: '2',
baseLocation: '420219'
}
},
respondent1DQRemoteHearingLRspec: {
remoteHearingRequested: 'Yes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ async function prepareClaimSpecRecordJudgment(api_spec){
await api_spec.recordJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_IMMEDIATELY');
}

Scenario('Record Judgment Spec claim 1v1 with set aside (Judge Order - pay instalments edit to Pay Immediately)', async ({I, api_spec}) => {
Scenario('SetAside Default Judgment after judgment error - Spec claim 1v1 - Case taken offline', async ({I, api_spec}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await prepareClaimSpecRecordJudgment(api_spec);
await api_spec.editJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_IN_INSTALMENTS');
await api_spec.createClaimWithRepresentedRespondent(config.applicantSolicitorUser, mpScenario);
await api_spec.amendRespondent1ResponseDeadline(config.systemupdate);
await api_spec.defaultJudgmentSpec(config.applicantSolicitorUser, mpScenario, false);
console.log('--setAsideJudgment--');
await api_spec.setAsideJudgment(caseWorkerUser, 'JUDGMENT_ERROR');
console.log(` user : ${caseWorkerUser.email} : config.testEarlyAdopterCourts : ${config.testEarlyAdopterCourts}`);
await api_spec.setAsideJudgment(config.hearingCenterAdminWithRegionId2, 'JUDGMENT_ERROR','ORDER_AFTER_DEFENCE','PROCEEDS_IN_HERITAGE_SYSTEM');
}
});

Expand All @@ -54,6 +56,27 @@ Scenario('Refer To Judge Spec claim 1v1 Defence Received In Time', async ({I, ap
}
});

Scenario('SetAside Default Judgment Spec claim 1v1 - Record new judgment after hearing', async ({I, api_spec}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await api_spec.createClaimWithRepresentedRespondent(config.applicantSolicitorUser, mpScenario);
await api_spec.amendRespondent1ResponseDeadline(config.systemupdate);
await api_spec.defaultJudgmentSpec(config.applicantSolicitorUser, mpScenario, false);
await api_spec.setAsideJudgment(config.hearingCenterAdminWithRegionId2, 'JUDGE_ORDER','ORDER_AFTER_APPLICATION', 'AWAITING_RESPONDENT_ACKNOWLEDGEMENT');
console.log('--defendantResponse--');
await api_spec.defendantResponse(config.defendantSolicitorUser);
console.log('--claimantResponse--');
await api_spec.claimantResponse(config.applicantSolicitorUser, 'FULL_DEFENCE', mpScenario,
'AWAITING_APPLICANT_INTENTION');
console.log('--sdo--');
await api_spec.createSDO(judgeUser, 'CREATE_FAST_NO_SUM');
console.log('--createFinalOrderJO--');
await api_spec.createFinalOrderJO(judgeUser, 'FREE_FORM_ORDER');
console.log('--recordJudgment--');
await api_spec.recordJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_IMMEDIATELY');
await api_spec.editJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_IN_INSTALMENTS');
}
});

AfterSuite(async ({api_spec}) => {
await api_spec.cleanUp();
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const caseWorkerUser = config.testEarlyAdopterCourts ? config.hearingCenterAdmin
// const caseWorkerUser = config.tribunalCaseworkerWithRegionId1Local;

//To reduce time of API test, temporarly stop running these tests. These test will modified to run in nightly build
Feature('Record Judgment 1v2 API test spec @api-spec-1v2 @api-jo @api-nightly-prod');
Feature('Record Judgment 1v2 API test spec @api-spec-1v2 @api-jo @api-nonprod-test');

async function prepareClaimSpecFinalOrderDJ(api_spec){
async function prepareClaimSpecFinalOrderJO(api_spec){
console.log('--createClaimWithRepresentedRespondent--');
await api_spec.createClaimWithRepresentedRespondent(config.applicantSolicitorUser, 'ONE_V_TWO_SAME_SOL');
console.log('--defendantResponse--');
Expand All @@ -25,32 +25,45 @@ async function prepareClaimSpecFinalOrderDJ(api_spec){
await api_spec.createFinalOrderJO(judgeUser, 'FREE_FORM_ORDER');

}
Scenario('Record Judgment with set aside Spec claim 1v2 with NO RTL Order - Set Aside After Order', async ({I, api_spec}) => {
Scenario('Default judgment Spec claim 1v2 - Set Aside After Order - Record new judgment', async ({I, api_spec}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await prepareClaimSpecFinalOrderDJ(api_spec);
await api_spec.createClaimWithRepresentedRespondent(config.applicantSolicitorUser, 'ONE_V_TWO_SAME_SOL', false );
await api_spec.amendRespondent1ResponseDeadline(config.systemupdate);
await api_spec.defaultJudgmentSpec(config.applicantSolicitorUser, mpScenario, false);
console.log('--setAsideJudgment--');
await api_spec.setAsideJudgment(config.hearingCenterAdminWithRegionId2, 'JUDGE_ORDER', 'ORDER_AFTER_APPLICATION','AWAITING_RESPONDENT_ACKNOWLEDGEMENT');
console.log('--defendantResponse--');
await api_spec.defendantResponse(config.defendantSolicitorUser, 'FULL_DEFENCE', mpScenario, 'AWAITING_APPLICANT_INTENTION', false,
false,'00000',true);
console.log('--claimantResponse--');
await api_spec.claimantResponse(config.applicantSolicitorUser, 'FULL_DEFENCE', mpScenario,
'JUDICIAL_REFERRAL');
console.log('--sdo--');
await api_spec.createSDO(judgeUser, 'CREATE_FAST_NO_SUM');
console.log('--createFinalOrderJO--');
await api_spec.createFinalOrderJO(judgeUser, 'FREE_FORM_ORDER');
console.log('--recordJudgment--');
await api_spec.recordJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_IMMEDIATELY');
await api_spec.editJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_BY_DATE');
console.log('--setAsideJudgment--');
await api_spec.setAsideJudgment(caseWorkerUser, 'JUDGE_ORDER', 'ORDER_AFTER_APPLICATION');
console.log('--markJudgmentPaid--');
await api_spec.markJudgmentPaid(config.applicantSolicitorUser);
}
});

Scenario('Record Judgment with set aside Spec claim 1v2 with NO RTL Order after defence - Set Aside after defence', async ({I, api_spec}) => {
Scenario('Default judgment Spec claim 1v2 - Set Aside after defence - Case taken offline', async ({I, api_spec}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await prepareClaimSpecFinalOrderDJ(api_spec);
console.log('--recordJudgment--');
await api_spec.recordJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_IMMEDIATELY');
await api_spec.editJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_BY_DATE');
await api_spec.createClaimWithRepresentedRespondent(config.applicantSolicitorUser, mpScenario, false );
await api_spec.amendRespondent1ResponseDeadline(config.systemupdate);
await api_spec.defaultJudgmentSpec(config.applicantSolicitorUser, mpScenario, false);
console.log('--setAsideJudgment--');
await api_spec.setAsideJudgment(caseWorkerUser, 'JUDGE_ORDER', 'ORDER_AFTER_DEFENCE');
await api_spec.setAsideJudgment(config.hearingCenterAdminWithRegionId2, 'JUDGE_ORDER', 'ORDER_AFTER_DEFENCE', 'PROCEEDS_IN_HERITAGE_SYSTEM');
}
});

Scenario('Record Judgment with mark judgment paid Spec claim 1v2', async ({I, api_spec}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
console.log('--createClaimWithRepresentedRespondent--');
await prepareClaimSpecFinalOrderDJ(api_spec);
await prepareClaimSpecFinalOrderJO(api_spec);
console.log('--recordJudgment--');
await api_spec.recordJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_IN_INSTALMENTS');
await api_spec.editJudgment(caseWorkerUser, mpScenario, 'DETERMINATION_OF_MEANS', 'PAY_BY_DATE');
Expand Down

0 comments on commit e4e4836

Please sign in to comment.