From 8ae179c38e5debc8dcc543e84e2ea1b79eef131b Mon Sep 17 00:00:00 2001 From: Niraj Date: Wed, 6 Nov 2024 14:41:11 +0545 Subject: [PATCH] test: navigation to edit proposal on invalid metadata url modal 'go to data edit screen' --- .../proposalDiscussion.loggedin.spec.ts | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.loggedin.spec.ts index a452b8101..fa9dbc999 100644 --- a/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.loggedin.spec.ts @@ -12,6 +12,7 @@ import ProposalDiscussionDetailsPage from "@pages/proposalDiscussionDetailsPage" import { Page, expect } from "@playwright/test"; import { setAllureEpic } from "@helpers/allure"; import { skipIfNotHardFork } from "@helpers/cardano"; +import ProposalSubmissionPage from "@pages/proposalSubmissionPage"; test.beforeEach(async () => { await setAllureEpic("8. Proposal Discussion Forum"); @@ -154,9 +155,10 @@ test.describe("Proposal created with poll enabled (proposal auth)", () => { }); let ownerProposalDiscussionDetailsPage: ProposalDiscussionDetailsPage; + let proposalPage: Page; test.beforeEach(async ({ browser, proposalId }) => { - const proposalPage = await createNewPageWithWallet(browser, { + proposalPage = await createNewPageWithWallet(browser, { storageState: ".auth/proposal01.json", wallet: proposal01Wallet, }); @@ -187,4 +189,36 @@ test.describe("Proposal created with poll enabled (proposal auth)", () => { await expect(userProposalDetailsPage.pollYesBtn).not.toBeVisible(); await expect(userProposalDetailsPage.pollNoBtn).not.toBeVisible(); }); + + test("8U. Should navigate to the edit proposal page when 'goto data edit screen' is selected if data does not match the anchor URL", async () => { + const invalidMetadataAnchorUrl = "https://www.google.com"; + await ownerProposalDiscussionDetailsPage.submitAsGABtn.click(); + + const proposalSubmissionPage = new ProposalSubmissionPage(proposalPage); + await proposalPage.getByTestId("agree-checkbox").click(); + await proposalSubmissionPage.continueBtn.click(); + await proposalSubmissionPage.metadataUrlInput.fill( + invalidMetadataAnchorUrl + ); + await proposalSubmissionPage.submitBtn.click(); + + await expect( + proposalPage.getByTestId("data-not-match-modal") + ).toBeVisible(); + await expect( + proposalPage.getByTestId("data-not-match-modal-go-to-data-button") + ).toBeVisible(); + + await proposalPage + .getByTestId("data-not-match-modal-go-to-data-button") + .click(); + + await expect( + proposalPage.getByTestId("governance-action-type") + ).toBeVisible(); + await expect(proposalPage.getByTestId("title-input")).toBeVisible(); + await expect(proposalPage.getByTestId("abstract-input")).toBeVisible(); + await expect(proposalPage.getByTestId("motivation-input")).toBeVisible(); + await expect(proposalPage.getByTestId("rationale-input")).toBeVisible(); + }); });