Skip to content

Commit bb2a3ac

Browse files
committed
DFPL-2864
Code changes to Additional applications
1 parent 46c7e22 commit bb2a3ac

File tree

3 files changed

+155
-97
lines changed

3 files changed

+155
-97
lines changed

playwright-e2e/pages/additional-applications.ts

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,24 @@ export class AdditionalApplications extends BasePage {
2323
readonly typeOfC2Application: Locator;
2424
readonly paymentPbaNumberTextBox: Locator;
2525
readonly paymentPBANumberDynamicList: Locator;
26+
readonly applyOnline: Locator;
27+
readonly uploadPaperForm: Locator;
28+
readonly evidenceConsent: Locator;
29+
readonly partiesConsent: Locator;
30+
readonly confirmDocuments: Locator;
31+
readonly uploadApplication: Locator;
32+
readonly otherApplicant: Locator;
33+
2634

2735
public constructor(page: Page) {
2836
super(page);
29-
this.otherSpecificOrder = page.getByText('Other specific order - including C1 and C100 orders, and supplements');
30-
this.c2Order = page.getByText('C2 - to add or remove someone on a case, or for a specific request to the judge');
37+
this.otherSpecificOrder = page.getByText('Other specific application -');
38+
this.c2Order = page.getByRole('checkbox', { name: 'C2 Application' });
3139
this.confidentialC2Order = page.getByLabel('Yes')
3240
this.nonConfidentialC2Order = page.locator('[for="isC2Confidential_No"]');
33-
this.applicant = page.getByLabel('Select applicant');
41+
this.applicant = page.getByLabel('Who is making this');
3442
this.c1ApplicationType = page.getByLabel('Select application');
35-
this.applicationForm = page.getByRole('button', { name: 'Upload application' });
43+
this.applicationForm = page.getByRole('button', { name: 'Upload C2 application' });
3644
this.c2ApplicationForm = page.getByRole('button', { name: 'Upload C2 application' });
3745
this.acknowledgeOtherApplicationForm = page.locator('[name="temporaryOtherApplicationsBundle_documentAcknowledge"]');
3846
this.acknowledgeC2ApplicationForm = page.locator('[name="temporaryC2Document_documentAcknowledge"]');
@@ -42,47 +50,84 @@ export class AdditionalApplications extends BasePage {
4250
this.selectApplication = page.getByLabel('What type of C2 application?');
4351
this.checkbox = page.getByLabel('Yes');
4452
this.paymentPbaNumber = page.getByRole('textbox', { name: 'Payment by account (PBA) number' });
45-
this.typeOfC2Application = page.getByLabel('Application with notice.');
53+
this.typeOfC2Application = page.getByLabel('Yes - only the judge or HMCTS');
4654
this.paymentPbaNumberTextBox = page.getByRole('textbox', { name: 'Payment by account (PBA)' });
4755
this.paymentPBANumberDynamicList = page.locator('#temporaryPbaPayment_pbaNumberDynamicList');
56+
this.applyOnline = page.getByRole('radio', { name: 'Apply online' });
57+
this.uploadPaperForm = page.getByRole('radio', { name: 'Upload a paper form' });
58+
this.evidenceConsent = page.getByRole('button', { name: 'Evidence of consent' });
59+
this.partiesConsent = page.getByRole('radio', { name: 'Yes', exact: true });
60+
this.confirmDocuments = page.getByRole('checkbox', { name: 'Yes' });
61+
this.uploadApplication = page.getByRole('button', { name: 'Upload application' });
62+
this.otherApplicant = page.getByRole('textbox', { name: 'Add applicant\'s name' });
63+
4864
}
4965

5066
public async chooseOtherApplicationType() {
5167
await this.otherSpecificOrder.click();
52-
await this.selectApplicant.selectOption('1: applicant');
68+
await this.applicant.selectOption('Someone else');
69+
await this.otherApplicant.fill('Moniks');
5370
await this.clickContinue();
71+
5472
}
5573

5674
public async chooseC2ApplicationType() {
5775
await this.c2Order.click();
76+
await this.applyOnline.click();
77+
await this.partiesConsent.click();
78+
await this.evidenceConsent.setInputFiles(config.testPdfFile);
79+
await this.expectAllUploadsCompleted();
80+
await this.page.waitForTimeout(6000);
5881
await this.typeOfC2Application.click();
59-
await this.confidentialC2Order.click();
60-
await this.selectApplicant.selectOption('3: 5c578fcc-7e41-45b0-82f7-46c38a769cb3');
82+
await this.applicant.selectOption('Someone else');
83+
await this.otherApplicant.fill('James');
6184
await this.clickContinue();
6285
}
6386

6487
public async chooseConfidentialC2ApplicationType() {
6588
await this.c2Order.click();
66-
await this.applicant.selectOption('Swansea City Council, Applicant');
67-
await this.page.getByText('Application by consent. Parties will be notified of this application.').click();
68-
await this.confidentialC2Order.click();
89+
await this.applyOnline.click();
90+
await this.partiesConsent.click();
91+
await this.evidenceConsent.setInputFiles(config.testPdfFile);
92+
await this.expectAllUploadsCompleted();
93+
await this.page.waitForTimeout(6000);
94+
await this.typeOfC2Application.click();
95+
await this.applicant.selectOption('Someone else');
96+
await this.otherApplicant.fill('Dianah');
6997
await this.clickContinue();
7098
}
7199

72100
public async chooseBothApplicationTypes() {
73101
await this.c2Order.click();
74-
await this.otherSpecificOrder.click();
75-
await this.applicant.selectOption('Swansea City Council, Applicant');
102+
await this.applyOnline.click();
103+
await this.evidenceConsent.getByLabel('Yes').click;
104+
await this.evidenceConsent.setInputFiles(config.testPdfFile);
105+
await this.expectAllUploadsCompleted();
106+
await this.page.waitForTimeout(6000);
76107
await this.typeOfC2Application.click();
77-
await this.nonConfidentialC2Order.click();
108+
await this.applicant.selectOption('Someone else');
109+
await this.otherApplicant.fill('Dianah');
110+
await this.clickContinue();
111+
}
112+
113+
public async enterOnlineC2ApplicationDetails() {
114+
await this.c2Order.click();
115+
await this.applyOnline.click();
116+
await this.evidenceConsent.getByLabel('Yes').click;
117+
await this.evidenceConsent.setInputFiles(config.testPdfFile);
118+
await this.expectAllUploadsCompleted();
119+
await this.page.waitForTimeout(6000);
120+
await this.typeOfC2Application.click();
121+
await this.applicant.selectOption('Someone else');
122+
await this.otherApplicant.fill('Dianah');
78123
await this.clickContinue();
79124
}
80125

81126
public async fillOtherApplicationDetails() {
82127
await this.c1ApplicationType.selectOption('C1 - Change surname or remove from jurisdiction');
83128

84129
// upload application form
85-
await this.applicationForm.setInputFiles(config.testPdfFile3);
130+
await this.uploadApplication.setInputFiles(config.testPdfFile);
86131
await this.expectAllUploadsCompleted();
87132
await this.page.waitForTimeout(6000);
88133
await this.acknowledgeOtherApplicationForm.check();
@@ -101,14 +146,17 @@ export class AdditionalApplications extends BasePage {
101146
for (let i = 0; i < locs.length; i++) {
102147
await expect(locs[i]).toBeDisabled();
103148
}
149+
// other Applicants details for C1 Application
150+
await this.applicant.selectOption('Swansea City Council, Applicant');
151+
await this.applicant.selectOption('Someone else');
152+
await this.otherApplicant.fill('Dianah');
104153
}
105154

106155
public async fillC2ApplicationDetails(uploadDraftOrder: boolean = true) {
107156
// upload application form
108157
await this.c2ApplicationForm.setInputFiles(config.testPdfFile);
109158
await this.expectAllUploadsCompleted();
110159
await this.page.waitForTimeout(6000);
111-
112160
await this.acknowledgeC2ApplicationForm.check();
113161
await this.page.getByLabel('Change surname or remove from jurisdiction.').click();
114162
await this.within2Days.click();
@@ -162,7 +210,7 @@ export class AdditionalApplications extends BasePage {
162210
await this.clickContinue();
163211
}
164212

165-
public async uploadBasicC2Application(uploadDraftOrder: boolean = true,PBAnumber: string) {
213+
public async uploadBasicC2Application(uploadDraftOrder: boolean = true, PBAnumber: string) {
166214
await this.chooseC2ApplicationType();
167215
await this.fillC2ApplicationDetails(uploadDraftOrder);
168216
await this.payForApplication(PBAnumber);

playwright-e2e/pages/applications/upload-additional/applications.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BasePage } from "../../base-page";
2-
import { Locator, Page } from "@playwright/test";
2+
import { expect, Locator, Page } from "@playwright/test";
33

44
export class Applications extends BasePage {
55
readonly applyingForGroup: Locator;
@@ -19,11 +19,12 @@ export class Applications extends BasePage {
1919

2020
constructor(page: Page) {
2121
super(page);
22-
this.applyingForGroup = page.getByRole('group', { name: 'What are you applying for?' });
22+
this.applyingForGroup = page.getByRole('group', { name: 'What application are you making?' });
2323
this.otherSpecificOrderCheckbox = this.applyingForGroup.getByRole('checkbox', { name: 'Other specific order' });
24-
this.c2OrderCheckbox = this.applyingForGroup.getByRole('checkbox', { name: 'C2 - to add or remove someone on a case' });
24+
this.c2OrderCheckbox = this.applyingForGroup.getByRole('checkbox', { name: 'C2 Application' });
2525

26-
this.typeOfC2ApplicationGroup = page.getByRole('group', { name: 'What type of C2 application?' });
26+
//this.typeOfC2ApplicationGroup = page.getByRole('group', { name: 'C2 application' });
27+
this.typeOfC2ApplicationGroup = page.getByRole('group', { name: 'C2 Application' });
2728
this.applicationWithNoticeRadioButton = this.typeOfC2ApplicationGroup.getByRole('radio', { name: 'Application with notice' });
2829
this.applicationByConsentRadioButton = this.typeOfC2ApplicationGroup.getByRole('radio', { name: 'Application by consent' });
2930

@@ -40,7 +41,12 @@ export class Applications extends BasePage {
4041
}
4142

4243
async checkC2Order(): Promise<void> {
43-
await this.c2OrderCheckbox.check();
44+
// await this.c2OrderCheckbox.focus();
45+
// await this.c2OrderCheckbox.dblclick();
46+
await this. page.getByRole('checkbox', { name: 'C2 Application' }).check();
47+
await this.page.waitForTimeout(6000);
48+
await expect (this.page.getByText('Do you want to make the C2 application online or upload a paper form?')).toBeVisible();
49+
4450
}
4551

4652
async checkApplicationWithNotice(): Promise<void> {

0 commit comments

Comments
 (0)