diff --git a/CHANGELOG.md b/CHANGELOG.md index 66c02cd3f..118436733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,13 +14,14 @@ changes. ### Fixed +- allow casting same vote with a different rationale [Issue 3191](https://github.com/IntersectMBO/govtool/issues/3191) + ### Changed ### Removed ## [v2.0.16](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.16) 2025-03-17 - ### Added - Add support for preprod in matomo analytics [Issue 3173](https://github.com/IntersectMBO/govtool/issues/3173) diff --git a/govtool/frontend/Dockerfile b/govtool/frontend/Dockerfile index e6a821471..026432cfe 100644 --- a/govtool/frontend/Dockerfile +++ b/govtool/frontend/Dockerfile @@ -47,8 +47,11 @@ RUN npm install COPY . . RUN npm run build -FROM nginx:stable-alpine +FROM fholzer/nginx-brotli:v1.23.4 + EXPOSE 80 + COPY nginx.conf /etc/nginx/conf.d/default.conf + COPY --from=builder /src/maintenance-page/index.html /usr/share/nginx/html/maintenance.html COPY --from=builder /src/dist /usr/share/nginx/html diff --git a/govtool/frontend/Dockerfile.qovery b/govtool/frontend/Dockerfile.qovery index 5e46ebcd8..715838ec8 100644 --- a/govtool/frontend/Dockerfile.qovery +++ b/govtool/frontend/Dockerfile.qovery @@ -30,8 +30,11 @@ RUN npm install COPY . . RUN npm run build -FROM nginx:stable-alpine +FROM fholzer/nginx-brotli:v1.23.4 + EXPOSE 80 + COPY nginx.conf /etc/nginx/conf.d/default.conf + COPY --from=builder /src/maintenance-page/index.html /usr/share/nginx/html/maintenance.html COPY --from=builder /src/dist /usr/share/nginx/html diff --git a/govtool/frontend/public/images/AppLogo.png b/govtool/frontend/public/images/AppLogo.png deleted file mode 100644 index 5c9d0e1bf..000000000 Binary files a/govtool/frontend/public/images/AppLogo.png and /dev/null differ diff --git a/govtool/frontend/public/images/AppLogo.webp b/govtool/frontend/public/images/AppLogo.webp new file mode 100644 index 000000000..953782201 Binary files /dev/null and b/govtool/frontend/public/images/AppLogo.webp differ diff --git a/govtool/frontend/public/images/AppLogoWithoutText.png b/govtool/frontend/public/images/AppLogoWithoutText.png deleted file mode 100644 index 16e3aa2f6..000000000 Binary files a/govtool/frontend/public/images/AppLogoWithoutText.png and /dev/null differ diff --git a/govtool/frontend/public/images/AppLogoWithoutText.webp b/govtool/frontend/public/images/AppLogoWithoutText.webp new file mode 100644 index 000000000..2171b12b8 Binary files /dev/null and b/govtool/frontend/public/images/AppLogoWithoutText.webp differ diff --git a/govtool/frontend/public/images/BGBlue.png b/govtool/frontend/public/images/BGBlue.png deleted file mode 100644 index cd6219b27..000000000 Binary files a/govtool/frontend/public/images/BGBlue.png and /dev/null differ diff --git a/govtool/frontend/public/images/BGBlue.webp b/govtool/frontend/public/images/BGBlue.webp new file mode 100644 index 000000000..aef25c4d5 Binary files /dev/null and b/govtool/frontend/public/images/BGBlue.webp differ diff --git a/govtool/frontend/public/images/BGOrange.png b/govtool/frontend/public/images/BGOrange.png deleted file mode 100644 index bec8f1a55..000000000 Binary files a/govtool/frontend/public/images/BGOrange.png and /dev/null differ diff --git a/govtool/frontend/public/images/BGOrange.webp b/govtool/frontend/public/images/BGOrange.webp new file mode 100644 index 000000000..5a5ee7a79 Binary files /dev/null and b/govtool/frontend/public/images/BGOrange.webp differ diff --git a/govtool/frontend/public/images/ErrorPageImage.png b/govtool/frontend/public/images/ErrorPageImage.png deleted file mode 100644 index c5a9db6e2..000000000 Binary files a/govtool/frontend/public/images/ErrorPageImage.png and /dev/null differ diff --git a/govtool/frontend/public/images/ErrorPageImage.webp b/govtool/frontend/public/images/ErrorPageImage.webp new file mode 100644 index 000000000..190a3e291 Binary files /dev/null and b/govtool/frontend/public/images/ErrorPageImage.webp differ diff --git a/govtool/frontend/public/images/GovActionDefault.png b/govtool/frontend/public/images/GovActionDefault.png deleted file mode 100644 index a1588e1d5..000000000 Binary files a/govtool/frontend/public/images/GovActionDefault.png and /dev/null differ diff --git a/govtool/frontend/public/images/GovActionDefault.webp b/govtool/frontend/public/images/GovActionDefault.webp new file mode 100644 index 000000000..81616a802 Binary files /dev/null and b/govtool/frontend/public/images/GovActionDefault.webp differ diff --git a/govtool/frontend/public/images/GovActionDelegate.png b/govtool/frontend/public/images/GovActionDelegate.png deleted file mode 100644 index d391e1a3f..000000000 Binary files a/govtool/frontend/public/images/GovActionDelegate.png and /dev/null differ diff --git a/govtool/frontend/public/images/GovActionDelegate.webp b/govtool/frontend/public/images/GovActionDelegate.webp new file mode 100644 index 000000000..e0ba1e4ec Binary files /dev/null and b/govtool/frontend/public/images/GovActionDelegate.webp differ diff --git a/govtool/frontend/public/images/GovActionList.png b/govtool/frontend/public/images/GovActionList.png deleted file mode 100644 index a783cec9b..000000000 Binary files a/govtool/frontend/public/images/GovActionList.png and /dev/null differ diff --git a/govtool/frontend/public/images/GovActionList.webp b/govtool/frontend/public/images/GovActionList.webp new file mode 100644 index 000000000..89ca11697 Binary files /dev/null and b/govtool/frontend/public/images/GovActionList.webp differ diff --git a/govtool/frontend/public/images/GovActionRegister.png b/govtool/frontend/public/images/GovActionRegister.png deleted file mode 100644 index 8c25d66b7..000000000 Binary files a/govtool/frontend/public/images/GovActionRegister.png and /dev/null differ diff --git a/govtool/frontend/public/images/GovActionRegister.webp b/govtool/frontend/public/images/GovActionRegister.webp new file mode 100644 index 000000000..897b4b782 Binary files /dev/null and b/govtool/frontend/public/images/GovActionRegister.webp differ diff --git a/govtool/frontend/public/images/GovActionsDirectVoter.png b/govtool/frontend/public/images/GovActionsDirectVoter.png deleted file mode 100644 index 69048a4c3..000000000 Binary files a/govtool/frontend/public/images/GovActionsDirectVoter.png and /dev/null differ diff --git a/govtool/frontend/public/images/GovActionsDirectVoter.webp b/govtool/frontend/public/images/GovActionsDirectVoter.webp new file mode 100644 index 000000000..29f5e05e1 Binary files /dev/null and b/govtool/frontend/public/images/GovActionsDirectVoter.webp differ diff --git a/govtool/frontend/public/images/HeroImage.png b/govtool/frontend/public/images/HeroImage.png deleted file mode 100644 index ccef4b680..000000000 Binary files a/govtool/frontend/public/images/HeroImage.png and /dev/null differ diff --git a/govtool/frontend/public/images/HeroImage.webp b/govtool/frontend/public/images/HeroImage.webp new file mode 100644 index 000000000..634cc4aad Binary files /dev/null and b/govtool/frontend/public/images/HeroImage.webp differ diff --git a/govtool/frontend/public/images/ProposeGovAction.png b/govtool/frontend/public/images/ProposeGovAction.png deleted file mode 100644 index a355503a3..000000000 Binary files a/govtool/frontend/public/images/ProposeGovAction.png and /dev/null differ diff --git a/govtool/frontend/public/images/ProposeGovAction.webp b/govtool/frontend/public/images/ProposeGovAction.webp new file mode 100644 index 000000000..8cdab81e3 Binary files /dev/null and b/govtool/frontend/public/images/ProposeGovAction.webp differ diff --git a/govtool/frontend/public/images/SanchoLogo.png b/govtool/frontend/public/images/SanchoLogo.png deleted file mode 100644 index 57b41ffbf..000000000 Binary files a/govtool/frontend/public/images/SanchoLogo.png and /dev/null differ diff --git a/govtool/frontend/public/images/Success.png b/govtool/frontend/public/images/Success.png deleted file mode 100644 index 502d6d40c..000000000 Binary files a/govtool/frontend/public/images/Success.png and /dev/null differ diff --git a/govtool/frontend/public/images/Success.webp b/govtool/frontend/public/images/Success.webp new file mode 100644 index 000000000..6e7d5dcf8 Binary files /dev/null and b/govtool/frontend/public/images/Success.webp differ diff --git a/govtool/frontend/public/images/Warning.png b/govtool/frontend/public/images/Warning.png deleted file mode 100644 index 656a1eb9f..000000000 Binary files a/govtool/frontend/public/images/Warning.png and /dev/null differ diff --git a/govtool/frontend/public/images/Warning.webp b/govtool/frontend/public/images/Warning.webp new file mode 100644 index 000000000..2c5ecad8f Binary files /dev/null and b/govtool/frontend/public/images/Warning.webp differ diff --git a/govtool/frontend/public/images/WarningYellow.png b/govtool/frontend/public/images/WarningYellow.png deleted file mode 100644 index 4967ad821..000000000 Binary files a/govtool/frontend/public/images/WarningYellow.png and /dev/null differ diff --git a/govtool/frontend/public/images/WarningYellow.webp b/govtool/frontend/public/images/WarningYellow.webp new file mode 100644 index 000000000..c65cace2b Binary files /dev/null and b/govtool/frontend/public/images/WarningYellow.webp differ diff --git a/govtool/frontend/src/consts/images.ts b/govtool/frontend/src/consts/images.ts index 9ff66e35a..4325bd550 100644 --- a/govtool/frontend/src/consts/images.ts +++ b/govtool/frontend/src/consts/images.ts @@ -1,17 +1,17 @@ export const IMAGES = { appLogo: "/images/CardanoLogo.svg", - appLogoWithoutText: "/images/AppLogoWithoutText.png", - bgBlue: "/images/BGBlue.png", - bgOrange: "/images/BGOrange.png", - errorPageImage: "/images/ErrorPageImage.png", - govActionDefaultImage: "/images/GovActionDefault.png", - govActionDelegateImage: "/images/GovActionDelegate.png", - govActionListImage: "/images/GovActionList.png", - govActionRegisterImage: "/images/GovActionRegister.png", - heroImage: "/images/HeroImage.png", - proposeGovActionImage: "/images/ProposeGovAction.png", - directVoterImage: "/images/GovActionsDirectVoter.png", - successImage: "/images/Success.png", - warningImage: "/images/Warning.png", - warningYellowImage: "/images/WarningYellow.png", + appLogoWithoutText: "/images/AppLogoWithoutText.webp", + bgBlue: "/images/BGBlue.webp", + bgOrange: "/images/BGOrange.webp", + errorPageImage: "/images/ErrorPageImage.webp", + govActionDefaultImage: "/images/GovActionDefault.webp", + govActionDelegateImage: "/images/GovActionDelegate.webp", + govActionListImage: "/images/GovActionList.webp", + govActionRegisterImage: "/images/GovActionRegister.webp", + heroImage: "/images/HeroImage.webp", + proposeGovActionImage: "/images/ProposeGovAction.webp", + directVoterImage: "/images/GovActionsDirectVoter.webp", + successImage: "/images/Success.webp", + warningImage: "/images/Warning.webp", + warningYellowImage: "/images/WarningYellow.webp", }; diff --git a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx index d3a35ca06..343ff146f 100644 --- a/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx +++ b/govtool/frontend/src/hooks/forms/useVoteActionForm.tsx @@ -69,8 +69,7 @@ export const useVoteActionForm = ({ txHash !== null && index !== undefined && index !== null && - !areFormErrors && - previousVote?.vote !== vote; + !areFormErrors; const confirmVote = useCallback( async (values: VoteActionFormValues) => { diff --git a/govtool/frontend/vite.config.ts b/govtool/frontend/vite.config.ts index 9209ab23f..ffbe9e570 100644 --- a/govtool/frontend/vite.config.ts +++ b/govtool/frontend/vite.config.ts @@ -16,6 +16,17 @@ const viteConfig = defineViteConfig({ define: { "process.env": {}, }, + build: { + chunkSizeWarningLimit: 512, + minify: "terser", + terserOptions: { + compress: { + keep_infinity: true, + drop_console: true, + drop_debugger: true, + }, + }, + }, resolve: { alias: [ { find: "@", replacement: path.resolve(__dirname, "./src") }, diff --git a/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts b/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts index d79a84e51..d6a8713a4 100644 --- a/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/governanceActionDetailsPage.ts @@ -1,6 +1,6 @@ import environments from "@constants/environments"; import { downloadMetadata } from "@helpers/metadata"; -import { Download, Page, Response } from "@playwright/test"; +import { Download, expect, Page, Response } from "@playwright/test"; import metadataBucketService from "@services/metadataBucketService"; import { IProposal } from "@types"; import { withTxConfirmation } from "lib/transaction.decorator"; @@ -76,8 +76,10 @@ export default class GovernanceActionDetailsPage { } @withTxConfirmation - async vote(context?: string) { - await this.yesVoteRadio.click(); + async vote(context?: string, isAlreadyVoted: boolean = false) { + if (!isAlreadyVoted) { + await this.yesVoteRadio.click(); + } if (context) { await this.contextBtn.click(); @@ -98,6 +100,12 @@ export default class GovernanceActionDetailsPage { await this.page.getByTestId("go-to-vote-modal-button").click(); } + const isVoteButtonEnabled = await this.voteBtn.isEnabled(); + + await expect(this.voteBtn, { + message: !isVoteButtonEnabled && "Vote button is not enabled", + }).toBeEnabled({ timeout: 60_000 }); + await this.voteBtn.click(); } @@ -126,10 +134,12 @@ export default class GovernanceActionDetailsPage { async getDRepTotalAbstainVoted( proposal: IProposal, - metricsResponsePromise: Promise + totalStakeResponsePromise: Promise ): Promise { - const metricsResponses = await Promise.resolve(metricsResponsePromise); - const alwaysAbstainVotingPower = await metricsResponses + const totalStakeResponses = await Promise.resolve( + totalStakeResponsePromise + ); + const alwaysAbstainVotingPower = await totalStakeResponses .json() .then((data) => data.alwaysAbstainVotingPower); @@ -154,6 +164,6 @@ export default class GovernanceActionDetailsPage { @withTxConfirmation async reVote() { await this.noVoteRadio.click(); - await this.voteBtn.click(); + await this.changeVoteBtn.click(); } } diff --git a/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts b/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts index 525efd75e..5ac4a9512 100644 --- a/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/governanceActionsPage.ts @@ -23,6 +23,10 @@ export default class GovernanceActionsPage { await this.page.waitForTimeout(2_000); // Waits to ensure the alert-success popup does not interfere } + get currentPage(): Page { + return this.page; + } + async viewProposal( proposal: IProposal ): Promise { diff --git a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts index 8a69e5bf3..e1e298704 100644 --- a/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/outcomeDetailsPage.ts @@ -46,13 +46,11 @@ export default class OutcomeDetailsPage { ): Promise { const alwaysAbstainVotingPower = await metricsResponses .json() - .then((res) => res.alwaysAbstainVotingPower); - if ( - alwaysAbstainVotingPower && - typeof alwaysAbstainVotingPower === "number" - ) { + .then((res) => res.always_abstain_voting_power); + + if (alwaysAbstainVotingPower) { const totalAbstainVoted = - alwaysAbstainVotingPower + parseInt(proposal.abstain_votes); + parseInt(alwaysAbstainVotingPower) + parseInt(proposal.abstain_votes); return totalAbstainVoted; } else { 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 1c8a25cf3..48e75c3ab 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 @@ -116,8 +116,6 @@ test.describe("Temporary DReps", async () => { }); test("4J. Should include metadata anchor in the vote transaction", async ({}, testInfo) => { - test.skip(); // Skipped: Vote context is not displayed in UI to validate - test.setTimeout(testInfo.timeout + environments.txTimeOut); const govActionsPage = new GovernanceActionsPage(dRepPage); @@ -130,6 +128,8 @@ test.describe("Temporary DReps", async () => { await govActionsPage.votedTab.click(); await govActionsPage.viewFirstVotedProposal(); + + // Vote context is not displayed in UI to validate expect(false, "No vote context displayed").toBe(true); }); }); @@ -150,10 +150,6 @@ test.describe("Check vote count", () => { ) ); - const metricsResponsePromise = page.waitForResponse((response) => - response.url().includes(`network/metrics`) - ); - const governanceActionsPage = new GovernanceActionsPage(page); await governanceActionsPage.goto(); @@ -179,19 +175,23 @@ test.describe("Check vote count", () => { storageState: ".auth/dRep01.json", wallet: dRep01Wallet, }); + + const totalStakeResponsePromise = dRepPage.waitForResponse((response) => + response.url().includes(`network/total-stake`) + ); const govActionDetailsPage = new GovernanceActionDetailsPage(dRepPage); await govActionDetailsPage.goto( `${proposalToCheck.txHash}#${proposalToCheck.index}` ); + await govActionDetailsPage.showVotesBtn.click(); + const dRepTotalAbstainVote = await govActionDetailsPage.getDRepTotalAbstainVoted( proposalToCheck, - metricsResponsePromise + totalStakeResponsePromise ); - await govActionDetailsPage.showVotesBtn.click(); - // check dRep votes if (await areDRepVoteTotalsDisplayed(proposalToCheck)) { await expect(govActionDetailsPage.dRepYesVotes).toHaveText( 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 f86f2dfa5..999a38f2a 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 @@ -222,10 +222,6 @@ test("4K. Should display correct vote counts on governance details page for disc ) ); - const metricsResponsePromise = page.waitForResponse((response) => - response.url().includes(`network/metrics`) - ); - const governanceActionsPage = new GovernanceActionsPage(page); await governanceActionsPage.goto(); const responses = await Promise.all(responsesPromise); @@ -248,6 +244,9 @@ test("4K. Should display correct vote counts on governance details page for disc uniqueProposalTypes.map(async (proposalToCheck) => { const newPage = await browser.newPage(); injectLogger(newPage); + const totalStakeResponsePromise = newPage.waitForResponse((response) => + response.url().includes(`network/total-stake`) + ); const govActionDetailsPage = new GovernanceActionDetailsPage(newPage); await govActionDetailsPage.goto( `${proposalToCheck.txHash}#${proposalToCheck.index}` @@ -256,7 +255,7 @@ test("4K. Should display correct vote counts on governance details page for disc const dRepTotalAbstainVote = await govActionDetailsPage.getDRepTotalAbstainVoted( proposalToCheck, - metricsResponsePromise + totalStakeResponsePromise ); // check dRep votes 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 3f7e7e838..fb0bf4c96 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 @@ -136,7 +136,6 @@ test.describe("Proposal checks", () => { test.describe("Perform voting", () => { let govActionDetailsPage: GovernanceActionDetailsPage; - let dRepPage: Page; test.beforeEach(async ({ page, browser }) => { test.slow(); // Due to queue in pop wallets @@ -145,7 +144,7 @@ test.describe("Perform voting", () => { const tempDRepAuth = await createTempDRepAuth(page, wallet); - dRepPage = await createNewPageWithWallet(browser, { + const dRepPage = await createNewPageWithWallet(browser, { storageState: tempDRepAuth, wallet, enableStakeSigning: true, @@ -166,7 +165,7 @@ test.describe("Perform voting", () => { : await govActionsPage.viewFirstProposal(); }); - test("5E. Should re-vote with new data on a already voted governance action", async ({}, testInfo) => { + test("5E. Should re-vote with change vote on an already voted governance action", async ({}, testInfo) => { test.setTimeout(testInfo.timeout + 2 * environments.txTimeOut); await govActionDetailsPage.vote(); @@ -175,7 +174,7 @@ test.describe("Perform voting", () => { govActionDetailsPage.currentPage ); - await dRepPage.waitForTimeout(5_000); + await governanceActionsPage.currentPage.reload(); await governanceActionsPage.votedTab.click(); @@ -190,7 +189,7 @@ test.describe("Perform voting", () => { govActionDetailsPage = await governanceActionsPage.viewFirstVotedProposal(); await govActionDetailsPage.reVote(); - await dRepPage.reload(); + await govActionDetailsPage.currentPage.reload(); await governanceActionsPage.votedTab.click(); @@ -224,6 +223,56 @@ test.describe("Perform voting", () => { }); }); + test("5L. Should update context on an already voted governance action without changing the vote", async ({}, testInfo) => { + test.setTimeout(testInfo.timeout + 2 * environments.txTimeOut); + + await govActionDetailsPage.vote(); + + const governanceActionsPage = new GovernanceActionsPage( + govActionDetailsPage.currentPage + ); + + await governanceActionsPage.currentPage.reload(); + + await governanceActionsPage.votedTab.click(); + + await govActionDetailsPage.currentPage.evaluate(() => + window.scrollTo(0, 500) + ); + + await expect( + govActionDetailsPage.currentPage.getByTestId("my-vote").getByText("Yes") + ).toBeVisible(); + + govActionDetailsPage = await governanceActionsPage.viewFirstVotedProposal(); + await govActionDetailsPage.vote(faker.lorem.sentence(200), true); + + await govActionDetailsPage.currentPage.reload(); + + await governanceActionsPage.votedTab.click(); + + const isYesVoteVisible = await govActionDetailsPage.currentPage + .getByTestId("my-vote") + .getByText("Yes") + .isVisible(); + + const textContent = await govActionDetailsPage.currentPage + .getByTestId("my-vote") + .textContent(); + + await govActionDetailsPage.currentPage.evaluate(() => + window.scrollTo(0, 500) + ); + await expect( + govActionDetailsPage.currentPage.getByTestId("my-vote").getByText("No"), + { + message: + !isYesVoteVisible && + `"Yes" vote not visible, current vote status: ${textContent.match(/My Vote:(Yes|No)/)[1]}`, + } + ).toBeVisible({ timeout: 60_000 }); + }); + test("5I. Should view the vote details,when viewing governance action already voted by the DRep", async ({}, testInfo) => { test.setTimeout(testInfo.timeout + environments.txTimeOut); @@ -233,7 +282,7 @@ test.describe("Perform voting", () => { govActionDetailsPage.currentPage ); - await dRepPage.waitForTimeout(5_000); + await governanceActionsPage.currentPage.waitForTimeout(5_000); await governanceActionsPage.votedTab.click(); await expect( diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts index ad97b87d1..f10ee426c 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts @@ -104,7 +104,7 @@ test("6M. Should navigate between footer links", async ({ page, context }) => { }); test("6O. Should display proper network name", async ({ page }) => { - await page.route("**/network/metrics", async (route) => { + await page.route("**/network/info", async (route) => { // Fetch the original response from the server const response = await route.fetch(); const json = await response.json(); @@ -119,7 +119,7 @@ test("6O. Should display proper network name", async ({ page }) => { body: JSON.stringify(json), }); }); - const responsePromise = page.waitForResponse("**/network/metrics"); + const responsePromise = page.waitForResponse("**/network/info"); await page.goto("/"); const response = await responsePromise; diff --git a/tests/govtool-frontend/playwright/tests/9-outcomes/outcomes.spec.ts b/tests/govtool-frontend/playwright/tests/9-outcomes/outcomes.spec.ts index 9a3b1ab95..4c7c41841 100644 --- a/tests/govtool-frontend/playwright/tests/9-outcomes/outcomes.spec.ts +++ b/tests/govtool-frontend/playwright/tests/9-outcomes/outcomes.spec.ts @@ -330,9 +330,7 @@ test("9G. Should display correct vote counts on outcome details page", async ({ ); const metricsResponsePromise = page.waitForResponse( - (response) => - response.url().includes(`/network/metrics`) && - !response.url().includes(`/misc/network/metrics`), + (response) => response.url().includes(`/misc/network/metrics`), { timeout: 60_000 } ); diff --git a/tests/govtool-frontend/playwright/tests/dRep.setup.ts b/tests/govtool-frontend/playwright/tests/dRep.setup.ts index 494f502e1..239e10e6d 100644 --- a/tests/govtool-frontend/playwright/tests/dRep.setup.ts +++ b/tests/govtool-frontend/playwright/tests/dRep.setup.ts @@ -13,7 +13,7 @@ import walletManager from "lib/walletManager"; import { functionWaitedAssert } from "@helpers/waitedLoop"; const REGISTER_DREP_WALLETS_COUNT = 6; -const DREP_WALLETS_COUNT = 9; +const DREP_WALLETS_COUNT = 10; let dRepDeposit: number;