Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: proposal data edit screen navigation #2336

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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();
});
});
Loading