From db60f0fd86efe0d35028cc5439629deec1379b8d Mon Sep 17 00:00:00 2001 From: Nabin Kawan Date: Wed, 3 Jul 2024 13:52:07 +0545 Subject: [PATCH 1/2] feat: Enable create proposal 01 auth --- .../playwright/tests/auth.setup.ts | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/govtool-frontend/playwright/tests/auth.setup.ts b/tests/govtool-frontend/playwright/tests/auth.setup.ts index f921830e6..043004498 100644 --- a/tests/govtool-frontend/playwright/tests/auth.setup.ts +++ b/tests/govtool-frontend/playwright/tests/auth.setup.ts @@ -128,20 +128,20 @@ setup("Create AdaHolder 06 auth", async ({ page, context }) => { await context.storageState({ path: adaHolder06AuthFile }); }); -/** - * TODO: Uncomment this - * This has been commented to temporarily disable pdf-tests - */ -// setup("Create Proposal 01 auth", async ({ page, context }) => { -// await importWallet(page, proposal01Wallet); - -// const loginPage = new LoginPage(page); -// await loginPage.login(); -// await loginPage.isLoggedIn(); - -// const proposalDiscussionPage = new ProposalDiscussionPage(page); -// await proposalDiscussionPage.goto(); -// await proposalDiscussionPage.setUsername(faker.internet.userName()); - -// await context.storageState({ path: proposal01AuthFile }); -// }); +setup("Create Proposal 01 auth", async ({ page, context }) => { + await importWallet(page, proposal01Wallet); + + const loginPage = new LoginPage(page); + await loginPage.login(); + await loginPage.isLoggedIn(); + + const proposalDiscussionPage = new ProposalDiscussionPage(page); + await proposalDiscussionPage.goto(); + await proposalDiscussionPage.verifyIdentityBtn.click(); + + await proposalDiscussionPage.setUsername( + faker.internet.userName().toLowerCase() + ); + + await context.storageState({ path: proposal01AuthFile }); +}); From 20f1b63006432b13f0002123fa6e6b7f8d29c89d Mon Sep 17 00:00:00 2001 From: Nabin Kawan Date: Wed, 3 Jul 2024 13:52:37 +0545 Subject: [PATCH 2/2] chore: Add type for ProposalCreateRequest --- .../lib/pages/proposalDiscussionPage.ts | 5 ++++- tests/govtool-frontend/playwright/lib/types.ts | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts b/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts index 5c1b5dd5f..cd7096e58 100644 --- a/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts @@ -2,9 +2,9 @@ import { faker } from "@faker-js/faker"; import { generateWalletAddress } from "@helpers/cardano"; import { extractProposalIdFromUrl } from "@helpers/string"; import { Page } from "@playwright/test"; -import { ProposalCreateRequest } from "@services/proposalDiscussion/types"; import environments from "lib/constants/environments"; import ProposalDiscussionDetailsPage from "./proposalDiscussionDetailsPage"; +import {ProposalCreateRequest} from "@types"; export default class ProposalDiscussionPage { // Buttons @@ -24,6 +24,9 @@ export default class ProposalDiscussionPage { readonly showLessBtn = this.page.getByRole("button", { name: "Show less" }); readonly infoRadio = this.page.getByLabel("Info"); readonly treasuryRadio = this.page.getByLabel("Treasury"); + readonly verifyIdentityBtn = this.page.getByRole("button", { + name: "Verify your identity", + }); constructor(private readonly page: Page) {} diff --git a/tests/govtool-frontend/playwright/lib/types.ts b/tests/govtool-frontend/playwright/lib/types.ts index ea587206c..be1429caf 100644 --- a/tests/govtool-frontend/playwright/lib/types.ts +++ b/tests/govtool-frontend/playwright/lib/types.ts @@ -122,3 +122,21 @@ export type CommentResponse = { subcommens_number: number; }; }; + + +export type ProposalLink = { + prop_link: string; + prop_link_text: string; +}; + +export type ProposalCreateRequest = { + proposal_links: Array; + gov_action_type_id: number; + prop_name: string; + prop_abstract: string; + prop_motivation: string; + prop_rationale: string; + prop_receiving_address?: string; + prop_amount?: string; + is_draft: boolean; +}; \ No newline at end of file