Skip to content

Commit

Permalink
CIV-6416 evidence-upload-e2e (#2023)
Browse files Browse the repository at this point in the history
* Feat/civ 5977 evidence upload (#1701)

* evidence upload screens

* EVIDENCE upload screen 1 (multiselect)

* EVIDENCE upload screen 2 (documents)

* Evidences screens page 2

* evidence upload small claims

* evidence upload small claims

* Refactored config for evidence upload screens, due to issues with populating change your answers

* updated permissions

* Made text field into dynamiclist

* datefield to trigger notifications

* removed dynamiclists

* Text style changes

* updated access

* evidence upload config for respondents

* evidence upload config for other parties

* evidence upload config for other parties

Updated permissions to use access-profiles

changed Authorities to Authorities and Costs"

* spelling

* update to mid event callback names
some checkstyle updates

Co-authored-by: Mark Drummond <[email protected]>
Co-authored-by: drummondjm <[email protected]>

* Evidence upload notification changes

* camunda changes for respondent solicitors

* Feat/civ 5977 (#1741)

* refactoring evidence upload

* Marker commit

Co-authored-by: Filippo Possenti <[email protected]>

* Removed handler for evidence other party
Further refactoring to simplify

* Removed handler for evidence other party
Further refactoring to simplify

* remove camunda process for notification (#1756)

* remove camunda process for notification

* remove additional profile

* Added condition to enable evidence upload events

* rebasing

* Feat/6208 mp evidence upload (#1849)

* multiparty for evidence upload

* initial

* multiparty evidence upload

* checkstyle

* Update values.preview.template.yaml

* Update values.preview.template.yaml

to test

* Update UserEvents-SDO-nonprod.json

* testing

* Revert "testing"

This reverts commit 43273c1.

* testing

* testing

* testing

* Revert "testing"

This reverts commit 80eefbd.

* Revert "testing"

This reverts commit 13dbe58.

* Revert "testing"

This reverts commit 5498c74.

* fixed PR pointing

* Fixed show conditions

* Fixed show conditions

* removal of testing changes

* evidence upload e2e pages

* uploaded e2e with EU passing

* moved evidence upload to damages folder

* created own scenario for evidence upload

* Update 1v2CreateClaim-LRspec_DiffSol_test.js

* expected text fix

* added defendant upload evidence test

* commit for testing on pipeline purpose

* commit for testing on pipeline purpose 2

* updated defendant evidence upload event

* updated defendant evidence upload event 2

* updated defendant evidence upload event 3

* fixed url

* added if conditions for url

* fixed id issues

* removed small claim id

* fixed some id and tags

* reverted package.json back to master

---------

Co-authored-by: filippo-possenti-version1 <[email protected]>
Co-authored-by: Mark Drummond <[email protected]>
Co-authored-by: drummondjm <[email protected]>
Co-authored-by: Bhagyashree Sharma <[email protected]>
Co-authored-by: bhagyashreesharma90 <[email protected]>
Co-authored-by: Filippo Possenti <[email protected]>
Co-authored-by: bhagyashreesharma90 <[email protected]>
Co-authored-by: zakishaik <[email protected]>
Co-authored-by: mounikahmcts <[email protected]>
  • Loading branch information
10 people authored Mar 16, 2023
1 parent d6c8ac0 commit 5bfc29a
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 0 deletions.
193 changes: 193 additions & 0 deletions e2e/pages/evidenceUpload/uploadDocument.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
const {I} = inject();
const config = require('../../config.js');

module.exports = {

fields: {
witnessSelectionEvidence: {
id: '#witnessSelectionEvidence',
options: {
witnessStatement: '#witnessSelectionEvidence-WITNESS_STATEMENT'
}
},

witnessSelectionEvidenceRes: {
id: '#witnessSelectionEvidenceRes',
options: {
witnessStatement: '#witnessSelectionEvidenceRes-WITNESS_STATEMENT'
}
},

expertSelectionEvidence:{
id: '#expertSelectionEvidence',
options: {
expertReport: '#expertSelectionEvidence-EXPERT_REPORT'
}
},

expertSelectionEvidenceRes:{
id: '#expertSelectionEvidenceRes',
options: {
expertReport: '#expertSelectionEvidenceRes-EXPERT_REPORT'
}
},

trialSelectionEvidence:{
id: '#trialSelectionEvidence',
options: {
authorities: '#trialSelectionEvidence-AUTHORITIES'
}
},

trialSelectionEvidenceRes:{
id: '#trialSelectionEvidenceRes',
options: {
authorities: '#trialSelectionEvidenceRes-AUTHORITIES'
}
},

documentWitnessStatement:{
id: '#documentWitnessStatement',
button: '#documentWitnessStatement > div:nth-child(1) > button:nth-child(2)',
name: '#documentWitnessStatement_0_witnessOptionName',
day: '#witnessOptionUploadDate-day',
month: '#witnessOptionUploadDate-month',
year: '#witnessOptionUploadDate-year',
document: '#documentWitnessStatement_0_witnessOptionDocument'
},

documentWitnessStatementRes:{
id: '#documentWitnessStatementRes',
button: '#documentWitnessStatementRes > div:nth-child(1) > button:nth-child(2)',
name: '#documentWitnessStatementRes_0_witnessOptionName',
day: '#witnessOptionUploadDate-day',
month: '#witnessOptionUploadDate-month',
year: '#witnessOptionUploadDate-year',
document: '#documentWitnessStatementRes_0_witnessOptionDocument'
},

documentExpertReport:{
id: '#documentExpertReport',
button: '#documentExpertReport > div:nth-child(1) > button:nth-child(2)',
name: '#documentExpertReport_0_expertOptionName',
expertise: '#documentExpertReport_0_expertOptionExpertise',
day: '#expertOptionUploadDate-day',
month: '#expertOptionUploadDate-month',
year: '#expertOptionUploadDate-year',
document: '#documentExpertReport_0_expertDocument'
},

documentExpertReportRes:{
id: '#documentExpertReportRes',
button: '#documentExpertReportRes > div:nth-child(1) > button:nth-child(2)',
name: '#documentExpertReportRes_0_expertOptionName',
expertise: '#documentExpertReportRes_0_expertOptionExpertise',
day: '#expertOptionUploadDate-day',
month: '#expertOptionUploadDate-month',
year: '#expertOptionUploadDate-year',
document: '#documentExpertReportRes_0_expertDocument'
},

documentAuthorities:{
id: '#documentAuthorities',
button: '#documentAuthorities > div:nth-child(1) > button:nth-child(2)',
document: '#documentAuthorities_0_documentUpload'
},

documentAuthoritiesRes:{
id: '#documentAuthoritiesRes',
button: '#documentAuthoritiesRes > div:nth-child(1) > button:nth-child(2)',
document: '#documentAuthoritiesRes_0_documentUpload'
}
},

async selectType(defendant){
if(defendant) {
await within(this.fields.witnessSelectionEvidenceRes.id, () => {
I.click(this.fields.witnessSelectionEvidenceRes.options.witnessStatement);
});
await within(this.fields.expertSelectionEvidenceRes.id, () => {
I.click(this.fields.expertSelectionEvidenceRes.options.expertReport);
});
await within(this.fields.trialSelectionEvidenceRes.id, () => {
I.click(this.fields.trialSelectionEvidenceRes.options.authorities);
});
}
else {
await within(this.fields.witnessSelectionEvidence.id, () => {
I.click(this.fields.witnessSelectionEvidence.options.witnessStatement);
});
await within(this.fields.expertSelectionEvidence.id, () => {
I.click(this.fields.expertSelectionEvidence.options.expertReport);
});
await within(this.fields.trialSelectionEvidence.id, () => {
I.click(this.fields.trialSelectionEvidence.options.authorities);
});
}
await I.clickContinue();
},

async uploadYourDocument(file, defendant){
await I.waitForText('Upload Your Documents');
if(defendant) {
await within(this.fields.documentWitnessStatementRes.id, () => {
I.click(this.fields.documentWitnessStatementRes.button);
I.fillField(this.fields.documentWitnessStatementRes.name, 'test name');
I.fillField(this.fields.documentWitnessStatementRes.day, '1');
I.fillField(this.fields.documentWitnessStatementRes.month, '1');
I.fillField(this.fields.documentWitnessStatementRes.year, '2022');
I.attachFile(this.fields.documentWitnessStatementRes.document, file);
});
await within(this.fields.documentExpertReportRes.id, () => {
I.click(this.fields.documentExpertReportRes.button);
I.fillField(this.fields.documentExpertReportRes.name, 'test name');
I.fillField(this.fields.documentExpertReportRes.expertise, 'test expertise');
I.fillField(this.fields.documentExpertReportRes.day, '1');
I.fillField(this.fields.documentExpertReportRes.month, '1');
I.fillField(this.fields.documentExpertReportRes.year, '2022');
I.attachFile(this.fields.documentExpertReportRes.document, file);
});
await within(this.fields.documentAuthoritiesRes.id, () => {
I.click(this.fields.documentAuthoritiesRes.button);
I.attachFile(this.fields.documentAuthoritiesRes.document, file);
});
}
else {
await within(this.fields.documentWitnessStatement.id, () => {
I.click(this.fields.documentWitnessStatement.button);
I.fillField(this.fields.documentWitnessStatement.name, 'test name');
I.fillField(this.fields.documentWitnessStatement.day, '1');
I.fillField(this.fields.documentWitnessStatement.month, '1');
I.fillField(this.fields.documentWitnessStatement.year, '2022');
I.attachFile(this.fields.documentWitnessStatement.document, file);
});
await within(this.fields.documentExpertReport.id, () => {
I.click(this.fields.documentExpertReport.button);
I.fillField(this.fields.documentExpertReport.name, 'test name');
I.fillField(this.fields.documentExpertReport.expertise, 'test expertise');
I.fillField(this.fields.documentExpertReport.day, '1');
I.fillField(this.fields.documentExpertReport.month, '1');
I.fillField(this.fields.documentExpertReport.year, '2022');
I.attachFile(this.fields.documentExpertReport.document, file);
});
await within(this.fields.documentAuthorities.id, () => {
I.click(this.fields.documentAuthorities.button);
I.attachFile(this.fields.documentAuthorities.document, file);
});
}
await I.clickContinue();
},

async uploadADocument(caseId, defendant) {
await I.amOnPage(config.url.manageCase + '/cases/case-details/' + caseId);
await I.waitForText('Summary');
if (defendant) {
await I.amOnPage(config.url.manageCase + '/cases/case-details/' + caseId + '/trigger/EVIDENCE_UPLOAD_RESPONDENT/EVIDENCE_UPLOAD_RESPONDENTEvidenceUpload');
}
else {
await I.amOnPage(config.url.manageCase + '/cases/case-details/' + caseId + '/trigger/EVIDENCE_UPLOAD_APPLICANT/EVIDENCE_UPLOAD_APPLICANTEvidenceUpload');
}
await I.waitForText('Upload Your Documents');
await I.click('Continue');
}
};
11 changes: 11 additions & 0 deletions e2e/steps_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const hearingScheduledMoreInfoPage = require('./pages/caseProgression/hearingSch

const selectLitigationFriendPage = require('./pages/selectLitigationFriend/selectLitigationFriend.page.ts');
const unspecifiedDefaultJudmentPage = require('./pages/defaultJudgment/requestDefaultJudgmentforUnspecifiedClaims');
const unspecifiedEvidenceUpload = require('./pages/evidenceUpload/uploadDocument');
const specifiedDefaultJudmentPage = require('./pages/defaultJudgment/requestDefaultJudgmentforSpecifiedClaims');

const createCaseFlagPage = require('./pages/caseFlags/createCaseFlags.page');
Expand Down Expand Up @@ -854,6 +855,16 @@ module.exports = function () {
]);
},

async evidenceUpload(caseId, defendant) {
defendant ? eventName = 'EVIDENCE_UPLOAD_RESPONDENT' : eventName = 'EVIDENCE_UPLOAD_APPLICANT';
await this.triggerStepsWithScreenshot([
() => unspecifiedEvidenceUpload.uploadADocument(caseId, defendant),
() => unspecifiedEvidenceUpload.selectType(defendant),
() => unspecifiedEvidenceUpload.uploadYourDocument(TEST_FILE_PATH, defendant),
() => event.submit('Submit', 'Documents uploaded')
]);
},

async navigateToCaseDetails(caseNumber) {
await this.retryUntilExists(async () => {
const normalizedCaseId = caseNumber.toString().replace(/\D/g, '');
Expand Down
14 changes: 14 additions & 0 deletions e2e/tests/ui_tests/damages/1v2CreateClaim_DiffSol_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@ Scenario('Judge triggers SDO', async ({I}) => {
await I.initiateSDO('yes', 'yes', null, null);
}).retry(3);

Scenario('Claimant solicitor uploads evidence', async ({I}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await I.login(config.applicantSolicitorUser);
await I.evidenceUpload(caseId(), false);
}
}).retry(3);

Scenario('Defendant solicitor uploads evidence', async ({I}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await I.login(config.defendantSolicitorUser);
await I.evidenceUpload(caseId(), true);
}
}).retry(3);

AfterSuite(async () => {
await unAssignAllUsers();
});
14 changes: 14 additions & 0 deletions e2e/tests/ui_tests/lrspec/1v2CreateClaim-LRspec_DiffSol_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ Scenario('Judge triggers SDO', async ({LRspec}) => {
await LRspec.initiateSDO('yes', 'yes', null, null);
}).retry(3);

Scenario('Claimant solicitor uploads evidence', async ({LRspec}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await LRspec.login(config.applicantSolicitorUser);
await LRspec.evidenceUpload(caseId(), false);
}
}).retry(3);

Scenario('Defendant solicitor uploads evidence', async ({LRspec}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
await LRspec.login(config.defendantSolicitorUser);
await LRspec.evidenceUpload(caseId(), true);
}
}).retry(3);

// ToDo: Refactor to trigger create case flags event
Scenario.skip('Add case flags - validateCaseFlags', async ({LRspec}) => {
await LRspec.login(config.adminUser);
Expand Down

0 comments on commit 5bfc29a

Please sign in to comment.