-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DTSCCI-1313 Create Step Methods For Notify Claim Details Event (#5288)
* refactoring notify claim COS fragment * adding notify claim details COS fragment, refactoring usage in files and working on POM * adding submit pages for all scenarios * refactoring the usage of COS fragments for notify-claim and notify-claim details * minor changes to the steps created for claim details and steps * update coding standards of page objects * update selector on page objects --------- Co-authored-by: kdaHMCTS <[email protected]> Co-authored-by: kdaHMCTS <[email protected]>
- Loading branch information
1 parent
cb45683
commit 451a526
Showing
25 changed files
with
595 additions
and
114 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
File renamed without changes.
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
119 changes: 119 additions & 0 deletions
119
...te-of-service-notify-claim-details/certificate-of-service-notify-claim-details-content.ts
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,119 @@ | ||
import { Party } from '../../../../models/partys'; | ||
import StringHelper from '../../../../helpers/string-helper'; | ||
|
||
export const heading = (defendantParty: Party) => `Certificate of Service [${defendantParty.key}]`; | ||
|
||
export const inputs = { | ||
dateOfService: { | ||
label: 'On what day did you serve?', | ||
}, | ||
dateDeemedServed: { | ||
label: 'The date of service is', | ||
}, | ||
documentsServed: { | ||
label: 'What documents did you serve?', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosServedDocumentFiles`, | ||
}, | ||
documentsServedLocation: { | ||
label: 'Where did you serve the documunts', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipientServeLocation`, | ||
}, | ||
notifyClaimRecipient: { | ||
label: 'Who did you serve the claim to?', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipient`, | ||
}, | ||
statementOfTruth: { | ||
name: { | ||
label: 'Your name', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosSender`, | ||
}, | ||
firm: { | ||
label: 'Your firm', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosSenderFirm`, | ||
}, | ||
}, | ||
evidenceDocument: { | ||
label: 'Supporting evidence', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosEvidenceDocument_value`, | ||
}, | ||
}; | ||
|
||
export const dropdowns = { | ||
serveType: { | ||
label: 'How did you serve the documents?', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipientServeType`, | ||
options: [ | ||
'Personally handed it to or left it with', | ||
'Delivered to or left at permitted place', | ||
'Sent by first class post or another service which delivers on the next business day', | ||
'Other means permitted by the court', | ||
], | ||
}, | ||
locationType: { | ||
label: 'Select the type of location where you served the documents', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipientServeLocationType`, | ||
options: [ | ||
'Usual Residence', | ||
'Last known residence', | ||
'Place of business of the partnership/company/corporation within the jurisdiction with a connection to the claim', | ||
'Principal office of the company', | ||
'Principal office of the coropration', | ||
'Principal office of the partnership', | ||
'Last known principal place of business', | ||
'Principal place of business', | ||
'Place of business', | ||
'Email', | ||
'Other', | ||
], | ||
}, | ||
}; | ||
|
||
export const radioButtons = { | ||
docsServed: { | ||
label: 'The location where you served the documents was the:', | ||
litigationFriend: { | ||
label: "litigation friend's", | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipientServeLocationOwnerType-FRIEND`, | ||
}, | ||
solicitor: { | ||
label: "solicitor's", | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipientServeLocationOwnerType-SOLICITOR`, | ||
}, | ||
defendant: { | ||
label: "defendant's", | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipientServeLocationOwnerType-DEFENDANT`, | ||
}, | ||
claimant: { | ||
label: "claimant's", | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosRecipientServeLocationOwnerType-CLAIMANT`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const checkboxes = { | ||
signedTrue: { | ||
label: 'I believe that the facts stated in the certificate are true', | ||
selector: (defendantParty: Party) => | ||
`#cosNotifyClaimDetails${StringHelper.capitalise(defendantParty.number.toString())}_cosUISenderStatementOfTruthLabel-CERTIFIED`, | ||
}, | ||
}; | ||
|
||
export const buttons = { | ||
addNewSupportingEvidence: { | ||
title: 'Add new', | ||
selector: (defendantParty: Party) => | ||
`div[id='cosNotifyClaimDetails${defendantParty.number}_cosEvidenceDocument'] button[class='button write-collection-add-item__top']`, | ||
}, | ||
}; |
108 changes: 108 additions & 0 deletions
108
...e-of-service-notify-claim-details/certificate-of-service-notify-claim-details-fragment.ts
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,108 @@ | ||
import { Page } from 'playwright-core'; | ||
import BasePage from '../../../../base/base-page'; | ||
import filePaths from '../../../../config/file-paths'; | ||
import { AllMethodsStep } from '../../../../decorators/test-steps'; | ||
import DateHelper from '../../../../helpers/date-helper'; | ||
import ExuiPage from '../../exui-page/exui-page'; | ||
import { | ||
heading, | ||
inputs, | ||
buttons, | ||
checkboxes, | ||
dropdowns, | ||
radioButtons, | ||
} from './certificate-of-service-notify-claim-details-content'; | ||
import { Party } from '../../../../models/partys'; | ||
import DateFragment from '../date/date-fragment'; | ||
|
||
@AllMethodsStep() | ||
export default class CertificateOfServiceNotifyClaimDetailsFragment extends ExuiPage(BasePage) { | ||
private dateFragment: DateFragment; | ||
private defendantParty: Party; | ||
|
||
constructor(page: Page, defendantParty: Party) { | ||
super(page); | ||
this.dateFragment = new DateFragment(page); | ||
this.defendantParty = defendantParty; | ||
} | ||
|
||
async verifyContent() { | ||
await super.runVerifications( | ||
[ | ||
super.expectHeading(heading(this.defendantParty)), | ||
super.expectText(inputs.dateDeemedServed.label), | ||
super.expectText(inputs.dateDeemedServed.label), | ||
super.expectLabel(inputs.statementOfTruth.firm.label), | ||
super.expectLabel(inputs.documentsServed.label), | ||
super.expectLabel(inputs.statementOfTruth.name.label), | ||
super.expectLabel(inputs.notifyClaimRecipient.label), | ||
super.expectLabel(dropdowns.locationType.label), | ||
super.expectLabel(dropdowns.serveType.label), | ||
super.expectLabel(radioButtons.docsServed.litigationFriend.label), | ||
super.expectLabel(radioButtons.docsServed.defendant.label), | ||
super.expectLabel(radioButtons.docsServed.litigationFriend.label), | ||
super.expectLabel(radioButtons.docsServed.solicitor.label), | ||
super.expectText(checkboxes.signedTrue.label, { first: true }), | ||
], | ||
{ runAxe: false }, | ||
); | ||
} | ||
|
||
async fillCertificateOfService() { | ||
const dateDeemedServed = DateHelper.getToday(); | ||
const dateOfService = DateHelper.addToToday({ | ||
days: 2, | ||
workingDay: true, | ||
addDayAfter4pm: true, | ||
}); | ||
|
||
await this.dateFragment.enterDate(dateDeemedServed, 'cosDateOfServiceForDefendant'); | ||
await this.dateFragment.enterDate(dateOfService, 'cosDateDeemedServedForDefendant'); | ||
|
||
await super.inputText( | ||
`Test Documents ${this.defendantParty.number}`, | ||
inputs.documentsServed.selector(this.defendantParty), | ||
); | ||
await super.inputText( | ||
`Defendant ${this.defendantParty.number}`, | ||
inputs.notifyClaimRecipient.selector(this.defendantParty), | ||
); | ||
await super.selectFromDropdown( | ||
dropdowns.locationType.options[this.defendantParty.number - 1], | ||
dropdowns.locationType.selector(this.defendantParty), | ||
); | ||
await super.inputText( | ||
`Test Address ${this.defendantParty.number}`, | ||
inputs.documentsServedLocation.selector(this.defendantParty), | ||
); | ||
await super.clickBySelector(radioButtons.docsServed.claimant.selector(this.defendantParty)); | ||
await super.selectFromDropdown( | ||
dropdowns.serveType.options[this.defendantParty.number - 1], | ||
dropdowns.serveType.selector(this.defendantParty), | ||
); | ||
} | ||
|
||
async uploadSupportingEvidence() { | ||
await super.clickBySelector(buttons.addNewSupportingEvidence.selector(this.defendantParty)); | ||
await super.retryUploadFile( | ||
filePaths.testPdfFile, | ||
inputs.evidenceDocument.selector(this.defendantParty), | ||
); | ||
} | ||
|
||
async fillStatementOfTruth() { | ||
await super.inputText( | ||
`Name ${this.defendantParty.number}`, | ||
inputs.statementOfTruth.name.selector(this.defendantParty), | ||
); | ||
await super.inputText( | ||
`Law firm ${this.defendantParty.number}`, | ||
inputs.statementOfTruth.firm.selector(this.defendantParty), | ||
); | ||
await super.clickBySelector(checkboxes.signedTrue.selector(this.defendantParty)); | ||
} | ||
|
||
async submit() { | ||
throw new Error('Method not implemented.'); | ||
} | ||
} |
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
22 changes: 14 additions & 8 deletions
22
...e-of-service-1-notify-claim-details/certificate-of-service-1-notify-claim-details-page.ts
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.