Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTSCCI-1503 #5310

Merged
merged 12 commits into from
Feb 6, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ import UploadParticularsOfClaimPage from './unspec/upload-particulars-of-claim/u
import SecondClaimantLitigationFriendPage from './unspec/second-claimant-litigation-friend/second-claimant-litigation-friend-page.ts';
import SecondDefendantSolicitorOrganisationPage from './unspec/second-defendant-solicitor-organisation/second-defendant-solicitor-organisation-page.ts';
import LitigationFriendFragment from '../../fragments/litigation-friend/litigation-friend-fragment.ts';
import BreakDownInterestPage from './lr-spec/break-down-interest/break-down-interest-page.ts';
import ClaimInterestOptionsPage from './lr-spec/claim-interest-options/claim-interest-options-page.ts';
import InterestClaimFromPage from './lr-spec/interest-claim-from/interest-claim-from-page.ts';
import InterestClaimUntilPage from './lr-spec/interest-claim-until/interest-claim-until-page.ts';
import InterestFromSpecificDate from './lr-spec/interest-from-specific-date/interest-from-specific-date-page.ts';
import SameRateInterestSelectionPage from './lr-spec/same-rate-interest-selection/same-rate-interest-selection-page.ts';

export default class CreateClaimPageFactory extends BasePageFactory {
get caseFilterPage() {
Expand Down Expand Up @@ -344,6 +350,30 @@ export default class CreateClaimPageFactory extends BasePageFactory {
return new ClaimInterestPage(this.page);
}

get breakDownInterestPage() {
return new BreakDownInterestPage(this.page);
}

get claimInterestOptionsPage() {
return new ClaimInterestOptionsPage(this.page);
}

get interestClaimFromPage() {
return new InterestClaimFromPage(this.page);
}

get interestClaimUntilPage() {
return new InterestClaimUntilPage(this.page);
}

get interestFromSpecificDate() {
return new InterestFromSpecificDate(this.page);
}

get sameRateInterestSelectionPage() {
return new SameRateInterestSelectionPage(this.page);
}

get pbaNumberPage() {
return new PbaNumberPage(this.page);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const subheadings = {
breakDownInterest: 'What is the total interest for your claim?',
};

export const paragraphs = {
descriptionText:
'Calculate interest for different periods of time, or items, and let us know the total. We’ll add it to your claim amount.',
};

export const inputs = {
total: {
label: 'Total interest amount',
selector: '#breakDownInterestTotal',
},
description: {
label: 'Show how you calculated the amount is required',
selector: '#breakDownInterestDescription',
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import BasePage from '../../../../../../base/base-page';
import { AllMethodsStep } from '../../../../../../decorators/test-steps';
import ExuiPage from '../../../../exui-page/exui-page';
import { subheadings, paragraphs, inputs } from './break-down-interest-content';

@AllMethodsStep()
export default class BreakDownInterestPage extends ExuiPage(BasePage) {
async verifyContent() {
await super.runVerifications([
super.expectText(subheadings.breakDownInterest),
super.expectText(paragraphs.descriptionText),
]);
}

async enterBreakDownInterestTotal() {
await super.inputText('1000', inputs.total.selector);
}

async enterBreakDownInterestDescription() {
await super.inputText('Test calculation', inputs.description.selector);
}

async submit() {
await super.clickSubmit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const subheadings = {
claimInterestOptions: 'How do you want to claim interest?',
};

export const radioButtons = {
claimInterestOptions: {
sameRateInterest: {
label: 'Same rate for whole period of time',
selector: '#interestClaimOptions-SAME_RATE_INTEREST',
},
breakDownInterest: {
label:
'Break down interest for different periods of time, or items. You can only use this service if any claim for interest is made at the same rate and from the same date. To claim interest at different rates or for different periods of time, you should issue your claim on paper',
selector: '#interestClaimOptions-BREAK_DOWN_INTEREST',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import BasePage from '../../../../../../base/base-page';
import { AllMethodsStep } from '../../../../../../decorators/test-steps';
import ExuiPage from '../../../../exui-page/exui-page';
import { radioButtons, subheadings } from './claim-interest-options-content';

@AllMethodsStep()
export default class ClaimInterestOptionsPage extends ExuiPage(BasePage) {
async verifyContent() {
await super.runVerifications([super.expectText(subheadings.claimInterestOptions)]);
}

async selectSameRateInterest() {
await super.clickBySelector(radioButtons.claimInterestOptions.sameRateInterest.selector);
}

async selectBreakDownInterest() {
await super.clickBySelector(radioButtons.claimInterestOptions.breakDownInterest.selector);
}

async submit() {
await super.clickSubmit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const subheadings = {
interestClaimFrom: 'When are you claiming interest from?',
};

export const radioButtons = {
interestClaimFrom: {
submitDate: {
label:
'The date you submit the claim. The interest will then be calculated up until the claim is settled or a judgment has been made.',
selector: '#interestClaimFrom-FROM_CLAIM_SUBMIT_DATE',
},
specificDate: {
label:
'A specific date. For example, the date an invoice was overdue, or the date that you told someone they owed you money.',
selector: '#interestClaimFrom-FROM_A_SPECIFIC_DATE',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import BasePage from '../../../../../../base/base-page';
import { AllMethodsStep } from '../../../../../../decorators/test-steps';
import ExuiPage from '../../../../exui-page/exui-page';
import { radioButtons, subheadings } from './interest-claim-from-content';

@AllMethodsStep()
export default class InterestClaimFromPage extends ExuiPage(BasePage) {
async verifyContent() {
await super.runVerifications([super.expectText(subheadings.interestClaimFrom)]);
}

async selectFromClaimSubmitDate() {
await super.clickBySelector(radioButtons.interestClaimFrom.submitDate.selector);
}

async selectfromASpecificDate() {
await super.clickBySelector(radioButtons.interestClaimFrom.specificDate.selector);
}

async submit() {
await super.clickSubmit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const subheadings = {
interestClaimUntil: 'When are you claiming interest to?',
};

export const radioButtons = {
interestClaimUntil: {
submitDate: {
label: 'When you submit the claim.',
selector: '#interestClaimUntil-UNTIL_CLAIM_SUBMIT_DATE',
},
untilSettledOrJudgement: {
label: 'Until the claim is settled or judgment made.',
selector: '#interestClaimUntil-UNTIL_SETTLED_OR_JUDGEMENT_MADE',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import BasePage from '../../../../../../base/base-page';
import { AllMethodsStep } from '../../../../../../decorators/test-steps';
import ExuiPage from '../../../../exui-page/exui-page';
import { radioButtons, subheadings } from './interest-claim-until-content';

@AllMethodsStep()
export default class InterestClaimUntilPage extends ExuiPage(BasePage) {
async verifyContent() {
await super.runVerifications([super.expectText(subheadings.interestClaimUntil)]);
}

async selectSameInterest() {
await super.clickBySelector(radioButtons.interestClaimUntil.submitDate.selector);
}

async selectBreakDownInterest() {
await super.clickBySelector(radioButtons.interestClaimUntil.untilSettledOrJudgement.selector);
}

async submit() {
await super.clickSubmit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const subheadings = {
dateClaimFrom: 'Date you want to claim interest from',
};

export const paragraphs = {
descriptionText: 'For example, 22 04 2021',
};

export const inputs = {
specificDate: {
selectorKey: 'interestFromSpecificDate',
},

description: {
label: 'Explain why you’re claiming from this date is required',
selector: '#interestFromSpecificDateDescription',
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import BasePage from '../../../../../../base/base-page';
import { AllMethodsStep } from '../../../../../../decorators/test-steps';
import ExuiPage from '../../../../exui-page/exui-page';
import { subheadings, paragraphs, inputs } from './interest-from-specific-date-content';
import DateFragment from '../../../../fragments/date/date-fragment';
import DateHelper from '../../../../../../helpers/date-helper';

@AllMethodsStep()
export default class InterestFromSpecificDate extends ExuiPage(BasePage) {
private dateFragment: DateFragment;

async verifyContent() {
await super.runVerifications([
super.expectText(subheadings.dateClaimFrom),
super.expectText(paragraphs.descriptionText),
]);
}

async enterFromSpecificDate() {
const date = DateHelper.subtractFromToday({ months: 6 });
await this.dateFragment.enterDate(date, inputs.specificDate.selectorKey);
}

async enterinterestFromSpecificDateDescription() {
await super.inputText('Test description', inputs.description.selector);
}

async submit() {
await super.clickSubmit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const subheadings = {
whatInterest: 'What annual rate of interest do you want to claim?',
};

export const paragraphs = {
descriptionText: 'You can claim 8% per year unless you know that a different rate applies',
};

export const radioButtons = {
sameRateInterestSelection: {
eightPercent: {
label: '8%',
selector: '#sameRateInterestSelection_sameRateInterestType-SAME_RATE_INTEREST_8_PC',
},
differentRate: {
label: 'A different rate',
selector: '#sameRateInterestSelection_sameRateInterestType-SAME_RATE_INTEREST_DIFFERENT_RATE',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import BasePage from '../../../../../../base/base-page';
import { AllMethodsStep } from '../../../../../../decorators/test-steps';
import ExuiPage from '../../../../exui-page/exui-page';
import { radioButtons, subheadings, paragraphs } from './same-rate-interest-selection-content';

@AllMethodsStep()
export default class SameRateInterestSelectionPage extends ExuiPage(BasePage) {
async verifyContent() {
await super.runVerifications([
super.expectText(subheadings.whatInterest),
super.expectText(paragraphs.descriptionText),
]);
}

async selectEightPercent() {
await super.clickBySelector(radioButtons.sameRateInterestSelection.eightPercent.selector);
}

async selectDifferentRate() {
await super.clickBySelector(radioButtons.sameRateInterestSelection.differentRate.selector);
}

async submit() {
await super.clickSubmit();
}
}
Loading