Skip to content

Commit 4c620b9

Browse files
committed
fix: update test IDs for budget discussion form components and related tests
1 parent 52b1e8a commit 4c620b9

File tree

3 files changed

+46
-53
lines changed

3 files changed

+46
-53
lines changed

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

Lines changed: 39 additions & 48 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(
@@ -93,51 +88,47 @@ export default class BudgetDiscussionSubmissionPage {
9388
); // BUG missing test Ids
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"
138-
);
139-
140-
readonly companyTypeSelect = this.page.getByTestId("beneficiary-type");
126+
readonly proposalCommittee = this.page
127+
.getByLabel("Is this proposal being")
128+
.first(); // BUG incorrect position of testId
129+
readonly countryOfIncorporationBtn = this.page
130+
.getByLabel("Country of Incorporation *")
131+
.first(); // BUG incorrect position of testId
141132
readonly publicChampionSelect = this.page.getByTestId(
142133
"proposal-public-champion"
143134
);
@@ -234,9 +225,9 @@ export default class BudgetDiscussionSubmissionPage {
234225

235226
// costing
236227
readonly adaAmountContent = this.page.getByTestId("ada-amount-content");
237-
readonly adaToUsdConversionRateContent = this.page.getByTestId(
228+
readonly usdToAdaConversionRateContent = this.page.getByTestId(
238229
"usd-to-ada-conversion-rate-content"
239-
); // BUG typo
230+
);
240231
readonly preferredCurrencyContent = this.page.getByTestId(
241232
"preferred-currency-content"
242233
);
@@ -271,7 +262,7 @@ export default class BudgetDiscussionSubmissionPage {
271262
proposalOwnership: BudgetProposalOwnershipProps,
272263
isNaviagted = true
273264
) {
274-
await this.companyTypeSelect.click();
265+
await this.proposalCommittee.click();
275266
await this.page
276267
.getByRole("option", { name: proposalOwnership.companyType })
277268
.click(); //BUG missing testId
@@ -772,7 +763,7 @@ export default class BudgetDiscussionSubmissionPage {
772763
await expect(this.adaAmountContent).toHaveText(
773764
`₳ ${formatWithThousandSeparator(proposalInformations.costing.adaAmount)}`
774765
);
775-
await expect(this.adaToUsdConversionRateContent).toHaveText(
766+
await expect(this.usdToAdaConversionRateContent).toHaveText(
776767
proposalInformations.costing.usdToAdaConversionRate.toString()
777768
);
778769

@@ -836,7 +827,7 @@ export default class BudgetDiscussionSubmissionPage {
836827
proposalOwnership: BudgetProposalOwnershipProps,
837828
isValid: boolean = true
838829
) {
839-
const companyTypeSelectContent = await this.companyTypeSelect.textContent();
830+
const companyTypeSelectContent = await this.proposalCommittee.textContent();
840831

841832
if (isValid) {
842833
if (proposalOwnership.companyType === "Company") {

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ 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
7575
.getByRole("option", { name: CompanyEnum.Company })
7676
.click(); //BUG missing testId
@@ -86,7 +86,7 @@ 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
9191
.getByRole("option", { name: CompanyEnum.Group })
9292
.click(); //BUG missing testId
@@ -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)