Skip to content

Commit 79f9269

Browse files
authored
Merge pull request #3696 from IntersectMBO/fix/budget-discussion-testId
fix: update test IDs for budget discussion form components and related tests
2 parents 45ed4a3 + 7f83827 commit 79f9269

File tree

4 files changed

+55
-69
lines changed

4 files changed

+55
-69
lines changed

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

Lines changed: 44 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,27 @@ export default class BudgetDiscussionSubmissionPage {
5151
readonly verifyIdentityBtn = this.page.getByTestId("verify-identity-button");
5252
readonly saveDraftBtn = this.page.getByTestId("draft-button");
5353
readonly submitBtn = this.page.getByTestId("submit-button");
54-
readonly countryOfIncorporationBtn = this.page.getByTestId(
55-
"country-of-incorporation"
56-
);
5754

58-
readonly agreeCheckbox = this.page.getByLabel(
59-
"I agree to the information in"
60-
); //BUG missing test Ids
55+
readonly agreeCheckbox = this.page.getByTestId("agree-checkbox");
6156
readonly submitCheckbox = this.page.getByTestId("submit-checkbox");
6257

6358
// input
6459
readonly linkTextInput = this.page.getByTestId("link-0-text-input");
6560
readonly linkUrlInput = this.page.getByTestId("link-0-url-input");
6661

6762
// proposal-ownership
68-
readonly companyNameInput = this.page.getByLabel("Company Name *"); //BUG missing test Ids
69-
readonly companyDomainNameInput = this.page.getByLabel(
70-
"Company Domain Name *"
71-
); //BUG missing test Ids
72-
readonly groupNameInput = this.page.getByLabel("Group Name *"); //BUG missing test Ids
73-
readonly groupTypeInput = this.page.getByLabel("Type of Group *"); //BUG missing test Ids
74-
readonly keyInformationOfGroupInput = this.page.getByLabel(
75-
"Key Information to Identify"
76-
); //BUG missing test Ids
77-
readonly contactDetailsInput = this.page.getByLabel(
78-
"Please provide your preferred"
79-
); //BUG missing test Ids
63+
readonly companyNameInput = this.page.getByTestId("company-name-input");
64+
readonly companyDomainNameInput = this.page.getByTestId(
65+
"company-domain-input"
66+
);
67+
readonly groupNameInput = this.page.getByTestId("group-name-input");
68+
readonly groupTypeInput = this.page.getByTestId("group-type-input");
69+
readonly keyInformationOfGroupInput = this.page.getByTestId(
70+
"group-identity-information-input"
71+
);
72+
readonly contactDetailsInput = this.page.getByTestId(
73+
"provide-preferred-input"
74+
);
8075

8176
// problem-statements
8277
readonly problemStatementInput = this.page.getByTestId(
@@ -88,56 +83,50 @@ export default class BudgetDiscussionSubmissionPage {
8883
readonly suplimentaryEndorsementInput = this.page.getByTestId(
8984
"supplementary-endorsement-input"
9085
);
91-
readonly productRoadmapDescriptionInput = this.page.getByLabel(
92-
"Please explain how your"
93-
); // BUG missing test Ids
86+
readonly productRoadmapDescriptionInput = this.page.getByTestId(
87+
"proposal-roadmap-description-input"
88+
);
9489

9590
// proposal-details
96-
readonly proposalNameInput = this.page.getByLabel(
97-
"What is your proposed name to"
98-
); //BUG missing testId
91+
readonly proposalNameInput = this.page.getByTestId("proposal-name-input");
9992
readonly proposalDescriptionInput = this.page.getByTestId(
10093
"proposal-description-input"
10194
);
10295
readonly proposalKeyDependenciesInput = this.page.getByTestId(
10396
"key-dependencies-input"
10497
);
105-
readonly proposalMaintainAndSupportInput = this.page.getByLabel(
106-
"How will this proposal be"
107-
); //BUG missing testId
98+
readonly proposalMaintainAndSupportInput = this.page.getByTestId(
99+
"proposal-maintain-and-support-input"
100+
);
108101
readonly milestonesInput = this.page.getByTestId(
109102
"key-proposal-deliverables-input"
110103
);
111104
readonly teamSizeAndDurationInput = this.page.getByTestId(
112105
"resourcing-duration-estimates-input"
113106
);
114-
readonly previousExperienceInput = this.page.getByLabel(
115-
"Please provide previous"
116-
); //BUG missing testId
117-
readonly otherDescriptionInput = this.page.getByLabel(
118-
"Please describe what you have"
107+
readonly previousExperienceInput = this.page.getByTestId(
108+
"proposal-previous-experience-input"
109+
);
110+
readonly otherDescriptionInput = this.page.getByTestId(
111+
"other-contract-description"
119112
);
120113

121114
// costing
122-
readonly adaAmountInput = this.page.getByLabel("ADA Amount *"); //BUG missing test Ids
123-
readonly usaToAdaCnversionRateInput = this.page.getByLabel(
124-
"USD to ADA Conversion Rate *"
125-
); //BUG missing test Ids
126-
readonly preferredCurrencyInput = this.page.getByLabel(
127-
"Amount in preferred currency *"
115+
readonly adaAmountInput = this.page.getByTestId("ada-amount-input");
116+
readonly usaToAdaCnversionRateInput = this.page.getByTestId(
117+
"usd-ada-conversion-input"
118+
);
119+
readonly preferredCurrencyInput = this.page.getByTestId(
120+
"preferred-currency-amount-input"
128121
);
129122
readonly costBreakdownInput = this.page.getByTestId("cost-breakdown-input");
130123
readonly venderDetailsInput = this.page.getByLabel("Please provide further"); //BUG missing test Ids
131124

132125
// select
133-
readonly beneficiaryCountrySelect = this.page.getByTestId(
134-
"beneficiary-country-of-residence"
135-
);
136-
readonly beneficiaryNationalitySelect = this.page.getByTestId(
137-
"beneficiary-nationality"
126+
readonly proposalCommittee = this.page.getByTestId("proposal-committee");
127+
readonly countryOfIncorporationBtn = this.page.getByTestId(
128+
"country-of-incorporation"
138129
);
139-
140-
readonly companyTypeSelect = this.page.getByTestId("beneficiary-type");
141130
readonly publicChampionSelect = this.page.getByTestId(
142131
"proposal-public-champion"
143132
);
@@ -234,9 +223,9 @@ export default class BudgetDiscussionSubmissionPage {
234223

235224
// costing
236225
readonly adaAmountContent = this.page.getByTestId("ada-amount-content");
237-
readonly adaToUsdConversionRateContent = this.page.getByTestId(
226+
readonly usdToAdaConversionRateContent = this.page.getByTestId(
238227
"usd-to-ada-conversion-rate-content"
239-
); // BUG typo
228+
);
240229
readonly preferredCurrencyContent = this.page.getByTestId(
241230
"preferred-currency-content"
242231
);
@@ -271,10 +260,10 @@ export default class BudgetDiscussionSubmissionPage {
271260
proposalOwnership: BudgetProposalOwnershipProps,
272261
isNaviagted = true
273262
) {
274-
await this.companyTypeSelect.click();
263+
await this.proposalCommittee.click();
275264
await this.page
276-
.getByRole("option", { name: proposalOwnership.companyType })
277-
.click(); //BUG missing testId
265+
.getByTestId(`${proposalOwnership.companyType.toLowerCase()}-submission`)
266+
.click();
278267

279268
await this.contactDetailsInput.fill(proposalOwnership.contactDetails);
280269

@@ -772,7 +761,7 @@ export default class BudgetDiscussionSubmissionPage {
772761
await expect(this.adaAmountContent).toHaveText(
773762
`₳ ${formatWithThousandSeparator(proposalInformations.costing.adaAmount)}`
774763
);
775-
await expect(this.adaToUsdConversionRateContent).toHaveText(
764+
await expect(this.usdToAdaConversionRateContent).toHaveText(
776765
proposalInformations.costing.usdToAdaConversionRate.toString()
777766
);
778767

@@ -796,13 +785,9 @@ export default class BudgetDiscussionSubmissionPage {
796785

797786
// further information
798787
for (let i = 0; i < proposalInformations.furtherInformation.length; i++) {
799-
//BUG missing testId
800-
await expect(
801-
this.currentPage.getByRole("link", {
802-
name: proposalInformations.furtherInformation[i].prop_link_text,
803-
exact: true,
804-
})
805-
).toBeVisible();
788+
await expect(this.currentPage.getByTestId(`link-${i}-label`)).toHaveText(
789+
proposalInformations.furtherInformation[i].prop_link_text
790+
);
806791
}
807792

808793
// administration and auditing
@@ -836,7 +821,7 @@ export default class BudgetDiscussionSubmissionPage {
836821
proposalOwnership: BudgetProposalOwnershipProps,
837822
isValid: boolean = true
838823
) {
839-
const companyTypeSelectContent = await this.companyTypeSelect.textContent();
824+
const companyTypeSelectContent = await this.proposalCommittee.textContent();
840825

841826
if (isValid) {
842827
if (proposalOwnership.companyType === "Company") {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ export default class OutComesPage {
437437
"**/governance-actions?search=&filters=&sort=**"
438438
);
439439

440-
441440
await this.goto();
442441
await actionsResponsePromise;
443442

tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.dRep.pb.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ test.describe("Budget proposal dRep behaviour", () => {
6161
await budgetDiscussionDetailsPage.voteOnPoll(choice);
6262
await budgetDiscussionDetailsPage.changePollVote();
6363

64-
await expect(budgetDiscussionDetailsPage.pollYesBtn).not.toBeVisible({timeout: 60_000});
64+
await expect(budgetDiscussionDetailsPage.pollYesBtn).not.toBeVisible({
65+
timeout: 60_000,
66+
});
6567
await expect(budgetDiscussionDetailsPage.pollNoBtn).not.toBeVisible();
6668

6769
// vote must be changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ test.describe("Budget proposal 01 wallet", () => {
6262
test("12D_1. Should verify all field of “proposal ownership” section", async () => {
6363
// default field
6464
await expect(
65-
budgetProposalSubmissionPage.companyTypeSelect
65+
budgetProposalSubmissionPage.proposalCommittee
6666
).toBeVisible();
6767

6868
await expect(
6969
budgetProposalSubmissionPage.contactDetailsInput
7070
).toBeVisible();
7171

7272
// company type field
73-
await budgetProposalSubmissionPage.companyTypeSelect.click();
73+
await budgetProposalSubmissionPage.proposalCommittee.click();
7474
await budgetProposalSubmissionPage.currentPage
75-
.getByRole("option", { name: CompanyEnum.Company })
76-
.click(); //BUG missing testId
75+
.getByTestId("company-submission")
76+
.click();
7777

7878
await expect(
7979
budgetProposalSubmissionPage.companyNameInput
@@ -86,10 +86,10 @@ test.describe("Budget proposal 01 wallet", () => {
8686
).toBeVisible();
8787

8888
// group type field
89-
await budgetProposalSubmissionPage.companyTypeSelect.click();
89+
await budgetProposalSubmissionPage.proposalCommittee.click();
9090
await budgetProposalSubmissionPage.currentPage
91-
.getByRole("option", { name: CompanyEnum.Group })
92-
.click(); //BUG missing testId
91+
.getByTestId("group-submission")
92+
.click();
9393
await expect(budgetProposalSubmissionPage.groupNameInput).toBeVisible();
9494
await expect(budgetProposalSubmissionPage.groupTypeInput).toBeVisible();
9595
await expect(
@@ -436,7 +436,7 @@ test("12C. Should save and view draft proposal", async ({ browser }) => {
436436

437437
await budgetSubmissionPage.viewLastDraft();
438438

439-
await expect(budgetSubmissionPage.companyTypeSelect).toHaveText(
439+
await expect(budgetSubmissionPage.proposalCommittee).toHaveText(
440440
draftProposalOwnership.companyType
441441
);
442442

0 commit comments

Comments
 (0)