Skip to content

Commit 0b80ed4

Browse files
committed
fix: proposal creation issue due to update on testids
1 parent 140d6df commit 0b80ed4

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default class BudgetDiscussionDetailsPage {
1616
readonly changeVoteYesBtn = this.page.getByTestId(
1717
"change-poll-vote-yes-button"
1818
);
19+
readonly verifyIdentityBtn = this.page.getByTestId("verify-identity-button");
1920

2021
// content
2122
readonly copyLinkText = this.page.getByTestId("copy-link-text");
@@ -32,7 +33,7 @@ export default class BudgetDiscussionDetailsPage {
3233
return this.page;
3334
}
3435

35-
async goto(proposalId: string) {
36+
async goto(proposalId: number) {
3637
await this.page.goto(
3738
`${environments.frontendUrl}/budget_discussion/${proposalId}`
3839
);

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default class BudgetDiscussionSubmissionPage {
141141
"beneficiary-nationality"
142142
);
143143

144-
readonly companyTypeSelect = this.page.getByTestId("beneficiary-nationality"); //BUG wrong test id
144+
readonly companyTypeSelect = this.page.getByTestId("beneficiary-type");
145145
readonly publicChampion = this.page.getByTestId("proposal-public-champion");
146146

147147
readonly roadmapNameSelect = this.page.getByTestId("roadmap-name");
@@ -190,7 +190,9 @@ export default class BudgetDiscussionSubmissionPage {
190190
.click();
191191
await this.beneficiaryNationalitySelect.click();
192192
await this.page
193-
.getByRole("option", { name: contactInformation.beneficiaryNationality })
193+
.getByTestId(
194+
`${contactInformation.beneficiaryNationality.toLowerCase()}-button`
195+
)
194196
.click();
195197

196198
await this.submissionLeadFullNameInput.fill(
@@ -411,12 +413,12 @@ export default class BudgetDiscussionSubmissionPage {
411413
return {
412414
beneficiaryFullName: faker.person.fullName(),
413415
beneficiaryEmail: faker.internet.email(),
414-
beneficiaryCountry: faker.helpers.arrayElement(
415-
Object.values(LocationEnum)
416-
),
417-
beneficiaryNationality: faker.helpers.arrayElement(
418-
Object.values(LocationEnum)
419-
),
416+
beneficiaryCountry: faker.helpers
417+
.arrayElement(Object.values(LocationEnum))
418+
.replace(/ /g, "-"),
419+
beneficiaryNationality: faker.helpers
420+
.arrayElement(Object.values(LocationEnum))
421+
.replace(/ /g, "-"),
420422
submissionLeadFullName: faker.person.fullName(),
421423
submissionLeadEmail: faker.internet.email(),
422424
};
@@ -452,9 +454,9 @@ export default class BudgetDiscussionSubmissionPage {
452454
groupKeyIdentity: faker.lorem.paragraph(2),
453455
companyName: faker.company.name(),
454456
companyDomainName: faker.internet.domainName(),
455-
countryOfIncorportation: faker.helpers.arrayElement(
456-
Object.values(LocationEnum)
457-
),
457+
countryOfIncorportation: faker.helpers
458+
.arrayElement(Object.values(LocationEnum))
459+
.replace(/ /g, "-"),
458460
};
459461
}
460462

@@ -524,7 +526,7 @@ export default class BudgetDiscussionSubmissionPage {
524526
this.generateValidBudgetProposalInformation();
525527

526528
await this.fillupForm(budgetProposalRequest);
527-
await this.continueBtn.click(); // BUG incorrect test id -> submit-button
529+
await this.submitBtn.click(); // BUG incorrect test id -> submit-button
528530

529531
// assert to check if the proposal is created and navigated to details page
530532
await expect(this.page.getByTestId("review-version")).toBeVisible({

0 commit comments

Comments
 (0)