Skip to content

Commit 6b970e8

Browse files
committed
chore: remove unused contact details and fix proposal budget failing test
1 parent 56c5e26 commit 6b970e8

File tree

5 files changed

+61
-132
lines changed

5 files changed

+61
-132
lines changed

tests/govtool-frontend/playwright/lib/pages/budgetDiscussionDetailsPage.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ export default class BudgetDiscussionDetailsPage {
144144
await this.readMoreBtn.click();
145145

146146
// proposal ownership validation
147-
await expect(this.publicProposalChampionContent).toHaveText(
148-
budgetProposal.proposalOwnership.publicChampion
149-
);
150147
await expect(this.socialHandlesContent).toHaveText(
151148
budgetProposal.proposalOwnership.contactDetails
152149
);

tests/govtool-frontend/playwright/lib/pages/budgetDiscussionSubmissionPage.ts

Lines changed: 10 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import environments from "@constants/environments";
2-
import { fa, faker } from "@faker-js/faker";
2+
import { faker } from "@faker-js/faker";
33
import { extractProposalIdFromUrl } from "@helpers/string";
44
import { Page, expect } from "@playwright/test";
55
import {
@@ -15,7 +15,6 @@ import {
1515
CompanyEnum,
1616
LocationEnum,
1717
PreferredCurrencyEnum,
18-
ProposalChampionEnum,
1918
ProposalContractingEnum,
2019
ProposalLink,
2120
RoadmapNameEnum,
@@ -163,7 +162,7 @@ export default class BudgetDiscussionSubmissionPage {
163162
this.page.getByTestId("preferred-currency");
164163

165164
readonly intersectNamedAdministratorSelect = this.page.getByTestId(
166-
"itersect-named-administrator"
165+
"intersect-named-administrator"
167166
);
168167

169168
// content
@@ -310,11 +309,6 @@ export default class BudgetDiscussionSubmissionPage {
310309
.getByRole("option", { name: proposalOwnership.companyType })
311310
.click(); //BUG missing testId
312311

313-
await this.publicChampionSelect.click();
314-
await this.page
315-
.getByRole("option", { name: proposalOwnership.publicChampion })
316-
.click(); //BUG missing testId
317-
318312
await this.contactDetailsInput.fill(proposalOwnership.contactDetails);
319313

320314
if (proposalOwnership.companyType === "Group") {
@@ -446,29 +440,25 @@ export default class BudgetDiscussionSubmissionPage {
446440
await this.continueBtn.click();
447441
}
448442

449-
async fillupForm(budgetProposal: BudgetProposalProps, stage = 8) {
450-
await this.fillupContactInformationForm(budgetProposal.contactInformation);
443+
async fillupForm(budgetProposal: BudgetProposalProps, stage = 7) {
444+
await this.fillupProposalOwnershipForm(budgetProposal.proposalOwnership);
451445

452446
if (stage > 2) {
453-
await this.fillupProposalOwnershipForm(budgetProposal.proposalOwnership);
454-
}
455-
456-
if (stage > 3) {
457447
await this.fillupProblemStatementAndBenefitsForm(
458448
budgetProposal.problemStatementAndBenefits
459449
);
460450
}
461451

462-
if (stage > 4) {
452+
if (stage > 3) {
463453
await this.fillupProposalDetailsForm(budgetProposal.proposalDetails);
464454
}
465-
if (stage > 5) {
455+
if (stage > 4) {
466456
await this.fillupCostingForm(budgetProposal.costing);
467457
}
468-
if (stage > 6) {
458+
if (stage > 5) {
469459
await this.fillupFurtherInformation(budgetProposal.furtherInformation);
470460
}
471-
if (stage > 7) {
461+
if (stage > 6) {
472462
await this.intersectNamedAdministratorSelect.click();
473463

474464
await this.page
@@ -558,9 +548,6 @@ export default class BudgetDiscussionSubmissionPage {
558548
generateValidProposalOwnerShip(): BudgetProposalOwnershipProps {
559549
return {
560550
companyType: faker.helpers.arrayElement(Object.values(CompanyEnum)),
561-
publicChampion: faker.helpers.arrayElement(
562-
Object.values(ProposalChampionEnum)
563-
),
564551
contactDetails: faker.internet.email(),
565552
groupName: faker.company.name(),
566553
groupType: faker.company.buzzVerb(),
@@ -623,7 +610,6 @@ export default class BudgetDiscussionSubmissionPage {
623610

624611
generateValidBudgetProposalInformation(): BudgetProposalProps {
625612
return {
626-
contactInformation: this.generateValidBudgetProposalContactInformation(),
627613
proposalOwnership: this.generateValidProposalOwnerShip(),
628614
problemStatementAndBenefits:
629615
this.generateValidBudgetProposalProblemStatementAndBenefits(),
@@ -640,17 +626,15 @@ export default class BudgetDiscussionSubmissionPage {
640626
if (fillAllDetails) {
641627
await this.fillupForm(budgetProposal);
642628
} else {
643-
await this.fillupContactInformationForm(
644-
budgetProposal.contactInformation
645-
);
629+
await this.fillupProposalOwnershipForm(budgetProposal.proposalOwnership);
646630
}
647631

648632
await this.saveDraftBtn.click();
649633
await this.closeDraftBtn.click();
650634
await this.cancelBtn.click();
651635
await this.createBudgetProposalBtn.click();
652636

653-
return fillAllDetails ? budgetProposal : budgetProposal.contactInformation;
637+
return fillAllDetails ? budgetProposal : budgetProposal.proposalOwnership;
654638
}
655639

656640
async createBudgetProposal(): Promise<{
@@ -678,42 +662,10 @@ export default class BudgetDiscussionSubmissionPage {
678662
async validateReviewBudgetProposal(
679663
proposalInformations: BudgetProposalProps
680664
) {
681-
// contact information
682-
await expect(this.beneficiaryFullNameContent).toHaveText(
683-
proposalInformations.contactInformation.beneficiaryFullName
684-
);
685-
await expect(this.beneficiaryCountryOfResidenceContent).toHaveText(
686-
proposalInformations.contactInformation.beneficiaryCountry
687-
);
688-
//BUG missing testId
689-
await expect(
690-
this.currentPage.getByText(
691-
proposalInformations.contactInformation.beneficiaryNationality,
692-
{ exact: true }
693-
)
694-
).toBeVisible();
695-
//BUG missing testId
696-
await expect(
697-
this.currentPage.getByText(
698-
proposalInformations.contactInformation.submissionLeadEmail,
699-
{ exact: true }
700-
)
701-
).toBeVisible();
702-
//BUG missing testId
703-
await expect(
704-
this.currentPage.getByText(
705-
proposalInformations.contactInformation.submissionLeadFullName,
706-
{ exact: true }
707-
)
708-
).toBeVisible();
709-
710665
// proposal ownership
711666
await expect(this.companyTypeContent).toHaveText(
712667
proposalInformations.proposalOwnership.companyType
713668
);
714-
await expect(this.providePreferredContent).toHaveText(
715-
proposalInformations.proposalOwnership.publicChampion
716-
);
717669
await expect(this.socialHandlesContent).toHaveText(
718670
proposalInformations.proposalOwnership.contactDetails
719671
);

tests/govtool-frontend/playwright/lib/pages/loginPage.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export default class LoginPage {
4747
// Handle multiple stake keys
4848
if (stakeKeys.length > 1) {
4949
await this.page
50-
.getByTestId(`${rewardAddresses[0]}-radio`).locator('div').first()
50+
.getByTestId(`${rewardAddresses[0]}-radio`)
51+
.locator("div")
52+
.first()
5153
.click({ force: true });
5254
await this.page.getByTestId("select-button").click();
5355
}

tests/govtool-frontend/playwright/lib/types.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,17 +352,8 @@ export enum CompanyEnum {
352352
Group = "Group",
353353
}
354354

355-
export type ProposalChampionType =
356-
| "Beneficiary listed above"
357-
| "Submission lead listed above";
358-
export enum ProposalChampionEnum {
359-
BeneficiaryListedAbove = "Beneficiary listed above",
360-
SubmissionLeadListedAbove = "Submission lead listed above",
361-
}
362-
363355
export interface BudgetProposalOwnershipProps {
364356
companyType: CompanyType;
365-
publicChampion: ProposalChampionType;
366357
contactDetails: string;
367358
groupName?: string;
368359
groupType?: string;
@@ -510,7 +501,6 @@ export interface AdministrationAndAuditingProps {
510501
}
511502

512503
export interface BudgetProposalProps {
513-
contactInformation: BudgetProposalContactInformationProps;
514504
proposalOwnership: BudgetProposalOwnershipProps;
515505
problemStatementAndBenefits: BudgetProposalProblemStatementAndBenefitProps;
516506
proposalDetails: BudgetProposalDetailsProps;

tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.spec.ts

Lines changed: 48 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import BudgetDiscussionDetailsPage from "@pages/budgetDiscussionDetailsPage";
1111
import BudgetDiscussionSubmissionPage from "@pages/budgetDiscussionSubmissionPage";
1212
import { expect } from "@playwright/test";
1313
import {
14-
BudgetProposalContactInformationProps,
14+
BudgetProposalOwnershipProps,
1515
BudgetProposalProps,
1616
CompanyEnum,
1717
} from "@types";
@@ -47,38 +47,12 @@ test.describe("Budget proposal 01 wallet", () => {
4747
});
4848

4949
test.describe("Budget proposal field verification", () => {
50-
test("12D_1. Should verify all field of “contact information” section", async () => {
51-
await expect(
52-
budgetProposalSubmissionPage.beneficiaryFullNameInput
53-
).toBeVisible();
54-
await expect(
55-
budgetProposalSubmissionPage.beneficiaryEmailInput
56-
).toBeVisible();
57-
await expect(
58-
budgetProposalSubmissionPage.beneficiaryCountrySelect
59-
).toBeVisible();
60-
await expect(
61-
budgetProposalSubmissionPage.beneficiaryNationalitySelect
62-
).toBeVisible();
63-
await expect(
64-
budgetProposalSubmissionPage.submissionLeadFullNameInput
65-
).toBeVisible();
66-
});
67-
68-
test("12D_2. Should verify all field of “proposal ownership” section", async () => {
69-
const proposalContactInformationContent =
70-
budgetProposalSubmissionPage.generateValidBudgetProposalContactInformation();
71-
await budgetProposalSubmissionPage.fillupContactInformationForm(
72-
proposalContactInformationContent
73-
);
74-
50+
test("12D_1. Should verify all field of “proposal ownership” section", async () => {
7551
// default field
7652
await expect(
7753
budgetProposalSubmissionPage.companyTypeSelect
7854
).toBeVisible();
79-
await expect(
80-
budgetProposalSubmissionPage.publicChampionSelect
81-
).toBeVisible();
55+
8256
await expect(
8357
budgetProposalSubmissionPage.contactDetailsInput
8458
).toBeVisible();
@@ -111,10 +85,12 @@ test.describe("Budget proposal 01 wallet", () => {
11185
).toBeVisible();
11286
});
11387

114-
test("12D_3. Should verify all field of “problem statements and proposal benefits” section", async () => {
115-
const proposalInformation =
116-
budgetProposalSubmissionPage.generateValidBudgetProposalInformation();
117-
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 3);
88+
test("12D_2. Should verify all field of “problem statements and proposal benefits” section", async () => {
89+
const proposalOwnership =
90+
budgetProposalSubmissionPage.generateValidProposalOwnerShip();
91+
await budgetProposalSubmissionPage.fillupProposalOwnershipForm(
92+
proposalOwnership
93+
);
11894

11995
await expect(
12096
budgetProposalSubmissionPage.problemStatementInput
@@ -136,10 +112,10 @@ test.describe("Budget proposal 01 wallet", () => {
136112
).toBeVisible();
137113
});
138114

139-
test("12D_4. Should verify all field of “proposal details” section", async () => {
115+
test("12D_3. Should verify all field of “proposal details” section", async () => {
140116
const proposalInformation =
141117
budgetProposalSubmissionPage.generateValidBudgetProposalInformation();
142-
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 4);
118+
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 3);
143119

144120
await expect(
145121
budgetProposalSubmissionPage.proposalNameInput
@@ -164,10 +140,10 @@ test.describe("Budget proposal 01 wallet", () => {
164140
).toBeVisible();
165141
});
166142

167-
test("12D_5. Should verify all field of “costing” section", async () => {
143+
test("12D_4. Should verify all field of “costing” section", async () => {
168144
const proposalInformation =
169145
budgetProposalSubmissionPage.generateValidBudgetProposalInformation();
170-
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 5);
146+
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 4);
171147

172148
await expect(budgetProposalSubmissionPage.adaAmountInput).toBeVisible();
173149
await expect(
@@ -184,20 +160,20 @@ test.describe("Budget proposal 01 wallet", () => {
184160
).toBeVisible();
185161
});
186162

187-
test("12D_6. Should verify all field of “further information” section", async () => {
163+
test("12D_5. Should verify all field of “further information” section", async () => {
188164
const proposalInformation =
189165
budgetProposalSubmissionPage.generateValidBudgetProposalInformation();
190-
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 6);
166+
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 5);
191167

192168
await expect(budgetProposalSubmissionPage.linkTextInput).toBeVisible();
193169
await expect(budgetProposalSubmissionPage.linkUrlInput).toBeVisible();
194170
await expect(budgetProposalSubmissionPage.addLinkBtn).toBeVisible();
195171
});
196172

197-
test("12D_7. Should verify all field of “administration and auditing” section", async () => {
173+
test("12D_6. Should verify all field of “administration and auditing” section", async () => {
198174
const proposalInformation =
199175
budgetProposalSubmissionPage.generateValidBudgetProposalInformation();
200-
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 7);
176+
await budgetProposalSubmissionPage.fillupForm(proposalInformation, 6);
201177

202178
await expect(
203179
budgetProposalSubmissionPage.intersectNamedAdministratorSelect
@@ -247,32 +223,44 @@ test("12C. Should save and view draft proposal", async ({ browser }) => {
247223

248224
const budgetSubmissionPage = new BudgetDiscussionSubmissionPage(page);
249225
await budgetSubmissionPage.goto();
250-
const draftContactInformationContent =
251-
(await budgetSubmissionPage.createDraftBudgetProposal()) as BudgetProposalContactInformationProps;
226+
const draftProposalOwnership =
227+
(await budgetSubmissionPage.createDraftBudgetProposal()) as BudgetProposalOwnershipProps;
252228
const getAddDrafts = await budgetSubmissionPage.getAllDrafts();
253229

254230
expect(getAddDrafts.length).toBeGreaterThan(0);
255231

256232
await budgetSubmissionPage.viewLastDraft();
257233

258-
await expect(budgetSubmissionPage.beneficiaryFullNameInput).toHaveValue(
259-
draftContactInformationContent.beneficiaryFullName
260-
);
261-
await expect(budgetSubmissionPage.beneficiaryEmailInput).toHaveValue(
262-
draftContactInformationContent.beneficiaryEmail
263-
);
264-
await expect(budgetSubmissionPage.beneficiaryCountrySelect).toHaveText(
265-
draftContactInformationContent.beneficiaryCountry
266-
);
267-
await expect(budgetSubmissionPage.beneficiaryNationalitySelect).toHaveText(
268-
draftContactInformationContent.beneficiaryNationality
269-
);
270-
await expect(budgetSubmissionPage.submissionLeadFullNameInput).toHaveValue(
271-
draftContactInformationContent.submissionLeadFullName
234+
await expect(budgetSubmissionPage.companyTypeSelect).toHaveText(
235+
draftProposalOwnership.companyType
272236
);
273-
await expect(budgetSubmissionPage.submissionLeadEmailInput).toHaveValue(
274-
draftContactInformationContent.submissionLeadEmail
237+
238+
await expect(budgetSubmissionPage.contactDetailsInput).toHaveValue(
239+
draftProposalOwnership.contactDetails
275240
);
241+
242+
if (draftProposalOwnership.companyType === "Group") {
243+
await expect(budgetSubmissionPage.groupNameInput).toHaveValue(
244+
draftProposalOwnership.groupName
245+
);
246+
await expect(budgetSubmissionPage.groupTypeInput).toHaveValue(
247+
draftProposalOwnership.groupType
248+
);
249+
await expect(budgetSubmissionPage.keyInformationOfGroupInput).toHaveValue(
250+
draftProposalOwnership.groupKeyIdentity
251+
);
252+
}
253+
if (draftProposalOwnership.companyType === "Company") {
254+
await expect(budgetSubmissionPage.companyNameInput).toHaveValue(
255+
draftProposalOwnership.companyName
256+
);
257+
await expect(budgetSubmissionPage.companyDomainNameInput).toHaveValue(
258+
draftProposalOwnership.companyDomainName
259+
);
260+
await expect(budgetSubmissionPage.countryOfIncorporationBtn).toHaveText(
261+
draftProposalOwnership.countryOfIncorportation
262+
);
263+
}
276264
});
277265

278266
test("12H. Should submit a valid budget proposal", async ({ browser }) => {
@@ -310,7 +298,7 @@ test("12I. Should submit a valid draft budget proposal", async ({
310298

311299
await budgetSubmissionPage.viewLastDraft();
312300

313-
for (let i = 0; i < 8; i++) {
301+
for (let i = 0; i < 7; i++) {
314302
await budgetSubmissionPage.continueBtn.click();
315303
}
316304
await budgetSubmissionPage.submitBtn.click();

0 commit comments

Comments
 (0)