From 551821132b28e3f41f7dd96e5ebf6dfbfeefecac Mon Sep 17 00:00:00 2001 From: joseph rana Date: Fri, 15 Aug 2025 13:27:03 +0545 Subject: [PATCH 01/11] fix undefined data test id issue for image input --- govtool/frontend/src/components/molecules/DRepDataForm.tsx | 2 +- .../src/components/organisms/UncontrolledImageInput.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/govtool/frontend/src/components/molecules/DRepDataForm.tsx b/govtool/frontend/src/components/molecules/DRepDataForm.tsx index 6b2a65506..e5b077b49 100644 --- a/govtool/frontend/src/components/molecules/DRepDataForm.tsx +++ b/govtool/frontend/src/components/molecules/DRepDataForm.tsx @@ -107,7 +107,7 @@ export const DRepDataForm = ({ control, errors, register, watch }: Props) => { subtitle={t("forms.dRepData.imageHelpfulText")} /> ({ /> {fieldState.error && ( )} From eab2adb1e726f60ec5f83ef658c0207bb80af1a8 Mon Sep 17 00:00:00 2001 From: joseph rana Date: Fri, 15 Aug 2025 13:28:05 +0545 Subject: [PATCH 02/11] fix:update image input related data test id and display message --- tests/govtool-frontend/playwright/lib/forms/dRepForm.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/govtool-frontend/playwright/lib/forms/dRepForm.ts b/tests/govtool-frontend/playwright/lib/forms/dRepForm.ts index 63516b43a..74d6fe61c 100644 --- a/tests/govtool-frontend/playwright/lib/forms/dRepForm.ts +++ b/tests/govtool-frontend/playwright/lib/forms/dRepForm.ts @@ -13,7 +13,7 @@ const formErrors = { ], linkDescription: "max-80-characters-error", email: "invalid-email-address-error", - image: "invalid-image-url-error", + image: "invalid-image-input-error", links: { url: "link-reference-description-1-error", description: "link-reference-description-1-error", @@ -304,7 +304,7 @@ export default class DRepForm { }).not.toEqual(dRepInfo.qualifications); await expect(this.form.getByTestId(formErrors.image), { - message: !isImageErrorVisible && `${dRepInfo.image} is a valid image`, + message: !isImageErrorVisible && `Invalid image URL or properly formatted base64-encoded image`, }).toBeVisible({ timeout: 60_000, }); From 931c12eb99693045fa31c2929f820cc9bc99cee4 Mon Sep 17 00:00:00 2001 From: joseph rana Date: Fri, 15 Aug 2025 14:02:05 +0545 Subject: [PATCH 03/11] fix: replace show all btn with link in governance actions page --- .../tests/4-proposal-visibility/proposalVisibility.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts index adab72a92..740935a99 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts @@ -189,7 +189,7 @@ test("4M. Should show view-all categorized governance actions", async ({ const governanceActionPage = new GovernanceActionsPage(page); await governanceActionPage.goto(); - await page.getByRole("button", { name: "Show All" }).click(); + await page.getByRole("link", { name: "Show All" }).click(); const proposalCards = await governanceActionPage.getAllProposals(); From 8b3fdaae756c06b3a508c7296ffdd3bd2100de1f Mon Sep 17 00:00:00 2001 From: joseph rana Date: Fri, 15 Aug 2025 14:52:53 +0545 Subject: [PATCH 04/11] chore: move voting tests to proposal functionality --- .../proposalVisibility.dRep.spec.ts | 1 - .../proposalFunctionality.dRep.spec.ts | 49 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts index aea5f9c61..1e7c1e1e1 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts @@ -67,7 +67,6 @@ test.describe("Logged in DRep", () => { ) : await govActionsPage.viewFirstProposal(); - await govActionDetailsPage.contextBtn.click(); await govActionDetailsPage.contextInput.fill(faker.lorem.sentence(200)); await govActionDetailsPage.confirmModalBtn.click(); await page.getByRole("checkbox").click(); diff --git a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts index e41b0def9..15d0a6c4e 100644 --- a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts @@ -315,3 +315,52 @@ test.describe("Check voting power", () => { expect(balance, "Retirement deposit not returned").toBeGreaterThan(500); }); }); + +test.describe("Temporary DReps Voting", async () => { + let dRepPage: Page; + + test.beforeEach(async ({ page, browser }) => { + const wallet = await walletManager.popWallet("registeredDRep"); + const tempDRepAuth = await createTempDRepAuth(page, wallet); + dRepPage = await createNewPageWithWallet(browser, { + storageState: tempDRepAuth, + wallet, + enableDRepSigning: true, + }); + }); + + const verifyVoteWithMetadata = async (testInfo: any, useGovToolIPFS: boolean = false) => { + test.setTimeout(testInfo.timeout + environments.txTimeOut); + + const govActionsPage = new GovernanceActionsPage(dRepPage); + await govActionsPage.goto(); + + const govActionDetailsPage = await govActionsPage.viewFirstProposal(); + const fakerContext = faker.lorem.sentence(200); + + if (useGovToolIPFS) { + await govActionDetailsPage.vote(fakerContext, false, true); + } else { + await govActionDetailsPage.vote(fakerContext); + } + + await dRepPage.reload(); + await dRepPage.waitForTimeout(5_000); + await govActionsPage.votedTab.click(); + + const votedGovActionDetailsPage = await govActionsPage.viewFirstVotedProposal(); + await votedGovActionDetailsPage.currentPage.getByTestId("show-more-button").click(); + await votedGovActionDetailsPage.currentPage.waitForTimeout(2000); + + const voteRationaleContext = await votedGovActionDetailsPage.currentPage.getByTestId("vote-rationale-context"); + await expect(voteRationaleContext).toContainText(fakerContext); + }; + + test("5M. Should vote with Context (Download and store yourself)", async ({}, testInfo) => { + await verifyVoteWithMetadata(testInfo, false); + }); + + test("4N. Should vote with Context (GovTool pins data to IPFS)", async ({}, testInfo) => { + await verifyVoteWithMetadata(testInfo, true); + }); +}); \ No newline at end of file From 42ecf9eb7abbf595002f62e1070b84751dd04fd4 Mon Sep 17 00:00:00 2001 From: joseph rana Date: Fri, 15 Aug 2025 15:04:58 +0545 Subject: [PATCH 05/11] add include metadata anchor in vote transaction test --- .../proposalVisibility.dRep.spec.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts index 1e7c1e1e1..3000c0ce8 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts @@ -113,7 +113,7 @@ test.describe("Temporary DReps", async () => { }); }); - const verifyVoteWithMetadata = async (testInfo: any, useGovToolIPFS: boolean = false) => { + const verifyVoteWithMetadata = async (testInfo: any) => { test.setTimeout(testInfo.timeout + environments.txTimeOut); const govActionsPage = new GovernanceActionsPage(dRepPage); @@ -122,11 +122,7 @@ test.describe("Temporary DReps", async () => { const govActionDetailsPage = await govActionsPage.viewFirstProposal(); const fakerContext = faker.lorem.sentence(200); - if (useGovToolIPFS) { - await govActionDetailsPage.vote(fakerContext, false, true); - } else { - await govActionDetailsPage.vote(fakerContext); - } + await govActionDetailsPage.vote(fakerContext); await dRepPage.reload(); await dRepPage.waitForTimeout(5_000); @@ -140,12 +136,8 @@ test.describe("Temporary DReps", async () => { await expect(voteRationaleContext).toContainText(fakerContext); }; - test("4J. Should include metadata anchor in the vote transaction (Download and store yourself)", async ({}, testInfo) => { - await verifyVoteWithMetadata(testInfo, false); - }); - - test("4k. Should include metadata anchor in the vote transaction (GovTool pins data to IPFS)", async ({}, testInfo) => { - await verifyVoteWithMetadata(testInfo, true); + test("4J. Should include metadata anchor in the vote transaction", async ({}, testInfo) => { + await verifyVoteWithMetadata(testInfo); }); }); From 8b03f189e97f968782ffab820e878fe1473c80ff Mon Sep 17 00:00:00 2001 From: joseph rana Date: Fri, 22 Aug 2025 14:16:32 +0545 Subject: [PATCH 06/11] fix: handle outcomeResponse as single object instead of array --- .../govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts index cbf39d9ca..a22b56110 100644 --- a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts @@ -111,7 +111,7 @@ export default class OutcomeDetailsPage { } const outcomeResponse = await outcomeResponsePromise; - const proposalToCheck = (await outcomeResponse.json())[0]; + const proposalToCheck = (await outcomeResponse.json()); const metricsResponse = await metricsResponsePromise; From b8b845c80db2557fe1d36585c36bc077d961f4ba Mon Sep 17 00:00:00 2001 From: joseph rana Date: Fri, 22 Aug 2025 16:14:09 +0545 Subject: [PATCH 07/11] chore: remove duplicate test --- .../playwright/lib/pages/outcomesPage.ts | 4 +- .../proposalVisibility.dRep.spec.ts | 41 ------------------- .../proposalFunctionality.dRep.spec.ts | 4 +- .../playwright/tests/dRep.setup.ts | 3 +- 4 files changed, 5 insertions(+), 47 deletions(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/outcomesPage.ts b/tests/govtool-frontend/playwright/lib/pages/outcomesPage.ts index 97d146349..32fe6dd98 100644 --- a/tests/govtool-frontend/playwright/lib/pages/outcomesPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/outcomesPage.ts @@ -579,7 +579,7 @@ export default class OutComesPage { const metricsResponsePromise = page.waitForResponse( (response) => response.url().includes(`/misc/network/metrics?epoch`), - { timeout: 60_000 } + { timeout: 120_000 } ); expect( @@ -597,7 +597,7 @@ export default class OutComesPage { .includes( `governance-actions/${governanceTransactionHash}?index=${governanceActionIndex}` ), - { timeout: 60_000 } + { timeout: 120_000 } ); const govActionDetailsPage = await outcomePage.viewFirstOutcomes(); diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts index 3000c0ce8..ff40cf000 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts @@ -100,47 +100,6 @@ test.describe("Logged in DRep", () => { }); }); -test.describe("Temporary DReps", async () => { - let dRepPage: Page; - - test.beforeEach(async ({ page, browser }) => { - const wallet = await walletManager.popWallet("registeredDRep"); - const tempDRepAuth = await createTempDRepAuth(page, wallet); - dRepPage = await createNewPageWithWallet(browser, { - storageState: tempDRepAuth, - wallet, - enableDRepSigning: true, - }); - }); - - const verifyVoteWithMetadata = async (testInfo: any) => { - test.setTimeout(testInfo.timeout + environments.txTimeOut); - - const govActionsPage = new GovernanceActionsPage(dRepPage); - await govActionsPage.goto(); - - const govActionDetailsPage = await govActionsPage.viewFirstProposal(); - const fakerContext = faker.lorem.sentence(200); - - await govActionDetailsPage.vote(fakerContext); - - await dRepPage.reload(); - await dRepPage.waitForTimeout(5_000); - await govActionsPage.votedTab.click(); - - const votedGovActionDetailsPage = await govActionsPage.viewFirstVotedProposal(); - await votedGovActionDetailsPage.currentPage.getByTestId("show-more-button").click(); - await votedGovActionDetailsPage.currentPage.waitForTimeout(2000); - - const voteRationaleContext = await votedGovActionDetailsPage.currentPage.getByTestId("vote-rationale-context"); - await expect(voteRationaleContext).toContainText(fakerContext); - }; - - test("4J. Should include metadata anchor in the vote transaction", async ({}, testInfo) => { - await verifyVoteWithMetadata(testInfo); - }); -}); - test.describe("Check vote count", () => { test.use({ storageState: dRep01AuthFile, wallet: dRep01Wallet }); diff --git a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts index 15d0a6c4e..7ec1f3a38 100644 --- a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts @@ -356,11 +356,11 @@ test.describe("Temporary DReps Voting", async () => { await expect(voteRationaleContext).toContainText(fakerContext); }; - test("5M. Should vote with Context (Download and store yourself)", async ({}, testInfo) => { + test("5M_1. Should vote with Context (Download and store yourself)", async ({}, testInfo) => { await verifyVoteWithMetadata(testInfo, false); }); - test("4N. Should vote with Context (GovTool pins data to IPFS)", async ({}, testInfo) => { + test("5M_2. Should vote with Context (GovTool pins data to IPFS)", async ({}, testInfo) => { await verifyVoteWithMetadata(testInfo, true); }); }); \ No newline at end of file diff --git a/tests/govtool-frontend/playwright/tests/dRep.setup.ts b/tests/govtool-frontend/playwright/tests/dRep.setup.ts index 47d4f1647..7268baeb7 100644 --- a/tests/govtool-frontend/playwright/tests/dRep.setup.ts +++ b/tests/govtool-frontend/playwright/tests/dRep.setup.ts @@ -12,10 +12,9 @@ import kuberService from "@services/kuberService"; import walletManager from "lib/walletManager"; import { functionWaitedAssert } from "@helpers/waitedLoop"; import { StaticWallet } from "@types"; -import { Logger } from "@helpers/logger"; const REGISTER_DREP_WALLETS_COUNT = 6; -const DREP_WALLETS_COUNT = 11; +const DREP_WALLETS_COUNT = 10; let dRepDeposit: number; From e438448dca44cc96329d6c52bca8251a7885e33a Mon Sep 17 00:00:00 2001 From: joseph rana Date: Mon, 25 Aug 2025 13:18:48 +0545 Subject: [PATCH 08/11] fix: udpate gov action api call regex --- .../playwright/lib/pages/outcomeDetailsPage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts index a22b56110..668997f2c 100644 --- a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts @@ -295,10 +295,10 @@ export default class OutcomeDetailsPage { url: string; hash: string; }) { - await this.page.route(/.*\/governance-actions\/[a-f0-9]{64}\?.*/, (route) => + await this.page.route("**/governance-actions*", (route) => route.fulfill({ body: JSON.stringify([outcomeResponse]) }) ); - + const outcomePage = new OutComesPage(this.page); await outcomePage.goto(); await outcomePage.viewFirstOutcomes(); From 2ae6c66fc465892ec66b9e78c96c410345670a89 Mon Sep 17 00:00:00 2001 From: joseph rana Date: Mon, 25 Aug 2025 14:50:46 +0545 Subject: [PATCH 09/11] fix gov action network interception response --- .../playwright/lib/pages/outcomeDetailsPage.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts index 668997f2c..6ead1d8be 100644 --- a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts @@ -188,7 +188,7 @@ export default class OutcomeDetailsPage { filterKey === "NoConfidence" ? proposalToCheck.pool_no_votes : parseInt(sPosNoConfidence.replace(/,/g, "")) * 1000000 + - parseInt(proposalToCheck.pool_no_votes); + parseInt(proposalToCheck.pool_no_votes); const totalSposYesVotesForNoConfidence = parseInt(sPosNoConfidence.replace(/,/g, "")) * 1000000 + @@ -295,19 +295,24 @@ export default class OutcomeDetailsPage { url: string; hash: string; }) { - await this.page.route("**/governance-actions*", (route) => - route.fulfill({ body: JSON.stringify([outcomeResponse]) }) + let governanceActionPromise = this.page.route("**/governance-actions/*", async (route) => { + if (route.request().url().includes("/governance-actions/metadata")) { + await route.continue(); + } else { + await route.fulfill({ body: JSON.stringify(outcomeResponse)}); + } + } ); - const outcomePage = new OutComesPage(this.page); await outcomePage.goto(); await outcomePage.viewFirstOutcomes(); + await governanceActionPromise; const outcomeTitle = await outcomePage.title.textContent(); await expect( outcomePage.title, outcomeTitle.toLowerCase() !== type.toLowerCase() && - `The URL "${url}" and hash "${hash}" do not match the expected properties for type "${type}".` + `The URL "${url}" and hash "${hash}" do not match the expected properties for type "${type}".` ).toHaveText(type, { ignoreCase: true, timeout: 60_000, From 3b52ae102c77d6e28b255902f5d672f271d8d2f2 Mon Sep 17 00:00:00 2001 From: joseph rana Date: Wed, 27 Aug 2025 10:46:12 +0545 Subject: [PATCH 10/11] chore: increase wallet generation count --- tests/govtool-frontend/playwright/tests/dRep.setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/govtool-frontend/playwright/tests/dRep.setup.ts b/tests/govtool-frontend/playwright/tests/dRep.setup.ts index 7268baeb7..d4c2e9936 100644 --- a/tests/govtool-frontend/playwright/tests/dRep.setup.ts +++ b/tests/govtool-frontend/playwright/tests/dRep.setup.ts @@ -14,7 +14,7 @@ import { functionWaitedAssert } from "@helpers/waitedLoop"; import { StaticWallet } from "@types"; const REGISTER_DREP_WALLETS_COUNT = 6; -const DREP_WALLETS_COUNT = 10; +const DREP_WALLETS_COUNT = 11; let dRepDeposit: number; From fd84704ecfce056685686ec199ea3d6e6257808f Mon Sep 17 00:00:00 2001 From: joseph rana Date: Wed, 27 Aug 2025 11:46:09 +0545 Subject: [PATCH 11/11] refactor: move voting related tests to perform voting group --- .../proposalFunctionality.dRep.spec.ts | 87 ++++++++----------- 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts index 7ec1f3a38..4d8052543 100644 --- a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts @@ -138,6 +138,8 @@ test.describe("Proposal checks", () => { test.describe("Perform voting", () => { let govActionDetailsPage: GovernanceActionDetailsPage; + let dRepPage: Page; + let govActionsPage: GovernanceActionsPage; test.beforeEach(async ({ page, browser }) => { test.slow(); // Due to queue in pop wallets @@ -146,14 +148,14 @@ test.describe("Perform voting", () => { const tempDRepAuth = await createTempDRepAuth(page, wallet); - const dRepPage = await createNewPageWithWallet(browser, { + dRepPage = await createNewPageWithWallet(browser, { storageState: tempDRepAuth, wallet, enableDRepSigning: true, }); - const govActionsPage = new GovernanceActionsPage(dRepPage); - await govActionsPage.goto(); + govActionsPage = new GovernanceActionsPage(dRepPage); + govActionsPage.goto(); // assert to wait until the loading button is hidden await expect(dRepPage.getByTestId("to-vote-tab")).toBeVisible({ @@ -282,6 +284,36 @@ test.describe("Perform voting", () => { govActionDetailsPage.currentPage.getByTestId("my-vote").getByText("Yes") ).toBeVisible(); }); + + const verifyVoteWithMetadata = async (testInfo: any, useGovToolIPFS: boolean = false) => { + test.setTimeout(testInfo.timeout + environments.txTimeOut); + const fakerContext = faker.lorem.sentence(200); + + if (useGovToolIPFS) { + await govActionDetailsPage.vote(fakerContext, false, true); + } else { + await govActionDetailsPage.vote(fakerContext); + } + + await dRepPage.reload(); + await dRepPage.waitForTimeout(5_000); + await govActionsPage.votedTab.click(); + + const votedGovActionDetailsPage = await govActionsPage.viewFirstVotedProposal(); + await votedGovActionDetailsPage.currentPage.getByTestId("show-more-button").click(); + await votedGovActionDetailsPage.currentPage.waitForTimeout(2000); + + const voteRationaleContext = await votedGovActionDetailsPage.currentPage.getByTestId("vote-rationale-context"); + await expect(voteRationaleContext).toContainText(fakerContext); + }; + + test("5M_1. Should vote with Context (Download and store yourself)", async ({}, testInfo) => { + await verifyVoteWithMetadata(testInfo, false); + }); + + test("5M_2. Should vote with Context (GovTool pins data to IPFS)", async ({}, testInfo) => { + await verifyVoteWithMetadata(testInfo, true ); + }); }); test.describe("Check voting power", () => { @@ -315,52 +347,3 @@ test.describe("Check voting power", () => { expect(balance, "Retirement deposit not returned").toBeGreaterThan(500); }); }); - -test.describe("Temporary DReps Voting", async () => { - let dRepPage: Page; - - test.beforeEach(async ({ page, browser }) => { - const wallet = await walletManager.popWallet("registeredDRep"); - const tempDRepAuth = await createTempDRepAuth(page, wallet); - dRepPage = await createNewPageWithWallet(browser, { - storageState: tempDRepAuth, - wallet, - enableDRepSigning: true, - }); - }); - - const verifyVoteWithMetadata = async (testInfo: any, useGovToolIPFS: boolean = false) => { - test.setTimeout(testInfo.timeout + environments.txTimeOut); - - const govActionsPage = new GovernanceActionsPage(dRepPage); - await govActionsPage.goto(); - - const govActionDetailsPage = await govActionsPage.viewFirstProposal(); - const fakerContext = faker.lorem.sentence(200); - - if (useGovToolIPFS) { - await govActionDetailsPage.vote(fakerContext, false, true); - } else { - await govActionDetailsPage.vote(fakerContext); - } - - await dRepPage.reload(); - await dRepPage.waitForTimeout(5_000); - await govActionsPage.votedTab.click(); - - const votedGovActionDetailsPage = await govActionsPage.viewFirstVotedProposal(); - await votedGovActionDetailsPage.currentPage.getByTestId("show-more-button").click(); - await votedGovActionDetailsPage.currentPage.waitForTimeout(2000); - - const voteRationaleContext = await votedGovActionDetailsPage.currentPage.getByTestId("vote-rationale-context"); - await expect(voteRationaleContext).toContainText(fakerContext); - }; - - test("5M_1. Should vote with Context (Download and store yourself)", async ({}, testInfo) => { - await verifyVoteWithMetadata(testInfo, false); - }); - - test("5M_2. Should vote with Context (GovTool pins data to IPFS)", async ({}, testInfo) => { - await verifyVoteWithMetadata(testInfo, true); - }); -}); \ No newline at end of file