diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index 2e01c721b..aa651f28c 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -17,7 +17,7 @@ on: - "staging.govtool.byron.network/api" - "govtool.cardanoapi.io/api" - "z6b8d2f7a-zca4a4c45-gtw.z937eb260.rustrocks.fr" - - "dev-sanchonet.govtool.byron.network/api" + - "z78acf3c2-z5575152b-gtw.z937eb260.rustrocks.fr" - "be.gov.tools" network: required: true @@ -39,7 +39,7 @@ concurrency: jobs: backend-tests: runs-on: ubuntu-latest - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} outputs: start_time: ${{ steps.set-pending-status.outputs.timestamp }} status: ${{ steps.run-tests.outcome }} @@ -58,7 +58,6 @@ jobs: https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.COMMIT_SHA }} \ -d "{\"state\": \"pending\", \"context\": \"Backend Tests : ${{env.BASE_URL}}\", \"target_url\": \"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}" - - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/test_integration_playwright.yml b/.github/workflows/test_integration_playwright.yml index 49a05166a..ea6406cfe 100644 --- a/.github/workflows/test_integration_playwright.yml +++ b/.github/workflows/test_integration_playwright.yml @@ -18,6 +18,7 @@ on: - "govtool.cardanoapi.io" - "preview.gov.tools" - "gov.tools" + - "p80-z78acf3c2-zded6a792-gtw.z937eb260.rustrocks.fr" network: required: true type: choice diff --git a/tests/govtool-frontend/playwright/lib/constants/auth.ts b/tests/govtool-frontend/playwright/lib/constants/auth.ts new file mode 100644 index 000000000..e2d85b948 --- /dev/null +++ b/tests/govtool-frontend/playwright/lib/constants/auth.ts @@ -0,0 +1,27 @@ +export const adaHolder01AuthFile = ".auth/adaHolder01.json"; +export const adaHolder02AuthFile = ".auth/adaHolder02.json"; +export const adaHolder03AuthFile = ".auth/adaHolder03.json"; +export const adaHolder04AuthFile = ".auth/adaHolder04.json"; +export const adaHolder05AuthFile = ".auth/adaHolder05.json"; +export const adaHolder06AuthFile = ".auth/adaHolder06.json"; + +export const user01AuthFile = ".auth/user01.json"; + +export const dRep01AuthFile = ".auth/dRep01.json"; +export const dRep02AuthFile = ".auth/dRep02.json"; +export const dRep03AuthFile = ".auth/dRep03.json"; + +export const proposal01AuthFile = ".auth/proposal01.json"; +export const proposal02AuthFile = ".auth/proposal02.json"; +export const proposal03AuthFile = ".auth/proposal03.json"; +export const proposal04AuthFile = ".auth/proposal04.json"; +export const proposal05AuthFile = ".auth/proposal05.json"; +export const proposal06AuthFile = ".auth/proposal06.json"; +export const proposal07AuthFile = ".auth/proposal07.json"; +export const proposal08AuthFile = ".auth/proposal08.json"; +export const proposal09AuthFile = ".auth/proposal09.json"; + +export const budgetProposal01AuthFile = ".auth/budgetProposal01.json"; +export const budgetProposal02AuthFile = ".auth/budgetProposal02.json"; +export const budgetProposal03AuthFile = ".auth/budgetProposal03.json"; +export const budgetProposal04AuthFile = ".auth/budgetProposal04.json"; diff --git a/tests/govtool-frontend/playwright/lib/constants/staticWallets.ts b/tests/govtool-frontend/playwright/lib/constants/staticWallets.ts index 17f486606..7884a5be8 100644 --- a/tests/govtool-frontend/playwright/lib/constants/staticWallets.ts +++ b/tests/govtool-frontend/playwright/lib/constants/staticWallets.ts @@ -44,7 +44,8 @@ export const adaHolderWallets = [ export const userWallets = [user01Wallet]; -export const dRepWallets = [dRep01Wallet, dRep02Wallet, dRep03Wallet]; +export const dRepWallets = [dRep01Wallet, dRep02Wallet]; +export const budgetProposalDRepWallets = [dRep03Wallet]; export const proposalWallets = [ proposal01Wallet, @@ -65,4 +66,5 @@ export const allStaticWallets = [ ...proposalWallets, faucetWallet, proposalFaucetWallet, + ...budgetProposalDRepWallets, ]; diff --git a/tests/govtool-frontend/playwright/lib/fixtures/budgetProposal.ts b/tests/govtool-frontend/playwright/lib/fixtures/budgetProposal.ts index f620d523a..e5c727559 100644 --- a/tests/govtool-frontend/playwright/lib/fixtures/budgetProposal.ts +++ b/tests/govtool-frontend/playwright/lib/fixtures/budgetProposal.ts @@ -1,3 +1,4 @@ +import { budgetProposal01AuthFile } from "@constants/auth"; import { budgetProposal01Wallet } from "@constants/staticWallets"; import { test as base } from "@fixtures/walletExtension"; import { createNewPageWithWallet } from "@helpers/page"; @@ -12,7 +13,7 @@ export const test = base.extend({ proposalId: async ({ browser }, use) => { // setup const budgetProposalPage = await createNewPageWithWallet(browser, { - storageState: ".auth/budgetProposal01.json", + storageState: budgetProposal01AuthFile, wallet: budgetProposal01Wallet, }); diff --git a/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts b/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts index b52d043b6..5ae1e4b0d 100644 --- a/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts +++ b/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts @@ -1,3 +1,4 @@ +import { proposal01AuthFile } from "@constants/auth"; import { proposal01Wallet } from "@constants/staticWallets"; import { test as base } from "@fixtures/walletExtension"; import { createNewPageWithWallet } from "@helpers/page"; @@ -15,7 +16,7 @@ export const test = base.extend({ proposalId: async ({ browser, pollEnabled }, use) => { // setup const proposalPage = await createNewPageWithWallet(browser, { - storageState: ".auth/proposal01.json", + storageState: proposal01AuthFile, wallet: proposal01Wallet, }); diff --git a/tests/govtool-frontend/playwright/lib/helpers/auth.ts b/tests/govtool-frontend/playwright/lib/helpers/auth.ts index 12820ea34..980cfa4f6 100644 --- a/tests/govtool-frontend/playwright/lib/helpers/auth.ts +++ b/tests/govtool-frontend/playwright/lib/helpers/auth.ts @@ -14,6 +14,12 @@ import { proposal08Wallet, proposal09Wallet, } from "@constants/staticWallets"; +import { + proposal05AuthFile, + proposal07AuthFile, + proposal08AuthFile, + proposal09AuthFile, +} from "@constants/auth"; interface CreateUserProps { page: Page; @@ -91,22 +97,22 @@ export const getDraftProposalWalletAndState = (proposalType: string) => { switch (proposalType) { case ProposalType.info: return { - storageState: ".auth/proposal05.json", + storageState: proposal05AuthFile, wallet: proposal05Wallet, }; case ProposalType.treasury: return { - storageState: ".auth/proposal07.json", + storageState: proposal07AuthFile, wallet: proposal07Wallet, }; case ProposalType.updatesToTheConstitution: return { - storageState: ".auth/proposal08.json", + storageState: proposal08AuthFile, wallet: proposal08Wallet, }; case ProposalType.motionOfNoConfedence: return { - storageState: ".auth/proposal09.json", + storageState: proposal09AuthFile, wallet: proposal09Wallet, }; } diff --git a/tests/govtool-frontend/playwright/lib/helpers/cardano.ts b/tests/govtool-frontend/playwright/lib/helpers/cardano.ts index ad7126a94..ae9528a7b 100644 --- a/tests/govtool-frontend/playwright/lib/helpers/cardano.ts +++ b/tests/govtool-frontend/playwright/lib/helpers/cardano.ts @@ -47,16 +47,6 @@ export async function skipIfNotInfoAndBootstrapping(type: ProposalType) { } } -export async function skipIfNotHardFork() { - const currentProtocolVersion = await getProtocolParamsMajorVersion(); - if (currentProtocolVersion < 9) { - await allure.description( - "Govtool Features will be available after hardfork." - ); - test.skip(); - } -} - export async function skipIfMainnet() { if (environments.networkId === 1) { await allure.description( diff --git a/tests/govtool-frontend/playwright/playwright.config.ts b/tests/govtool-frontend/playwright/playwright.config.ts index 4a254fcd7..457c8d0a4 100644 --- a/tests/govtool-frontend/playwright/playwright.config.ts +++ b/tests/govtool-frontend/playwright/playwright.config.ts @@ -44,8 +44,12 @@ export default defineConfig({ /* Configure projects for major browsers */ projects: [ { - name: "auth setup", - testMatch: "**/auth.setup.ts", + name: "adaholder auth setup", + testMatch: "**/adaholder.auth.setup.ts", + }, + { + name: "user auth setup", + testMatch: "**/user.auth.setup.ts", }, { name: "faucet setup", @@ -55,7 +59,25 @@ export default defineConfig({ { name: "dRep setup", testMatch: "**/dRep.setup.ts", - dependencies: environments.ci ? ["faucet setup"] : [], + dependencies: environments.ci ? ["faucet setup", "wallet bootstrap"] : [], + }, + { + name: "proposal budget dRep setup", + testMatch: "**/proposal-budget.dRep.setup.ts", + teardown: environments.ci && "cleanup faucet", + }, + { + name: "dRep auth setup", + testMatch: "**/dRep.auth.setup.ts", + dependencies: environments.ci ? ["dRep setup"] : [], + }, + { + name: "proposal discussion auth setup", + testMatch: "**/proposal-discussion.auth.setup.ts", + }, + { + name: "proposal budget auth setup", + testMatch: "**/proposal-budget.auth.setup.ts", }, { name: "proposal setup", @@ -71,7 +93,24 @@ export default defineConfig({ name: "transaction", use: { ...devices["Desktop Chrome"] }, testMatch: "**/*.tx.spec.ts", - dependencies: environments.ci ? ["auth setup", "wallet bootstrap"] : [], + dependencies: environments.ci ? ["adaholder auth setup", "wallet bootstrap"] : [], + }, + { + name: "proposal discussion", + use: { ...devices["Desktop Chrome"] }, + testMatch: "**/*.pd.spec.ts", + dependencies: environments.ci + ? ["proposal discussion auth setup"] + : [], + }, + { + name: "proposal budget", + use: { ...devices["Desktop Chrome"] }, + testMatch: "**/*.pb.spec.ts", + dependencies: environments.ci + ? ["proposal budget auth setup"] + : [], + testIgnore: ["**/*.dRep.pb.spec.ts"], }, { name: "proposal submission", @@ -85,14 +124,23 @@ export default defineConfig({ name: "loggedin (desktop)", use: { ...devices["Desktop Chrome"] }, testMatch: "**/*.loggedin.spec.ts", - dependencies: environments.ci ? ["auth setup"] : [], + dependencies: environments.ci ? ["user auth setup"] : [], + }, + { + name: "proposal budget dRep", + use: { ...devices["Desktop Chrome"] }, + testMatch: "**/*.dRep.pb.spec.ts", + dependencies: environments.ci + ? ["proposal budget auth setup","proposal budget dRep setup"] + : [], + teardown: environments.ci && "cleanup dRep", }, { name: "dRep", use: { ...devices["Desktop Chrome"] }, testMatch: "**/*.dRep.spec.ts", dependencies: environments.ci - ? ["auth setup", "dRep setup", "wallet bootstrap"] + ? ["dRep setup", "dRep auth setup", "wallet bootstrap"] : [], teardown: environments.ci && "cleanup dRep", }, @@ -101,7 +149,7 @@ export default defineConfig({ use: { ...devices["Desktop Chrome"] }, testMatch: "**/*.delegation.spec.ts", dependencies: environments.ci - ? ["auth setup", "dRep setup", "wallet bootstrap"] + ? ["adaholder auth setup", "dRep setup", "wallet bootstrap"] : [], teardown: environments.ci && "cleanup delegation", }, @@ -114,6 +162,8 @@ export default defineConfig({ "**/*.dRep.spec.ts", "**/*.tx.spec.ts", "**/*.ga.spec.ts", + "**/*.pd.spec.ts", + "**/*.pb.spec.ts", ], }, { @@ -125,6 +175,8 @@ export default defineConfig({ "**/*.delegation.spec.ts", "**/*.tx.spec.ts", "**/*.ga.spec.ts", + "**/*.pd.spec.ts", + "**/*.pb.spec.ts", "**/walletConnect.spec.ts", ], }, diff --git a/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts index f073d6cb2..017a2ac2b 100644 --- a/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts @@ -1,9 +1,10 @@ +import { user01AuthFile } from "@constants/auth"; import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; import LoginPage from "@pages/loginPage"; -test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.use({ storageState: user01AuthFile, wallet: user01Wallet }); test.beforeEach(async () => { await setAllureEpic("1. Wallet connect"); }); diff --git a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.dRep.pb.spec.ts similarity index 96% rename from tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.dRep.spec.ts rename to tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.dRep.pb.spec.ts index 4d1888265..8e38001f0 100644 --- a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.dRep.pb.spec.ts @@ -5,14 +5,17 @@ import BudgetDiscussionDetailsPage from "@pages/budgetDiscussionDetailsPage"; import { expect } from "@playwright/test"; import { dRep03Wallet } from "@constants/staticWallets"; import BudgetDiscussionPage from "@pages/budgetDiscussionPage"; +import { dRep03AuthFile } from "@constants/auth"; +import { skipIfMainnet } from "@helpers/cardano"; test.beforeEach(async () => { await setAllureEpic("11. Proposal Budget"); + await skipIfMainnet(); }); test.describe("Budget proposal dRep behaviour", () => { test.use({ - storageState: ".auth/dRep03.json", + storageState: dRep03AuthFile, wallet: dRep03Wallet, }); diff --git a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.pb.spec.ts similarity index 96% rename from tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.spec.ts rename to tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.pb.spec.ts index bf0912073..12c1ba5be 100644 --- a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.pb.spec.ts @@ -1,3 +1,4 @@ +import { budgetProposal01AuthFile } from "@constants/auth"; import { budgetProposal01Wallet } from "@constants/staticWallets"; import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; @@ -12,7 +13,7 @@ test.beforeEach(async () => { test.describe("Budget proposal logged in state", () => { test.use({ - storageState: ".auth/budgetProposal01.json", + storageState: budgetProposal01AuthFile, wallet: budgetProposal01Wallet, }); diff --git a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts index 22a041e45..733ed6fd7 100644 --- a/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts +++ b/tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.spec.ts @@ -8,7 +8,7 @@ import { functionWaitedAssert } from "@helpers/waitedLoop"; import BudgetDiscussionDetailsPage from "@pages/budgetDiscussionDetailsPage"; import BudgetDiscussionPage from "@pages/budgetDiscussionPage"; import { expect } from "@playwright/test"; -import { BudgetDiscussionEnum, CommentResponse } from "@types"; +import { BudgetDiscussionEnum } from "@types"; const mockBudgetProposal = require("../../lib/_mock/budgetProposal.json"); const mockPoll = require("../../lib/_mock/budgetProposalPoll.json"); diff --git a/tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.pb.spec.ts similarity index 98% rename from tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.spec.ts rename to tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.pb.spec.ts index af9aa95cb..a2c320b8f 100644 --- a/tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.pb.spec.ts @@ -1,3 +1,9 @@ +import { + budgetProposal01AuthFile, + budgetProposal02AuthFile, + budgetProposal03AuthFile, + budgetProposal04AuthFile, +} from "@constants/auth"; import { budgetProposal01Wallet, budgetProposal02Wallet, @@ -26,7 +32,7 @@ test.beforeEach(async () => { test.describe("Budget proposal 01 wallet", () => { test.use({ - storageState: ".auth/budgetProposal01.json", + storageState: budgetProposal01AuthFile, wallet: budgetProposal01Wallet, }); @@ -413,7 +419,7 @@ test.describe("Budget proposal 01 wallet", () => { test("12C. Should save and view draft proposal", async ({ browser }) => { const page = await createNewPageWithWallet(browser, { - storageState: ".auth/budgetProposal02.json", + storageState: budgetProposal02AuthFile, wallet: budgetProposal02Wallet, }); @@ -461,7 +467,7 @@ test("12C. Should save and view draft proposal", async ({ browser }) => { test("12H. Should submit a valid budget proposal", async ({ browser }) => { const page = await createNewPageWithWallet(browser, { - storageState: ".auth/budgetProposal03.json", + storageState: budgetProposal03AuthFile, wallet: budgetProposal03Wallet, }); const budgetSubmissionPage = new BudgetDiscussionSubmissionPage(page); @@ -482,7 +488,7 @@ test("12I. Should submit a valid draft budget proposal", async ({ }) => { test.slow(); const page = await createNewPageWithWallet(browser, { - storageState: ".auth/budgetProposal04.json", + storageState: budgetProposal04AuthFile, wallet: budgetProposal04Wallet, }); diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts index 22e49433a..c712f7ec2 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts @@ -3,7 +3,7 @@ import { createTempDRepAuth } from "@datafactory/createAuth"; import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import { ShelleyWallet } from "@helpers/crypto"; import { createNewPageWithWallet } from "@helpers/page"; import DRepRegistrationPage from "@pages/dRepRegistrationPage"; @@ -13,7 +13,6 @@ import walletManager from "lib/walletManager"; test.beforeEach(async () => { await setAllureEpic("2. Delegation"); - await skipIfNotHardFork(); await skipIfMainnet(); }); diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts index d7a77489b..c0b6ed60a 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts @@ -1,7 +1,7 @@ +import { user01AuthFile } from "@constants/auth"; import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { ShelleyWallet } from "@helpers/crypto"; import { fetchFirstActiveDRepDetails } from "@helpers/dRep"; import { isMobile } from "@helpers/mobile"; @@ -9,11 +9,10 @@ import extractDRepFromWallet from "@helpers/shellyWallet"; import DRepDirectoryPage from "@pages/dRepDirectoryPage"; import { expect } from "@playwright/test"; -test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.use({ storageState: user01AuthFile, wallet: user01Wallet }); test.beforeEach(async () => { await setAllureEpic("2. Delegation"); - await skipIfNotHardFork(); }); test("2B. Should access DRep Directory page", async ({ page }) => { diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts index 1bab08af8..b5b859ac2 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts @@ -1,6 +1,5 @@ import environments from "@constants/environments"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { convertDRep, fetchFirstActiveDRepDetails } from "@helpers/dRep"; import { functionWaitedAssert } from "@helpers/waitedLoop"; import DRepDetailsPage from "@pages/dRepDetailsPage"; @@ -11,7 +10,6 @@ import { DRepStatus, IDRep, PaginatedDRepResponse } from "@types"; test.beforeEach(async () => { await setAllureEpic("2. Delegation"); - await skipIfNotHardFork(); }); enum SortOption { diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts index 2c1057dc0..0c5c1e2dd 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts @@ -1,3 +1,11 @@ +import { + adaHolder01AuthFile, + adaHolder02AuthFile, + adaHolder03AuthFile, + adaHolder04AuthFile, + adaHolder05AuthFile, + adaHolder06AuthFile, +} from "@constants/auth"; import environments from "@constants/environments"; import { adaHolder01Wallet, @@ -16,7 +24,7 @@ import { correctDRepDirectoryFormat, } from "@helpers/adaFormat"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import { createNewPageWithWallet } from "@helpers/page"; import { waitForTxConfirmation } from "@helpers/transaction"; import DRepDirectoryPage from "@pages/dRepDirectoryPage"; @@ -27,13 +35,12 @@ import walletManager from "lib/walletManager"; test.beforeEach(async () => { await setAllureEpic("2. Delegation"); - await skipIfNotHardFork(); await skipIfMainnet(); }); test.describe("Delegate to others", () => { test.use({ - storageState: ".auth/adaHolder01.json", + storageState: adaHolder01AuthFile, wallet: adaHolder01Wallet, }); @@ -83,7 +90,7 @@ test.describe("Delegate to others", () => { test.describe("Change delegation", () => { test.use({ - storageState: ".auth/adaHolder02.json", + storageState: adaHolder02AuthFile, wallet: adaHolder02Wallet, }); @@ -220,7 +227,7 @@ test("2G. Should delegate to myself", async ({ page, browser }, testInfo) => { test.describe("Multiple delegations", () => { test.use({ - storageState: ".auth/adaHolder05.json", + storageState: adaHolder05AuthFile, wallet: adaHolder05Wallet, }); @@ -248,7 +255,7 @@ test.describe("Multiple delegations", () => { test.describe("Abstain delegation", () => { test.use({ - storageState: ".auth/adaHolder03.json", + storageState: adaHolder03AuthFile, wallet: adaHolder03Wallet, }); @@ -278,7 +285,7 @@ test.describe("Abstain delegation", () => { test.describe("No confidence delegation", () => { test.use({ - storageState: ".auth/adaHolder04.json", + storageState: adaHolder04AuthFile, wallet: adaHolder04Wallet, }); @@ -309,7 +316,7 @@ test.describe("No confidence delegation", () => { test.describe("Delegated ADA visibility", () => { test.use({ - storageState: ".auth/adaHolder06.json", + storageState: adaHolder06AuthFile, wallet: adaHolder06Wallet, }); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts index a548758cc..f97449614 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts @@ -5,7 +5,7 @@ import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import { createNewPageWithWallet } from "@helpers/page"; import { waitForTxConfirmation } from "@helpers/transaction"; import DRepRegistrationPage from "@pages/dRepRegistrationPage"; @@ -14,16 +14,16 @@ import { expect } from "@playwright/test"; import walletManager from "lib/walletManager"; import DRepDirectoryPage from "@pages/dRepDirectoryPage"; import { GovernanceActionType } from "@types"; +import { dRep01AuthFile } from "@constants/auth"; test.beforeEach(async () => { await setAllureEpic("3. DRep registration"); - await skipIfNotHardFork(); await skipIfMainnet(); }); test.describe("Logged in DReps", () => { test.use({ - storageState: ".auth/dRep01.json", + storageState: dRep01AuthFile, wallet: dRep01Wallet, enableDRepSigning: true, enableStakeSigning: false, @@ -99,6 +99,15 @@ test.describe("Logged in DReps", () => { }); await page.getByTestId("confirm-modal-button").click(); }); + + test("3S. Should restrict dRep registration for dRep", async ({ page }) => { + await page.goto(`${environments.frontendUrl}/register_drep`); + + await expect(page.getByText("You already are a DRep")).toBeVisible({ + timeout: 60_000, + }); + await expect(page.getByTestId("name-input")).not.toBeVisible(); + }); }); test.describe("Temporary DReps", () => { diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts index 2a19d17c0..35e20f006 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts @@ -4,19 +4,19 @@ import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; import { invalid as mockInvalid, valid as mockValid } from "@mock/index"; -import { skipIfNotHardFork } from "@helpers/cardano"; import DRepRegistrationPage from "@pages/dRepRegistrationPage"; import { expect } from "@playwright/test"; import environments from "@constants/environments"; +import { user01AuthFile } from "@constants/auth"; +import EditDRepPage from "@pages/editDRepPage"; test.use({ - storageState: ".auth/user01.json", + storageState: user01AuthFile, wallet: user01Wallet, }); test.beforeEach(async () => { await setAllureEpic("3. DRep registration"); - await skipIfNotHardFork(); }); test("3B. Should access DRep registration page", async ({ page }) => { @@ -223,3 +223,11 @@ test("3O. Should reject invalid dRep registration metadata", async ({ /your external data does not/i ); }); + +test("3R. Should restrict edit dRep for non dRep", async ({ page }) => { + const editDrepPage = new EditDRepPage(page); + await editDrepPage.goto(); + + await page.waitForTimeout(2_000); + await expect(editDrepPage.nameInput).not.toBeVisible(); +}); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts index 594aaed3b..204762cb7 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts @@ -1,11 +1,9 @@ import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { expect } from "@playwright/test"; import { test } from "@fixtures/walletExtension"; test.beforeEach(async () => { await setAllureEpic("3. DRep registration"); - await skipIfNotHardFork(); }); test("3C. Should open wallet connection popup on DRep registration in disconnected state", async ({ diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts index 873755f55..59ee9f0eb 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts @@ -4,18 +4,18 @@ import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; import { invalid as mockInvalid, valid as mockValid } from "@mock/index"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import EditDRepPage from "@pages/editDRepPage"; import { expect } from "@playwright/test"; import environments from "@constants/environments"; +import { dRep02AuthFile } from "@constants/auth"; test.beforeEach(async () => { await setAllureEpic("3. DRep registration"); - await skipIfNotHardFork(); await skipIfMainnet(); }); -test.use({ wallet: dRep02Wallet, storageState: ".auth/dRep02.json" }); +test.use({ wallet: dRep02Wallet, storageState: dRep02AuthFile }); test.describe("Validation of edit dRep Form", () => { test("3M_1. Should accept valid data in edit dRep form", async ({ page }) => { 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 d2845e961..b9ceb02a8 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 @@ -8,7 +8,6 @@ import { isBootStrapingPhase, lovelaceToAda, skipIfMainnet, - skipIfNotHardFork, } from "@helpers/cardano"; import { createNewPageWithWallet } from "@helpers/page"; import GovernanceActionsPage from "@pages/governanceActionsPage"; @@ -23,15 +22,15 @@ import { areDRepVoteTotalsDisplayed, areSPOVoteTotalsDisplayed, } from "@helpers/featureFlag"; +import { dRep01AuthFile } from "@constants/auth"; test.beforeEach(async () => { await setAllureEpic("4. Proposal visibility"); - await skipIfNotHardFork(); await skipIfMainnet(); }); test.describe("Logged in DRep", () => { - test.use({ storageState: ".auth/dRep01.json", wallet: dRep01Wallet }); + test.use({ storageState: dRep01AuthFile, wallet: dRep01Wallet }); test("4E. Should display DRep's voting power in governance actions page", async ({ page, @@ -135,7 +134,7 @@ test.describe("Temporary DReps", async () => { }); test.describe("Check vote count", () => { - test.use({ storageState: ".auth/dRep01.json", wallet: dRep01Wallet }); + test.use({ storageState: dRep01AuthFile, wallet: dRep01Wallet }); test("4G. Should display correct vote counts on governance details page for DRep", async ({ page, @@ -172,7 +171,7 @@ test.describe("Check vote count", () => { await Promise.all( uniqueProposalTypes.map(async (proposalToCheck) => { const dRepPage = await createNewPageWithWallet(browser, { - storageState: ".auth/dRep01.json", + storageState: dRep01AuthFile, wallet: dRep01Wallet, }); diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts index a907f7f1e..afc6b5f5d 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts @@ -1,16 +1,15 @@ +import { user01AuthFile } from "@constants/auth"; import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { isMobile, openDrawer } from "@helpers/mobile"; import GovernanceActionsPage from "@pages/governanceActionsPage"; import { expect } from "@playwright/test"; -test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.use({ storageState: user01AuthFile, wallet: user01Wallet }); test.beforeEach(async () => { await setAllureEpic("4. Proposal visibility"); - await skipIfNotHardFork(); }); test("4A_1. Should access Governance Actions page with connecting wallet", async ({ 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 9447e2906..1127032ab 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 @@ -1,6 +1,5 @@ import { correctVoteAdaFormat } from "@helpers/adaFormat"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { areCCVoteTotalsDisplayed, areDRepVoteTotalsDisplayed, @@ -19,7 +18,6 @@ import { InvalidMetadata } from "@constants/index"; test.beforeEach(async () => { await setAllureEpic("4. Proposal visibility"); - await skipIfNotHardFork(); }); const infoTypeProposal: PaginatedLiveProposal = require("../../lib/_mock/infoTypeProposal.json"); 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 6b2042f93..8a21e99f1 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 @@ -1,14 +1,11 @@ +import { dRep01AuthFile } from "@constants/auth"; import environments from "@constants/environments"; import { dRep01Wallet } from "@constants/staticWallets"; import { createTempDRepAuth } from "@datafactory/createAuth"; import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; -import { - isBootStrapingPhase, - skipIfMainnet, - skipIfNotHardFork, -} from "@helpers/cardano"; +import { isBootStrapingPhase, skipIfMainnet } from "@helpers/cardano"; import { encodeCIP129Identifier } from "@helpers/encodeDecode"; import { createNewPageWithWallet } from "@helpers/page"; import { waitForTxConfirmation } from "@helpers/transaction"; @@ -22,12 +19,11 @@ import walletManager from "lib/walletManager"; test.beforeEach(async () => { await setAllureEpic("5. Proposal functionality"); - await skipIfNotHardFork(); await skipIfMainnet(); }); test.describe("Proposal checks", () => { - test.use({ storageState: ".auth/dRep01.json", wallet: dRep01Wallet }); + test.use({ storageState: dRep01AuthFile, wallet: dRep01Wallet }); let govActionDetailsPage: GovernanceActionDetailsPage; let currentPage: Page; diff --git a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts index 91c71b26c..de7b3e4ce 100644 --- a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts @@ -1,14 +1,13 @@ +import { user01AuthFile } from "@constants/auth"; import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { expect } from "@playwright/test"; -test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.use({ storageState: user01AuthFile, wallet: user01Wallet }); test.beforeEach(async () => { await setAllureEpic("5. Proposal functionality"); - await skipIfNotHardFork(); }); test("5J. Should hide retirement option for non-registered DRep", async ({ diff --git a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.spec.ts b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.spec.ts index 595566e79..4d859570b 100644 --- a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.spec.ts +++ b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.spec.ts @@ -1,13 +1,11 @@ import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import GovernanceActionsPage from "@pages/governanceActionsPage"; import { expect } from "@playwright/test"; const invalidInfinityProposals = require("../../lib/_mock/invalidInfinityProposals.json"); test.beforeEach(async () => { await setAllureEpic("5. Proposal functionality"); - await skipIfNotHardFork(); }); test.describe("Bad Proposals", () => { let govActionsPage: GovernanceActionsPage; diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.dRep.spec.ts deleted file mode 100644 index 027f39f0c..000000000 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.dRep.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import environments from "@constants/environments"; -import { dRep01Wallet } from "@constants/staticWallets"; -import { test } from "@fixtures/walletExtension"; -import { setAllureEpic } from "@helpers/allure"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; -import { expect } from "@playwright/test"; - -test.beforeEach(async () => { - await setAllureEpic("6. Miscellaneous"); - await skipIfNotHardFork(); - await skipIfMainnet(); -}); - -test.use({ - storageState: ".auth/dRep01.json", - wallet: dRep01Wallet, -}); - -test("6H. Should restrict dRep registration for dRep", async ({ page }) => { - await page.goto(`${environments.frontendUrl}/register_drep`); - - await expect(page.getByText("You already are a DRep")).toBeVisible({ - timeout: 60_000, - }); - await expect(page.getByTestId("name-input")).not.toBeVisible(); -}); diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts index fff528bad..08c1bca6e 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts @@ -1,3 +1,4 @@ +import { user01AuthFile } from "@constants/auth"; import { ABSTAIN_VOTE_DOC_URL, DELEGATION_DOC_URL, @@ -11,23 +12,20 @@ import { user01Wallet } from "@constants/staticWallets"; import { createTempUserAuth } from "@datafactory/createAuth"; import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { ShelleyWallet } from "@helpers/crypto"; import { createNewPageWithWallet } from "@helpers/page"; import { invalid as mockInvalid, valid as mockValid } from "@mock/index"; import DRepDirectoryPage from "@pages/dRepDirectoryPage"; -import EditDRepPage from "@pages/editDRepPage"; import ProposalDiscussionPage from "@pages/proposalDiscussionPage"; import { Page, expect } from "@playwright/test"; test.beforeEach(async () => { await setAllureEpic("6. Miscellaneous"); - await skipIfNotHardFork(); }); test.describe("Logged in user", () => { test.use({ - storageState: ".auth/user01.json", + storageState: user01AuthFile, wallet: user01Wallet, }); @@ -94,14 +92,6 @@ test.describe("Logged in user", () => { ); }); - test("6G. Should restrict edit dRep for non dRep", async ({ page }) => { - const editDrepPage = new EditDRepPage(page); - await editDrepPage.goto(); - - await page.waitForTimeout(2_000); - await expect(editDrepPage.nameInput).not.toBeVisible(); - }); - test("6I. Should prompt for a username after clicking on proposal discussion link if username is not set", async ({ page, }) => { 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 f10ee426c..6692c6c55 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts @@ -13,7 +13,6 @@ import { test } from "@fixtures/walletExtension"; import { setAllureEpic } from "@helpers/allure"; import { isMobile, openDrawer } from "@helpers/mobile"; import { expect, Page } from "@playwright/test"; -import { allure } from "allure-playwright"; import environments from "lib/constants/environments"; test.beforeEach(async () => { diff --git a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts index fbfa52a6a..a9ab165f7 100644 --- a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts +++ b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts @@ -7,7 +7,7 @@ import { waitForTxConfirmation } from "@helpers/transaction"; import ProposalDiscussionPage from "@pages/proposalDiscussionPage"; import ProposalSubmissionPage from "@pages/proposalSubmissionPage"; import { expect } from "@playwright/test"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import { ProposalType } from "@types"; import { proposalFaucetWallet } from "@constants/proposalFaucetWallet"; import walletManager from "lib/walletManager"; @@ -15,7 +15,6 @@ import { valid } from "@mock/index"; test.beforeEach(async () => { await setAllureEpic("7. Proposal submission"); - await skipIfNotHardFork(); await skipIfMainnet(); }); diff --git a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.pd.spec.ts similarity index 98% rename from tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.spec.ts rename to tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.pd.spec.ts index 2c53bb141..f4b0bdf36 100644 --- a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.pd.spec.ts @@ -1,3 +1,9 @@ +import { + proposal01AuthFile, + proposal03AuthFile, + proposal04AuthFile, + proposal06AuthFile, +} from "@constants/auth"; import environments from "@constants/environments"; import { proposal01Wallet, @@ -11,7 +17,6 @@ import { setAllureEpic } from "@helpers/allure"; import { getDraftProposalWalletAndState } from "@helpers/auth"; import { skipIfNotInfoAndBootstrapping, - skipIfNotHardFork, isBootStrapingPhase, } from "@helpers/cardano"; import { ShelleyWallet } from "@helpers/crypto"; @@ -24,11 +29,10 @@ import { ProposalCreateRequest, ProposalType } from "@types"; test.beforeEach(async () => { await setAllureEpic("7. Proposal submission"); - await skipIfNotHardFork(); }); test.describe("Proposal created logged state", () => { - test.use({ storageState: ".auth/proposal01.json", wallet: proposal01Wallet }); + test.use({ storageState: proposal01AuthFile, wallet: proposal01Wallet }); test("7B. Should access proposal creation page", async ({ page }) => { await page.goto("/"); await page.getByTestId("proposal-discussion-link").click(); @@ -368,7 +372,7 @@ test.describe("Proposal created logged state", () => { test.describe("Proposal Draft", () => { test("7C. Should list unfinished Draft ", async ({ browser }) => { const page = await createNewPageWithWallet(browser, { - storageState: ".auth/proposal03.json", + storageState: proposal03AuthFile, wallet: proposal03Wallet, }); const proposalSubmissionPage = new ProposalSubmissionPage(page); @@ -384,7 +388,7 @@ test.describe("Proposal Draft", () => { test("7L. Should save proposal as a draft", async ({ browser }) => { const page = await createNewPageWithWallet(browser, { - storageState: ".auth/proposal04.json", + storageState: proposal04AuthFile, wallet: proposal04Wallet, }); @@ -534,7 +538,7 @@ test.describe("Proposal Draft", () => { test("7N. Should submit a draft proposal", async ({ browser }) => { const page = await createNewPageWithWallet(browser, { - storageState: ".auth/proposal06.json", + storageState: proposal06AuthFile, wallet: proposal06Wallet, }); diff --git a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.spec.ts b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.spec.ts index 41c1036be..a7063eb8c 100644 --- a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.spec.ts +++ b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.spec.ts @@ -1,11 +1,9 @@ import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import { expect } from "@playwright/test"; import { test } from "@fixtures/walletExtension"; test.beforeEach(async () => { await setAllureEpic("7. Proposal submission"); - await skipIfNotHardFork(); }); test("7A. Should open wallet connection popup, when propose a governance action in disconnected state.", async ({ 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.pd.spec.ts similarity index 96% rename from tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.loggedin.spec.ts rename to tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.loggedin.pd.spec.ts index 5caee4fd3..62b91df76 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.pd.spec.ts @@ -9,17 +9,20 @@ import { createNewPageWithWallet } from "@helpers/page"; 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"; +import { + proposal01AuthFile, + proposal02AuthFile, + user01AuthFile, +} from "@constants/auth"; test.beforeEach(async () => { await setAllureEpic("8. Proposal Discussion Forum"); - await skipIfNotHardFork(); }); test.describe("Proposal created logged in state", () => { test.use({ - storageState: ".auth/proposal02.json", + storageState: proposal02AuthFile, wallet: proposal02Wallet, }); @@ -76,7 +79,7 @@ test.describe("Proposal created logged in state", () => { test.describe("Proposal created with poll enabled (user auth)", () => { test.use({ - storageState: ".auth/proposal02.json", + storageState: proposal02AuthFile, wallet: proposal02Wallet, pollEnabled: true, }); @@ -136,7 +139,7 @@ test.describe("Proposal created with poll enabled (user auth)", () => { test.describe("Proposal created with poll enabled (proposal auth)", () => { test.use({ - storageState: ".auth/user01.json", + storageState: user01AuthFile, wallet: user01Wallet, pollEnabled: true, }); @@ -147,7 +150,7 @@ test.describe("Proposal created with poll enabled (proposal auth)", () => { test.beforeEach(async ({ browser, proposalId }) => { test.slow(); proposalPage = await createNewPageWithWallet(browser, { - storageState: ".auth/proposal01.json", + storageState: proposal01AuthFile, wallet: proposal01Wallet, }); ownerProposalDiscussionDetailsPage = new ProposalDiscussionDetailsPage( diff --git a/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.spec.ts b/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.spec.ts index 84d6b408e..e4303ae9b 100644 --- a/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.spec.ts +++ b/tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.spec.ts @@ -6,7 +6,7 @@ import { import { faker } from "@faker-js/faker"; import { test } from "@fixtures/proposal"; import { setAllureEpic } from "@helpers/allure"; -import { isBootStrapingPhase, skipIfNotHardFork } from "@helpers/cardano"; +import { isBootStrapingPhase } from "@helpers/cardano"; import { injectLogger } from "@helpers/page"; import { extractProposalIdFromUrl } from "@helpers/string"; import { functionWaitedAssert } from "@helpers/waitedLoop"; @@ -21,7 +21,6 @@ const mockComments = require("../../lib/_mock/proposalComments.json"); test.beforeEach(async () => { await setAllureEpic("8. Proposal Discussion Forum"); - await skipIfNotHardFork(); }); test("8A. Should access proposed governance actions in disconnected state", async ({ 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 bdce3eacc..0976ebb49 100644 --- a/tests/govtool-frontend/playwright/tests/9-outcomes/outcomes.spec.ts +++ b/tests/govtool-frontend/playwright/tests/9-outcomes/outcomes.spec.ts @@ -1,11 +1,7 @@ import { InvalidMetadata } from "@constants/index"; import { test } from "@fixtures/walletExtension"; -import { - correctVoteAdaFormat, - formatWithThousandSeparator, -} from "@helpers/adaFormat"; +import { formatWithThousandSeparator } from "@helpers/adaFormat"; import { setAllureEpic } from "@helpers/allure"; -import { skipIfNotHardFork } from "@helpers/cardano"; import extractExpiryDateFromText from "@helpers/extractExpiryDateFromText"; import { areCCVoteTotalsDisplayed, @@ -24,7 +20,6 @@ const invalidOutcomeProposals = require("../../lib/_mock/outcome.json"); test.beforeEach(async () => { await setAllureEpic("9. Outcomes"); - await skipIfNotHardFork(); }); const status = ["Expired", "Ratified", "Enacted", "Live"]; diff --git a/tests/govtool-frontend/playwright/tests/adaholder.auth.setup.ts b/tests/govtool-frontend/playwright/tests/adaholder.auth.setup.ts new file mode 100644 index 000000000..e812af725 --- /dev/null +++ b/tests/govtool-frontend/playwright/tests/adaholder.auth.setup.ts @@ -0,0 +1,72 @@ +import { + adaHolder01AuthFile, + adaHolder02AuthFile, + adaHolder03AuthFile, + adaHolder04AuthFile, + adaHolder05AuthFile, + adaHolder06AuthFile, +} from "@constants/auth"; +import { + adaHolder01Wallet, + adaHolder02Wallet, + adaHolder03Wallet, + adaHolder04Wallet, + adaHolder05Wallet, + adaHolder06Wallet, +} from "@constants/staticWallets"; +import { test as setup } from "@fixtures/walletExtension"; +import { setAllureEpic, setAllureStory } from "@helpers/allure"; +import { createAuth, createAuthWithMultipleStake } from "@helpers/auth"; + +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Authentication"); +}); + +const authConfigs = [ + { + name: "AdaHolder 01", + wallet: adaHolder01Wallet, + auth: adaHolder01AuthFile, + }, + { + name: "AdaHolder 02", + wallet: adaHolder02Wallet, + auth: adaHolder02AuthFile, + }, + { + name: "AdaHolder 03", + wallet: adaHolder03Wallet, + auth: adaHolder03AuthFile, + }, + { + name: "AdaHolder 04", + wallet: adaHolder04Wallet, + auth: adaHolder04AuthFile, + }, + { + name: "AdaHolder 05", + wallet: adaHolder05Wallet, + auth: adaHolder05AuthFile, + }, +]; + +for (const config of authConfigs) { + setup(`Create ${config.name} auth`, async ({ page, context }) => { + await createAuth({ + page, + context, + wallet: config.wallet, + auth: config.auth, + }); + }); +} + +setup("Create AdaHolder 06 auth", async ({ page, context }) => { + await createAuthWithMultipleStake({ + page, + context, + wallet: adaHolder06Wallet, + auth: adaHolder06AuthFile, + }); +}); diff --git a/tests/govtool-frontend/playwright/tests/auth.setup.ts b/tests/govtool-frontend/playwright/tests/auth.setup.ts deleted file mode 100644 index 2732ff065..000000000 --- a/tests/govtool-frontend/playwright/tests/auth.setup.ts +++ /dev/null @@ -1,276 +0,0 @@ -// Saves storage state to a file in the .auth directory - -import { - adaHolder01Wallet, - adaHolder02Wallet, - adaHolder03Wallet, - adaHolder04Wallet, - adaHolder05Wallet, - adaHolder06Wallet, - budgetProposal01Wallet, - budgetProposal02Wallet, - budgetProposal03Wallet, - budgetProposal04Wallet, - dRep01Wallet, - dRep02Wallet, - dRep03Wallet, - proposal01Wallet, - proposal02Wallet, - proposal03Wallet, - proposal04Wallet, - proposal05Wallet, - proposal06Wallet, - proposal07Wallet, - proposal08Wallet, - proposal09Wallet, - user01Wallet, -} from "@constants/staticWallets"; -import { test as setup } from "@fixtures/walletExtension"; -import { setAllureEpic, setAllureStory } from "@helpers/allure"; -import { - createAuth, - createAuthWithMultipleStake, - createAuthWithUserName, -} from "@helpers/auth"; -import { skipIfNotHardFork } from "@helpers/cardano"; - -const dRep01AuthFile = ".auth/dRep01.json"; -const dRep02AuthFile = ".auth/dRep02.json"; -const dRep03AuthFile = ".auth/dRep03.json"; - -const adaHolder01AuthFile = ".auth/adaHolder01.json"; -const adaHolder02AuthFile = ".auth/adaHolder02.json"; -const adaHolder03AuthFile = ".auth/adaHolder03.json"; -const adaHolder04AuthFile = ".auth/adaHolder04.json"; -const adaHolder05AuthFile = ".auth/adaHolder05.json"; -const adaHolder06AuthFile = ".auth/adaHolder06.json"; - -const user01AuthFile = ".auth/user01.json"; - -const proposal01AuthFile = ".auth/proposal01.json"; -const proposal02AuthFile = ".auth/proposal02.json"; -const proposal03AuthFile = ".auth/proposal03.json"; -const proposal04AuthFile = ".auth/proposal04.json"; -const proposal05AuthFile = ".auth/proposal05.json"; -const proposal06AuthFile = ".auth/proposal06.json"; -const proposal07AuthFile = ".auth/proposal07.json"; -const proposal08AuthFile = ".auth/proposal08.json"; -const proposal09AuthFile = ".auth/proposal09.json"; - -const budgetProposal01AuthFile = ".auth/budgetProposal01.json"; -const budgetProposal02AuthFile = ".auth/budgetProposal02.json"; -const budgetProposal03AuthFile = ".auth/budgetProposal03.json"; -const budgetProposal04AuthFile = ".auth/budgetProposal04.json"; - -setup.beforeEach(async () => { - await setAllureEpic("Setup"); - await setAllureStory("Authentication"); - await skipIfNotHardFork(); -}); - -setup("Create DRep 01 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: dRep01Wallet, - auth: dRep01AuthFile, - }); -}); - -setup("Create DRep 02 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: dRep02Wallet, - auth: dRep02AuthFile, - }); -}); - -setup("Create DRep 03 auth with username", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: dRep03Wallet, - auth: dRep03AuthFile, - }); -}); - -setup("Create User 01 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: user01Wallet, - auth: user01AuthFile, - }); -}); - -setup("Create AdaHolder 01 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: adaHolder01Wallet, - auth: adaHolder01AuthFile, - }); -}); - -setup("Create AdaHolder 02 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: adaHolder02Wallet, - auth: adaHolder02AuthFile, - }); -}); - -setup("Create AdaHolder 03 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: adaHolder03Wallet, - auth: adaHolder03AuthFile, - }); -}); - -setup("Create AdaHolder 04 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: adaHolder04Wallet, - auth: adaHolder04AuthFile, - }); -}); - -setup("Create AdaHolder 05 auth", async ({ page, context }) => { - await createAuth({ - page, - context, - wallet: adaHolder05Wallet, - auth: adaHolder05AuthFile, - }); -}); - -setup("Create AdaHolder 06 auth", async ({ page, context }) => { - await createAuthWithMultipleStake({ - page, - context, - wallet: adaHolder06Wallet, - auth: adaHolder06AuthFile, - }); -}); - -setup("Create Proposal 01 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal01Wallet, - auth: proposal01AuthFile, - }); -}); - -setup("Create Proposal 02 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal02Wallet, - auth: proposal02AuthFile, - }); -}); - -setup("Create Proposal 03 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal03Wallet, - auth: proposal03AuthFile, - }); -}); - -setup("Create Proposal 04 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal04Wallet, - auth: proposal04AuthFile, - }); -}); - -setup("Create Proposal 05 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal05Wallet, - auth: proposal05AuthFile, - }); -}); - -setup("Create Proposal 06 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal06Wallet, - auth: proposal06AuthFile, - }); -}); - -setup("Create Proposal 07 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal07Wallet, - auth: proposal07AuthFile, - }); -}); - -setup("Create Proposal 08 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal08Wallet, - auth: proposal08AuthFile, - }); -}); - -setup("Create Proposal 09 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: proposal09Wallet, - auth: proposal09AuthFile, - }); -}); - -setup("Create Budget Proposal 01 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: budgetProposal01Wallet, - auth: budgetProposal01AuthFile, - }); -}); - -setup("Create Budget Proposal 02 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: budgetProposal02Wallet, - auth: budgetProposal02AuthFile, - }); -}); - -setup("Create Budget Proposal 03 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: budgetProposal03Wallet, - auth: budgetProposal03AuthFile, - }); -}); - -setup("Create Budget Proposal 04 auth", async ({ page, context }) => { - await createAuthWithUserName({ - page, - context, - wallet: budgetProposal04Wallet, - auth: budgetProposal04AuthFile, - }); -}); diff --git a/tests/govtool-frontend/playwright/tests/dRep.auth.setup.ts b/tests/govtool-frontend/playwright/tests/dRep.auth.setup.ts new file mode 100644 index 000000000..f1593d593 --- /dev/null +++ b/tests/govtool-frontend/playwright/tests/dRep.auth.setup.ts @@ -0,0 +1,28 @@ +import { dRep01AuthFile, dRep02AuthFile } from "@constants/auth"; +import { dRep01Wallet, dRep02Wallet } from "@constants/staticWallets"; +import { test as setup } from "@fixtures/walletExtension"; +import { setAllureEpic, setAllureStory } from "@helpers/allure"; +import { createAuth } from "@helpers/auth"; +import { skipIfMainnet } from "@helpers/cardano"; + +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Authentication"); + await skipIfMainnet(); +}); + +const drepAuthConfigs = [ + { name: "DRep 01", wallet: dRep01Wallet, auth: dRep01AuthFile }, + { name: "DRep 02", wallet: dRep02Wallet, auth: dRep02AuthFile }, +]; + +for (const config of drepAuthConfigs) { + setup(`Create ${config.name} auth`, async ({ page, context }) => { + await createAuth({ + page, + context, + wallet: config.wallet, + auth: config.auth, + }); + }); +} diff --git a/tests/govtool-frontend/playwright/tests/dRep.setup.ts b/tests/govtool-frontend/playwright/tests/dRep.setup.ts index 9dde14e07..25792139f 100644 --- a/tests/govtool-frontend/playwright/tests/dRep.setup.ts +++ b/tests/govtool-frontend/playwright/tests/dRep.setup.ts @@ -1,7 +1,7 @@ import environments from "@constants/environments"; import { dRepWallets } from "@constants/staticWallets"; import { setAllureEpic, setAllureStory } from "@helpers/allure"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import { uploadMetadataAndGetJsonHash } from "@helpers/metadata"; import { generateWallets } from "@helpers/shellyWallet"; import { pollTransaction } from "@helpers/transaction"; @@ -31,7 +31,6 @@ setup.beforeAll(async () => { setup.beforeEach(async () => { await setAllureEpic("Setup"); await setAllureStory("Register DRep"); - await skipIfNotHardFork(); await skipIfMainnet(); }); diff --git a/tests/govtool-frontend/playwright/tests/dRep.teardown.ts b/tests/govtool-frontend/playwright/tests/dRep.teardown.ts index 5a7272185..0e246b846 100644 --- a/tests/govtool-frontend/playwright/tests/dRep.teardown.ts +++ b/tests/govtool-frontend/playwright/tests/dRep.teardown.ts @@ -1,5 +1,8 @@ import environments from "@constants/environments"; -import { dRepWallets } from "@constants/staticWallets"; +import { + budgetProposalDRepWallets, + dRepWallets, +} from "@constants/staticWallets"; import { setAllureEpic, setAllureStory } from "@helpers/allure"; import { skipIfMainnet } from "@helpers/cardano"; import { pollTransaction } from "@helpers/transaction"; @@ -26,6 +29,7 @@ cleanup("DRep de-registration", async () => { ...dRepWallets, ...registerDRep, ...registeredDRep, + ...budgetProposalDRepWallets, ]; try { const { txId, lockInfo } = await kuberService.multipleDRepDeRegistration( diff --git a/tests/govtool-frontend/playwright/tests/delegation.teardown.ts b/tests/govtool-frontend/playwright/tests/delegation.teardown.ts index 5534439f1..f1d4b279b 100644 --- a/tests/govtool-frontend/playwright/tests/delegation.teardown.ts +++ b/tests/govtool-frontend/playwright/tests/delegation.teardown.ts @@ -1,7 +1,7 @@ import environments from "@constants/environments"; import { adaHolderWallets } from "@constants/staticWallets"; import { setAllureStory, setAllureEpic } from "@helpers/allure"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import { pollTransaction } from "@helpers/transaction"; import { test as cleanup } from "@fixtures/walletExtension"; import kuberService from "@services/kuberService"; @@ -10,7 +10,6 @@ cleanup.describe.configure({ timeout: environments.txTimeOut }); cleanup.beforeEach(async () => { await setAllureEpic("Setup"); await setAllureStory("Cleanup"); - await skipIfNotHardFork(); await skipIfMainnet(); }); cleanup(`Abstain delegation`, async () => { diff --git a/tests/govtool-frontend/playwright/tests/proposal-budget.auth.setup.ts b/tests/govtool-frontend/playwright/tests/proposal-budget.auth.setup.ts new file mode 100644 index 000000000..a4e24036b --- /dev/null +++ b/tests/govtool-frontend/playwright/tests/proposal-budget.auth.setup.ts @@ -0,0 +1,65 @@ +import { + budgetProposal01AuthFile, + budgetProposal02AuthFile, + budgetProposal03AuthFile, + budgetProposal04AuthFile, + dRep03AuthFile, +} from "@constants/auth"; +import { + budgetProposal01Wallet, + budgetProposal02Wallet, + budgetProposal03Wallet, + budgetProposal04Wallet, + dRep03Wallet, +} from "@constants/staticWallets"; +import { test as setup } from "@fixtures/walletExtension"; +import { setAllureEpic, setAllureStory } from "@helpers/allure"; +import { createAuthWithUserName } from "@helpers/auth"; + +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Authentication"); +}); + +const walletAuthPairs = [ + { + wallet: budgetProposal01Wallet, + auth: budgetProposal01AuthFile, + name: "Budget Proposal 01", + }, + { + wallet: budgetProposal02Wallet, + auth: budgetProposal02AuthFile, + name: "Budget Proposal 02", + }, + { + wallet: budgetProposal03Wallet, + auth: budgetProposal03AuthFile, + name: "Budget Proposal 03", + }, + { + wallet: budgetProposal04Wallet, + auth: budgetProposal04AuthFile, + name: "Budget Proposal 04", + }, +]; + +walletAuthPairs.forEach(({ wallet, auth, name }) => { + setup(`Create ${name} auth`, async ({ page, context }) => { + await createAuthWithUserName({ + page, + context, + wallet, + auth, + }); + }); +}); + +setup("Create DRep 03 auth with username", async ({ page, context }) => { + await createAuthWithUserName({ + page, + context, + wallet: dRep03Wallet, + auth: dRep03AuthFile, + }); +}); diff --git a/tests/govtool-frontend/playwright/tests/proposal-budget.dRep.setup.ts b/tests/govtool-frontend/playwright/tests/proposal-budget.dRep.setup.ts new file mode 100644 index 000000000..48137cc4c --- /dev/null +++ b/tests/govtool-frontend/playwright/tests/proposal-budget.dRep.setup.ts @@ -0,0 +1,58 @@ +import environments from "@constants/environments"; +import { + budgetProposalDRepWallets, + dRepWallets, +} from "@constants/staticWallets"; +import { setAllureEpic, setAllureStory } from "@helpers/allure"; +import { skipIfMainnet } from "@helpers/cardano"; +import { uploadMetadataAndGetJsonHash } from "@helpers/metadata"; +import { pollTransaction } from "@helpers/transaction"; +import { expect } from "@playwright/test"; +import { test as setup } from "@fixtures/walletExtension"; + +import kuberService from "@services/kuberService"; + +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Register DRep"); + await skipIfMainnet(); +}); + +setup("Register DRep of proposal budget static wallets", async () => { + setup.setTimeout(environments.txTimeOut); + + try { + // Submit metadata to obtain a URL and generate hash value. + const metadataPromises = budgetProposalDRepWallets.map( + async (dRepWallet) => { + const metadataResponse = await uploadMetadataAndGetJsonHash(); + const givenName = metadataResponse.givenName; + const index = dRepWallets.indexOf(dRepWallet); + dRepWallets[index] = { + ...dRepWallet, + givenName, + }; + return { + ...metadataResponse, + wallet: dRepWallet, + }; + } + ); + + const metadataAndDRepWallets = await Promise.all(metadataPromises); + const res = await kuberService.multipleDRepRegistration( + metadataAndDRepWallets + ); + + await pollTransaction(res.txId, res.lockInfo); + } catch (err) { + if ( + err.status === 400 && + err.message.includes("ConwayDRepAlreadyRegistered") + ) { + expect(true, "DRep already registered").toBeTruthy(); + } else { + throw err; + } + } +}); diff --git a/tests/govtool-frontend/playwright/tests/proposal-discussion.auth.setup.ts b/tests/govtool-frontend/playwright/tests/proposal-discussion.auth.setup.ts new file mode 100644 index 000000000..5240acd4e --- /dev/null +++ b/tests/govtool-frontend/playwright/tests/proposal-discussion.auth.setup.ts @@ -0,0 +1,53 @@ +import { setAllureEpic, setAllureStory } from "@helpers/allure"; +import { test as setup } from "@fixtures/walletExtension"; +import { createAuthWithUserName } from "@helpers/auth"; +import { + proposal01Wallet, + proposal02Wallet, + proposal03Wallet, + proposal04Wallet, + proposal05Wallet, + proposal06Wallet, + proposal07Wallet, + proposal08Wallet, + proposal09Wallet, +} from "@constants/staticWallets"; +import { + proposal01AuthFile, + proposal02AuthFile, + proposal03AuthFile, + proposal04AuthFile, + proposal05AuthFile, + proposal06AuthFile, + proposal07AuthFile, + proposal08AuthFile, + proposal09AuthFile, +} from "@constants/auth"; + +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Authentication"); +}); + +const proposalSetups = [ + { name: "Proposal 01", wallet: proposal01Wallet, auth: proposal01AuthFile }, + { name: "Proposal 02", wallet: proposal02Wallet, auth: proposal02AuthFile }, + { name: "Proposal 03", wallet: proposal03Wallet, auth: proposal03AuthFile }, + { name: "Proposal 04", wallet: proposal04Wallet, auth: proposal04AuthFile }, + { name: "Proposal 05", wallet: proposal05Wallet, auth: proposal05AuthFile }, + { name: "Proposal 06", wallet: proposal06Wallet, auth: proposal06AuthFile }, + { name: "Proposal 07", wallet: proposal07Wallet, auth: proposal07AuthFile }, + { name: "Proposal 08", wallet: proposal08Wallet, auth: proposal08AuthFile }, + { name: "Proposal 09", wallet: proposal09Wallet, auth: proposal09AuthFile }, +]; + +for (const { name, wallet, auth } of proposalSetups) { + setup(`Create ${name} auth`, async ({ page, context }) => { + await createAuthWithUserName({ + page, + context, + wallet, + auth, + }); + }); +} diff --git a/tests/govtool-frontend/playwright/tests/proposal.setup.ts b/tests/govtool-frontend/playwright/tests/proposal.setup.ts index 09192d3c8..9f905b426 100644 --- a/tests/govtool-frontend/playwright/tests/proposal.setup.ts +++ b/tests/govtool-frontend/playwright/tests/proposal.setup.ts @@ -1,7 +1,7 @@ import environments from "@constants/environments"; import { proposalFaucetWallet } from "@constants/proposalFaucetWallet"; import { setAllureEpic, setAllureStory } from "@helpers/allure"; -import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano"; +import { skipIfMainnet } from "@helpers/cardano"; import { generateWallets } from "@helpers/shellyWallet"; import { pollTransaction } from "@helpers/transaction"; import { test as setup } from "@fixtures/walletExtension"; @@ -26,7 +26,6 @@ setup.beforeAll(async () => { setup.beforeEach(async () => { await setAllureEpic("Setup"); await setAllureStory("Proposal"); - await skipIfNotHardFork(); await skipIfMainnet(); }); diff --git a/tests/govtool-frontend/playwright/tests/user.auth.setup.ts b/tests/govtool-frontend/playwright/tests/user.auth.setup.ts new file mode 100644 index 000000000..9f012a83e --- /dev/null +++ b/tests/govtool-frontend/playwright/tests/user.auth.setup.ts @@ -0,0 +1,19 @@ +import { user01AuthFile } from "@constants/auth"; +import { user01Wallet } from "@constants/staticWallets"; +import { test as setup } from "@fixtures/walletExtension"; +import { setAllureEpic, setAllureStory } from "@helpers/allure"; +import { createAuth } from "@helpers/auth"; + +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Authentication"); +}); + +setup("Create User 01 auth", async ({ page, context }) => { + await createAuth({ + page, + context, + wallet: user01Wallet, + auth: user01AuthFile, + }); +});