From b579be9fbe84158b6fb0bcbaab2831d75ad6ca27 Mon Sep 17 00:00:00 2001 From: Niraj Date: Fri, 4 Apr 2025 17:40:26 +0545 Subject: [PATCH 1/4] fix: update multipleDRepRegistration to use proposalFaucetWallet --- .../govtool-frontend/playwright/lib/services/kuberService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/govtool-frontend/playwright/lib/services/kuberService.ts b/tests/govtool-frontend/playwright/lib/services/kuberService.ts index d4bbd06c5..5192debc4 100644 --- a/tests/govtool-frontend/playwright/lib/services/kuberService.ts +++ b/tests/govtool-frontend/playwright/lib/services/kuberService.ts @@ -211,7 +211,10 @@ const kuberService = { }, multipleDRepRegistration: (metadataAndWallets: WalletAndAnchorType[]) => { - const kuber = new Kuber(faucetWallet.address, faucetWallet.payment.private); + const kuber = new Kuber( + proposalFaucetWallet.address, + proposalFaucetWallet.payment.private + ); const req = { certificates: metadataAndWallets.map((metadataAndWallet) => Kuber.generateCert( From dd5072bb23856fad33d5ce75af79fb45e0b445df Mon Sep 17 00:00:00 2001 From: Niraj Date: Fri, 4 Apr 2025 17:41:45 +0545 Subject: [PATCH 2/4] fix: reduce comment length in budget proposal tests --- .../tests/11-proposal-budget/proposalBudget.loggedin.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.spec.ts index e73882eac..e76bb8738 100644 --- a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.spec.ts @@ -49,7 +49,7 @@ test.describe("Budget proposal logged in state", () => { }); test("11I. Should comments on any proposal", async ({}) => { - const comment = faker.lorem.paragraph(2); + const comment = faker.lorem.paragraph(1); await budgetDiscussionDetailsPage.addComment(comment); await expect( budgetDiscussionDetailsPage.currentPage @@ -59,7 +59,7 @@ test.describe("Budget proposal logged in state", () => { }); test("11J. Should reply to any comments", async ({}) => { - const randComment = faker.lorem.paragraph(2); + const randComment = faker.lorem.paragraph(1); const randReply = faker.lorem.words(5); await budgetDiscussionDetailsPage.addComment(randComment); From 521d2fd2b94c0a1f8dd2cb4b8dc408e621177f20 Mon Sep 17 00:00:00 2001 From: Niraj Date: Fri, 4 Apr 2025 17:50:57 +0545 Subject: [PATCH 3/4] chore: add proper messge for comment length invalid issue --- .../11-proposal-budget/proposalBudget.spec.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts index 9e7fc2ce2..b00ad58c3 100644 --- a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts +++ b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts @@ -201,9 +201,20 @@ test("11E. Should view comments with count indications on a budget proposal", as await responsePromise; - await expect(budgetDiscussionDetailsPage.totalComments).toHaveText( - comments.length.toString() - ); + const actualTotalComments = + await budgetDiscussionDetailsPage.totalComments.textContent(); + const expectedTotalComments = comments.length.toString(); + const isEqual = actualTotalComments === expectedTotalComments; + + const currentPageUrl = budgetDiscussionDetailsPage.currentPage.url(); + + const proposalId = extractProposalIdFromUrl(currentPageUrl); + + await expect( + budgetDiscussionDetailsPage.totalComments, + !isEqual && + `Total comments do not match in ${environments.frontendUrl}/budget_discussion/${proposalId}` + ).toHaveText(expectedTotalComments); }); test.describe("Restricted access to interact budget proposal", () => { From ca8d2e57bef5afb8ba729e9bcbd6b3544a27db93 Mon Sep 17 00:00:00 2001 From: Niraj Date: Fri, 4 Apr 2025 19:18:44 +0545 Subject: [PATCH 4/4] fix: comment count issue --- .../tests/11-proposal-budget/proposalBudget.spec.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts index b00ad58c3..22a041e45 100644 --- a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts +++ b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts @@ -187,7 +187,7 @@ test("11E. Should view comments with count indications on a budget proposal", as page, }) => { let responsePromise = page.waitForResponse((response) => - response.url().includes(`/api/comments`) + response.url().includes(`/api/bds/`) ); const budgetDiscussionPage = new BudgetDiscussionPage(page); @@ -197,13 +197,12 @@ test("11E. Should view comments with count indications on a budget proposal", as await budgetDiscussionPage.viewFirstProposal(); const response = await responsePromise; - const comments: CommentResponse[] = (await response.json()).data; - - await responsePromise; + const proposalResponse = await response.json(); const actualTotalComments = await budgetDiscussionDetailsPage.totalComments.textContent(); - const expectedTotalComments = comments.length.toString(); + const expectedTotalComments = + proposalResponse.data.attributes.prop_comments_number.toString(); const isEqual = actualTotalComments === expectedTotalComments; const currentPageUrl = budgetDiscussionDetailsPage.currentPage.url();