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

Enable and Display dRep Voting for All Governance Actions in Testing #2552

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
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 @@ -18,11 +18,7 @@ export const areDRepVoteTotalsDisplayed = async (proposal: IProposal) => {
);
}

return ![
GovernanceActionType.NoConfidence,
GovernanceActionType.NewCommittee,
GovernanceActionType.UpdatetotheConstitution,
].includes(proposal.type as GovernanceActionType);
return true;
};

export const areSPOVoteTotalsDisplayed = async (proposal: IProposal) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import removeAllSpaces from "@helpers/removeAllSpaces";
import { Locator, Page, expect } from "@playwright/test";
import {
FullGovernanceDRepVoteActionsType,
GovernanceActionType,
IProposal,
} from "@types";
import { GovernanceActionType, IProposal } from "@types";
import environments from "lib/constants/environments";
import GovernanceActionDetailsPage from "./governanceActionDetailsPage";
import { getEnumKeyByValue } from "@helpers/enum";
Expand Down Expand Up @@ -51,20 +47,6 @@ export default class GovernanceActionsPage {
return new GovernanceActionDetailsPage(this.page);
}

async viewFirstDRepVoteEnabledGovernanceAction(): Promise<GovernanceActionDetailsPage> {
for (const governanceAction of Object.keys(
FullGovernanceDRepVoteActionsType
)) {
const result = await this.viewFirstProposalByGovernanceAction(
governanceAction as GovernanceActionType
);
if (result) {
return result;
}
}
return null;
}

async viewFirstProposalByGovernanceAction(
governanceAction: GovernanceActionType
): Promise<GovernanceActionDetailsPage> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import { createNewPageWithWallet } from "@helpers/page";
import GovernanceActionsPage from "@pages/governanceActionsPage";
import { Page, expect } from "@playwright/test";
import { invalid as mockInvalid, valid as mockValid } from "@mock/index";
import {
FullGovernanceDRepVoteActionsType,
GovernanceActionType,
IProposal,
} from "@types";
import { GovernanceActionType, IProposal } from "@types";
import walletManager from "lib/walletManager";
import GovernanceActionDetailsPage from "@pages/governanceActionDetailsPage";
import { correctVoteAdaFormat } from "@helpers/adaFormat";
Expand Down Expand Up @@ -67,7 +63,7 @@ test.describe("Logged in DRep", () => {
? await govActionsPage.viewFirstProposalByGovernanceAction(
GovernanceActionType.InfoAction
)
: await govActionsPage.viewFirstDRepVoteEnabledGovernanceAction();
: await govActionsPage.viewFirstProposal();

await govActionDetailsPage.contextBtn.click();
await govActionDetailsPage.contextInput.fill(faker.lorem.sentence(200));
Expand Down Expand Up @@ -146,7 +142,7 @@ test.describe("Check vote count", () => {
}) => {
const voteWhiteListOption = (await isBootStrapingPhase())
? { InfoAction: "InfoAction" }
: FullGovernanceDRepVoteActionsType;
: GovernanceActionType;
const responsesPromise = Object.keys(voteWhiteListOption).map((filterKey) =>
page.waitForResponse((response) =>
response.url().includes(`&type[]=${voteWhiteListOption[filterKey]}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.describe("Proposal checks", () => {
? await govActionsPage.viewFirstProposalByGovernanceAction(
GovernanceActionType.InfoAction
)
: await govActionsPage.viewFirstDRepVoteEnabledGovernanceAction();
: await govActionsPage.viewFirstProposal();
});

test("5A. Should show relevant details about governance action as DRep", async () => {
Expand Down Expand Up @@ -157,7 +157,7 @@ test.describe("Perform voting", () => {
? await govActionsPage.viewFirstProposalByGovernanceAction(
GovernanceActionType.InfoAction
)
: await govActionsPage.viewFirstDRepVoteEnabledGovernanceAction();
: await govActionsPage.viewFirstProposal();
});

test("5E. Should re-vote with new data on a already voted governance action", async ({}, testInfo) => {
Expand Down
Loading