generated from hmcts/ccd-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add bundle tests to playwright framework * migrate CFV tests to playwright * remove unused variables * remove commented code * refactored code * add claimant bundle test * case link tests * Increase workers * Increase worker count * comment unexisting step * revert citizen ui code * fix falky test * fix Nightly (#422) * fix dependency * RET-5556 * add case flag scripts * notification * send notification * fix ET3 tests * fix jurisdiction event * Refactor & tests for casesubmissions * add logs for date * amend idam endpoint --------- Co-authored-by: gokul-sol <[email protected]> Co-authored-by: Nilamkanojiya <[email protected]>
- Loading branch information
1 parent
f812669
commit b2d235f
Showing
16 changed files
with
520 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"postcode": "LS9 9HE", | ||
"addressOption": "3, Skelton Avenue, Leeds, LS9 9HE", | ||
"workPostcode": "LS7 4QE", | ||
"selectedWorkAddress": "7, Valley Gardens, Leeds, LS7 4QE", | ||
"firstLineOfAddress": "7, Valley Gardens", | ||
"scotWorkPostcode": "EH45 9BU", | ||
"scotSelectedWorkAddress": "Unit 4, Cherry Court, Cavalry Park, Peebles, EH45 9BU", | ||
"scotFirstLineOfAddress": "Unit 4, Cherry Court, Cavalry Park" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import { Page } from '@playwright/test'; | ||
import { BasePage } from './basePage'; | ||
|
||
export class CaseOverviewPage extends BasePage{ | ||
|
||
applicationTab = '#mat-tab-label-0-9'; | ||
applicationDropdown = '#tseAdminSelectApplication'; | ||
decisionForm = '#caseEditForm'; | ||
notificationTitleDecisionPage = '#tseAdminEnterNotificationTitle'; | ||
decisionGranted = '#tseAdminDecision-Granted'; | ||
decisionGrantedInPart = '#tseAdminDecision-Granted in part'; | ||
decisionRefused = '#tseAdminDecision-Refused'; | ||
otherDecision = '#tseAdminDecision-Other'; | ||
judgementDecisionType = 'tseAdminTypeOfDecision-Judgment'; | ||
caseManagementDecisionType = '[id="tseAdminTypeOfDecision-Case management order"]'; | ||
additionalDecisionInformation = '#tseAdminAdditionalInformation'; | ||
madeByLegalOfficer = '[id="tseAdminDecisionMadeBy-Legal officer"]'; | ||
isResponseRequired_No = '#tseAdminIsResponseRequired-No'; | ||
madeByAJudge = '#tseAdminDecisionMadeBy-Judge'; | ||
bothParties = '[id="tseAdminSelectPartyNotify-Both parties"]'; | ||
claimantOnly = '[id="tseAdminSelectPartyNotify-Claimant only"]'; | ||
respondentOnly = '[id="tseAdminSelectPartyNotify-Respondent only"]'; | ||
fullNameDecisionMaker = '#tseAdminDecisionMadeByFullName'; | ||
confirmSubmission = '#confirmation-body'; | ||
returnToCaseOverview = '//button[@class="button"]'; | ||
|
||
async recordAdecisionOnAcase(submissionReference: string, appOption: string, decision: string, decisionType: string, decisionMaker: string, respondingParties: string) { | ||
const recordDecisionLink = `/cases/case-details/${submissionReference}/trigger/tseAdmin/tseAdmin1`; | ||
await this.page.click(this.applicationTab); | ||
await this.page.click(`[href="${recordDecisionLink}"]`); | ||
await this.page.selectOption(this.applicationDropdown, appOption); | ||
await this.page.click('text=Continue'); | ||
await this.page.waitForSelector(this.decisionForm, { timeout: 15000 }); | ||
await this.page.fill(this.notificationTitleDecisionPage, 'adding a decision'); | ||
|
||
switch (decision) { | ||
case 'granted': | ||
await this.page.check(this.decisionGranted); | ||
break; | ||
case 'granted in part': | ||
await this.page.check(this.decisionGrantedInPart); | ||
break; | ||
case 'refused': | ||
await this.page.check(this.decisionRefused); | ||
break; | ||
case 'other decision': | ||
await this.page.check(this.otherDecision); | ||
break; | ||
default: | ||
throw new Error('... decision option is invalid'); | ||
} | ||
|
||
switch (decisionType) { | ||
case 'judgment': | ||
await this.page.check(this.judgementDecisionType); | ||
break; | ||
case 'cmo-responding': | ||
await this.page.waitForTimeout(2000); | ||
await this.page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)); | ||
await this.page.check(this.caseManagementDecisionType); | ||
await this.page.check(this.isResponseRequired_No); | ||
break; | ||
case 'cmo-no-response': | ||
await this.page.waitForTimeout(2000); | ||
await this.page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)); | ||
await this.page.check(this.caseManagementDecisionType); | ||
await this.page.check(this.isResponseRequired_No); | ||
break; | ||
default: | ||
throw new Error('... decision type is invalid'); | ||
} | ||
|
||
await this.page.fill(this.additionalDecisionInformation, '...test'); | ||
|
||
switch (decisionMaker) { | ||
case 'legal officer': | ||
await this.page.check(this.madeByLegalOfficer); | ||
break; | ||
case 'judge': | ||
await this.page.check(this.madeByAJudge); | ||
break; | ||
default: | ||
throw new Error('... please select who made the decision'); | ||
} | ||
|
||
await this.page.fill(this.fullNameDecisionMaker, 'ET Tester'); | ||
|
||
switch (respondingParties) { | ||
case 'both': | ||
await this.page.check(this.bothParties); | ||
break; | ||
case 'claimant only': | ||
await this.page.check(this.claimantOnly); | ||
break; | ||
case 'respondent only': | ||
await this.page.check(this.respondentOnly); | ||
break; | ||
default: | ||
throw new Error('... please party to respond'); | ||
} | ||
|
||
await this.page.click('text=Continue'); | ||
await this.page.waitForSelector('.form-table', { timeout: 15000 }); | ||
await this.page.waitForSelector('text=Check your answers'); | ||
await this.page.click('text=Submit'); | ||
await this.page.waitForSelector(this.confirmSubmission, { timeout: 15000 }); | ||
await this.page.waitForSelector('text=What happens next'); | ||
await this.page.click(this.returnToCaseOverview); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.